Skip to content

Commit 53691f3

Browse files
committed
midi event noteon with velocity 0 = noteoff
some controllers report noteoff as noteon with velocity zero; convert to noteoff for easier processing
1 parent 78ce5ea commit 53691f3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

patcher/fswrap.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def __init__(self, event):
174174
@property
175175
def type(self):
176176
b = FL.fluid_midi_event_get_type(self.event)
177+
if b == MIDI_NOTEON and self.par2 == 0:
178+
return MIDI_NOTEOFF
177179
return b if b in MIDI_TYPES else None
178180
@type.setter
179181
def type(self, v): FL.fluid_midi_event_set_type(self.event, v)

0 commit comments

Comments
 (0)