diff options
Diffstat (limited to 'libs/evoral/src/SMF.cpp')
-rw-r--r-- | libs/evoral/src/SMF.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp index 42c5369b76..0a5bf589f5 100644 --- a/libs/evoral/src/SMF.cpp +++ b/libs/evoral/src/SMF.cpp @@ -287,6 +287,11 @@ SMF::read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf, event_id_t* no } memcpy(*buf, event->midi_buffer, size_t(event_size)); *size = event_size; + if (((*buf)[0] & 0xF0) == 0x90 && (*buf)[2] == 0) { + /* normalize note on with velocity 0 to proper note off */ + (*buf)[0] = 0x80 | ((*buf)[0] & 0x0F); /* note off */ + (*buf)[2] = 0x40; /* default velocity */ + } if (!midi_event_is_valid(*buf, *size)) { cerr << "WARNING: SMF ignoring illegal MIDI event" << endl; |