From a03605ddac6b6c15d5c380a8b239e81ca20c00e0 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Fri, 9 Jun 2023 20:47:00 +0700 Subject: [PATCH] CHIP MC MOMENT BRUHHHHHHHH or is it harry zhou moment? yeah this took a few times of debugging and to fix it just change `this.sound = name` to `this.sound = sound` --- .../land/chipmunk/chayapak/chomens_bot/song/Instrument.java | 2 +- .../land/chipmunk/chayapak/chomens_bot/song/NBSConverter.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Instrument.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Instrument.java index ea216c7..55a993e 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Instrument.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Instrument.java @@ -28,7 +28,7 @@ public class Instrument { this.id = id; this.name = name; this.offset = offset; - this.sound = name; + this.sound = sound; } private Instrument (int id, String name, int offset) { diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/NBSConverter.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/NBSConverter.java index 2f918d5..1969369 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/NBSConverter.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/NBSConverter.java @@ -163,10 +163,12 @@ public class NBSConverter { instrument = instrumentIndex[note.instrument]; } else { int index = note.instrument - instrumentIndex.length; + if (index >= customInstruments.size()) continue; + NBSCustomInstrument customInstrument = customInstruments.get(index); instrument = Instrument.of(customInstrument.name); - // key += customInstrument.pitch; + key += customInstrument.pitch; } // if (key < 30 || key > 60) continue;