
// MIDI instrument and Percussion map to YM2413 instrument
//
static const uint8_t PROGMEM MidiIMap[] = 
{
  // 1-8 Piano
  MD_YM2413::I_PIANO, MD_YM2413::I_PIANO, MD_YM2413::I_PIANO, MD_YM2413::I_PIANO, 
  MD_YM2413::I_PIANO, MD_YM2413::I_PIANO, MD_YM2413::I_HARPSICHORD, MD_YM2413::I_HARPSICHORD, 
  // 9-16 Chrom Percussion
  MD_YM2413::I_VIBRAPHONE, MD_YM2413::I_VIBRAPHONE, MD_YM2413::I_VIBRAPHONE, MD_YM2413::I_VIBRAPHONE, 
  MD_YM2413::I_VIBRAPHONE, MD_YM2413::I_VIBRAPHONE, MD_YM2413::I_VIBRAPHONE, MD_YM2413::I_VIBRAPHONE, 
  // 17-24 Organ
  MD_YM2413::I_ORGAN, MD_YM2413::I_ORGAN, MD_YM2413::I_ORGAN, MD_YM2413::I_ORGAN, 
  MD_YM2413::I_ORGAN, MD_YM2413::I_ORGAN, MD_YM2413::I_ORGAN, MD_YM2413::I_ORGAN, 
  // 25-32 Guitar
  MD_YM2413::I_GUITAR, MD_YM2413::I_GUITAR, MD_YM2413::I_EGUITAR, MD_YM2413::I_EGUITAR, 
  MD_YM2413::I_EGUITAR, MD_YM2413::I_EGUITAR, MD_YM2413::I_EGUITAR, MD_YM2413::I_EGUITAR, 
  // 33-40 Bass
  MD_YM2413::I_ACOUSTIC_BASS, MD_YM2413::I_ACOUSTIC_BASS, MD_YM2413::I_ACOUSTIC_BASS, MD_YM2413::I_ACOUSTIC_BASS,
  MD_YM2413::I_SYNTH_BASS, MD_YM2413::I_SYNTH_BASS, MD_YM2413::I_SYNTH_BASS, MD_YM2413::I_SYNTH_BASS, 
  // 41-48 Strings
  MD_YM2413::I_VIOLIN, MD_YM2413::I_VIOLIN, MD_YM2413::I_VIOLIN, MD_YM2413::I_ACOUSTIC_BASS, 
  MD_YM2413::I_VIOLIN, MD_YM2413::I_VIOLIN, MD_YM2413::I_VIOLIN, MD_YM2413::I_HARPSICHORD,
  // 49-56 Ensemble
  MD_YM2413::I_VIOLIN, MD_YM2413::I_VIOLIN, MD_YM2413::I_VIOLIN, MD_YM2413::I_VIOLIN, 
  MD_YM2413::I_ORGAN, MD_YM2413::I_ORGAN, MD_YM2413::I_SYNTH, MD_YM2413::I_SYNTH, 
  // 57-64 Brass
   MD_YM2413::I_TRUMPET, MD_YM2413::I_TRUMPET, MD_YM2413::I_HORN, MD_YM2413::I_TRUMPET, 
   MD_YM2413::I_HORN, MD_YM2413::I_TRUMPET, MD_YM2413::I_SYNTH, MD_YM2413::I_SYNTH, 
  // 65-72 Reed
  MD_YM2413::I_CLARINET, MD_YM2413::I_CLARINET, MD_YM2413::I_CLARINET, MD_YM2413::I_CLARINET,
  MD_YM2413::I_OBOE, MD_YM2413::I_HORN, MD_YM2413::I_HORN, MD_YM2413::I_CLARINET, 
  // 73-80 Pipe
  MD_YM2413::I_FLUTE, MD_YM2413::I_FLUTE, MD_YM2413::I_FLUTE, MD_YM2413::I_FLUTE, 
  MD_YM2413::I_FLUTE, MD_YM2413::I_FLUTE, MD_YM2413::I_FLUTE, MD_YM2413::I_FLUTE,
  // 81-88 Synth Lead
  MD_YM2413::I_SYNTH, MD_YM2413::I_SYNTH, MD_YM2413::I_SYNTH, MD_YM2413::I_SYNTH, 
  MD_YM2413::I_SYNTH, MD_YM2413::I_SYNTH, MD_YM2413::I_SYNTH, MD_YM2413::I_SYNTH, 
/* All undefined after this point, so handle by checking upper boundary in code
  // 89-96 Synth Pad
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, 
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, 
  // 97-104 Synth Effects
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, 
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, 
  // 105-112 Ethnic
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, 
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, 
  // 113-120 Percussive
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED,
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED,
  // 121-128 Sound Effects
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, 
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, 
*/
};

// this table starts mapping at 35 (ie index + 35 is the MIDI number)
static const uint8_t MIDI_PMAP_BASE = 35;
static const uint8_t PROGMEM MidiPMap[] = 
{
  MD_YM2413::P_BASS_DRUM, MD_YM2413::P_BASS_DRUM, MD_YM2413::I_UNDEFINED, // 35-37
  MD_YM2413::P_SNARE_DRUM, MD_YM2413::I_UNDEFINED, MD_YM2413::P_SNARE_DRUM, // 38-40
  MD_YM2413::P_TOM_TOM, MD_YM2413::P_HI_HAT, MD_YM2413::P_TOM_TOM, // 41-43
  MD_YM2413::P_HI_HAT, MD_YM2413::P_TOM_TOM, MD_YM2413::P_HI_HAT, // 44-46
  MD_YM2413::P_TOM_TOM, MD_YM2413::P_TOM_TOM, MD_YM2413::P_TOP_CYMBAL, // 47-49
  MD_YM2413::P_TOM_TOM, MD_YM2413::P_TOP_CYMBAL, MD_YM2413::P_TOP_CYMBAL, // 50-52
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::P_TOP_CYMBAL, // 53-55
  MD_YM2413::I_UNDEFINED, MD_YM2413::P_TOP_CYMBAL, MD_YM2413::I_UNDEFINED, // 56-58
  MD_YM2413::P_TOP_CYMBAL, MD_YM2413::P_TOM_TOM, MD_YM2413::P_TOM_TOM, // 59-61
/* All undefined after this point, so handle by checking upper boundary in code
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, // 62-64
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, // 65-67
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, // 68-70
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, // 71-73
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, // 74-76
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, // 77-79
  MD_YM2413::I_UNDEFINED, MD_YM2413::I_UNDEFINED, // 80-81
*/
};

