Fix midi velocity range
This commit is contained in:
parent
92a982b2f0
commit
8d28ed8832
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue