Created
December 26, 2016 18:48
-
-
Save igneus/bdd67b7bce2c125c6ce9e4d4f8474635 to your computer and use it in GitHub Desktop.
Switch MIDI presets by piano pedals
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
# mididings patch translating piano pedals to Program switch messages | |
# | |
# I use it to switch presets in aeolus | |
from mididings import * | |
config( | |
client_name='pedal_channel_switch' | |
) | |
# MIDI ctrl ids | |
pedal_soft_ctrl = 67 | |
pedal_sostenuto_ctrl = 66 | |
pedal_sustain_ctrl = 64 | |
# chosen to fit my needs | |
port = 1 | |
channel = 11 | |
def pedals_to_programs(): | |
return CtrlSplit({ | |
pedal_soft_ctrl: Program(port, channel, 1), | |
pedal_sostenuto_ctrl: Program(port, channel, 3), | |
pedal_sustain_ctrl: Program(port, channel, 2), | |
}) | |
run({CTRL: pedals_to_programs(), NOTE: Pass()}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment