ttdm/Symphonium

Notes keep on playing on Stop

Closed this issue · 4 comments

When hitting a stop/pause while notes are playing "note off" event is not being sent so last notes continue to play.

ttdm commented

You probably mean last "ongoing" notes and while i didn't use or work the soft for quite a while, I believe you are right.
Checking the code seems to confirm it.

On the other hand, I believe what you are asking needs a bit more than a single line of code. Since note Off is specific to each note and since sending tons of midi event can lead to ignoring some of them (at very high replay speed with heavy file, I used to notice some missed notes), I don't believe it's possible to send a noteOff for all existing notes.

The best way to handle this is probably to keep a set of pressed key and to send a noteOff to all the elements in the set.

A while ago, I made a couple enhancements that I didn't publish. I'll try to spend a bit of time on this project during the week.

Thanks for the interest and feedback.

The best way to handle this is probably to keep a set of pressed key and to send a noteOff to all the elements in the set.

I looked at the code too and noticed noteOff method on MidiMessage... However, using noteOff implies keeping track of all currently playing notes. I am wondering if MIDI spec has some special message to clear all active tracks or just clear everything. I am totally unfamiliar with MIDI spec.

There are stop/continue MIDI events in the spec

ttdm commented

Hmm, I should have thought about it; I have been doing too much project from scratch lately and didn't think about going back to the specs.
It seems there is one is the MIDI spec (which you also found)

Will try it during the week. Thank for the idea.

ttdm commented

Worked like a charm. Iv'e done it only for the STOP and not for the PAUSE but it's a choice made consciously.

If anybody find his way to this thread and is bothered by this choice, feel free to explain why and comment on it.