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;