diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/conversion/MidiConverter.java b/src/main/java/com/github/hhhzzzsss/songplayer/conversion/MidiConverter.java index cf97b2a..764967d 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/conversion/MidiConverter.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/conversion/MidiConverter.java @@ -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);