Am 23.10.2016 um 17:56 schrieb Simon van der Veldt:
> One of the things I was wondering, it seems like there's no way to make
> use of the functionality some instruments have to kill all sounds (panic
> button) for all instruments in a session.

"Panic" is a colloquial name for the reaction triggered by the
combination of the  MIDI "All notes off" and/or "All sound off" and
"Reset all controllers" messages. Devices and software, which have a
panic function usually react to these MIDI messages as well.

Here's a script using python-rtmidi [1] to send "All sound off" and
"Reset all controllers" on all MIDI channels to all available JACK MIDI
outputs:

https://gist.github.com/c3a212d0071ed78adf4507d16e74305d

import rtmidi
from rtmidi.midiconstants import (ALL_SOUND_OFF, CONTROL_CHANGE,
                                  RESET_ALL_CONTROLLERS)

mo = rtmidi.MidiOut(rtapi=rtmidi.API_UNIX_JACK)

print("Sending AllSoundOff and ResetAllControllers on all channels...")
for portnum, portname in enumerate(mo.get_ports()):
    print("Port:", portname)
    mo.open_port(portnum)
    for channel in range(16):
        mo.send_message([CONTROL_CHANGE, ALL_SOUND_OFF, 0])
        mo.send_message([CONTROL_CHANGE, RESET_ALL_CONTROLLERS, 0])

    mo.close_port()


[1] https://github.com/SpotlightKid/python-rtmidi


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Reply via email to