Last active
November 23, 2017 10:50
-
-
Save SpotlightKid/c3a212d0071ed78adf4507d16e74305d to your computer and use it in GitHub Desktop.
Send AllSoundOff and ResetAllControllers on all JACK MIDI ouputs on all channels.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Send AllSoundOff and ResetAllControllers on all JACK MIDI outputs on all channels.""" | |
import rtmidi | |
from rtmidi.midiconstants import (ALL_SOUND_OFF, CONTROL_CHANGE, | |
RESET_ALL_CONTROLLERS) | |
mo = rtmidi.MidiOut(rtapi=rtmidi.API_UNIX_JACK) | |
print(__doc__) | |
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 & channel, ALL_SOUND_OFF, 0]) | |
mo.send_message([CONTROL_CHANGE & channel, RESET_ALL_CONTROLLERS, 0]) | |
mo.close_port() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Latest version: https://github.com/SpotlightKid/python-rtmidi/blob/master/examples/basic/panic.py