alsa-utils
alsa-utils copied to clipboard
when aplaymidi exits the sustained notes are played forever.
Transfered from here: https://github.com/OpenTTD/OpenTTD/issues/7637
Expected Result
All notes are stoped before exit aplaymidi
Actual Result
Notes are sustained forever and I have to press the panic button on Qsynth
Steps to Reproduce
- Open Qsynth with fluid-soundfonts
- do this:
aplaymidi --port 128:0 file.mid
- do control+c to kill aplaymidi
- Qsynth plays a note forever.
Possible fix
Capture SIGINT and send midi off messages before exit properly.
I don't think aplaymidi should do any termination things by itself: the user had a reason for the abrupt ctrl+c. You can do manually something like:
amidi -S ff
I understand that you think is not the responsibility of amidi to do a proper exit
but as I stated on the ticket... some "misbehaving" application can leave the "sound card" playing forever.
I think that after you finish a midi song... the card should be stopped.
thanks for your understanding.
the problem is described here: https://github.com/OpenTTD/OpenTTD/issues/7637
I experienced this yesterday. It seems that the final Note Off
message doesn't have a chance to be sent before aplaymidi closes itself upon reaching the end of a file. It's not exclusive to Qsynth, but any MIDI device. Perhaps some latency in MIDI message transferring should be accounted for before the application terminates.
This issue is a common one among many users, as can be seen by a simple Google search, for example here: https://stackoverflow.com/questions/38687774/stopping-aplaymidi-leaves-stuck-notes.
None of the workarounds given do not work with software midi synths, as they can not accept raw midi commands (AFAIK). Instead users should fire up a sequencer, make an "all notes off" -mid file and play it.
A humble opinion: aplaymidi to send all notes off when CTRL+C has been given.