rsynth: map note-on with zero velocity to note-off
This commit is contained in:
parent
3f8583f8d6
commit
3a63b785a9
|
@ -447,6 +447,9 @@ static void synth_parse_midi(void *synth, const uint8_t *data, const size_t size
|
||||||
ev.type=NOTE_ON;
|
ev.type=NOTE_ON;
|
||||||
ev.d.tone.note=data[1]&0x7f;
|
ev.d.tone.note=data[1]&0x7f;
|
||||||
ev.d.tone.velocity=data[2]&0x7f;
|
ev.d.tone.velocity=data[2]&0x7f;
|
||||||
|
if (ev.d.tone.velocity == 0) {
|
||||||
|
ev.type=NOTE_OFF;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 0xB0:
|
case 0xB0:
|
||||||
ev.type=CONTROL_CHANGE;
|
ev.type=CONTROL_CHANGE;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user