Skip to content

Commit

Permalink
Update NoteBlockReceiver.java (#2431)
Browse files Browse the repository at this point in the history
Added 5 new sounds; Didgeridoo, Cow Bell, Banjo, Iron Xylophone, and Bit.

Patch numbers 81-96 have had their instrument numbers changed from 0 to 0-16 in respective order, allowing all notes to be played.
  • Loading branch information
C-olossal committed Feb 4, 2023
1 parent 2b03bac commit 3f58494
Showing 1 changed file with 21 additions and 16 deletions.
Expand Up @@ -161,22 +161,22 @@ public void close() {
}

private static final int[] instruments_1_12 = {
0, 0, 0, 0, 0, 0, 0, 5, // 8
9, 9, 9, 9, 9, 6, 0, 9, // 16
9, 0, 0, 0, 0, 0, 0, 5, // 24
5, 5, 5, 5, 5, 5, 5, 1, // 32
1, 1, 1, 1, 1, 1, 1, 5, // 40
1, 5, 5, 5, 5, 5, 5, 5, // 48
5, 5, 5, 8, 8, 8, 8, 8, // 56
8, 8, 8, 8, 8, 8, 8, 8, // 64
8, 8, 8, 8, 8, 8, 8, 8, // 72
8, 8, 8, 8, 8, 8, 8, 8, // 80
0, 0, 0, 0, 0, 0, 0, 0, // 88
0, 0, 0, 0, 0, 0, 0, 0, // 96
0, 0, 0, 0, 0, 0, 0, 5, // 104
5, 5, 5, 9, 8, 5, 8, 6, // 112
6, 3, 3, 2, 2, 2, 6, 5, // 120
1, 1, 1, 6, 1, 2, 4, 7, // 128
0, 0, 0, 0, 0, 0, 0, 5, // 8
9, 9, 9, 9, 9, 6, 0, 9, // 16
9, 0, 0, 0, 0, 0, 0, 5, // 24
5, 5, 5, 5, 5, 5, 5, 1, // 32
1, 1, 1, 1, 1, 1, 1, 5, // 40
1, 5, 5, 5, 5, 5, 5, 5, // 48
5, 5, 5, 8, 8, 8, 8, 8, // 56
8, 8, 8, 8, 8, 8, 8, 8, // 64
8, 8, 8, 8, 8, 8, 8, 8, // 72
8, 8, 8, 8, 8, 8, 8, 8, // 80
0, 1, 2, 3, 4, 5, 6, 7, // 88
8, 9, 10, 11, 12, 13, 14, 15, // 96
0, 0, 0, 0, 0, 0, 0, 5, // 104
5, 5, 5, 9, 8, 5, 8, 6, // 112
6, 3, 3, 2, 2, 2, 6, 5, // 120
1, 1, 1, 6, 1, 2, 4, 7, // 128
};

public static Sound getMidiInstrumentFromPatch(int patch) {
Expand All @@ -192,6 +192,11 @@ public static Sound getMidiInstrumentFromPatch(int patch) {
case 8: return Sound.BLOCK_NOTE_BLOCK_FLUTE;
case 9: return Sound.BLOCK_NOTE_BLOCK_XYLOPHONE;
case 10: return Sound.BLOCK_NOTE_BLOCK_PLING;
case 11: return Sound.BLOCK_NOTE_BLOCK_DIDGERIDOO;
case 12: return Sound.BLOCK_NOTE_BLOCK_COW_BELL;
case 13: return Sound.BLOCK_NOTE_BLOCK_BANJO;
case 14: return Sound.BLOCK_NOTE_BLOCK_IRON_XYLOPHONE;
case 15: return Sound.BLOCK_NOTE_BLOCK_BIT;
default: return defaultMidiInstrument;
}
}
Expand Down

0 comments on commit 3f58494

Please sign in to comment.