MKMIDIStatusBytes.h

The following code is a reference for MKMIDIStatusBytes.h, which reduces large sections of the MIDI specification to human-readable constants.



        /*_--__-_--____--__-___-____-___-_____------------------------_-------------------------------------
|  \/  | |/ /  \/  |_ _|  _ \_ _|_   _|   _ _ __   ___  ___  | |__  
| |\/| | ' /| |\/| || || | | | |  | || | | | '_ \ / _ \/ __| | '_ \ 
| |  | | . \| |  | || || |_| | |  | || |_| | |_) |  __/\__ \_| | | |
|_|  |_|_|\_\_|  |_|___|____/___| |_| \__, | .__/ \___||___(_)_| |_|
                                      |___/|_|                      
various enumerations and types pertaining to MIDI files
--------------------------------------------------------------------------------------------------*/
#ifndef MK_MIDI_TYPES
#define MK_MIDI_TYPES

/*__-_--------_-------------___------_--------------------------------------------------------------
/ __| |_ __ _| |_ _  _ ___ | _ )_  _| |_ ___ ___
\__ \  _/ _` |  _| || (_-< | _ \ || |  _/ -_|_-<
|___/\__\__,_|\__|\_,_/__/ |___/\_, |\__\___/__/
                                |__/            
--------------------------------------------------------------------------------------------------*/
typedef enum
  {
    MIDI_STATUS_NOTE_OFF                    = 0x80, // (nibble)channel, (byte)pitch, (byte)velocity
    MIDI_STATUS_NOTE_ON                     = 0x90, // (nibble)channel, (byte)pitch, (byte)velocity
    MIDI_STATUS_POLYPHONIC_AFTERTOUCH       = 0xA0, // (nibble)channel, (byte)pitch, (byte)velocity
    MIDI_STATUS_MODE_CHANGE                 = 0xB0, // (nibble)channel, (byte)mode,  (more bytes)see below
    MIDI_STATUS_CONTROL_CHANGE              = 0xB0, // synonym for MODE_CHANGE
    MIDI_STATUS_PROGRAM_CHANGE              = 0xC0, // (nibble)channel, (byte)instrument
    MIDI_STATUS_CHANNEL_AFTERTOUCH          = 0xD0, // (nibble)channel, (byte)velocity
    MIDI_STATUS_PITCH_WHEEL                 = 0xE0, // (short)pitch
    MIDI_STATUS_SYSTEM_EXCLUSIVE            = 0xF0, // data bytes, described below
    MIDI_STATUS_MTC_QUARTER_FRAME           = 0xF1,
    MIDI_STATUS_SONG_POSITION_POINTER       = 0xF2, // LSB, MSB
    MIDI_STATUS_SONG_SELECT                 = 0xF3, // song number (1-127)
    //undefined                             = 0xF4,
    //undefined                             = 0xF5,
    MIDI_STATUS_TUNE_REQUEST                = 0xF6, // none
    MIDI_STATUS_END_OF_EXCLUSIVE            = 0xF7, // none
    MIDI_STATUS_TIMING_CLOCK                = 0xF8, // none
    //undefined                             = 0xF9, 
    MIDI_STATUS_START                       = 0xFA, // none
    MIDI_STATUS_CONTINUE                    = 0xFB, // none
    MIDI_STATUS_STOP                        = 0xFC, // none
    //undefined                             = 0xFD,
    MIDI_STATUS_ACTIVE_SENSING              = 0xFE, // none
    MIDI_STATUS_SYSTEM_RESET                = 0xFF, // none, realtime only
    MIDI_STATUS_META_EVENT                  = 0xFF, // data bytes, described below, midi files only
  }mkMIDIStatus_t;
 
/*___-_-----------------------_---------------------------------------------------------------------
 / __| |_  __ _ _ _  _ _  ___| |___
| (__| ' \/ _` | ' \| ' \/ -_) (_-<
 \___|_||_\__,_|_||_|_||_\___|_/__/
--------------------------------------------------------------------------------------------------*/
typedef enum 
  {
    MIDI_CHANNEL_1                  = 0x00,
    MIDI_CHANNEL_GRAND_PIANO        = 0x00,
    MIDI_CHANNEL_2                  = 0x01,
    MIDI_CHANNEL_POLYSYNTH          = 0x01,
    MIDI_CHANNEL_3                  = 0x02,
    MIDI_CHANNEL_FINGERED_BASS      = 0x02,
    MIDI_CHANNEL_4                  = 0x03,
    MIDI_CHANNEL_MUTED_GUITAR       = 0x03,
    MIDI_CHANNEL_5                  = 0x04,
    MIDI_CHANNEL_STRINGS            = 0x04,  
    MIDI_CHANNEL_6                  = 0x05,
    MIDI_CHANNEL_PIZZICATO_STRINGS  = 0x05,
    MIDI_CHANNEL_7                  = 0x06,
    MIDI_CHANNEL_BRASS              = 0x06,  
    MIDI_CHANNEL_8                  = 0x07,
    MIDI_CHANNEL_TRUMPET            = 0x07,  
    MIDI_CHANNEL_9                  = 0x08,
    MIDI_CHANNEL_REVERSE_CYMBAL     = 0x08,  
    MIDI_CHANNEL_10                 = 0x09,
    MIDI_CHANNEL_STANDARD_DRUM      = 0x09,
    MIDI_CHANNEL_11                 = 0x0A,
    MIDI_CHANNEL_DRAW_ORGAN         = 0x0A,
    MIDI_CHANNEL_12                 = 0x0B,
    MIDI_CHANNEL_ELECTRIC_PIANO     = 0x0B,
    MIDI_CHANNEL_13                 = 0x0C,
    MIDI_CHANNEL_SYNTH_STRINGS      = 0x0C,
    MIDI_CHANNEL_14                 = 0x0D,
    MIDI_CHANNEL_SQUARE_WAVE        = 0x0D,
    MIDI_CHANNEL_15                 = 0x0E,
    MIDI_CHANNEL_SAW_WAVE           = 0x0E,
    MIDI_CHANNEL_16                 = 0x0F,
    MIDI_CHANNEL_SOUNDTRACK         = 0x0F,
  }mkMIDIChannel_t;

/*__-_-_------_-------------------------------------------------------------------------------------
| _ (_) |_ __| |_  ___ ___
|  _/ |  _/ _| ' \/ -_|_-<
|_| |_|\__\__|_||_\___/__/
--------------------------------------------------------------------------------------------------*/
typedef enum
  {
    MIDI_PITCH_C_NEG1   = 0x00,
    MIDI_PITCH_Cs_NEG1  = 0x01,
    MIDI_PITCH_Db_NEG1  = 0x01,
    MIDI_PITCH_D_NEG1   = 0x02,
    MIDI_PITCH_Ds_NEG1  = 0x03,
    MIDI_PITCH_Eb_NEG1  = 0x03,
    MIDI_PITCH_E_NEG1   = 0x04,
    MIDI_PITCH_F_NEG1   = 0x05,
    MIDI_PITCH_Fs_NEG1  = 0x06,
    MIDI_PITCH_Gb_NEG1  = 0x06,
    MIDI_PITCH_G_NEG1   = 0x07,
    MIDI_PITCH_Gs_NEG1  = 0x08,
    MIDI_PITCH_Ab_NEG1  = 0x08,
    MIDI_PITCH_A_NEG1   = 0x09,
    MIDI_PITCH_As_NEG1  = 0x0A,
    MIDI_PITCH_Bb_NEG1  = 0x0A,
    MIDI_PITCH_B_NEG1   = 0x0B,
    
    MIDI_PITCH_C_0      = 0x0C,
    MIDI_PITCH_Cs_0     = 0x0D,
    MIDI_PITCH_Db_0     = 0x0D,
    MIDI_PITCH_D_0      = 0x0E,
    MIDI_PITCH_Ds_0     = 0x0F,
    MIDI_PITCH_Eb_0     = 0x0F,
    MIDI_PITCH_E_0      = 0x10,
    MIDI_PITCH_F_0      = 0x11,
    MIDI_PITCH_Fs_0     = 0x12,
    MIDI_PITCH_Gb_0     = 0x12,
    MIDI_PITCH_G_0      = 0x13,
    MIDI_PITCH_Gs_0     = 0x14,
    MIDI_PITCH_Ab_0     = 0x14,
    MIDI_PITCH_A_0      = 0x15,
    MIDI_PITCH_As_0     = 0x16,
    MIDI_PITCH_Bb_0     = 0x16,
    MIDI_PITCH_B_0      = 0x17,
    
    MIDI_PITCH_C_1      = 0x18,
    MIDI_PITCH_Cs_1     = 0x19,
    MIDI_PITCH_Db_1     = 0x19,
    MIDI_PITCH_D_1      = 0x1A,
    MIDI_PITCH_Ds_1     = 0x1B,
    MIDI_PITCH_Eb_1     = 0x1B,
    MIDI_PITCH_E_1      = 0x1C,
    MIDI_PITCH_F_1      = 0x1D,
    MIDI_PITCH_Fs_1     = 0x1E,
    MIDI_PITCH_Gb_1     = 0x1E,
    MIDI_PITCH_G_1      = 0x1F,
    MIDI_PITCH_Gs_1     = 0x20,
    MIDI_PITCH_Ab_1     = 0x20,
    MIDI_PITCH_A_1      = 0x21,
    MIDI_PITCH_As_1     = 0x22,
    MIDI_PITCH_Bb_1     = 0x22,
    MIDI_PITCH_B_1      = 0x23,    
    
    MIDI_PITCH_C_2      = 0x24,
    MIDI_PITCH_Cs_2     = 0x25,
    MIDI_PITCH_Db_2     = 0x25,
    MIDI_PITCH_D_2      = 0x26,
    MIDI_PITCH_Ds_2     = 0x27,
    MIDI_PITCH_Eb_2     = 0x27,
    MIDI_PITCH_E_2      = 0x28,
    MIDI_PITCH_F_2      = 0x29,
    MIDI_PITCH_Fs_2     = 0x2A,
    MIDI_PITCH_Gb_2     = 0x2A,
    MIDI_PITCH_G_2      = 0x2B,
    MIDI_PITCH_Gs_2     = 0x2C,
    MIDI_PITCH_Ab_2     = 0x2C,
    MIDI_PITCH_A_2      = 0x2D,
    MIDI_PITCH_As_2     = 0x2E,
    MIDI_PITCH_Bb_2     = 0x2E,
    MIDI_PITCH_B_2      = 0x2F,
    
    MIDI_PITCH_C_3      = 0x30,
    MIDI_PITCH_Cs_3     = 0x31,
    MIDI_PITCH_Db_3     = 0x31,
    MIDI_PITCH_D_3      = 0x32,
    MIDI_PITCH_Ds_3     = 0x33,
    MIDI_PITCH_Eb_3     = 0x33,
    MIDI_PITCH_E_3      = 0x34,
    MIDI_PITCH_F_3      = 0x35,
    MIDI_PITCH_Fs_3     = 0x36,
    MIDI_PITCH_Gb_3     = 0x36,
    MIDI_PITCH_G_3      = 0x37,
    MIDI_PITCH_Gs_3     = 0x38,
    MIDI_PITCH_Ab_3     = 0x38,
    MIDI_PITCH_A_3      = 0x39,
    MIDI_PITCH_As_3     = 0x3A,
    MIDI_PITCH_Bb_3     = 0x3A,
    MIDI_PITCH_B_3      = 0x3B,
    
    MIDI_PITCH_C_4      = 0x3C,
    MIDI_PITCH_Cs_4     = 0x3D,
    MIDI_PITCH_Db_4     = 0x3D,
    MIDI_PITCH_D_4      = 0x3E,
    MIDI_PITCH_Ds_4     = 0x3F,
    MIDI_PITCH_Eb_4     = 0x3F,
    MIDI_PITCH_E_4      = 0x40,
    MIDI_PITCH_F_4      = 0x41,
    MIDI_PITCH_Fs_4     = 0x42,
    MIDI_PITCH_Gb_4     = 0x42,
    MIDI_PITCH_G_4      = 0x43,
    MIDI_PITCH_Gs_4     = 0x44,
    MIDI_PITCH_Ab_4     = 0x44,
    MIDI_PITCH_A_4      = 0x45,
    MIDI_PITCH_As_4     = 0x46,
    MIDI_PITCH_Bb_4     = 0x46,
    MIDI_PITCH_B_4      = 0x47,
    
    MIDI_PITCH_C_5      = 0x48,
    MIDI_PITCH_Cs_5     = 0x49,
    MIDI_PITCH_Db_5     = 0x49,
    MIDI_PITCH_D_5      = 0x4A,
    MIDI_PITCH_Ds_5     = 0x4B,
    MIDI_PITCH_Eb_5     = 0x4B,
    MIDI_PITCH_E_5      = 0x4C,
    MIDI_PITCH_F_5      = 0x4D,
    MIDI_PITCH_Fs_5     = 0x4E,
    MIDI_PITCH_Gb_5     = 0x4E,
    MIDI_PITCH_G_5      = 0x4F,
    MIDI_PITCH_Gs_5     = 0x50,
    MIDI_PITCH_Ab_5     = 0x50,
    MIDI_PITCH_A_5      = 0x51,
    MIDI_PITCH_As_5     = 0x52,
    MIDI_PITCH_Bb_5     = 0x52,
    MIDI_PITCH_B_5      = 0x53,
    
    MIDI_PITCH_C_6      = 0x54,
    MIDI_PITCH_Cs_6     = 0x55,
    MIDI_PITCH_Db_6     = 0x55,
    MIDI_PITCH_D_6      = 0x56,
    MIDI_PITCH_Ds_6     = 0x57,
    MIDI_PITCH_Eb_6     = 0x57,
    MIDI_PITCH_E_6      = 0x58,
    MIDI_PITCH_F_6      = 0x59,
    MIDI_PITCH_Fs_6     = 0x5A,
    MIDI_PITCH_Gb_6     = 0x5A,
    MIDI_PITCH_G_6      = 0x5B,
    MIDI_PITCH_Gs_6     = 0x5C,
    MIDI_PITCH_Ab_6     = 0x5C,
    MIDI_PITCH_A_6      = 0x5D,
    MIDI_PITCH_As_6     = 0x5E,
    MIDI_PITCH_Bb_6     = 0x5E,
    MIDI_PITCH_B_6      = 0x5F,
    
    MIDI_PITCH_C_7      = 0x60,
    MIDI_PITCH_Cs_7     = 0x61,
    MIDI_PITCH_Db_7     = 0x61,
    MIDI_PITCH_D_7      = 0x62,
    MIDI_PITCH_Ds_7     = 0x63,
    MIDI_PITCH_Eb_7     = 0x63,
    MIDI_PITCH_E_7      = 0x64,
    MIDI_PITCH_F_7      = 0x65,
    MIDI_PITCH_Fs_7     = 0x66,
    MIDI_PITCH_Gb_7     = 0x66,
    MIDI_PITCH_G_7      = 0x67,
    MIDI_PITCH_Gs_7     = 0x68,
    MIDI_PITCH_Ab_7     = 0x68,
    MIDI_PITCH_A_7      = 0x69,
    MIDI_PITCH_As_7     = 0x6A,
    MIDI_PITCH_Bb_7     = 0x6A,
    MIDI_PITCH_B_7      = 0x6B,
    
    MIDI_PITCH_C_8      = 0x6C,
    MIDI_PITCH_Cs_8     = 0x6D,
    MIDI_PITCH_Db_8     = 0x6D,
    MIDI_PITCH_D_8      = 0x6E,
    MIDI_PITCH_Ds_8     = 0x6F,
    MIDI_PITCH_Eb_8     = 0x6F,
    MIDI_PITCH_E_8      = 0x70,
    MIDI_PITCH_F_8      = 0x71,
    MIDI_PITCH_Fs_8     = 0x72,
    MIDI_PITCH_Gb_8     = 0x72,
    MIDI_PITCH_G_8      = 0x73,
    MIDI_PITCH_Gs_8     = 0x74,
    MIDI_PITCH_Ab_8     = 0x74,
    MIDI_PITCH_A_8      = 0x75,
    MIDI_PITCH_As_8     = 0x76,
    MIDI_PITCH_Bb_8     = 0x76,
    MIDI_PITCH_B_8      = 0x77,
    
    MIDI_PITCH_C_9      = 0x78,
    MIDI_PITCH_Cs_9     = 0x79,
    MIDI_PITCH_Db_9     = 0x79,
    MIDI_PITCH_D_9      = 0x7A,
    MIDI_PITCH_Ds_9     = 0x7B,
    MIDI_PITCH_Eb_9     = 0x7B,
    MIDI_PITCH_E_9      = 0x7C,
    MIDI_PITCH_F_9      = 0x7D,
    MIDI_PITCH_Fs_9     = 0x7E,
    MIDI_PITCH_Gb_9     = 0x7E,
    MIDI_PITCH_G_9      = 0x7F,
  }mkMIDIPitch_t;   

/*---__---_---------_-_-----------------------------------------------------------------------------
\ \ / /__| |___  __(_) |_ _  _ 
 \ V / -_) / _ \/ _| |  _| || |
  \_/\___|_\___/\__|_|\__|\_, |
                          |__/ 
--------------------------------------------------------------------------------------------------*/
typedef enum
  {
    MIDI_VELOCITY_OFF   = 0x00,
    MIDI_VELOCITY_PPP   = 0x0F,
    MIDI_VELOCITY_PP    = 0x1F,
    MIDI_VELOCITY_P     = 0x2F,
    MIDI_VELOCITY_MP    = 0x3F,
    MIDI_VELOCITY_MF    = 0x4F,
    MIDI_VELOCITY_F     = 0x5F,
    MIDI_VELOCITY_FF    = 0x6F,
    MIDI_VELOCITY_FFF   = 0x7F,
  }mkMIDIVelocity_t;
  
/*__---------_----------------_---------------------------------------------------------------------
/ __| ___ __| |_ ___ _ _ _  _| |_ ___ 
\__ \/ _ (_-<  _/ -_) ' \ || |  _/ _ \
|___/\___/__/\__\___|_||_\_,_|\__\___/
--------------------------------------------------------------------------------------------------*/
typedef enum
  {
    MIDI_SOSTENUTO_OFF                      = 0x00,
    MIDI_SOSTENUTO_QUARTER_DEPRESSED        = 0x1F,
    MIDI_SOSTENUTO_HALF_DEPRESSED           = 0x3F,
    MIDI_SOSTENUTO_THREE_QUARTERS_DEPRESSED = 0x5F,
    MIDI_SOSTENUTO_FULLY_DEPRESSED          = 0x7F,
  }mkMIDISostenutoVelocity_t;                                       
                                                    
/*--------------------------------------------------------------------------------------------------                                                                                                                                                                                                                                         
                                                    
                                                                                                                                                                                                                                                                    
--------------------------------------------------------------------------------------------------*/
enum sysExByte
  {
	  MIDI_GARBAGE = 0x00,
  };
  
/*_--__---------_-------___------_------------------------------------------------------------------
|  \/  |___  __| |___  | _ )_  _| |_ ___ ___
| |\/| / _ \/ _` / -_) | _ \ || |  _/ -_|_-<
|_|  |_\___/\__,_\___| |___/\_, |\__\___/__/
                            |__/            
--------------------------------------------------------------------------------------------------*/
typedef enum
  {
    MIDI_MODE_BANK_SELECT_MSB                   = 0x00,
    MIDI_MODE_MODULATION_WHEEL_MSB              = 0x01,
    MIDI_MODE_BREATH_CONTROLLER_MSB             = 0x02,
    //undefined                                 = 0x03,
    MIDI_MODE_FOOT_CONTROLLER_MSB               = 0x04,
    MIDI_MODE_PORTAMENTO_TIME_MSB               = 0x05,
    MIDI_MODE_DATA_ENTRY_MSB                    = 0x06,
    MIDI_MODE_CHANNEL_VOLUME_MSB                = 0x07,
    MIDI_MODE_BALANCE_MSB                       = 0x08,
    //undefined                                 = 0x09,
    MIDI_MODE_PAN_MSB                           = 0x0A,
    MIDI_MODE_EXPRESSION_CONTROLLER_MSB         = 0x0B,
    MIDI_MODE_EFFECT_CTRL_1_MSB                 = 0x0C,
    MIDI_MODE_EFFECT_CTRL_2_MSB                 = 0x0D,
    //undefined                                 = 0x0E,
    //undefined                                 = 0x0F,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_1_MSB        = 0x10,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_2_MSB        = 0x11,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_3_MSB        = 0x12,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_4_MSB        = 0x13,
    //undefined                                 = 0x14,
    //undefined                                 = 0x15,
    //undefined                                 = 0x16,
    //undefined                                 = 0x17,
    //undefined                                 = 0x18,
    //undefined                                 = 0x19,
    //undefined                                 = 0x1A,
    //undefined                                 = 0x1B,
    //undefined                                 = 0x1C,
    //undefined                                 = 0x1D,
    //undefined                                 = 0x1E,
    //undefined                                 = 0x1F,
    MIDI_MODE_BANK_SELECT_LSB                   = 0x20,
    MIDI_MODE_MODULATION_WHEEL_LSB              = 0x21,
    MIDI_MODE_BREATH_CONTROLLER_LSB             = 0x22,
    //undefined                                 = 0x23,
    MIDI_MODE_FOOT_CONTROLLER_LSB               = 0x24,
    MIDI_MODE_PORTAMENTO_TIME_LSB               = 0x25,
    MIDI_MODE_DATA_ENTRY_LSB                    = 0x26,
    MIDI_MODE_CHANNEL_VOLUME_LSB                = 0x27,
    MIDI_MODE_BALANCE_LSB                       = 0x28,
    //undefined                                 = 0x29,
    MIDI_MODE_PAN_LSB                           = 0x2A,
    MIDI_MODE_EXPRESSION_CONTROLLER_LSB         = 0x2B,
    MIDI_MODE_EFFECT_CTRL_1_LSB                 = 0x2C,
    MIDI_MODE_EFFECT_CTRL_2_LSB                 = 0x2D,
    //undefined                                 = 0x2E,
    //undefined                                 = 0x2F,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_1_LSB        = 0x30,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_2_LSB        = 0x31,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_3_LSB        = 0x32,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_4_LSB        = 0x33,
    //undefined                                 = 0x34,
    //undefined                                 = 0x35,
    //undefined                                 = 0x36,
    //undefined                                 = 0x37,
    //undefined                                 = 0x38,
    //undefined                                 = 0x39,
    //undefined                                 = 0x3A,
    //undefined                                 = 0x3B,
    //undefined                                 = 0x3C,
    //undefined                                 = 0x3D,
    //undefined                                 = 0x3E,
    //undefined                                 = 0x3F,    
    MIDI_MODE_SUSTAIN_PEDAL                     = 0x40,  //<63 off, >64 on, according to the specs.
    MIDI_MODE_PORTAMENTO                        = 0x41,  //<63 off, >64 on
    MIDI_MODE_SOSTENUTO                         = 0x42,  //<63 off, >64 on
    MIDI_MODE_SOFT_PEDAL                        = 0x43,  //<63 off, >64 on
    MIDI_MODE_LEGATO_FOOTSWITCH                 = 0x44,  //<63 off, >64 on
    MIDI_MODE_HOLD_2                            = 0x45,  //<63 off, >64 on
    MIDI_MODE_SOUND_VARIATION                   = 0x46,
    MIDI_MODE_SOUND_CONTROLLER_1                = 0x46,
    MIDI_MODE_TIMBRE                            = 0x47,
    MIDI_MODE_SOUND_CONTROLLER_2                = 0x47,
    MIDI_MODE_RELEASE_TIME                      = 0x48,
    MIDI_MODE_SOUND_CONTROLLER_3                = 0x48,
    MIDI_MODE_ATTACK_TIME                       = 0x49,
    MIDI_MODE_SOUND_CONTROLLER_4                = 0x49,
    MIDI_MODE_BRIGHTNESS                        = 0x4A,
    MIDI_MODE_SOUND_CONTROLLER_5                = 0x4A,
    MIDI_MODE_DECAY_TIME                        = 0x4B,
    MIDI_MODE_SOUND_CONTROLLER_6                = 0x4B,
    MIDI_MODE_VIBRATO_RATE                      = 0x4C,
    MIDI_MODE_SOUND_CONTROLLER_7                = 0x4C,
    MIDI_MODE_VIBRATO_DEPTH                     = 0x4D,
    MIDI_MODE_SOUND_CONTROLLER_8                = 0x4D,
    MIDI_MODE_VIBRATO_DELAY                     = 0x4E,
    MIDI_MODE_SOUND_CONTROLLER_9                = 0x4E,
    MIDI_MODE_SOUND_CONTROLLER_10               = 0x4F,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_5            = 0x50,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_6            = 0x51,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_7            = 0x52,
    MIDI_MODE_GENERAL_PURPOSE_CTRL_8            = 0x53,
    MIDI_MODE_PORTAMENTO_CONTROL                = 0x54,
    //undefined = 0x55,
    //undefined = 0x56,
    //undefined = 0x57,
    //undefined = 0x58,
    //undefined = 0x59,
    //undefined = 0x5A,
    MIDI_MODE_EFFECTS_DEPTH_1                   = 0x5B,
    MIDI_MODE_REVERB_SEND_LEVEL                 = 0x5B, 
    MIDI_MODE_EFFECTS_DEPTH_2                   = 0x5C,
    MIDI_MODE_EFFECTS_DEPTH_3                   = 0x5D,
    MIDI_MODE_CHORUS_SEND_LEVEL                 = 0x5D, 
    MIDI_MODE_EFFECTS_DEPTH_4                   = 0x5E, 
    MIDI_MODE_EFFECTS_DEPTH_5                   = 0x5F,
    MIDI_MODE_DATA_INCREMENT                    = 0x60,
    MIDI_MODE_DATA_DECREMENT                    = 0x61,
    MIDI_MODE_NON_REGISTERED_PARAMETER_LSB      = 0x62,
    MIDI_MODE_NON_REGISTERED_PARAMETER_MSB      = 0x63,
    MIDI_MODE_REGISTERED_PARAMETER_LSB          = 0x64,
    MIDI_MODE_REGISTERED_PARAMETER_MSB          = 0x65,
    //undefined = 0x66,
    //undefined = 0x67,
    //undefined = 0x68,
    //undefined = 0x69,
    //undefined = 0x6A,
    //undefined = 0x6B,
    //undefined = 0x6C,
    //undefined = 0x6D,
    //undefined = 0x6E,
    //undefined = 0x6F,
    //undefined = 0x70,
    //undefined = 0x71,
    //undefined = 0x72,
    //undefined = 0x73,
    //undefined = 0x74,
    //undefined = 0x75,
    //undefined = 0x76,
    //undefined = 0x77,
    //undefined = 0x78,
    //undefined = 0x79,
    //undefined = 0x7A,
    //undefined = 0x7B,
    //undefined = 0x7C,
    //undefined = 0x7D,
    //undefined = 0x7E,
    //undefined = 0x7F,  
  }mkMIDIMode_t;
  
/*__---------_--------------------------_-----------------------------------------------------------
|_ _|_ _  __| |_ _ _ _  _ _ __  ___ _ _| |_ ___
 | || ' \(_-<  _| '_| || | '  \/ -_) ' \  _(_-<
|___|_||_/__/\__|_|  \_,_|_|_|_\___|_||_\__/__/
--------------------------------------------------------------------------------------------------*/
typedef enum
  {
    MIDI_INSTRUMENT_GRAND_PIANO         = 0,
    MIDI_INSTRUMENT_BRIGHT_PIANO        = 1,
    MIDI_INSTRUMENT_ELECTRIC_GRAND      = 2,
    MIDI_INSTRUMENT_HONKEY_TONK         = 3,
    MIDI_INSTRUMENT_E_PIANO_1           = 4,
    MIDI_INSTRUMENT_E_PIANO_2           = 5,
    MIDI_INSTRUMENT_HARPSICHORD         = 6,
    MIDI_INSTRUMENT_CLAVINET            = 7,
    MIDI_INSTRUMENT_CELESTA             = 8,
    MIDI_INSTRUMENT_GLOCKENSPIEL        = 9,
    MIDI_INSTRUMENT_MUSIC_BOX           = 10,
    MIDI_INSTRUMENT_VIBRAPHONE          = 11,
    MIDI_INSTRUMENT_MARIMBA             = 12,
    MIDI_INSTRUMENT_XYLOPHONE           = 13,
    MIDI_INSTRUMENT_TUBULAR_BELL        = 14,
    MIDI_INSTRUMENT_DULCIMER            = 15,
    MIDI_INSTRUMENT_DRAW_ORGAN          = 16,
    MIDI_INSTRUMENT_PERC_ORGAN          = 17,
    MIDI_INSTRUMENT_ROCK_ORGAN          = 18,
    MIDI_INSTRUMENT_CHURCH_ORGAN        = 19,
    MIDI_INSTRUMENT_REED_ORGAN          = 20,
    MIDI_INSTRUMENT_ACCORDIAN_FR        = 21,
    MIDI_INSTRUMENT_HARMONICA           = 22,
    MIDI_INSTRUMENT_TANGO_ACCORDIAN     = 23,
    MIDI_INSTRUMENT_NYLON_GUITAR        = 24,
    MIDI_INSTRUMENT_STEEL_GUITAR        = 25,
    MIDI_INSTRUMENT_JAZZ_GUITAR         = 26,
    MIDI_INSTRUMENT_CLEAN_GUITAR        = 27,
    MIDI_INSTRUMENT_MUTED_GUITAR        = 28,
    MIDI_INSTRUMENT_OVERDRIVE_GUITAR    = 29,
    MIDI_INSTRUMENT_DISTORTION_GUITAR   = 30,   
    MIDI_INSTRUMENT_GUITAR_HARMONICS    = 31,
    MIDI_INSTRUMENT_ACOUSTIC_BASS       = 32,
    MIDI_INSTRUMENT_FINGERED_BASS       = 33,
    MIDI_INSTRUMENT_PICKED_BASS         = 34,
    MIDI_INSTRUMENT_FRETLESS_BASS       = 35,
    MIDI_INSTRUMENT_SLAP_BASS_1         = 36,
    MIDI_INSTRUMENT_SLAP_BASS_2         = 37,
    MIDI_INSTRUMENT_SYNTH_BASS_1        = 38,
    MIDI_INSTRUMENT_SYNTH_BASS_2        = 39,
    MIDI_INSTRUMENT_VIOLIN              = 40,       
    MIDI_INSTRUMENT_VIOLA               = 41,
    MIDI_INSTRUMENT_CELLO               = 42,
    MIDI_INSTRUMENT_CONTRABASS          = 43,
    MIDI_INSTRUMENT_TREMOLO_STRINGS     = 44,
    MIDI_INSTRUMENT_PIZZICATO_STRINGS   = 45,
    MIDI_INSTRUMENT_HARP                = 46,
    MIDI_INSTRUMENT_TIMPANI             = 47,
    MIDI_INSTRUMENT_STRINGS             = 48,
    MIDI_INSTRUMENT_SLOW_STRINGS        = 49,   
    MIDI_INSTRUMENT_SYNTH_STRINGS_1     = 50,
    MIDI_INSTRUMENT_SYNTH_STRINGS_2     = 51,
    MIDI_INSTRUMENT_CHOIR_AAHS          = 52,
    MIDI_INSTRUMENT_VOICE_OOHS          = 53,
    MIDI_INSTRUMENT_SYNTH_VOX           = 54,
    MIDI_INSTRUMENT_ORCHESTRA_HIT       = 55,
    MIDI_INSTRUMENT_TRUMPET             = 56,
    MIDI_INSTRUMENT_TROMBONE            = 57,
    MIDI_INSTRUMENT_TUBA                = 58,
    MIDI_INSTRUMENT_MUTED_TRUMPET       = 59,   
    MIDI_INSTRUMENT_FRENCH_HORN         = 60,
    MIDI_INSTRUMENT_BRASS               = 61,
    MIDI_INSTRUMENT_SYNTH_BRASS_1       = 62,
    MIDI_INSTRUMENT_SYNTH_BRASS_2       = 63,
    MIDI_INSTRUMENT_SOPRANO_SAX         = 64,
    MIDI_INSTRUMENT_ALTO_SAX            = 65,
    MIDI_INSTRUMENT_TENOR_SAX           = 66,
    MIDI_INSTRUMENT_BARTONE_SAX         = 67,
    MIDI_INSTRUMENT_OBOE                = 68,
    MIDI_INSTRUMENT_ENGLISH_HORN        = 69,   
    MIDI_INSTRUMENT_BASSOON             = 70,
    MIDI_INSTRUMENT_CLARINET            = 71,
    MIDI_INSTRUMENT_PICCOLO             = 72,
    MIDI_INSTRUMENT_FLUTE               = 73,
    MIDI_INSTRUMENT_RECORDER            = 74,
    MIDI_INSTRUMENT_PAN_FLUTE           = 75,
    MIDI_INSTRUMENT_BLOWN_BOTTLE        = 76,
    MIDI_INSTRUMENT_SHAKUHACHI          = 77,
    MIDI_INSTRUMENT_WHISTLE             = 78,
    MIDI_INSTRUMENT_OCARINA             = 79,   
    MIDI_INSTRUMENT_SQUARE_WAVE         = 80,
    MIDI_INSTRUMENT_SAW_WAVE            = 81,
    MIDI_INSTRUMENT_CALLIOPE            = 82,
    MIDI_INSTRUMENT_CHIFFER_LEAD        = 83,
    MIDI_INSTRUMENT_CHARANG             = 84,
    MIDI_INSTRUMENT_SOLO_VOX            = 85,
    MIDI_INSTRUMENT_5TH_SAW_WAVE        = 86,
    MIDI_INSTRUMENT_BASS_AND_LEAD       = 87,
    MIDI_INSTRUMENT_FANTASIA            = 88,
    MIDI_INSTRUMENT_WARM_PAD            = 89,   
    MIDI_INSTRUMENT_POLYSYNTH           = 90,
    MIDI_INSTRUMENT_SPACE_VOICE         = 91,
    MIDI_INSTRUMENT_BOWED_GLASS         = 92,
    MIDI_INSTRUMENT_METAL_PAD           = 93,
    MIDI_INSTRUMENT_HALO_PAD            = 94,
    MIDI_INSTRUMENT_SWEEP_PAD           = 95,
    MIDI_INSTRUMENT_ICE_RAIN            = 96,
    MIDI_INSTRUMENT_SOUNDTRACK          = 97,
    MIDI_INSTRUMENT_CRYSTAL             = 98,
    MIDI_INSTRUMENT_ATMOSPHERE          = 99,
    MIDI_INSTRUMENT_BRIGHTNESS          = 100,
    MIDI_INSTRUMENT_GOBLIN              = 101,
    MIDI_INSTRUMENT_ECHO_DROPS          = 102,
    MIDI_INSTRUMENT_STAR_THEME          = 103,
    MIDI_INSTRUMENT_SITAR               = 104,
    MIDI_INSTRUMENT_BANJO               = 105,
    MIDI_INSTRUMENT_SHAMISAN            = 106,
    MIDI_INSTRUMENT_KOTO                = 107,
    MIDI_INSTRUMENT_KALIMBA             = 108,
    MIDI_INSTRUMENT_BAGPIPE             = 109,
    MIDI_INSTRUMENT_FIDDLE              = 110,
    MIDI_INSTRUMENT_SHANAI              = 111,
    MIDI_INSTRUMENT_TINKLE_BELL         = 112,
    MIDI_INSTRUMENT_AGOGO               = 113,
    MIDI_INSTRUMENT_STEEL_DRUMS         = 114,
    MIDI_INSTRUMENT_WOODBLOCK           = 115,
    MIDI_INSTRUMENT_TAIKO               = 116,
    MIDI_INSTRUMENT_MELO_TOM            = 117,
    MIDI_INSTRUMENT_SYNTH_DRUM          = 118,
    MIDI_INSTRUMENT_REVERSE_CYMBAL      = 119,
    MIDI_INSTRUMENT_GUITAR_FRET_NOISE   = 120,
    MIDI_INSTRUMENT_BREATH_NOISE        = 121,
    MIDI_INSTRUMENT_SEASHORE            = 122,
    MIDI_INSTRUMENT_BIRD                = 123,
    MIDI_INSTRUMENT_TELEPHONE           = 124,
    MIDI_INSTRUMENT_HELICOPTER          = 125,
    MIDI_INSTRUMENT_APPLAUSE            = 126,
    MIDI_INSTRUMENT_GUN_SHOT            = 127,
  }mkMIDIInstrument_t;
  
/*------------_----_------------------_---------------------------------_---------------------------
 _ _ ___ __ _(_)__| |_ ___ _ _ ___ __| |  _ __  __ _ _ _ __ _ _ __  ___| |_ ___ _ _ ___
| '_/ -_) _` | (_-<  _/ -_) '_/ -_) _` | | '_ \/ _` | '_/ _` | '  \/ -_)  _/ -_) '_(_-<
|_| \___\__, |_/__/\__\___|_| \___\__,_| | .__/\__,_|_| \__,_|_|_|_\___|\__\___|_| /__/
        |___/                            |_|                                                                         
--------------------------------------------------------------------------------------------------*/
/*
 To set the value of a registered parameter, use one of the following three message patterns:
 
 1)
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_REGISTERED_PARAMETER_MSB,  (MSB of the registered-parameter number) 
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_REGISTERED_PARAMETER_LSB,  (LSB of the registered-parameter number) 
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_DATA_ENTRY_MSB,            (MSB of the new value of the parameter)
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_DATA_ENTRY_LSB,            (LSB of the new value of the parameter)

 2)
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_REGISTERED_PARAMETER_MSB,  (MSB of the registered-parameter number) 
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_REGISTERED_PARAMETER_LSB,  (LSB of the registered-parameter number) 
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_DATA_INCREMENT

 3)
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_REGISTERED_PARAMETER_MSB,  (MSB of the registered-parameter number) 
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_REGISTERED_PARAMETER_LSB,  (LSB of the registered-parameter number) 
MIDI_STATUS_MODE_CHANGE | MIDI_CHANNEL_X,  MIDI_MODE_DATA_DECREMENT
*/

typedef enum                 
  {                  
    MIDI_PARAMETER_PITCH_BEND_SENSITIVITY  = 0x0000,  
    MIDI_PARAMETER_CHANNEL_FINE_TUNING     = 0x0001,  //resolution 100/8192 cents  
    MIDI_PARAMETER_CHANNEL_COARSE_TUNING   = 0x0002,  //resolution 100 cents, MSB only
    MIDI_PARAMETER_TUNING_PROGRAM_CHANGE   = 0x0003,
    MIDI_PARAMETER_TUNING_BANK_SELECT      = 0x0004,
    MIDI_PARAMETER_MODULATION_DEPTH        = 0x0005,
    MIDI_PARAMETER_NULL_PARAMATER          = 0x7F7F
  }mkMIDIRegisterdParameter_t;

/*_--__-----_------------___-------------_----------------------------------------------------------
|  \/  |___| |_ __ _ ___| __|_ _____ _ _| |_ ___
| |\/| / -_)  _/ _` |___| _|\ V / -_) ' \  _(_-<
|_|  |_\___|\__\__,_|   |___|\_/\___|_||_\__/__/
--------------------------------------------------------------------------------------------------*/
typedef enum //followed by length of data to follow
  {
    MIDI_META_SEQUENCE_NUMBER      = 0x00, //length 2
    MIDI_META_INSERT_TEXT          = 0x01, //variable length, text
    MIDI_META_COPYRIGHT            = 0x02, //variable length, text
    MIDI_META_TRACK_NAME           = 0x03, //variable length, text
    MIDI_META_INSTRUMENT_NAME      = 0x04, //variable length, text
    MIDI_META_INSERT_LYRIC         = 0x05, //variable length, text
    MIDI_META_MARKER               = 0x06, //variable length, text
    MIDI_META_CUE_POINT            = 0x07, //variable length, text
    
    MIDI_META_CHANNEL              = 0x20, //length 1, channel
    MIDI_META_PORT                 = 0x21, //length 1, port
    MIDI_META_END_OF_TRACK         = 0x2F, //length 0
    MIDI_META_TEMPO_CHANGE         = 0x51, //length 3, microsends per quarter
    MIDI_META_SMPTE_OFFSET         = 0x54, //length 5, hours, minutes, seconds, frames, subframes
    MIDI_META_TIME_SIGNATURE       = 0x58, //length 4, numerator, denominator, clocks/metronome, 32nd notes/quarter note
    MIDI_META_KEY_SIGNATURE        = 0x59, //length 2, num accidentals(neg for flat), mode (0=MAJ, 1=MIN)
  }mkMIDIMetaEvent_t;

/*--------------------------------------------------------------------------------------------------






--------------------------------------------------------------------------------------------------*/
typedef enum
  {
    TRANSPOSE       = 0x5B,
    SCALE_CHANGE    = 0x5C, // (toggle Major/Minor);
  }mkMIDIUnregisteredParameters_t;


#endif
















       




:/ root#