midi pitchy thingy

This commit is contained in:
Chayapak 2023-08-28 20:56:20 +07:00
parent 44db9f75b0
commit 7fcd8923fb

View file

@ -147,8 +147,12 @@ public class MidiConverter {
return null;
}
int pitch = (midiPitch-instrument.offset) + SongHandler.getInstance().pitch;
int noteId = pitch + instrument.instrumentId*25;
int pitch = ((midiPitch-instrument.offset) + SongHandler.getInstance().pitch) + 33;
while (pitch < 33) pitch += 12;
while (pitch > 57) pitch -= 12;
int noteId = (pitch - 33) + instrument.instrumentId*25;
long time = microTime / 1000L;
return new Note(noteId, time);