Skip to content

Instantly share code, notes, and snippets.

@Warwolt
Last active July 29, 2020 10:06
Show Gist options
  • Save Warwolt/6bfa4ec869c518d268fc7da8bc815748 to your computer and use it in GitHub Desktop.
Save Warwolt/6bfa4ec869c518d268fc7da8bc815748 to your computer and use it in GitHub Desktop.
def light_up_element(self, element_name, color):
"""
Send a midi message to light up an element.
element_name: the name of the element to light up
color: a string 'red', 'orange', or 'green'
"""
status = MIDI_NOTE_ON_STATUS + MIDI_CHANNEL_NUM
note = self._element_color_to_midi[element_name][color]
velocity = 127
self._c_instance.send_midi((status, note, velocity))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment