Re: [LAD] Session wide panic functionality?

From: Christopher Arndt <chris@email-addr-hidden>
Date: Sun Oct 23 2016 - 19:36:10 EEST

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

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

Received on Sun Oct 23 20:15:01 2016

This archive was generated by hypermail 2.1.8 : Sun Oct 23 2016 - 20:15:02 EEST