Quantisation settings based on another events tempo

Hi! I wonder, mostly out of curiosity, if it’s possible to use quantisation settings based on another events tempo.

The use case would be to sync an event with the music’s tempo, so that it is slightly delayed to play at the next beat. Is there any sane way to do that within Fmod? I imagine that it could be useful for rhythm based games, especially if you use a higher note values and for sounds that doesn’t need to be 100% responsive.

It is possible to quantize an event such that it starts only on specific beats or bars of another event, with some caveats.

An instrument or logic marker can only be quantized based on the timeline and tempo of the event instance that contains that instrument or logic marker. It is not possible to quantize an instrument or marker to the timeline of a different event or event instance. This means that if you want to quantize “Event A” to begin playing only on certain beats or bars of a playing instance of “Event B,” “Event A” must be spawned by an event instrument in “Event B,” or a “start event” command instrument in “Event B.”

It is not possible, however, to make instruments in one event be quantized to the timeline and tempo of another event.

Can you (or someone) explain this in more detail? I’m having a tough time finding any information about this anywhere online, and the documentation is really unclear (to me). It sounds like from your description that I’d have to already have a preset location for the secondary event to play with respect to the first instrument, in which case quantization seems to be of little value.

Is there a way to instead trigger this secondary event instrument programmatically? Essentially I’d like to have a song playing and then programmatically trigger an event that is quantized to that song. I’m assuming this is possible, but I can’t figure out what I need to do to make it work.

So I ended up putting together a solution and wanted to share it. It feels super hacky for something that seems like it should be straightforward though.

Basically, created a parameter sheet on the same song as a discrete parameter that allowed only values of 0 and 1. I then created a separate event to trigger when that parameter’s value when to 1 and quantized it. The trouble: I want to be able to stop the event when I turn off the parameter, which doesn’t seem possible. So I created another parameter called parameter volume, which I set to 0 when I’m turning off the first parameter.

So triggering the event consists of setting the first parameter to 1 and setting the second parameter to 1, and turning it off consists of setting both to 0.

Finally, because all of this is now forcibly routed through the same channel as the music, and I wanted this separate layer to be routed to my SFX bus, I created a new dummy “container” event that had the same exact tempo and time signature as my song but contained only silence. I set the whole thing to route to my SFX bus and put my parameter sheet there instead. Then I start this “container” event at the same time as my music so that they will (hopefully) be synced.

Phew. Feels like there has to be an easier way. Maybe fmod just isn’t built for this sort of thing?

Have you tried using a “stop event” command instrument? It will stop all instances of the specified event when triggered.

Have you considered creating a send to a return bus? Sends allow you to send a copy of a signal at the send’s position and route that copy to anywhere in your project’s mixer, which sounds like exactly what you want.

Thanks, I’ll give those a shot!

Looking into this more, I don’t think this will work, since the event itself isn’t targetable, as I needed to embed it within the event that’s playing my music in order to get the quantization working. Right?

Using a command instrument instead of an event instrument would allow you to quantize its start to a specific beat or bar in a similar manner, provided you made sure to load the spawned event’s sample data in advance. Event instances spawned from a command instrument can be stopped by a stop event command instrument.