use my calculation

This commit is contained in:
Chayapak 2023-08-20 19:07:39 +07:00
parent 04a9714b7e
commit fd105e001e

View file

@ -298,14 +298,16 @@ 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 {
// 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 {
// i wrote this part
// this uses the average of the pitch and the volume to calcuate the stereo
@ -313,7 +315,6 @@ public class MusicPlayerPlugin extends Bot.Listener {
if (average > 5) blockPosition = (average - 5) / -5;
else if (average < 5) blockPosition = ((average - 5) * -1) / 5;
}
bot.core.run(
"minecraft:execute as " +