/**
* Choose PLUGIN_TYPE_FOR_KEYBOARD.
*/
private static final String PluginType = PLUGIN_TYPE_FOR_KEYBOARD;
/**
* General MIDI Program Change Event for Clean Electric Guitar
*
* Please refer General MIDI Spec: http://en.wikipedia.org/wiki/General_MIDI
*/
private static final int MIDI_CLEAN_ELECTRIC_GUITAR = 27;
/**
* Drawable res id of icon design for Perfect Piano Instrument Switch Menu
*/
private static final int MenuIconResID = R.drawable.ic_launcher;
/**
* Drawable res id of icon design for Perfect Piano tool bar
*/
private static final int ToolBarIconResID = R.drawable.ic_launcher;
/**
* String res id of this instrument
*/
private static final int InstrumentNameID = R.string.ins_name;
/**
* Raw sound file name under asserts. It could be 88 size and one by one mapping to the keys on keyboards.
*
* And we also accept part of the keys sound and modulate the sounds in code. Then two array: RawSoundsIndexArray and QuickChooseIndexArray
* should return right value. PerfectPiano will handle the modulate.
*/
private final static String[] SOUND_NAME_ARRAY = {
"1d.ogg","1f.ogg","1a.ogg",
"2d.ogg","2f.ogg","2a.ogg",
"3d.ogg","3f.ogg","3a.ogg",
"4c.ogg","4d.ogg","4f.ogg","4g.ogg","4a.ogg","4b.ogg",
"5d.ogg","5f.ogg","5a.ogg",
"6c.ogg","6f.ogg","6am.ogg",
"7c.ogg","7fm.ogg"
};
/**
* The sound file mapping keys index on Keyboard. From 0 to 87 (Total 88 Keys on a Keyboard)
*
* For Example: Sound for C0 which is the first key of the keyboard. The index value is 0.
* Sound for C8 which is the last key of the keyboard. The index value is 87.
*
* Note: This is only use for PLUGIN_TYPE_FOR_KEYBOARD. This is useless when using PLUGIN_TYPE_FOR_DRUM.
*/
private static final int RawSoundsIndexArray[] = {
5, 8, 12, //"1d.ogg","1f.ogg","1a.ogg",
17, 20, 24, //"2d.ogg","2f.ogg","2a.ogg",
29, 32, 36, //"3d.ogg","3f.ogg","3a.ogg",
39, 41, 44, 46, 48, 50, //"4c.ogg","4d.ogg","4f.ogg","4g.ogg","4a.ogg","4b.ogg",
53, 56, 60, //"5d.ogg","5f.ogg","5a.ogg",
63, 68, 73, //"6c.ogg","6f.ogg","6am.ogg",
75, 81 //"7c.ogg","7fm.ogg"
};
/**
* Size is 88. It is a key mapping that each key of the keyboard using which index of audio sounds of SOUND_NAME_ARRAY.
*
* For Example: In this code. From A0 ~ D1# (0 ~ 6) all using "1d.ogg". Give the right index value.
*
* Note: This is only use for PLUGIN_TYPE_FOR_KEYBOARD. This is useless when using PLUGIN_TYPE_FOR_DRUM.
*/
private static final int QuickChooseIndexArray[] = {
0, 0, 0, 0, 0, 0, 0, //0 ~ 6 //C0 ~ D1# //1d.ogg
1, 1, 1, 1, //7 ~ 10 //D1# ~ G1 //1f.ogg
2, 2, 2, 2, 2, //11 ~ 15 //G1# ~ C2 //1a.ogg
3, 3, 3, //16 ~ 18 //C2# ~ D2# //2d.ogg
4, 4, 4, 4, //19 ~ 22 //E2 ~ G2 //2f.ogg
5, 5, 5, 5, //23 ~ 26 //G2# ~ B2 //2a.ogg
6, 6, 6, 6, //27 ~ 30 //C3 ~ D3# //3d.ogg
7, 7, 7, 7, //31 ~ 34 //E3 ~ G3 //3f.ogg
8, 8, 8, //35 ~ 37 //G3# ~ A3# //3a.ogg
9, 9, //38 ~ 39 //B3 ~ C4 //4c.ogg
10, 10, 10, //40 ~ 42 //C4# ~ D4# //4d.ogg
11, 11, 11, //43 ~ 45 //E4 ~ F4# //4f.ogg
12, 12, //46 ~ 47 //G4 ~ G4# //4g.ogg
13, 13, //48 ~ 49 //A4 ~ A4# //4a.ogg
14, 14, //50 ~ 51 //C4 ~ C5 //4b.ogg
15, 15, 15, //52 ~ 54 //C5# ~ D5# //5d.ogg
16, 16, 16, 16, //55 ~ 58 //E5 ~ G5 //5f.ogg
17, 17, 17, //59 ~ 61 //G5# ~ A5# //5a.ogg
18, 18, 18, 18, 18, //62 ~ 66 //B5 ~ D6# //6c.ogg
19, 19, 19, 19, //67 ~ 70 //E6 ~ G6 //6f.ogg
20, 20, 20, 20, //71 ~ 74 //G6# ~ B6 //6am.ogg
21, 21, 21, 21, 21, //75 ~ 79 //C7 ~ E7 //7c.ogg
22, 22, 22, 22, 22, 22, 22, 22 //80 ~ 87 //F7 ~ C8 //7fm.ogg
};