# Writing Custom Plug-In Instrument

**URL:** <https://qa.fmod.com/t/writing-custom-plug-in-instrument/23700>\
**Category:** FMOD Engine\
**Created:** [November 21, 2025, 9:12pm UTC](https://qa.fmod.com/t/writing-custom-plug-in-instrument/23700 "2025-11-21T21:12:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![noahthompson111](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@noahthompson111](https://qa.fmod.com/u/noahthompson111)\
**Post date:** [November 21, 2025, 9:12pm UTC](https://qa.fmod.com/t/writing-custom-plug-in-instrument/23700/1 "2025-11-21T21:12:25Z")

</div>

Hi all,

I have written a granular plugin effect for fmod studio that works great. Now I would like to write a synth plug-in instrument (like the noise generator) that can be triggered via scripting in game engines (i’m using Unity).

At its most basic, it should be able to deliver a polyphonic sine pluck. It would need a per voice frequency parameter for different notes, but I’m not sure how that would be achieved with the fmod dsp. I am wondering if anyone has any insight about doing something like this. I know some people have done run-time sound synthesis with Csound, but since I’m heavily using FMOD in my project, I want to stick to using fmod event emitters and avoid any audio source components in Unity.

Thanks so much!

Noah

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [November 28, 2025, 12:27am UTC](https://qa.fmod.com/t/writing-custom-plug-in-instrument/23700/2 "2025-11-28T00:27:57Z")

</div>

If you happen to be familiar with Max MSP, we have a C++ example for turning RNBO patches into DSPs, which might be a good starting point [Making plugins using RNBO - #17 by jeff\_fmod](https://qa.fmod.com/t/making-plugins-using-rnbo/21181/17).

If you want to tackle it yourself, the only real difference between an effect and an instrument in FMOD is the presence of an input buffer. If you report 0 input buffers and 1 output buffer for [`FMOD.DSP_DESCRIPTION.numinputbuffers`](https://fmod.com/docs/2.02/api/plugin-api-dsp.html#fmod_dsp_description_numinputbuffers) and [`FMOD.DSP_DESCRIPTION.numoutputbuffers`](https://fmod.com/docs/2.02/api/plugin-api-dsp.html#fmod_dsp_description_numoutputbuffers) respectively, FMOD Studio will treat it as a generator and allow you to place it in the timeline. The fmod\_noise example demonstrates this (and it sounds like you’ve already found it). With that as a base all you will need to do is:

- Replace the `FMODNoiseState::generate` method with an oscillator (replace the `rand` with `sinf` and give it different values over time)
- Expose frequency as a parameter

```cpp
FMOD_DSP_INIT_PARAMDESC_FLOAT(p_freq, "Frequency", "Hz", "Frequency", 60, 20000, 440);

```

- Make as many parameters and oscillators for each voice you want to support

With that, you can trigger your DSP as a [Plug-in Instrument](https://fmod.com/docs/2.02/studio/working-with-instruments.html#plug-in-instruments) and control the frequency with [Automation](https://fmod.com/docs/2.02/studio/glossary.html#automation).

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/2/2046516b114830f4dbc71b97476ff92694a32cdb.png)
