Godtone
Joined 17 December 2020
→Novation Launchpad Pro MK3 isomorphic keyboard code: remove unnecessary parentheses and unnecessary indent |
m →Novation Launchpad Pro MK3 isomorphic keyboard code: typo & clarification of wording |
||
| Line 1,174: | Line 1,174: | ||
if note_vel: # if we're pressing a key | if note_vel: # if we're pressing a key | ||
note_vel = round( note_vel * 2**( -(midi_note-bottomleftnote)/half ) ) | note_vel = round( note_vel * 2**( -(midi_note-bottomleftnote)/half ) ) | ||
if note_state[midi_note]: # if one or more | if note_state[midi_note]: # if one or more equivalent keys are already held | ||
to_send = mido.Message('note_on', channel=0, note=midi_note, velocity=0) | to_send = mido.Message('note_on', channel=0, note=midi_note, velocity=0) | ||
print(to_send) | print(to_send) | ||
mo.send(to_send) # turn off equivalent midi note | mo.send(to_send) # turn off equivalent midi note before repressing | ||
else: # light all equivalent keys | else: # light all equivalent keys | ||
for k in key_codes: | for k in key_codes: | ||