mess with the pitch correction again to fix the sus problem

This commit is contained in:
Chayapak 2023-04-19 12:37:12 +07:00
parent ad84f86bcd
commit c9b818e3e5

View file

@ -262,23 +262,9 @@ public class MusicPlayerPlugin extends SessionAdapter {
while (currentSong.reachedNextNote()) { while (currentSong.reachedNextNote()) {
final Note note = currentSong.getNextNote(); final Note note = currentSong.getNextNote();
final boolean nbs = currentSong.nbs;
float key = note.pitch; float key = note.pitch;
if (nbs) { final double floatingPitch = 0.5 * (Math.pow(2, ((key + (pitch / 10)) / 12)));
if (key < 33) key -= 9;
else if (key > 57) key -= 57;
else key -= 33;
}
final double floatingPitch = Math.pow(
2,
!nbs ?
// sus math real
((key + (pitch / 10)) - 12) / 12.0 : // if it is midi
(key + (pitch / 10)) / 12 // if it is nbs
);
bot.core().run( bot.core().run(
"minecraft:execute as " + "minecraft:execute as " +