diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/MusicPlayerPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/MusicPlayerPlugin.java index 89e5e0b..c6d778c 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/MusicPlayerPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/MusicPlayerPlugin.java @@ -336,10 +336,10 @@ public class MusicPlayerPlugin extends Bot.Listener { else if (average < 100) blockPosition = (float) average / 100; // right } else { // this uses the MIDI PITCH and MIDI PANNING to calculate - final double pitch = (double) (note.originalPitch + note.panning) / 2; + final double pitch = (double) (note.originalPitch + (note.panning / 100)) / 2; - if (pitch > 80) blockPosition = -(float) (pitch / -85) - 2; // right - else if (pitch < 20) blockPosition = (float) ((pitch / 15) - 2); // left + if (pitch > 80) blockPosition = -(float) (pitch / -80) - 2; // right + else if (pitch < 20) blockPosition = (float) ((pitch / 20) - 2); // left blockPosition = MathUtilities.clamp(blockPosition, -0.4F, 0.4F); } diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/MidiConverter.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/MidiConverter.java index 9981c97..0e31ee8 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/MidiConverter.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/MidiConverter.java @@ -218,7 +218,7 @@ public class MidiConverter implements Converter { float volume = (float) velocity / 127.0f; long time = microTime / 1000L; - return new Note(instrument, pitch, midiPitch, volume, time, (int) ((panning - 64) / (float) 64), 100); + return new Note(instrument, pitch, midiPitch, volume, time, (int) ((panning - 64) / (float) 64) * 100, 100); } private static Note getMidiPercussionNote (int midiPitch, int velocity, long microTime, int panning) { @@ -229,7 +229,7 @@ public class MidiConverter implements Converter { Instrument instrument = Instrument.fromId(noteId / 25); long time = microTime / 1000L; - return new Note(instrument, pitch, midiPitch, volume, time, (int) ((panning - 64) / (float) 64), 100); + return new Note(instrument, pitch, midiPitch, volume, time, (int) ((panning - 64) / (float) 64) * 100, 100); } return null; }