song player file pitch thing
This commit is contained in:
parent
0923cbfc4d
commit
623c569c99
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package com.github.hhhzzzsss.songplayer.conversion;
|
package com.github.hhhzzzsss.songplayer.conversion;
|
||||||
|
|
||||||
import com.github.hhhzzzsss.songplayer.Util;
|
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.Note;
|
||||||
import com.github.hhhzzzsss.songplayer.song.Song;
|
import com.github.hhhzzzsss.songplayer.song.Song;
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ public class SPConverter {
|
||||||
int noteId = buffer.getShort();
|
int noteId = buffer.getShort();
|
||||||
if (noteId >= 0 && noteId < 400) {
|
if (noteId >= 0 && noteId < 400) {
|
||||||
time += getVarLong(buffer);
|
time += getVarLong(buffer);
|
||||||
song.add(new Note(noteId, time));
|
song.add(new Note(noteId + SongHandler.getInstance().pitch, time));
|
||||||
}
|
}
|
||||||
else if ((noteId & 0xFFFF) == 0xFFFF) {
|
else if ((noteId & 0xFFFF) == 0xFFFF) {
|
||||||
break;
|
break;
|
||||||
|
@ -82,7 +83,7 @@ public class SPConverter {
|
||||||
song.sort();
|
song.sort();
|
||||||
long prevTime = 0;
|
long prevTime = 0;
|
||||||
for (Note note : song.notes) {
|
for (Note note : song.notes) {
|
||||||
writeShort(os, note.noteId);
|
writeShort(os, note.noteId + SongHandler.getInstance().pitch);
|
||||||
writeVarLong(os, note.time - prevTime);
|
writeVarLong(os, note.time - prevTime);
|
||||||
prevTime = note.time;
|
prevTime = note.time;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue