# X = {
#     "8": {
#         "id": 8,
#         "name": "note_off",
#         "length": 2,
#         "params": [
#             "note_number",
#             "velocity"
#         ],
#         "mask": 127
#     },
#     "9": {
#         "id": 9,
#         "name": "note_on",
#         "length": 2,
#         "params": [
#             "note_number",
#             "velocity"
#         ],
#         "mask": 127
#     },
#     "10": {
#         "id": 10,
#         "name": "after_touch",
#         "length": 2,
#         "params": [
#             "note_number",
#             "amount"
#         ],
#         "mask": 127
#     },
#     "11": {
#         "id": 11,
#         "name": "controller",
#         "length": 2,
#         "params": [
#             "controller_type",
#             "value"
#         ],
#         "mask": 127,
#         "0": {
#             "cntrl_id": 0,
#             "cntrl_name": "blank_select"
#         },
#         "1": {
#             "cntrl_id": 1,
#             "cntrl_name": "modulation"
#         },
#         "2": {
#             "cntrl_id": 2,
#             "cntrl_name": "breath_controller"
#         },
#         "4": {
#             "cntrl_id": 4,
#             "cntrl_name": "foot_controller"
#         },
#         "5": {
#             "cntrl_id": 5,
#             "cntrl_name": "portamento_time"
#         },
#         "6": {
#             "cntrl_id": 6,
#             "cntrl_name": "data_entry"
#         },
#         "7": {
#             "cntrl_id": 7,
#             "cntrl_name": "main_volume"
#         },
#         "8": {
#             "cntrl_id": 8,
#             "cntrl_name": "balance"
#         },
#         "10": {
#             "cntrl_id": 10,
#             "cntrl_name": "pan"
#         },
#         "11": {
#             "cntrl_id": 11,
#             "cntrl_name": "expression_controller"
#         },
#         "12": {
#             "cntrl_id": 12,
#             "cntrl_name": "effect_control_0"
#         },
#         "13": {
#             "cntrl_id": 13,
#             "cntrl_name": "effect_control_1"
#         },
#         "16": {
#             "cntrl_id": 16,
#             "cntrl_name": "general_purpose_controller_0"
#         },
#         "17": {
#             "cntrl_id": 17,
#             "cntrl_name": "general_purpose_controller_1"
#         },
#         "18": {
#             "cntrl_id": 18,
#             "cntrl_name": "general_purpose_controller_2"
#         },
#         "19": {
#             "cntrl_id": 19,
#             "cntrl_name": "general_purpose_controller_3"
#         },
#         "32": {
#             "cntrl_id": 32,
#             "cntrl_name": "LSB_for_controller_0"
#         },
#         "33": {
#             "cntrl_id": 33,
#             "cntrl_name": "LSB_for_controller_1"
#         },
#         "34": {
#             "cntrl_id": 34,
#             "cntrl_name": "LSB_for_controller_2"
#         },
#         "35": {
#             "cntrl_id": 35,
#             "cntrl_name": "LSB_for_controller_3"
#         },
#         "36": {
#             "cntrl_id": 36,
#             "cntrl_name": "LSB_for_controller_4"
#         },
#         "37": {
#             "cntrl_id": 37,
#             "cntrl_name": "LSB_for_controller_5"
#         },
#         "38": {
#             "cntrl_id": 38,
#             "cntrl_name": "LSB_for_controller_6"
#         },
#         "39": {
#             "cntrl_id": 39,
#             "cntrl_name": "LSB_for_controller_7"
#         },
#         "40": {
#             "cntrl_id": 40,
#             "cntrl_name": "LSB_for_controller_8"
#         },
#         "41": {
#             "cntrl_id": 41,
#             "cntrl_name": "LSB_for_controller_9"
#         },
#         "42": {
#             "cntrl_id": 42,
#             "cntrl_name": "LSB_for_controller_10"
#         },
#         "43": {
#             "cntrl_id": 43,
#             "cntrl_name": "LSB_for_controller_11"
#         },
#         "44": {
#             "cntrl_id": 44,
#             "cntrl_name": "LSB_for_controller_12"
#         },
#         "45": {
#             "cntrl_id": 45,
#             "cntrl_name": "LSB_for_controller_13"
#         },
#         "46": {
#             "cntrl_id": 46,
#             "cntrl_name": "LSB_for_controller_14"
#         },
#         "47": {
#             "cntrl_id": 47,
#             "cntrl_name": "LSB_for_controller_15"
#         },
#         "48": {
#             "cntrl_id": 48,
#             "cntrl_name": "LSB_for_controller_16"
#         },
#         "49": {
#             "cntrl_id": 49,
#             "cntrl_name": "LSB_for_controller_17"
#         },
#         "50": {
#             "cntrl_id": 50,
#             "cntrl_name": "LSB_for_controller_18"
#         },
#         "51": {
#             "cntrl_id": 51,
#             "cntrl_name": "LSB_for_controller_19"
#         },
#         "52": {
#             "cntrl_id": 52,
#             "cntrl_name": "LSB_for_controller_20"
#         },
#         "53": {
#             "cntrl_id": 53,
#             "cntrl_name": "LSB_for_controller_21"
#         },
#         "54": {
#             "cntrl_id": 54,
#             "cntrl_name": "LSB_for_controller_22"
#         },
#         "55": {
#             "cntrl_id": 55,
#             "cntrl_name": "LSB_for_controller_23"
#         },
#         "56": {
#             "cntrl_id": 56,
#             "cntrl_name": "LSB_for_controller_24"
#         },
#         "57": {
#             "cntrl_id": 57,
#             "cntrl_name": "LSB_for_controller_25"
#         },
#         "58": {
#             "cntrl_id": 58,
#             "cntrl_name": "LSB_for_controller_26"
#         },
#         "59": {
#             "cntrl_id": 59,
#             "cntrl_name": "LSB_for_controller_27"
#         },
#         "60": {
#             "cntrl_id": 60,
#             "cntrl_name": "LSB_for_controller_28"
#         },
#         "61": {
#             "cntrl_id": 61,
#             "cntrl_name": "LSB_for_controller_29"
#         },
#         "62": {
#             "cntrl_id": 62,
#             "cntrl_name": "LSB_for_controller_30"
#         },
#         "63": {
#             "cntrl_id": 63,
#             "cntrl_name": "LSB_for_controller_31"
#         },
#         "64": {
#             "cntrl_id": 64,
#             "cntrl_name": "damper_pedal"
#         },
#         "65": {
#             "cntrl_id": 65,
#             "cntrl_name": "portamento"
#         },
#         "66": {
#             "cntrl_id": 66,
#             "cntrl_name": "sostenuto"
#         },
#         "67": {
#             "cntrl_id": 67,
#             "cntrl_name": "soft_pedal"
#         },
#         "68": {
#             "cntrl_id": 68,
#             "cntrl_name": "legato_footswitch"
#         },
#         "69": {
#             "cntrl_id": 69,
#             "cntrl_name": "hold"
#         },
#         "70": {
#             "cntrl_id": 70,
#             "cntrl_name": "sound_controller_0"
#         },
#         "71": {
#             "cntrl_id": 71,
#             "cntrl_name": "sound_controller_1"
#         },
#         "72": {
#             "cntrl_id": 72,
#             "cntrl_name": "sound_controller_2"
#         },
#         "73": {
#             "cntrl_id": 73,
#             "cntrl_name": "sound_controller_3"
#         },
#         "74": {
#             "cntrl_id": 74,
#             "cntrl_name": "sound_controller_4"
#         },
#         "75": {
#             "cntrl_id": 75,
#             "cntrl_name": "sound_controller_5"
#         },
#         "76": {
#             "cntrl_id": 76,
#             "cntrl_name": "sound_controller_6"
#         },
#         "77": {
#             "cntrl_id": 77,
#             "cntrl_name": "sound_controller_7"
#         },
#         "78": {
#             "cntrl_id": 78,
#             "cntrl_name": "sound_controller_8"
#         },
#         "79": {
#             "cntrl_id": 79,
#             "cntrl_name": "sound_controller_9"
#         },
#         "80": {
#             "cntrl_id": 80,
#             "cntrl_name": "post_general_purpose_controller_0"
#         },
#         "81": {
#             "cntrl_id": 81,
#             "cntrl_name": "post_general_purpose_controller_1"
#         },
#         "82": {
#             "cntrl_id": 82,
#             "cntrl_name": "post_general_purpose_controller_2"
#         },
#         "83": {
#             "cntrl_id": 83,
#             "cntrl_name": "post_general_purpose_controller_3"
#         },
#         "84": {
#             "cntrl_id": 84,
#             "cntrl_name": "portamento_control"
#         },
#         "91": {
#             "cntrl_id": 91,
#             "cntrl_name": "effects_depth_0"
#         },
#         "92": {
#             "cntrl_id": 92,
#             "cntrl_name": "effects_depth_1"
#         },
#         "93": {
#             "cntrl_id": 93,
#             "cntrl_name": "effects_depth_2"
#         },
#         "94": {
#             "cntrl_id": 94,
#             "cntrl_name": "effects_depth_3"
#         },
#         "95": {
#             "cntrl_id": 95,
#             "cntrl_name": "effects_depth_4"
#         },
#         "96": {
#             "cntrl_id": 96,
#             "cntrl_name": "data_increment"
#         },
#         "97": {
#             "cntrl_id": 97,
#             "cntrl_name": "data_decrement"
#         },
#         "98": {
#             "cntrl_id": 98,
#             "cntrl_name": "nonreg_param_num_lsb"
#         },
#         "99": {
#             "cntrl_id": 99,
#             "cntrl_name": "nonreg_param_num_msb"
#         },
#         "100": {
#             "cntrl_id": 100,
#             "cntrl_name": "reg_param_num_lsb"
#         },
#         "101": {
#             "cntrl_id": 101,
#             "cntrl_name": "reg_param_num_msb"
#         },
#         "121": {
#             "cntrl_id": 121,
#             "cntrl_name": "mode_messages_0"
#         },
#         "122": {
#             "cntrl_id": 122,
#             "cntrl_name": "mode_messages_1"
#         },
#         "123": {
#             "cntrl_id": 123,
#             "cntrl_name": "mode_messages_2"
#         },
#         "124": {
#             "cntrl_id": 124,
#             "cntrl_name": "mode_messages_3"
#         },
#         "125": {
#             "cntrl_id": 125,
#             "cntrl_name": "mode_messages_4"
#         },
#         "126": {
#             "cntrl_id": 126,
#             "cntrl_name": "mode_messages_5"
#         },
#         "127": {
#             "cntrl_id": 127,
#             "cntrl_name": "mode_messages_6"
#         }
#     },
#     "12": {
#         "id": 12,
#         "name": "program_change",
#         "length": 1,
#         "params": [
#             "program_number"
#         ],
#         "mask": 127
#     },
#     "13": {
#         "id": 13,
#         "name": "channel_after_touch",
#         "length": 1,
#         "params": [
#             "amount"
#         ],
#         "mask": 127
#     },
#     "14": {
#         "id": 14,
#         "name": "pitch_bend",
#         "length": 2,
#         "params": [
#             "vlsb",
#             "vmsb"
#         ],
#         "mask": 127
#     }
# }

X = {
    8: {'id': 8,
        'length': 2,
        'mask': 127,
        'name': 'note_off',
        'params': ('note_number', 'velocity')},
    9: {'id': 9,
        'length': 2,
        'mask': 127,
        'name': 'note_on',
        'params': ('note_number', 'velocity')},
    10: {'id': 10,
        'length': 2,
        'mask': 127,
        'name': 'after_touch',
        'params': ('note_number', 'amount')},
    11: {0: {'cntrl_id': 0, 'cntrl_name': 'blank_select'},
        1: {'cntrl_id': 1, 'cntrl_name': 'modulation'},
        2: {'cntrl_id': 2, 'cntrl_name': 'breath_controller'},
        4: {'cntrl_id': 4, 'cntrl_name': 'foot_controller'},
        5: {'cntrl_id': 5, 'cntrl_name': 'portamento_time'},
        6: {'cntrl_id': 6, 'cntrl_name': 'data_entry'},
        7: {'cntrl_id': 7, 'cntrl_name': 'main_volume'},
        8: {'cntrl_id': 8, 'cntrl_name': 'balance'},
        10: {'cntrl_id': 10, 'cntrl_name': 'pan'},
        11: {'cntrl_id': 11, 'cntrl_name': 'expression_controller'},
        12: {'cntrl_id': 12, 'cntrl_name': 'effect_control_0'},
        13: {'cntrl_id': 13, 'cntrl_name': 'effect_control_1'},
        16: {'cntrl_id': 16, 'cntrl_name': 'general_purpose_controller_0'},
        17: {'cntrl_id': 17, 'cntrl_name': 'general_purpose_controller_1'},
        18: {'cntrl_id': 18, 'cntrl_name': 'general_purpose_controller_2'},
        19: {'cntrl_id': 19, 'cntrl_name': 'general_purpose_controller_3'},
        32: {'cntrl_id': 32, 'cntrl_name': 'LSB_for_controller_0'},
        33: {'cntrl_id': 33, 'cntrl_name': 'LSB_for_controller_1'},
        34: {'cntrl_id': 34, 'cntrl_name': 'LSB_for_controller_2'},
        35: {'cntrl_id': 35, 'cntrl_name': 'LSB_for_controller_3'},
        36: {'cntrl_id': 36, 'cntrl_name': 'LSB_for_controller_4'},
        37: {'cntrl_id': 37, 'cntrl_name': 'LSB_for_controller_5'},
        38: {'cntrl_id': 38, 'cntrl_name': 'LSB_for_controller_6'},
        39: {'cntrl_id': 39, 'cntrl_name': 'LSB_for_controller_7'},
        40: {'cntrl_id': 40, 'cntrl_name': 'LSB_for_controller_8'},
        41: {'cntrl_id': 41, 'cntrl_name': 'LSB_for_controller_9'},
        42: {'cntrl_id': 42, 'cntrl_name': 'LSB_for_controller_10'},
        43: {'cntrl_id': 43, 'cntrl_name': 'LSB_for_controller_11'},
        44: {'cntrl_id': 44, 'cntrl_name': 'LSB_for_controller_12'},
        45: {'cntrl_id': 45, 'cntrl_name': 'LSB_for_controller_13'},
        46: {'cntrl_id': 46, 'cntrl_name': 'LSB_for_controller_14'},
        47: {'cntrl_id': 47, 'cntrl_name': 'LSB_for_controller_15'},
        48: {'cntrl_id': 48, 'cntrl_name': 'LSB_for_controller_16'},
        49: {'cntrl_id': 49, 'cntrl_name': 'LSB_for_controller_17'},
        50: {'cntrl_id': 50, 'cntrl_name': 'LSB_for_controller_18'},
        51: {'cntrl_id': 51, 'cntrl_name': 'LSB_for_controller_19'},
        52: {'cntrl_id': 52, 'cntrl_name': 'LSB_for_controller_20'},
        53: {'cntrl_id': 53, 'cntrl_name': 'LSB_for_controller_21'},
        54: {'cntrl_id': 54, 'cntrl_name': 'LSB_for_controller_22'},
        55: {'cntrl_id': 55, 'cntrl_name': 'LSB_for_controller_23'},
        56: {'cntrl_id': 56, 'cntrl_name': 'LSB_for_controller_24'},
        57: {'cntrl_id': 57, 'cntrl_name': 'LSB_for_controller_25'},
        58: {'cntrl_id': 58, 'cntrl_name': 'LSB_for_controller_26'},
        59: {'cntrl_id': 59, 'cntrl_name': 'LSB_for_controller_27'},
        60: {'cntrl_id': 60, 'cntrl_name': 'LSB_for_controller_28'},
        61: {'cntrl_id': 61, 'cntrl_name': 'LSB_for_controller_29'},
        62: {'cntrl_id': 62, 'cntrl_name': 'LSB_for_controller_30'},
        63: {'cntrl_id': 63, 'cntrl_name': 'LSB_for_controller_31'},
        64: {'cntrl_id': 64, 'cntrl_name': 'damper_pedal'},
        65: {'cntrl_id': 65, 'cntrl_name': 'portamento'},
        66: {'cntrl_id': 66, 'cntrl_name': 'sostenuto'},
        67: {'cntrl_id': 67, 'cntrl_name': 'soft_pedal'},
        68: {'cntrl_id': 68, 'cntrl_name': 'legato_footswitch'},
        69: {'cntrl_id': 69, 'cntrl_name': 'hold'},
        70: {'cntrl_id': 70, 'cntrl_name': 'sound_controller_0'},
        71: {'cntrl_id': 71, 'cntrl_name': 'sound_controller_1'},
        72: {'cntrl_id': 72, 'cntrl_name': 'sound_controller_2'},
        73: {'cntrl_id': 73, 'cntrl_name': 'sound_controller_3'},
        74: {'cntrl_id': 74, 'cntrl_name': 'sound_controller_4'},
        75: {'cntrl_id': 75, 'cntrl_name': 'sound_controller_5'},
        76: {'cntrl_id': 76, 'cntrl_name': 'sound_controller_6'},
        77: {'cntrl_id': 77, 'cntrl_name': 'sound_controller_7'},
        78: {'cntrl_id': 78, 'cntrl_name': 'sound_controller_8'},
        79: {'cntrl_id': 79, 'cntrl_name': 'sound_controller_9'},
        80: {'cntrl_id': 80, 'cntrl_name': 'post_general_purpose_controller_0'},
        81: {'cntrl_id': 81, 'cntrl_name': 'post_general_purpose_controller_1'},
        82: {'cntrl_id': 82, 'cntrl_name': 'post_general_purpose_controller_2'},
        83: {'cntrl_id': 83, 'cntrl_name': 'post_general_purpose_controller_3'},
        84: {'cntrl_id': 84, 'cntrl_name': 'portamento_control'},
        91: {'cntrl_id': 91, 'cntrl_name': 'effects_depth_0'},
        92: {'cntrl_id': 92, 'cntrl_name': 'effects_depth_1'},
        93: {'cntrl_id': 93, 'cntrl_name': 'effects_depth_2'},
        94: {'cntrl_id': 94, 'cntrl_name': 'effects_depth_3'},
        95: {'cntrl_id': 95, 'cntrl_name': 'effects_depth_4'},
        96: {'cntrl_id': 96, 'cntrl_name': 'data_increment'},
        97: {'cntrl_id': 97, 'cntrl_name': 'data_decrement'},
        98: {'cntrl_id': 98, 'cntrl_name': 'nonreg_param_num_lsb'},
        99: {'cntrl_id': 99, 'cntrl_name': 'nonreg_param_num_msb'},
        100: {'cntrl_id': 100, 'cntrl_name': 'reg_param_num_lsb'},
        101: {'cntrl_id': 101, 'cntrl_name': 'reg_param_num_msb'},
        121: {'cntrl_id': 121, 'cntrl_name': 'mode_messages_0'},
        122: {'cntrl_id': 122, 'cntrl_name': 'mode_messages_1'},
        123: {'cntrl_id': 123, 'cntrl_name': 'mode_messages_2'},
        124: {'cntrl_id': 124, 'cntrl_name': 'mode_messages_3'},
        125: {'cntrl_id': 125, 'cntrl_name': 'mode_messages_4'},
        126: {'cntrl_id': 126, 'cntrl_name': 'mode_messages_5'},
        127: {'cntrl_id': 127, 'cntrl_name': 'mode_messages_6'},
        'id': 11,
        'length': 2,
        'mask': 127,
        'params': ['controller_type', 'value']},
    12: {'id': 12,
        'length': 1,
        'mask': 127,
        'name': 'program_change',
        'params': ('program_number',)},
    13: {'id': 13,
        'length': 1,
        'mask': 127,
        'name': 'channel_after_touch',
        'params': ('amount',)},
    14: {'id': 14,
        'length': 2,
        'mask': 127,
        'name': 'pitch_bend',
        'params': ('vlsb', 'vmsb')
        }
    }