X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fmidi%2Flists.py;h=1e6286151ba6a837200710da1b3636c2f843104c;hb=HEAD;hp=dc728a9d12a68fac6c7816b4e3dde9ce3103aa27;hpb=b0fc934add3394f7e753db6bcac23a2362bf7149;p=libsigrokdecode.git diff --git a/decoders/midi/lists.py b/decoders/midi/lists.py index dc728a9..1e62861 100644 --- a/decoders/midi/lists.py +++ b/decoders/midi/lists.py @@ -1,7 +1,8 @@ ## ## This file is part of the libsigrokdecode project. ## -## Copyright (C) 2013 Uwe Hermann +## Copyright (C) 2013-2016 Uwe Hermann +## Copyright (C) 2016 Chris Dreher ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -14,44 +15,44 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## along with this program; if not, see . ## +# Each status byte has 3 string names, each shorter than the previous status_bytes = { # Channel voice messages - 0x80: 'note off', - 0x90: 'note on', # However, velocity = 0 means "note off". - 0xa0: 'polyphonic key pressure / aftertouch', - 0xb0: 'control change', - 0xc0: 'program change', - 0xd0: 'channel pressure / aftertouch', - 0xe0: 'pitch bend change', + 0x80: ['note off', 'note off', 'N off'], + 0x90: ['note on', 'note on', 'N on'], # However, velocity = 0 means "note off". + 0xa0: ['polyphonic key pressure / aftertouch', 'key pressure', 'KP' ], + 0xb0: ['control change', 'ctrl chg', 'CC'], + 0xc0: ['program change', 'prgm chg', 'PC'], + 0xd0: ['channel pressure / aftertouch', 'channel pressure', 'CP'], + 0xe0: ['pitch bend change', 'pitch bend', 'PB'], # Channel mode messages # 0xb0: 'select channel mode', # Note: Same as 'control change'. # System exclusive messages - 0xf0: 'system exclusive (SysEx)', + 0xf0: ['system exclusive', 'SysEx', 'SE'], # System common messages - 0xf1: 'MIDI time code quarter frame', - 0xf2: 'song position pointer', - 0xf3: 'song select', - 0xf4: 'undefined 0xf4', - 0xf5: 'undefined 0xf5', - 0xf6: 'tune request', - 0xf7: 'end of system exclusive (EOX)', + 0xf1: ['MIDI time code quarter frame', 'MIDI time code', 'MIDI time'], + 0xf2: ['song position pointer', 'song position', 'song pos'], + 0xf3: ['song select', 'song select', 'song sel'], + 0xf4: ['undefined 0xf4', 'undef 0xf4', 'undef'], + 0xf5: ['undefined 0xf5', 'undef 0xf5', 'undef'], + 0xf6: ['tune request', 'tune request', 'tune req'], + 0xf7: ['end of system exclusive (EOX)', 'end of SysEx', 'EOX'], # System real time messages - 0xf8: 'timing clock', - 0xf9: 'undefined 0xf9', - 0xfa: 'start', - 0xfb: 'continue', - 0xfc: 'stop', - 0xfd: 'undefined 0xfd', - 0xfe: 'active sensing', - 0xff: 'system reset', + 0xf8: ['timing clock', 'timing clock', 'clock'], + 0xf9: ['undefined 0xf9', 'undef 0xf9', 'undef'], + 0xfa: ['start', 'start', 's'], + 0xfb: ['continue', 'continue', 'cont'], + 0xfc: ['stop', 'stop', 'st'], + 0xfd: ['undefined 0xfd', 'undef 0xfd', 'undef'], + 0xfe: ['active sensing', 'active sensing', 'sensing'], + 0xff: ['system reset', 'reset', 'rst'], } # Universal system exclusive (SysEx) messages, non-realtime (0x7e) @@ -409,89 +410,89 @@ sysex_manufacturer_ids = { } control_functions = { - 0x00: 'bank select MSB', - 0x01: 'modulation wheel/lever MSB', - 0x02: 'breath controller MSB', + 0x00: ['bank select MSB', 'bank MSB', 'bank-M'], + 0x01: ['modulation wheel/lever MSB', 'modulation MSB', 'mod-M'], + 0x02: ['breath controller MSB', 'breath MSB', 'breath-M'], # 0x03: undefined MSB - 0x04: 'foot controller MSB', - 0x05: 'portamento time MSB', - 0x06: 'data entry MSB', - 0x07: 'channel volume MSB (formerly main volume)', - 0x08: 'balance MSB', + 0x04: ['foot controller MSB', 'foot MSB', 'foot-M'], + 0x05: ['portamento time MSB', 'portamento MSB', 'porta-M'], + 0x06: ['data entry MSB', 'data entry MSB', 'data-M'], + 0x07: ['channel volume MSB (formerly main volume)', 'channel volume MSB', 'ch vol-M'], + 0x08: ['balance MSB', 'bal MSB', 'bal-M'], # 0x09: undefined MSB - 0x0a: 'pan MSB', - 0x0b: 'expression controller MSB', - 0x0c: 'effect control 1 MSB', - 0x0d: 'effect control 2 MSB', + 0x0a: ['pan MSB', 'pan MSB', 'pan-M'], + 0x0b: ['expression controller MSB', 'expression MSB', 'expr-M'], + 0x0c: ['effect control 1 MSB', 'effect 1 MSB', 'eff-1-M'], + 0x0d: ['effect control 2 MSB', 'effect 2 MSB', 'eff-2-M'], # 0x0e-0x0f: undefined MSB - 0x10: 'general purpose controller 1 MSB', - 0x11: 'general purpose controller 2 MSB', - 0x12: 'general purpose controller 3 MSB', - 0x13: 'general purpose controller 4 MSB', + 0x10: ['general purpose controller 1 MSB', 'GP ctrl 1 MSB', 'GPC-1-M'], + 0x11: ['general purpose controller 2 MSB', 'GP ctrl 2 MSB', 'GPC-2-M'], + 0x12: ['general purpose controller 3 MSB', 'GP ctrl 3 MSB', 'GPC-3-M'], + 0x13: ['general purpose controller 4 MSB', 'GP ctrl 4 MSB', 'GPC-4-M'], # 0x14-0x1f: undefined MSB - 0x20: 'bank select LSB', - 0x21: 'modulation wheel/lever LSB', - 0x22: 'breath controller LSB', + 0x20: ['bank select LSB', 'bank LSB', 'bank-L'], + 0x21: ['modulation wheel/lever LSB', 'modulation LSB', 'mod-L'], + 0x22: ['breath controller LSB', 'breath LSB', 'breath-L'], # 0x23: undefined LSB - 0x24: 'foot controller LSB', - 0x25: 'portamento time LSB', - 0x26: 'data entry LSB', - 0x27: 'channel volume LSB (formerly main volume)', - 0x28: 'balance LSB', + 0x24: ['foot controller LSB', 'foot LSB', 'foot-L'], + 0x25: ['portamento time LSB', 'portamento LSB', 'porta-L'], + 0x26: ['data entry LSB', 'data entry LSB', 'data-L'], + 0x27: ['channel volume LSB (formerly main volume)', 'channel volume LSB', 'ch vol-L'], + 0x28: ['balance LSB', 'bal LSB', 'bal-L'], # 0x29: undefined LSB - 0x2a: 'pan LSB', - 0x2b: 'expression controller LSB', - 0x2c: 'effect control 1 LSB', - 0x2d: 'effect control 2 LSB', + 0x2a: ['pan LSB', 'pan LSB', 'pan-L'], + 0x2b: ['expression controller LSB', 'expression LSB', 'expr-L'], + 0x2c: ['effect control 1 LSB', 'effect 1 LSB', 'eff-1-L'], + 0x2d: ['effect control 2 LSB', 'effect 2 LSB', 'eff-2-L'], # 0x2e-0x2f: undefined LSB - 0x30: 'general purpose controller 1 LSB', - 0x31: 'general purpose controller 2 LSB', - 0x32: 'general purpose controller 3 LSB', - 0x33: 'general purpose controller 4 LSB', + 0x30: ['general purpose controller 1 LSB', 'GP ctrl 1 LSB', 'GPC-1-L'], + 0x31: ['general purpose controller 2 LSB', 'GP ctrl 2 LSB', 'GPC-2-L'], + 0x32: ['general purpose controller 3 LSB', 'GP ctrl 3 LSB', 'GPC-3-L'], + 0x33: ['general purpose controller 4 LSB', 'GP ctrl 4 LSB', 'GPC-4-L'], # 0x34-0x3f: undefined LSB - 0x40: 'damper pedal (sustain)', - 0x41: 'portamento on/off', - 0x42: 'sostenuto', - 0x43: 'soft pedal', - 0x44: 'legato footswitch', # vv: 00-3f = normal, 40-7f = legato - 0x45: 'hold 2', - 0x46: 'sound controller 1 (default: sound variation)', - 0x47: 'sound controller 2 (default: timbre / harmonic intensity)', - 0x48: 'sound controller 3 (default: release time)', - 0x49: 'sound controller 4 (default: attack time)', - 0x4a: 'sound controller 5 (default: brightness)', - 0x4b: 'sound controller 6 (GM2 default: decay time)', - 0x4c: 'sound controller 7 (GM2 default: vibrato rate)', - 0x4d: 'sound controller 8 (GM2 default: vibrato depth)', - 0x4e: 'sound controller 9 (GM2 default: vibrato delay)', - 0x4f: 'sound controller 10', - 0x50: 'general purpose controller 5', - 0x51: 'general purpose controller 6', - 0x52: 'general purpose controller 7', - 0x53: 'general purpose controller 8', - 0x54: 'portamento control', + 0x40: ['damper pedal (sustain)', 'sustain', 'sust'], + 0x41: ['portamento on/off', 'porta on/off', 'porta on/off'], + 0x42: ['sostenuto', 'sostenuto', 'sostenuto'], + 0x43: ['soft pedal', 'soft pedal', 'soft pedal'], + 0x44: ['legato footswitch', 'legato switch', 'legato'], # vv: 00-3f = normal, 40-7f = legato + 0x45: ['hold 2', 'hold 2', 'hold 2'], + 0x46: ['sound controller 1 (default: sound variation)', 'sound ctrl 1', 'snd ctrl 1'], + 0x47: ['sound controller 2 (default: timbre / harmonic intensity)', 'sound ctrl 2', 'snd ctrl 2'], + 0x48: ['sound controller 3 (default: release time)', 'sound ctrl 3', 'snd ctrl 3'], + 0x49: ['sound controller 4 (default: attack time)', 'sound ctrl 4', 'snd ctrl 4'], + 0x4a: ['sound controller 5 (default: brightness)', 'sound ctrl 5', 'snd ctrl 5'], + 0x4b: ['sound controller 6 (GM2 default: decay time)', 'sound ctrl 6', 'snd ctrl 6'], + 0x4c: ['sound controller 7 (GM2 default: vibrato rate)', 'sound ctrl 7', 'snd ctrl 7'], + 0x4d: ['sound controller 8 (GM2 default: vibrato depth)', 'sound ctrl 8', 'snd ctrl 8'], + 0x4e: ['sound controller 9 (GM2 default: vibrato delay)', 'sound ctrl 9', 'snd ctrl 9'], + 0x4f: ['sound controller 10', 'sound ctrl 10', 'snd ctrl 10'], + 0x50: ['general purpose controller 5', 'GP controller 5', 'GPC-5'], + 0x51: ['general purpose controller 6', 'GP controller 6', 'GPC-6'], + 0x52: ['general purpose controller 7', 'GP controller 7', 'GPC-7'], + 0x53: ['general purpose controller 8', 'GP controller 8', 'GPC-8'], + 0x54: ['portamento control', 'portamento ctrl', 'porta ctrl'], # 0x55-0x5a: undefined - 0x5b: 'effects 1 depth (formerly external effects depth)', - 0x5c: 'effects 2 depth (formerly tremolo depth)', - 0x5d: 'effects 3 depth (formerly chorus depth)', - 0x5e: 'effects 4 depth (formerly celeste/detune depth)', - 0x5f: 'effects 5 depth (formerly phaser depth)', - 0x60: 'data increment', - 0x61: 'data decrement', - 0x62: 'Non-Registered Parameter Number LSB', - 0x63: 'Non-Registered Parameter Number MSB', - 0x64: 'Registered Parameter Number LSB', - 0x65: 'Registered Parameter Number MSB', + 0x5b: ['effects 1 depth (formerly external effects depth)', 'effects 1 depth', 'eff 1 depth'], + 0x5c: ['effects 2 depth (formerly tremolo depth)', 'effects 2 depth', 'eff 2 depth'], + 0x5d: ['effects 3 depth (formerly chorus depth)', 'effects 3 depth', 'eff 3 depth'], + 0x5e: ['effects 4 depth (formerly celeste/detune depth)', 'effects 4 depth', 'eff 4 depth'], + 0x5f: ['effects 5 depth (formerly phaser depth)', 'effects 5 depth', 'eff 5 depth'], + 0x60: ['data increment', 'data inc', 'data++'], + 0x61: ['data decrement', 'data dec', 'data--'], + 0x62: ['Non-Registered Parameter Number LSB', 'NRPN LSB', 'NRPN-L'], + 0x63: ['Non-Registered Parameter Number MSB', 'NRPN MSB', 'NRPN-M'], + 0x64: ['Registered Parameter Number LSB', 'RPN LSB', 'RPN-L'], + 0x65: ['Registered Parameter Number MSB', 'RPN MSB', 'RPN-M'], # 0x66-0x77: undefined # 0x78-0x7f: reserved for channel mode messages - 0x78: 'all sound off', - 0x79: 'reset all controllers', - 0x7a: 'local control', - 0x7b: 'all notes off', - 0x7c: 'omni mode off', # all notes off - 0x7d: 'omni mode on', # all notes off - 0x7e: 'mono mode on', # mono mode on, all notes off - 0x7f: 'poly mode on', # mono mode off, all notes off + 0x78: ['all sound off', 'all snd off', 'snd off'], + 0x79: ['reset all controllers', 'reset all ctrls', 'reset ctrls'], + 0x7a: ['local control', 'local ctrl', 'local ctrl'], + 0x7b: ['all notes off', 'notes off', 'notes off'], + 0x7c: ['omni mode off', 'omni off', 'omni off'], # all notes off + 0x7d: ['omni mode on', 'omni on', 'omni on'], # all notes off + 0x7e: ['mono mode on', 'mono on', 'mono'], # mono mode on, all notes off + 0x7f: ['poly mode on', 'poly on', 'poly'], # mono mode off, all notes off } gm_instruments = { @@ -638,153 +639,154 @@ drum_kit = { 128: 'GS CM-64/CM-32 Kit', } +# Each quarter frame type has 2 string names, each shorter than the previous quarter_frame_type = { - 0: 'frame count LS nibble', - 1: 'frame count MS nibble', - 2: 'seconds count LS nibble', - 3: 'seconds count MS nibble', - 4: 'minutes count LS nibble', - 5: 'minutes count MS nibble', - 6: 'hours count LS nibble', - 7: 'hours count MS nibble and SMPTE type', + 0: ['frame count LS nibble', 'frame LSN'], + 1: ['frame count MS nibble', 'frame MSN'], + 2: ['seconds LS nibble', 'sec LSN'], + 3: ['seconds MS nibble', 'sec MSN'], + 4: ['minutes LS nibble', 'min LSN'], + 5: ['minutes MS nibble', 'min MSN'], + 6: ['hours LS nibble', 'hrs LSN'], + 7: ['hours MS nibble and SMPTE type', 'hrs MSN'], } smpte_type = { - 0: '24 frames/second', - 1: '25 frames/second', - 2: '30 frames/second (drop-frame)', - 3: '30 frames/second (non-drop)', + 0: '24 fps', + 1: '25 fps', + 2: '30 fps (drop-frame)', + 3: '30 fps (non-drop)', } chromatic_notes = { - 0: 'C-2', - 1: 'C#-2', - 2: 'D-2', - 3: 'D#-2', - 4: 'E-2', - 5: 'F-2', - 6: 'F#-2', - 7: 'G-2', - 8: 'G#-2', - 9: 'A-2', - 10: 'A#-2', - 11: 'B-2', - 12: 'C-1', - 13: 'C#-1', - 14: 'D-1', - 15: 'D#-1', - 16: 'E-1', - 17: 'F-1', - 18: 'F#-1', - 19: 'G-1', - 20: 'G#-1', - 21: 'A-1', - 22: 'A#-1', - 23: 'B-1', - 24: 'C0', - 25: 'C#0', - 26: 'D0', - 27: 'D#0', - 28: 'E0', - 29: 'F0', - 30: 'F#0', - 31: 'G0', - 32: 'G#0', - 33: 'A0', - 34: 'A#0', - 35: 'B0', - 36: 'C1', - 37: 'C#1', - 38: 'D1', - 39: 'D#1', - 40: 'E1', - 41: 'F1', - 42: 'F#1', - 43: 'G1', - 44: 'G#1', - 45: 'A1', - 46: 'A#1', - 47: 'B1', - 48: 'C2', - 49: 'C#2', - 50: 'D2', - 51: 'D#2', - 52: 'E2', - 53: 'F2', - 54: 'F#2', - 55: 'G2', - 56: 'G#2', - 57: 'A2', - 58: 'A#2', - 59: 'B2', - 60: 'C3', - 61: 'C#3', - 62: 'D3', - 63: 'D#3', - 64: 'E3', - 65: 'F3', - 66: 'F#3', - 67: 'G3', - 68: 'G#3', - 69: 'A3', - 70: 'A#3', - 71: 'B3', - 72: 'C4', - 73: 'C#4', - 74: 'D4', - 75: 'D#4', - 76: 'E4', - 77: 'F4', - 78: 'F#4', - 79: 'G4', - 80: 'G#4', - 81: 'A4', - 82: 'A#4', - 83: 'B4', - 84: 'C5', - 85: 'C#5', - 86: 'D5', - 87: 'D#5', - 88: 'E5', - 89: 'F5', - 90: 'F#5', - 91: 'G5', - 92: 'G#5', - 93: 'A5', - 94: 'A#5', - 95: 'B5', - 96: 'C6', - 97: 'C#6', - 98: 'D6', - 99: 'D#6', - 100: 'E6', - 101: 'F6', - 102: 'F#6', - 103: 'G6', - 104: 'G#6', - 105: 'A6', - 106: 'A#6', - 107: 'B6', - 108: 'C7', - 109: 'C#7', - 110: 'D7', - 111: 'D#7', - 112: 'E7', - 113: 'F7', - 114: 'F#7', - 115: 'G7', - 116: 'G#7', - 117: 'A7', - 118: 'A#7', - 119: 'B7', - 120: 'C8', - 121: 'C#8', - 122: 'D8', - 123: 'D#8', - 124: 'E8', - 125: 'F8', - 126: 'F#8', - 127: 'G8', + 0: 'C-1', + 1: 'C#-1', + 2: 'D-1', + 3: 'D#-1', + 4: 'E-1', + 5: 'F-1', + 6: 'F#-1', + 7: 'G-1', + 8: 'G#-1', + 9: 'A-1', + 10: 'A#-1', + 11: 'B-1', + 12: 'C0', + 13: 'C#0', + 14: 'D0', + 15: 'D#0', + 16: 'E0', + 17: 'F0', + 18: 'F#0', + 19: 'G0', + 20: 'G#0', + 21: 'A0', + 22: 'A#0', + 23: 'B0', + 24: 'C1', + 25: 'C#1', + 26: 'D1', + 27: 'D#1', + 28: 'E1', + 29: 'F1', + 30: 'F#1', + 31: 'G1', + 32: 'G#1', + 33: 'A1', + 34: 'A#1', + 35: 'B1', + 36: 'C2', + 37: 'C#2', + 38: 'D2', + 39: 'D#2', + 40: 'E2', + 41: 'F2', + 42: 'F#2', + 43: 'G2', + 44: 'G#2', + 45: 'A2', + 46: 'A#2', + 47: 'B2', + 48: 'C3', + 49: 'C#3', + 50: 'D3', + 51: 'D#3', + 52: 'E3', + 53: 'F3', + 54: 'F#3', + 55: 'G3', + 56: 'G#3', + 57: 'A3', + 58: 'A#3', + 59: 'B3', + 60: 'C4', + 61: 'C#4', + 62: 'D4', + 63: 'D#4', + 64: 'E4', + 65: 'F4', + 66: 'F#4', + 67: 'G4', + 68: 'G#4', + 69: 'A4', + 70: 'A#4', + 71: 'B4', + 72: 'C5', + 73: 'C#5', + 74: 'D5', + 75: 'D#5', + 76: 'E5', + 77: 'F5', + 78: 'F#5', + 79: 'G5', + 80: 'G#5', + 81: 'A5', + 82: 'A#5', + 83: 'B5', + 84: 'C6', + 85: 'C#6', + 86: 'D6', + 87: 'D#6', + 88: 'E6', + 89: 'F6', + 90: 'F#6', + 91: 'G6', + 92: 'G#6', + 93: 'A6', + 94: 'A#6', + 95: 'B6', + 96: 'C7', + 97: 'C#7', + 98: 'D7', + 99: 'D#7', + 100: 'E7', + 101: 'F7', + 102: 'F#7', + 103: 'G7', + 104: 'G#7', + 105: 'A7', + 106: 'A#7', + 107: 'B7', + 108: 'C8', + 109: 'C#8', + 110: 'D8', + 111: 'D#8', + 112: 'E8', + 113: 'F8', + 114: 'F#8', + 115: 'G8', + 116: 'G#8', + 117: 'A8', + 118: 'A#8', + 119: 'B8', + 120: 'C9', + 121: 'C#9', + 122: 'D9', + 123: 'D#9', + 124: 'E9', + 125: 'F9', + 126: 'F#9', + 127: 'G9', } percussion_notes = {