Fix midi velocity range

This commit is contained in:
hhhzzzsss 2024-06-04 18:59:30 -05:00
parent 92a982b2f0
commit 8d28ed8832

View file

@ -93,6 +93,7 @@ public class MidiConverter {
int pitch = sm.getData1(); int pitch = sm.getData1();
int velocity = sm.getData2(); int velocity = sm.getData2();
if (velocity == 0) continue; // Just ignore notes with velocity 0 if (velocity == 0) continue; // Just ignore notes with velocity 0
velocity = (velocity * 100) / 127; // Midi velocity goes from 0-127
long deltaTick = event.getTick() - prevTick; long deltaTick = event.getTick() - prevTick;
prevTick = event.getTick(); prevTick = event.getTick();
microTime += (mpq/tpq) * deltaTick; microTime += (mpq/tpq) * deltaTick;