Creating a virtual instrument using FMOD

Hi, i would like to create a virtual instrument player within Unity using samples of instruments (all notes and sharps samples for each instrument).

I wonder what would be the ideal way to set this up from FMOD side.
On Unity i have a button per note, and a button to change to the sharp note. You chose the instrument before playing it oc, and notes need to be able to play all at once.
I want the same set up for all instruments in FMOD so its flexible.
So how should i group and bind the sounds and select which to play so its tidy organized and performant? I could just have them as individual events but there should be a more organized way.
FMOD is so extense and i dont know which way to go.

Thank you

Maybe one event per instrument, each one containing a unique “note” labelled parameter sheet with one semitone sample per value?

Given that you want to encompass all notes, I agree with @Alcibiade’s suggestion.

However, for ease of setup, you may want to use a discrete parameter instead of a labeled one. Functionally, a discrete and labelled parameter accomplish the same thing, but if your note range is quite large, for example the standard 0-127 MIDI range, then a discrete parameter avoids you having to manually set labels for all values.

As for polyphony, it depends on the level of complexity you want - if you don’t really need indepth per-note behaviour, then you could handle it with a single event instance by simply setting the parameter value and allowing each sample to play out in full. If you want more control over individual note behaviour, I’d recommend creating one instance of your event per virtual instrument note, as you’ll be more easily able to control note per-note behaviours like velocity and release.

Hope this helps!

1 Like

I just set it up and it works perfectly!! Thank you all.
I would need to learn how to ease out better in between triggering notes, so the cut is not so heavy nor so slow.
I wonder, how can i add vibrato? I think set pitch could work, may i use sine mathematics from Unity side or is there anything built in for this?

i have it set it up so vibrato amplitude input is gamepad stick X values and frequency would be X, i just would need to hook this to FMOD.

Thank you!

Okay os i used a global parameter driven by the Marthf.sin and it works like a charm!

Glad to hear that you found a way to implement vibrato! Another way to do this, if you wanted to offload some of the math to Studio, would be to modulate the pitch with an LFO, and automate the depth (amplitude) and rate (frequency) properties of the LFO with two parameters, which you can then set to match your stick values from Unity.

1 Like

You need to put an AHDSR modulator on each note instrument volume. You can easily copy and paste the properties from one note to another, or multi-select all the instruments before applying the modulation.

1 Like

thank you for the suggestion, i was indeed looking to have it on the FMOD side, i will look into it! :slight_smile:

Okay done! I was struggling cause i added it to the master notes track and it didnt work. Thanks!