]> sigrok.org Git - libsigrokdecode.git/blob - decoders/midi/lists.py
midi: Some annotation consistency changes.
[libsigrokdecode.git] / decoders / midi / lists.py
1 ##
2 ## This file is part of the libsigrokdecode project.
3 ##
4 ## Copyright (C) 2013 Uwe Hermann <uwe@hermann-uwe.de>
5 ##
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 2 of the License, or
9 ## (at your option) any later version.
10 ##
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
15 ##
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19 ##
20
21 # Each status byte has 3 string names, each shorter than the previous
22 status_bytes = {
23     # Channel voice messages
24     0x80: ['note off', 'note off', 'N off'],
25     0x90: ['note on', 'note on', 'N on'], # However, velocity = 0 means "note off".
26     0xa0: ['polyphonic key pressure / aftertouch', 'key pressure', 'KP' ],
27     0xb0: ['control change', 'ctrl chg', 'CC'],
28     0xc0: ['program change', 'prgm chg', 'PC'],
29     0xd0: ['channel pressure / aftertouch', 'channel pressure', 'CP'],
30     0xe0: ['pitch bend change', 'pitch bend', 'PB'],
31
32     # Channel mode messages
33     # 0xb0: 'select channel mode', # Note: Same as 'control change'.
34
35     # System exclusive messages
36     0xf0: ['system exclusive', 'SysEx', 'SE'],
37
38     # System common messages
39     0xf1: ['MIDI time code quarter frame', 'MIDI time code', 'MIDI time'],
40     0xf2: ['song position pointer', 'song position', 'song pos'],
41     0xf3: ['song select', 'song select', 'song sel'],
42     0xf4: ['undefined 0xf4', 'undef 0xf4', 'undef'],
43     0xf5: ['undefined 0xf5', 'undef 0xf5', 'undef'],
44     0xf6: ['tune request', 'tune request', 'tune req'],
45     0xf7: ['end of system exclusive (EOX)', 'end of SysEx', 'EOX'],
46
47     # System real time messages
48     0xf8: ['timing clock', 'timing clock', 'clock'],
49     0xf9: ['undefined 0xf9', 'undef 0xf9', 'undef'],
50     0xfa: ['start', 'start', 's'],
51     0xfb: ['continue', 'continue', 'cont'],
52     0xfc: ['stop', 'stop', 'st'],
53     0xfd: ['undefined 0xfd', 'undef 0xfd', 'undef'],
54     0xfe: ['active sensing', 'active sensing', 'sensing'],
55     0xff: ['system reset', 'reset', 'rst'],
56 }
57
58 # Universal system exclusive (SysEx) messages, non-realtime (0x7e)
59 universal_sysex_nonrealtime = {
60     (0x00, None): 'unused',
61     (0x01, None): 'sample dump header',
62     (0x02, None): 'sample data packet',
63     (0x03, None): 'sample dump request',
64
65     (0x04, None): 'MIDI time code',
66     (0x04, 0x00): 'special',
67     (0x04, 0x01): 'punch in points',
68     (0x04, 0x02): 'punch out points',
69     (0x04, 0x03): 'delete punch in point',
70     (0x04, 0x04): 'delete punch out point',
71     (0x04, 0x05): 'event start point',
72     (0x04, 0x06): 'event stop point',
73     (0x04, 0x07): 'event start points with additional info',
74     (0x04, 0x08): 'event stop points with additional info',
75     (0x04, 0x09): 'delete event start point',
76     (0x04, 0x0a): 'delete event stop point',
77     (0x04, 0x0b): 'cue points',
78     (0x04, 0x0c): 'cue points with additional info',
79     (0x04, 0x0d): 'delete cue point',
80     (0x04, 0x0e): 'event name in additional info',
81
82     (0x05, None): 'sample dump extensions',
83     (0x05, 0x01): 'multiple loop points',
84     (0x05, 0x02): 'loop points request',
85
86     (0x06, None): 'general information',
87     (0x06, 0x01): 'identity request',
88     (0x06, 0x02): 'identity reply',
89
90     (0x07, None): 'file dump',
91     (0x07, 0x01): 'header',
92     (0x07, 0x02): 'data packet',
93     (0x07, 0x03): 'request',
94
95     (0x08, None): 'MIDI tuning standard',
96     (0x08, 0x00): 'bulk dump request',
97     (0x08, 0x01): 'bulk dump reply',
98
99     (0x09, None): 'general MIDI',
100     (0x09, 0x01): 'general MIDI system on',
101     (0x09, 0x02): 'general MIDI system off',
102
103     (0x7b, None): 'end of file',
104     (0x7c, None): 'wait',
105     (0x7d, None): 'cancel',
106     (0x7e, None): 'nak',
107     (0x7f, None): 'ack',
108 }
109
110 # Universal system exclusive (SysEx) messages, realtime (0x7f)
111 universal_sysex_realtime = {
112     (0x00, None): 'unused',
113
114     (0x01, None): 'MIDI time code',
115     (0x01, 0x01): 'full message',
116     (0x01, 0x02): 'user bits',
117
118     (0x02, None): 'MIDI show control',
119     (0x02, 0x00): 'MSC extensions',
120     # (0x02, TODO): 'TODO', # 0x01 - 0x7f: MSC commands.
121
122     (0x03, None): 'notation information',
123     (0x03, 0x01): 'bar number',
124     (0x03, 0x02): 'time signature (immediate)',
125     (0x03, 0x42): 'time signature (delayed)',
126
127     (0x04, None): 'device control',
128     (0x04, 0x01): 'master volume',
129     (0x04, 0x02): 'master balance',
130
131     (0x05, None): 'real time MTC cueing',
132     (0x05, 0x00): 'special',
133     (0x05, 0x01): 'punch in points',
134     (0x05, 0x02): 'punch out points',
135     (0x05, 0x03): 'reserved',
136     (0x05, 0x04): 'reserved',
137     (0x05, 0x05): 'event start points',
138     (0x05, 0x06): 'event stop points',
139     (0x05, 0x07): 'event start points with additional info',
140     (0x05, 0x08): 'event stop points with additional info',
141     (0x05, 0x09): 'reserved',
142     (0x05, 0x0a): 'reserved',
143     (0x05, 0x0b): 'cue points',
144     (0x05, 0x0c): 'cue points with additional info',
145     (0x05, 0x0d): 'reserved',
146     (0x05, 0x0e): 'event name in additional info',
147
148     (0x06, None): 'MIDI machine control commands',
149     # (0x06, TODO): 'TODO', # 0x00 - 0x7f: MMC commands.
150
151     (0x07, None): 'MIDI machine control responses',
152     # (0x07, TODO): 'TODO', # 0x00 - 0x7f: MMC commands.
153
154     (0x08, None): 'MIDI tuning standard',
155     (0x85, 0x02): 'note change',
156 }
157
158 # Note: Not all IDs are used/listed, i.e. there are some "holes".
159 sysex_manufacturer_ids = {
160     # American group (range 01-1f, 000001-001f7f)
161     (0x01,): 'Sequential',
162     (0x02,): 'IDP',
163     (0x03,): 'Voyetra/Octave-Plateau',
164     (0x04,): 'Moog',
165     (0x05,): 'Passport Designs',
166     (0x06,): 'Lexicon',
167     (0x07,): 'Kurzweil',
168     (0x08,): 'Fender',
169     (0x09,): 'Gulbransen',
170     (0x0a,): 'AKG Acoustics',
171     (0x0b,): 'Voyce Music',
172     (0x0c,): 'Waveframe Corp',
173     (0x0d,): 'ADA Signal Processors',
174     (0x0e,): 'Garfield Electronics',
175     (0x0f,): 'Ensoniq',
176     (0x10,): 'Oberheim',
177     (0x11,): 'Apple Computer',
178     (0x12,): 'Grey Matter Response',
179     (0x13,): 'Digidesign',
180     (0x14,): 'Palm Tree Instruments',
181     (0x15,): 'JLCooper Electronics',
182     (0x16,): 'Lowrey',
183     (0x17,): 'Adams-Smith',
184     (0x18,): 'Emu Systems',
185     (0x19,): 'Harmony Systems',
186     (0x1a,): 'ART',
187     (0x1b,): 'Baldwin',
188     (0x1c,): 'Eventide',
189     (0x1d,): 'Inventronics',
190     (0x1f,): 'Clarity',
191
192     (0x00, 0x00, 0x01): 'Time Warner Interactive',
193     (0x00, 0x00, 0x07): 'Digital Music Corp.',
194     (0x00, 0x00, 0x08): 'IOTA Systems',
195     (0x00, 0x00, 0x09): 'New England Digital',
196     (0x00, 0x00, 0x0a): 'Artisyn',
197     (0x00, 0x00, 0x0b): 'IVL Technologies',
198     (0x00, 0x00, 0x0c): 'Southern Music Systems',
199     (0x00, 0x00, 0x0d): 'Lake Butler Sound Company',
200     (0x00, 0x00, 0x0e): 'Alesis',
201     (0x00, 0x00, 0x10): 'DOD Electronics',
202     (0x00, 0x00, 0x11): 'Studer-Editech',
203     (0x00, 0x00, 0x14): 'Perfect Fretworks',
204     (0x00, 0x00, 0x15): 'KAT',
205     (0x00, 0x00, 0x16): 'Opcode',
206     (0x00, 0x00, 0x17): 'Rane Corp.',
207     (0x00, 0x00, 0x18): 'Anadi Inc.',
208     (0x00, 0x00, 0x19): 'KMX',
209     (0x00, 0x00, 0x1a): 'Allen & Heath Brenell',
210     (0x00, 0x00, 0x1b): 'Peavy Electronics',
211     (0x00, 0x00, 0x1c): '360 Systems',
212     (0x00, 0x00, 0x1d): 'Spectrum Design and Development',
213     (0x00, 0x00, 0x1e): 'Marquis Music',
214     (0x00, 0x00, 0x1f): 'Zeta Systems',
215
216     (0x00, 0x00, 0x20): 'Axxes',
217     (0x00, 0x00, 0x21): 'Orban',
218     (0x00, 0x00, 0x24): 'KTI',
219     (0x00, 0x00, 0x25): 'Breakaway Technologies',
220     (0x00, 0x00, 0x26): 'CAE',
221     (0x00, 0x00, 0x29): 'Rocktron Corp.',
222     (0x00, 0x00, 0x2a): 'PianoDisc',
223     (0x00, 0x00, 0x2b): 'Cannon Research Group',
224     (0x00, 0x00, 0x2d): 'Rogers Instrument Corp.',
225     (0x00, 0x00, 0x2e): 'Blue Sky Logic',
226     (0x00, 0x00, 0x2f): 'Encore Electronics',
227
228     (0x00, 0x00, 0x30): 'Uptown',
229     (0x00, 0x00, 0x31): 'Voce',
230     (0x00, 0x00, 0x32): 'CTI Audio, Inc. (Music. Intel Dev.)',
231     (0x00, 0x00, 0x33): 'S&S Research',
232     (0x00, 0x00, 0x34): 'Broderbund Software, Inc.',
233     (0x00, 0x00, 0x35): 'Allen Organ Co.',
234     (0x00, 0x00, 0x37): 'Music Quest',
235     (0x00, 0x00, 0x38): 'APHEX',
236     (0x00, 0x00, 0x39): 'Gallien Krueger',
237     (0x00, 0x00, 0x3a): 'IBM',
238     (0x00, 0x00, 0x3c): 'Hotz Instruments Technologies',
239     (0x00, 0x00, 0x3d): 'ETA Lighting',
240     (0x00, 0x00, 0x3e): 'NSI Corporation',
241     (0x00, 0x00, 0x3f): 'Ad Lib, Inc.',
242
243     (0x00, 0x00, 0x40): 'Richmond Sound Design',
244     (0x00, 0x00, 0x41): 'Microsoft',
245     (0x00, 0x00, 0x42): 'The Software Toolworks',
246     (0x00, 0x00, 0x43): 'Niche/RJMG',
247     (0x00, 0x00, 0x44): 'Intone',
248     (0x00, 0x00, 0x47): 'GT Electronics / Groove Tubes',
249     (0x00, 0x00, 0x49): 'Timeline Vista',
250     (0x00, 0x00, 0x4a): 'Mesa Boogie',
251     (0x00, 0x00, 0x4c): 'Sequoia Development',
252     (0x00, 0x00, 0x4d): 'Studio Electronics',
253     (0x00, 0x00, 0x4e): 'Euphonix',
254     (0x00, 0x00, 0x4f): 'InterMIDI, Inc.',
255
256     (0x00, 0x00, 0x50): 'MIDI Solutions',
257     (0x00, 0x00, 0x51): '3DO Company',
258     (0x00, 0x00, 0x52): 'Lightwave Research',
259     (0x00, 0x00, 0x53): 'Micro-W',
260     (0x00, 0x00, 0x54): 'Spectral Synthesis',
261     (0x00, 0x00, 0x55): 'Lone Wolf',
262     (0x00, 0x00, 0x56): 'Studio Technologies',
263     (0x00, 0x00, 0x57): 'Peterson EMP',
264     (0x00, 0x00, 0x58): 'Atari',
265     (0x00, 0x00, 0x59): 'Marion Systems',
266     (0x00, 0x00, 0x5a): 'Design Event',
267     (0x00, 0x00, 0x5b): 'Winjammer Software',
268     (0x00, 0x00, 0x5c): 'AT&T Bell Labs',
269     (0x00, 0x00, 0x5e): 'Symetrix',
270     (0x00, 0x00, 0x5f): 'MIDI the World',
271
272     (0x00, 0x00, 0x60): 'Desper Products',
273     (0x00, 0x00, 0x61): 'Micros\'N MIDI',
274     (0x00, 0x00, 0x62): 'Accordians Intl',
275     (0x00, 0x00, 0x63): 'EuPhonics',
276     (0x00, 0x00, 0x64): 'Musonix',
277     (0x00, 0x00, 0x65): 'Turtle Beach Systems',
278     (0x00, 0x00, 0x66): 'Mackie Designs',
279     (0x00, 0x00, 0x67): 'Compuserve',
280     (0x00, 0x00, 0x68): 'BES Technologies',
281     (0x00, 0x00, 0x69): 'QRS Music Rolls',
282     (0x00, 0x00, 0x6a): 'P G Music',
283     (0x00, 0x00, 0x6b): 'Sierra Semiconductor',
284     (0x00, 0x00, 0x6c): 'EpiGraf Audio Visual',
285     (0x00, 0x00, 0x6d): 'Electronics Deiversified',
286     (0x00, 0x00, 0x6e): 'Tune 1000',
287     (0x00, 0x00, 0x6f): 'Advanced Micro Devices',
288
289     (0x00, 0x00, 0x70): 'Mediamation',
290     (0x00, 0x00, 0x71): 'Sabine Music',
291     (0x00, 0x00, 0x72): 'Woog Labs',
292     (0x00, 0x00, 0x73): 'Micropolis',
293     (0x00, 0x00, 0x74): 'Ta Horng Musical Inst.',
294     (0x00, 0x00, 0x75): 'eTek (formerly Forte)',
295     (0x00, 0x00, 0x76): 'Electrovoice',
296     (0x00, 0x00, 0x77): 'Midisoft',
297     (0x00, 0x00, 0x78): 'Q-Sound Labs',
298     (0x00, 0x00, 0x79): 'Westrex',
299     (0x00, 0x00, 0x7a): 'NVidia',
300     (0x00, 0x00, 0x7b): 'ESS Technology',
301     (0x00, 0x00, 0x7c): 'MediaTrix Peripherals',
302     (0x00, 0x00, 0x7d): 'Brooktree',
303     (0x00, 0x00, 0x7e): 'Otari',
304     (0x00, 0x00, 0x7f): 'Key Electronics',
305
306     (0x00, 0x01, 0x01): 'Crystalake Multimedia',
307     (0x00, 0x01, 0x02): 'Crystal Semiconductor',
308     (0x00, 0x01, 0x03): 'Rockwell Semiconductor',
309
310     # European group (range 20-3f, 002000-003f7f)
311     (0x20,): 'Passac',
312     (0x21,): 'SIEL',
313     (0x22,): 'Synthaxe',
314     (0x24,): 'Hohner',
315     (0x25,): 'Twister',
316     (0x26,): 'Solton',
317     (0x27,): 'Jellinghaus MS',
318     (0x28,): 'Southworth Music Systems',
319     (0x29,): 'PPG',
320     (0x2a,): 'JEN',
321     (0x2b,): 'SSL Limited',
322     (0x2c,): 'Audio Veritrieb',
323     (0x2f,): 'Elka',
324
325     (0x30,): 'Dynacord',
326     (0x31,): 'Viscount',
327     (0x33,): 'Clavia Digital Instruments',
328     (0x34,): 'Audio Architecture',
329     (0x35,): 'GeneralMusic Corp.',
330     (0x39,): 'Soundcraft Electronics',
331     (0x3b,): 'Wersi',
332     (0x3c,): 'Avab Elektronik Ab',
333     (0x3d,): 'Digigram',
334     (0x3e,): 'Waldorf Electronics',
335     (0x3f,): 'Quasimidi',
336
337     (0x00, 0x20, 0x00): 'Dream',
338     (0x00, 0x20, 0x01): 'Strand Lighting',
339     (0x00, 0x20, 0x02): 'Amek Systems',
340     (0x00, 0x20, 0x04): 'Böhm Electronic',
341     (0x00, 0x20, 0x06): 'Trident Audio',
342     (0x00, 0x20, 0x07): 'Real World Studio',
343     (0x00, 0x20, 0x09): 'Yes Technology',
344     (0x00, 0x20, 0x0a): 'Audiomatica',
345     (0x00, 0x20, 0x0b): 'Bontempi/Farfisa',
346     (0x00, 0x20, 0x0c): 'F.B.T. Elettronica',
347     (0x00, 0x20, 0x0d): 'MidiTemp',
348     (0x00, 0x20, 0x0e): 'LA Audio (Larking Audio)',
349     (0x00, 0x20, 0x0f): 'Zero 88 Lighting Limited',
350
351     (0x00, 0x20, 0x10): 'Micon Audio Electronics GmbH',
352     (0x00, 0x20, 0x11): 'Forefront Technology',
353     (0x00, 0x20, 0x13): 'Kenton Electronics',
354     (0x00, 0x20, 0x15): 'ADB',
355     (0x00, 0x20, 0x16): 'Marshall Products',
356     (0x00, 0x20, 0x17): 'DDA',
357     (0x00, 0x20, 0x18): 'BSS',
358     (0x00, 0x20, 0x19): 'MA Lighting Technology',
359     (0x00, 0x20, 0x1a): 'Fatar',
360     (0x00, 0x20, 0x1b): 'QSC Audio',
361     (0x00, 0x20, 0x1c): 'Artisan Classic Organ',
362     (0x00, 0x20, 0x1d): 'Orla Spa',
363     (0x00, 0x20, 0x1e): 'Pinnacle Audio',
364     (0x00, 0x20, 0x1f): 'TC Electronics',
365
366     (0x00, 0x20, 0x20): 'Doepfer Musikelektronik',
367     (0x00, 0x20, 0x21): 'Creative Technology Pte',
368     (0x00, 0x20, 0x22): 'Minami/Seiyddo',
369     (0x00, 0x20, 0x23): 'Goldstar',
370     (0x00, 0x20, 0x24): 'Midisoft s.a.s di M. Cima',
371     (0x00, 0x20, 0x25): 'Samick',
372     (0x00, 0x20, 0x26): 'Penny and Giles',
373     (0x00, 0x20, 0x27): 'Acorn Computer',
374     (0x00, 0x20, 0x28): 'LSC Electronics',
375     (0x00, 0x20, 0x29): 'Novation EMS',
376     (0x00, 0x20, 0x2a): 'Samkyung Mechatronics',
377     (0x00, 0x20, 0x2b): 'Medeli Electronics',
378     (0x00, 0x20, 0x2c): 'Charlie Lab',
379     (0x00, 0x20, 0x2d): 'Blue Chip Music Tech',
380     (0x00, 0x20, 0x2e): 'BEE OH Corp',
381
382     # Japanese group (range 40-5f, 004000-005f7f)
383     (0x40,): 'Kawai',
384     (0x41,): 'Roland',
385     (0x42,): 'Korg',
386     (0x43,): 'Yamaha',
387     (0x44,): 'Casio',
388     (0x46,): 'Kamiya Studio',
389     (0x47,): 'Akai',
390     (0x48,): 'Japan Victor',
391     (0x49,): 'Mesosha',
392     (0x4a,): 'Hoshino Gakki',
393     (0x4b,): 'Fujitsu Elect',
394     (0x4c,): 'Sony',
395     (0x4d,): 'Nisshin Onpa',
396     (0x4e,): 'TEAC',
397     (0x50,): 'Matsushita Electric',
398     (0x51,): 'Fostex',
399     (0x52,): 'Zoom',
400     (0x53,): 'Midori Electronics',
401     (0x54,): 'Matsushita Communication Industrial',
402     (0x55,): 'Suzuki Musical Inst. Mfg.',
403
404     # Other (range 60-7c, 006000-007f7f)
405
406     # Special (7d-7f)
407     (0x7d,): 'Non-Commercial',
408     (0x7e,): 'Universal Non-Realtime',
409     (0x7f,): 'Universal Realtime',
410 }
411
412 control_functions = {
413     0x00: ['bank select MSB', 'bank MSB', 'bank-M'],
414     0x01: ['modulation wheel/lever MSB', 'modulation MSB', 'mod-M'],
415     0x02: ['breath controller MSB', 'breath MSB', 'breath-M'],
416     # 0x03: undefined MSB
417     0x04: ['foot controller MSB', 'foot MSB', 'foot-M'],
418     0x05: ['portamento time MSB', 'portamento MSB', 'porta-M'],
419     0x06: ['data entry MSB', 'data entry MSB', 'data-M'],
420     0x07: ['channel volume MSB (formerly main volume)', 'channel volume MSB', 'ch vol-M'],
421     0x08: ['balance MSB', 'bal MSB', 'bal-M'],
422     # 0x09: undefined MSB
423     0x0a: ['pan MSB', 'pan MSB', 'pan-M'],
424     0x0b: ['expression controller MSB', 'expression MSB', 'expr-M'],
425     0x0c: ['effect control 1 MSB', 'effect 1 MSB', 'eff-1-M'],
426     0x0d: ['effect control 2 MSB', 'effect 2 MSB', 'eff-2-M'],
427     # 0x0e-0x0f: undefined MSB
428     0x10: ['general purpose controller 1 MSB', 'GP ctrl 1 MSB', 'GPC-1-M'],
429     0x11: ['general purpose controller 2 MSB', 'GP ctrl 2 MSB', 'GPC-2-M'],
430     0x12: ['general purpose controller 3 MSB', 'GP ctrl 3 MSB', 'GPC-3-M'],
431     0x13: ['general purpose controller 4 MSB', 'GP ctrl 4 MSB', 'GPC-4-M'],
432     # 0x14-0x1f: undefined MSB
433     0x20: ['bank select LSB', 'bank LSB', 'bank-L'],
434     0x21: ['modulation wheel/lever LSB', 'modulation LSB', 'mod-L'],
435     0x22: ['breath controller LSB', 'breath LSB', 'breath-L'],
436     # 0x23: undefined LSB
437     0x24: ['foot controller LSB', 'foot LSB', 'foot-L'],
438     0x25: ['portamento time LSB', 'portamento LSB', 'porta-L'],
439     0x26: ['data entry LSB', 'data entry LSB', 'data-L'],
440     0x27: ['channel volume LSB (formerly main volume)', 'channel volume LSB', 'ch vol-L'],
441     0x28: ['balance LSB', 'bal LSB', 'bal-L'],
442     # 0x29: undefined LSB
443     0x2a: ['pan LSB', 'pan LSB', 'pan-L'],
444     0x2b: ['expression controller LSB', 'expression LSB', 'expr-L'],
445     0x2c: ['effect control 1 LSB', 'effect 1 LSB', 'eff-1-L'],
446     0x2d: ['effect control 2 LSB', 'effect 2 LSB', 'eff-2-L'],
447     # 0x2e-0x2f: undefined LSB
448     0x30: ['general purpose controller 1 LSB', 'GP ctrl 1 LSB', 'GPC-1-L'],
449     0x31: ['general purpose controller 2 LSB', 'GP ctrl 2 LSB', 'GPC-2-L'],
450     0x32: ['general purpose controller 3 LSB', 'GP ctrl 3 LSB', 'GPC-3-L'],
451     0x33: ['general purpose controller 4 LSB', 'GP ctrl 4 LSB', 'GPC-4-L'],
452     # 0x34-0x3f: undefined LSB
453     0x40: ['damper pedal (sustain)', 'sustain', 'sust'],
454     0x41: ['portamento on/off', 'porta on/off', 'porta on/off'],
455     0x42: ['sostenuto', 'sostenuto', 'sostenuto'],
456     0x43: ['soft pedal', 'soft pedal', 'soft pedal'],
457     0x44: ['legato footswitch', 'legato switch', 'legato'], # vv: 00-3f = normal, 40-7f = legato
458     0x45: ['hold 2', 'hold 2', 'hold 2'],
459     0x46: ['sound controller 1 (default: sound variation)', 'sound ctrl 1', 'snd ctrl 1'],
460     0x47: ['sound controller 2 (default: timbre / harmonic intensity)', 'sound ctrl 2', 'snd ctrl 2'],
461     0x48: ['sound controller 3 (default: release time)', 'sound ctrl 3', 'snd ctrl 3'],
462     0x49: ['sound controller 4 (default: attack time)', 'sound ctrl 4', 'snd ctrl 4'],
463     0x4a: ['sound controller 5 (default: brightness)', 'sound ctrl 5', 'snd ctrl 5'],
464     0x4b: ['sound controller 6 (GM2 default: decay time)', 'sound ctrl 6', 'snd ctrl 6'],
465     0x4c: ['sound controller 7 (GM2 default: vibrato rate)', 'sound ctrl 7', 'snd ctrl 7'],
466     0x4d: ['sound controller 8 (GM2 default: vibrato depth)', 'sound ctrl 8', 'snd ctrl 8'],
467     0x4e: ['sound controller 9 (GM2 default: vibrato delay)', 'sound ctrl 9', 'snd ctrl 9'],
468     0x4f: ['sound controller 10', 'sound ctrl 10', 'snd ctrl 10'],
469     0x50: ['general purpose controller 5', 'GP controller 5', 'GPC-5'],
470     0x51: ['general purpose controller 6', 'GP controller 6', 'GPC-6'],
471     0x52: ['general purpose controller 7', 'GP controller 7', 'GPC-7'],
472     0x53: ['general purpose controller 8', 'GP controller 8', 'GPC-8'],
473     0x54: ['portamento control', 'portamento ctrl', 'porta ctrl'],
474     # 0x55-0x5a: undefined
475     0x5b: ['effects 1 depth (formerly external effects depth)', 'effects 1 depth', 'eff 1 depth'],
476     0x5c: ['effects 2 depth (formerly tremolo depth)', 'effects 2 depth', 'eff 2 depth'],
477     0x5d: ['effects 3 depth (formerly chorus depth)', 'effects 3 depth', 'eff 3 depth'],
478     0x5e: ['effects 4 depth (formerly celeste/detune depth)', 'effects 4 depth', 'eff 4 depth'],
479     0x5f: ['effects 5 depth (formerly phaser depth)', 'effects 5 depth', 'eff 5 depth'],
480     0x60: ['data increment', 'data inc', 'data++'],
481     0x61: ['data decrement', 'data dec', 'data--'],
482     0x62: ['Non-Registered Parameter Number LSB', 'NRPN LSB', 'NRPN-L'],
483     0x63: ['Non-Registered Parameter Number MSB', 'NRPN MSB', 'NRPN-M'],
484     0x64: ['Registered Parameter Number LSB', 'RPN LSB', 'RPN-L'],
485     0x65: ['Registered Parameter Number MSB', 'RPN MSB', 'RPN-M'],
486     # 0x66-0x77: undefined
487     # 0x78-0x7f: reserved for channel mode messages
488     0x78: ['all sound off', 'all snd off', 'snd off'],
489     0x79: ['reset all controllers', 'reset all ctrls', 'reset ctrls'],
490     0x7a: ['local control', 'local ctrl', 'local ctrl'],
491     0x7b: ['all notes off', 'notes off', 'notes off'],
492     0x7c: ['omni mode off', 'omni off', 'omni off'], # all notes off
493     0x7d: ['omni mode on', 'omni on', 'omni on'], # all notes off
494     0x7e: ['mono mode on', 'mono on', 'mono'], # mono mode on, all notes off
495     0x7f: ['poly mode on', 'poly on', 'poly'], # mono mode off, all notes off
496 }
497
498 gm_instruments = {
499     1:   'Acoustic Grand Piano',
500     2:   'Bright Acoustic Piano',
501     3:   'Electric Grand Piano',
502     4:   'Honky-tonk Piano',
503     5:   'Electric Piano 1',
504     6:   'Electric Piano 2',
505     7:   'Harpsichord',
506     8:   'Clavi',
507     9:   'Celesta',
508     10:  'Glockenspiel',
509     11:  'Music Box',
510     12:  'Vibraphone',
511     13:  'Marimba',
512     14:  'Xylophone',
513     15:  'Tubular Bells',
514     16:  'Dulcimer',
515     17:  'Drawbar Organ',
516     18:  'Percussive Organ',
517     19:  'Rock Organ',
518     20:  'Church Organ',
519     21:  'Reed Organ',
520     22:  'Accordion',
521     23:  'Harmonica',
522     24:  'Tango Accordion',
523     25:  'Acoustic Guitar (nylon)',
524     26:  'Acoustic Guitar (steel)',
525     27:  'Electric Guitar (jazz)',
526     28:  'Electric Guitar (clean)',
527     29:  'Electric Guitar (muted)',
528     30:  'Overdriven Guitar',
529     31:  'Distortion Guitar',
530     32:  'Guitar harmonics',
531     33:  'Acoustic Bass',
532     34:  'Electric Bass (finger)',
533     35:  'Electric Bass (pick)',
534     36:  'Fretless Bass',
535     37:  'Slap Bass 1',
536     38:  'Slap Bass 2',
537     39:  'Synth Bass 1',
538     40:  'Synth Bass 2',
539     41:  'Violin',
540     42:  'Viola',
541     43:  'Cello',
542     44:  'Contrabass',
543     45:  'Tremolo Strings',
544     46:  'Pizzicato Strings',
545     47:  'Orchestral Harp',
546     48:  'Timpani',
547     49:  'String Ensemble 1',
548     50:  'String Ensemble 2',
549     51:  'SynthStrings 1',
550     52:  'SynthStrings 2',
551     53:  'Choir Aahs',
552     54:  'Voice Oohs',
553     55:  'Synth Voice',
554     56:  'Orchestra Hit',
555     57:  'Trumpet',
556     58:  'Trombone',
557     59:  'Tuba',
558     60:  'Muted Trumpet',
559     61:  'French Horn',
560     62:  'Brass Section',
561     63:  'SynthBrass 1',
562     64:  'SynthBrass 2',
563     65:  'Soprano Sax',
564     66:  'Alto Sax',
565     67:  'Tenor Sax',
566     68:  'Baritone Sax',
567     69:  'Oboe',
568     70:  'English Horn',
569     71:  'Bassoon',
570     72:  'Clarinet',
571     73:  'Piccolo',
572     74:  'Flute',
573     75:  'Recorder',
574     76:  'Pan Flute',
575     77:  'Blown Bottle',
576     78:  'Shakuhachi',
577     79:  'Whistle',
578     80:  'Ocarina',
579     81:  'Lead 1 (square)',
580     82:  'Lead 2 (sawtooth)',
581     83:  'Lead 3 (calliope)',
582     84:  'Lead 4 (chiff)',
583     85:  'Lead 5 (charang)',
584     86:  'Lead 6 (voice)',
585     87:  'Lead 7 (fifths)',
586     88:  'Lead 8 (bass + lead)',
587     89:  'Pad 1 (new age)',
588     90:  'Pad 2 (warm)',
589     91:  'Pad 3 (polysynth)',
590     92:  'Pad 4 (choir)',
591     93:  'Pad 5 (bowed)',
592     94:  'Pad 6 (metallic)',
593     95:  'Pad 7 (halo)',
594     96:  'Pad 8 (sweep)',
595     97:  'FX 1 (rain)',
596     98:  'FX 2 (soundtrack)',
597     99:  'FX 3 (crystal)',
598     100: 'FX 4 (atmosphere)',
599     101: 'FX 5 (brightness)',
600     102: 'FX 6 (goblins)',
601     103: 'FX 7 (echoes)',
602     104: 'FX 8 (sci-fi)',
603     105: 'Sitar',
604     106: 'Banjo',
605     107: 'Shamisen',
606     108: 'Koto',
607     109: 'Kalimba',
608     110: 'Bag pipe',
609     111: 'Fiddle',
610     112: 'Shanai',
611     113: 'Tinkle Bell',
612     114: 'Agogo',
613     115: 'Steel Drums',
614     116: 'Woodblock',
615     117: 'Taiko Drum',
616     118: 'Melodic Tom',
617     119: 'Synth Drum',
618     120: 'Reverse Cymbal',
619     121: 'Guitar Fret Noise',
620     122: 'Breath Noise',
621     123: 'Seashore',
622     124: 'Bird Tweet',
623     125: 'Telephone Ring',
624     126: 'Helicopter',
625     127: 'Applause',
626     128: 'Gunshot',
627 }
628
629 drum_kit = {
630     1:   'GM Standard Kit',
631     9:   'GS Room Kit',
632     17:  'GS Power Kit',
633     25:  'GS Power Kit',
634     26:  'GS TR-808 Kit',
635     33:  'GS Jazz Kit',
636     41:  'GS Brush Kit',
637     49:  'GS Orchestra Kit',
638     57:  'GS Sound FX Kit',
639     128: 'GS CM-64/CM-32 Kit',
640 }
641
642 # Each quarter frame type has 2 string names, each shorter than the previous
643 quarter_frame_type = {
644     0: ['frame count LS nibble', 'frame LSN'],
645     1: ['frame count MS nibble', 'frame MSN'],
646     2: ['seconds LS nibble', 'sec LSN'],
647     3: ['seconds MS nibble', 'sec MSN'],
648     4: ['minutes LS nibble', 'min LSN'],
649     5: ['minutes MS nibble', 'min MSN'],
650     6: ['hours LS nibble', 'hrs LSN'],
651     7: ['hours MS nibble and SMPTE type', 'hrs MSN'],
652 }
653
654 smpte_type = {
655     0: '24 fps',
656     1: '25 fps',
657     2: '30 fps (drop-frame)',
658     3: '30 fps (non-drop)',
659 }
660
661 chromatic_notes = {
662     0: 'C-2',
663     1: 'C#-2',
664     2: 'D-2',
665     3: 'D#-2',
666     4: 'E-2',
667     5: 'F-2',
668     6: 'F#-2',
669     7: 'G-2',
670     8: 'G#-2',
671     9: 'A-2',
672     10: 'A#-2',
673     11: 'B-2',
674     12: 'C-1',
675     13: 'C#-1',
676     14: 'D-1',
677     15: 'D#-1',
678     16: 'E-1',
679     17: 'F-1',
680     18: 'F#-1',
681     19: 'G-1',
682     20: 'G#-1',
683     21: 'A-1',
684     22: 'A#-1',
685     23: 'B-1',
686     24: 'C0',
687     25: 'C#0',
688     26: 'D0',
689     27: 'D#0',
690     28: 'E0',
691     29: 'F0',
692     30: 'F#0',
693     31: 'G0',
694     32: 'G#0',
695     33: 'A0',
696     34: 'A#0',
697     35: 'B0',
698     36: 'C1',
699     37: 'C#1',
700     38: 'D1',
701     39: 'D#1',
702     40: 'E1',
703     41: 'F1',
704     42: 'F#1',
705     43: 'G1',
706     44: 'G#1',
707     45: 'A1',
708     46: 'A#1',
709     47: 'B1',
710     48: 'C2',
711     49: 'C#2',
712     50: 'D2',
713     51: 'D#2',
714     52: 'E2',
715     53: 'F2',
716     54: 'F#2',
717     55: 'G2',
718     56: 'G#2',
719     57: 'A2',
720     58: 'A#2',
721     59: 'B2',
722     60: 'C3',
723     61: 'C#3',
724     62: 'D3',
725     63: 'D#3',
726     64: 'E3',
727     65: 'F3',
728     66: 'F#3',
729     67: 'G3',
730     68: 'G#3',
731     69: 'A3',
732     70: 'A#3',
733     71: 'B3',
734     72: 'C4',
735     73: 'C#4',
736     74: 'D4',
737     75: 'D#4',
738     76: 'E4',
739     77: 'F4',
740     78: 'F#4',
741     79: 'G4',
742     80: 'G#4',
743     81: 'A4',
744     82: 'A#4',
745     83: 'B4',
746     84: 'C5',
747     85: 'C#5',
748     86: 'D5',
749     87: 'D#5',
750     88: 'E5',
751     89: 'F5',
752     90: 'F#5',
753     91: 'G5',
754     92: 'G#5',
755     93: 'A5',
756     94: 'A#5',
757     95: 'B5',
758     96: 'C6',
759     97: 'C#6',
760     98: 'D6',
761     99: 'D#6',
762     100: 'E6',
763     101: 'F6',
764     102: 'F#6',
765     103: 'G6',
766     104: 'G#6',
767     105: 'A6',
768     106: 'A#6',
769     107: 'B6',
770     108: 'C7',
771     109: 'C#7',
772     110: 'D7',
773     111: 'D#7',
774     112: 'E7',
775     113: 'F7',
776     114: 'F#7',
777     115: 'G7',
778     116: 'G#7',
779     117: 'A7',
780     118: 'A#7',
781     119: 'B7',
782     120: 'C8',
783     121: 'C#8',
784     122: 'D8',
785     123: 'D#8',
786     124: 'E8',
787     125: 'F8',
788     126: 'F#8',
789     127: 'G8',
790 }
791
792 percussion_notes = {
793     35: 'Acoustic Bass Drum',
794     36: 'Bass Drum 1',
795     37: 'Side Stick',
796     38: 'Acoustic Snare',
797     39: 'Hand Clap',
798     40: 'Electric Snare',
799     41: 'Low Floor Tom',
800     42: 'Closed Hi Hat',
801     43: 'High Floor Tom',
802     44: 'Pedal Hi-Hat',
803     45: 'Low Tom',
804     46: 'Open Hi-Hat',
805     47: 'Low-Mid Tom',
806     48: 'Hi Mid Tom',
807     49: 'Crash Cymbal 1',
808     50: 'High Tom',
809     51: 'Ride Cymbal 1',
810     52: 'Chinese Cymbal',
811     53: 'Ride Bell',
812     54: 'Tambourine',
813     55: 'Splash Cymbal',
814     56: 'Cowbell',
815     57: 'Crash Cymbal 2',
816     58: 'Vibraslap',
817     59: 'Ride Cymbal 2',
818     60: 'Hi Bongo',
819     61: 'Low Bongo',
820     62: 'Mute Hi Conga',
821     63: 'Open Hi Conga',
822     64: 'Low Conga',
823     65: 'High Timbale',
824     66: 'Low Timbale',
825     67: 'High Agogo',
826     68: 'Low Agogo',
827     69: 'Cabasa',
828     70: 'Maracas',
829     71: 'Short Whistle',
830     72: 'Long Whistle',
831     73: 'Short Guiro',
832     74: 'Long Guiro',
833     75: 'Claves',
834     76: 'Hi Wood Block',
835     77: 'Low Wood Block',
836     78: 'Mute Cuica',
837     79: 'Open Cuica',
838     80: 'Mute Triangle',
839     81: 'Open Triangle',
840 }