Release MIDI notes when seeking/stopping a sequence?

Hi there,

When I stop or change the position of a MIDI sequence in the FMOD Core API, the song abruptly cuts out like it were playing a WAV or MP3. Is there a way to have FMOD release the current notes that are being played when I stop or change the position of a sequence, instead of abruptly stopping? If you play a MIDI in for instance, Windows Media Player, it has this behavior. When you press pause it sounds like it releases or finishes the notes that were being played. The Miles Sound System exhibits this behavior as well.


Are you able to post the code you are using to achieve this change of position? As you mentioned, it should be possible to change position without it cutting out. Are you using only the Core API or are you using FMOD Studio with programmer instruments?

I’m using purely the Core API as an audio back-end for a game engine.

Here’s how I change the position:

result = _channel->setPosition(time_ms, FMOD_TIMEUNIT_MS);

And here’s how I stop the playback:

result =_channel->stop();

I’ve spoken with our lead developers and they have confirmed that seeking within a MIDI file operates the same as a streaming audio file, which means that moving the position will cause a hard cut.

For achieving something like this within FMOD you may need to set up a system where you have two MIDI files that you swap between, fading in and out when transitioning from place to place (eg. play MIDI file 1, set position X on MIDI file 2, fade out MIDI 1, fade in MIDI 2). Otherwise it may be better to utilize a specialized MIDI tracker for this bit of music.