diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/conversion/SPConverter.java b/src/main/java/com/github/hhhzzzsss/songplayer/conversion/SPConverter.java index 41da087..d7ae54a 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/conversion/SPConverter.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/conversion/SPConverter.java @@ -1,6 +1,7 @@ package com.github.hhhzzzsss.songplayer.conversion; import com.github.hhhzzzsss.songplayer.Util; +import com.github.hhhzzzsss.songplayer.playing.SongHandler; import com.github.hhhzzzsss.songplayer.song.Note; import com.github.hhhzzzsss.songplayer.song.Song; @@ -52,7 +53,7 @@ public class SPConverter { int noteId = buffer.getShort(); if (noteId >= 0 && noteId < 400) { time += getVarLong(buffer); - song.add(new Note(noteId, time)); + song.add(new Note(noteId + SongHandler.getInstance().pitch, time)); } else if ((noteId & 0xFFFF) == 0xFFFF) { break; @@ -82,7 +83,7 @@ public class SPConverter { song.sort(); long prevTime = 0; for (Note note : song.notes) { - writeShort(os, note.noteId); + writeShort(os, note.noteId + SongHandler.getInstance().pitch); writeVarLong(os, note.time - prevTime); prevTime = note.time; }