From 623c569c99a50d70dd82ad5268d7f7e71b6b3d44 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 27 Aug 2023 20:51:04 +0700 Subject: [PATCH] song player file pitch thing --- .../github/hhhzzzsss/songplayer/conversion/SPConverter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }