From fd105e001e8ae6d33ee96d6a7b468f784101a5e4 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 20 Aug 2023 19:07:39 +0700 Subject: [PATCH] use my calculation --- .../plugins/MusicPlayerPlugin.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) 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 02425329..c489d9a0 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 @@ -298,22 +298,23 @@ public class MusicPlayerPlugin extends Bot.Listener { final double floatingPitch = Math.pow(2.0, ((key + (pitch / 10)) - 12) / 12.0); // final double floatingPitch = 0.5 * (Math.pow(2, ((key + (pitch / 10)) / 12))); - // totallynotskidded from opennbs float blockPosition = 0; - if (currentSong.nbs) { - final int s = (note.stereo + note.panning) / 2; // Stereo values to X coordinates, calc'd from the average of both note and layer pan. - if (s > 100) blockPosition = (float) (s - 100) / -100; - else if (s < 100) blockPosition = (float) ((s - 100) * -1) / 100; - } else { - // i wrote this part + // imo with my stereo calculation it sounds better so rip calculation using stereo and panning +// // totallynotskidded from opennbs +// if (currentSong.nbs) { +// final int s = (note.stereo + note.panning) / 2; // Stereo values to X coordinates, calc'd from the average of both note and layer pan. +// if (s > 100) blockPosition = (float) (s - 100) / -100; +// else if (s < 100) blockPosition = (float) ((s - 100) * -1) / 100; +// } else { - // this uses the average of the pitch and the volume to calcuate the stereo - final float average = (note.pitch + note.volume) / 2; + // i wrote this part - if (average > 5) blockPosition = (average - 5) / -5; - else if (average < 5) blockPosition = ((average - 5) * -1) / 5; - } + // this uses the average of the pitch and the volume to calcuate the stereo + final float average = (note.pitch + note.volume) / 2; + + if (average > 5) blockPosition = (average - 5) / -5; + else if (average < 5) blockPosition = ((average - 5) * -1) / 5; bot.core.run( "minecraft:execute as " +