Skip to content

Commit

Permalink
new 1.12 midi sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
mergu committed Aug 2, 2017
1 parent a30ba34 commit 9356c06
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
Expand Up @@ -24,6 +24,24 @@ public interface SoundHelper {
1, 1, 1, 1, 1, 2, 4, 3, // 128
};

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
};

Sound getMidiInstrumentFromPatch(int patch);

Expand Down
Expand Up @@ -8,19 +8,29 @@ public class SoundHelper_v1_12_R1 implements SoundHelper {
@Override
public Sound getMidiInstrumentFromPatch(int patch) {
// look up the instrument matching the patch
switch (instruments[patch]) {
switch (instruments_1_12[patch]) {
case 0:
return Sound.BLOCK_NOTE_HARP;
case 1:
return Sound.BLOCK_NOTE_BASS;
case 2:
return Sound.BLOCK_NOTE_SNARE;
case 3:
return Sound.BLOCK_NOTE_HARP;
case 4:
return Sound.BLOCK_NOTE_HAT;
case 4:
return Sound.BLOCK_NOTE_BASEDRUM;
case 5:
return Sound.BLOCK_NOTE_PLING;
return Sound.BLOCK_NOTE_GUITAR;
case 6:
return Sound.BLOCK_NOTE_BASEDRUM;
return Sound.BLOCK_NOTE_BELL;
case 7:
return Sound.BLOCK_NOTE_CHIME;
case 8:
return Sound.BLOCK_NOTE_FLUTE;
case 9:
return Sound.BLOCK_NOTE_XYLOPHONE;
case 10:
return Sound.BLOCK_NOTE_PLING;
}
return getDefaultMidiInstrument();
}
Expand Down

0 comments on commit 9356c06

Please sign in to comment.