midilib 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/README.rdoc +9 -4
 - data/Rakefile +2 -6
 - data/examples/from_scratch.rb +3 -5
 - data/examples/measures_mbt.rb +4 -4
 - data/examples/print_program_changes.rb +9 -9
 - data/examples/reader2text.rb +188 -188
 - data/examples/seq2text.rb +17 -17
 - data/examples/split.rb +19 -19
 - data/examples/strings.rb +14 -14
 - data/examples/transpose.rb +31 -31
 - data/html/IO.html +65 -169
 - data/html/MIDI.html +138 -256
 - data/html/MIDI/ActiveSense.html +89 -178
 - data/html/MIDI/ChannelEvent.html +95 -183
 - data/html/MIDI/ChannelPressure.html +105 -190
 - data/html/MIDI/Clock.html +89 -178
 - data/html/MIDI/Continue.html +89 -178
 - data/html/MIDI/Controller.html +107 -192
 - data/html/MIDI/Event.html +138 -222
 - data/html/MIDI/IO.html +45 -157
 - data/html/MIDI/IO/MIDIFile.html +596 -568
 - data/html/MIDI/IO/SeqReader.html +272 -314
 - data/html/MIDI/IO/SeqWriter.html +229 -305
 - data/html/MIDI/KeySig.html +129 -211
 - data/html/MIDI/MIDI.html +45 -154
 - data/html/MIDI/MIDI/MIDI.html +45 -154
 - data/html/MIDI/MIDI/MIDI/Array.html +87 -185
 - data/html/MIDI/Marker.html +71 -170
 - data/html/MIDI/Measure.html +95 -190
 - data/html/MIDI/Measures.html +103 -193
 - data/html/MIDI/MetaEvent.html +180 -253
 - data/html/MIDI/NoteEvent.html +118 -204
 - data/html/MIDI/NoteOff.html +95 -183
 - data/html/MIDI/NoteOn.html +95 -183
 - data/html/MIDI/PitchBend.html +106 -191
 - data/html/MIDI/PolyPressure.html +106 -189
 - data/html/MIDI/ProgramChange.html +105 -190
 - data/html/MIDI/Realtime.html +98 -184
 - data/html/MIDI/Sequence.html +246 -311
 - data/html/MIDI/SongPointer.html +106 -191
 - data/html/MIDI/SongSelect.html +105 -190
 - data/html/MIDI/Start.html +89 -178
 - data/html/MIDI/Stop.html +89 -178
 - data/html/MIDI/SystemCommon.html +71 -170
 - data/html/MIDI/SystemExclusive.html +108 -193
 - data/html/MIDI/SystemReset.html +89 -178
 - data/html/MIDI/Tempo.html +135 -213
 - data/html/MIDI/TimeSig.html +135 -214
 - data/html/MIDI/Track.html +217 -291
 - data/html/MIDI/TuneRequest.html +98 -184
 - data/html/MIDI/Utils.html +89 -189
 - data/html/README_rdoc.html +237 -257
 - data/html/TODO_rdoc.html +64 -139
 - data/html/created.rid +14 -14
 - data/html/css/fonts.css +167 -0
 - data/html/{rdoc.css → css/rdoc.css} +265 -218
 - data/html/fonts/Lato-Light.ttf +0 -0
 - data/html/fonts/Lato-LightItalic.ttf +0 -0
 - data/html/fonts/Lato-Regular.ttf +0 -0
 - data/html/fonts/Lato-RegularItalic.ttf +0 -0
 - data/html/fonts/SourceCodePro-Bold.ttf +0 -0
 - data/html/fonts/SourceCodePro-Regular.ttf +0 -0
 - data/html/images/add.png +0 -0
 - data/html/images/arrow_up.png +0 -0
 - data/html/images/delete.png +0 -0
 - data/html/images/tag_blue.png +0 -0
 - data/html/index.html +187 -169
 - data/html/js/darkfish.js +41 -33
 - data/html/js/jquery.js +4 -18
 - data/html/js/navigation.js.gz +0 -0
 - data/html/js/search.js +20 -5
 - data/html/js/search_index.js +1 -1
 - data/html/js/search_index.js.gz +0 -0
 - data/html/js/searcher.js.gz +0 -0
 - data/html/table_of_contents.html +1111 -498
 - data/install.rb +43 -32
 - data/lib/midilib/consts.rb +407 -407
 - data/lib/midilib/event.rb +295 -294
 - data/lib/midilib/info.rb +5 -5
 - data/lib/midilib/io/midifile.rb +266 -267
 - data/lib/midilib/io/seqreader.rb +106 -106
 - data/lib/midilib/io/seqwriter.rb +59 -60
 - data/lib/midilib/measure.rb +69 -69
 - data/lib/midilib/sequence.rb +68 -70
 - data/lib/midilib/track.rb +96 -102
 - data/lib/midilib/utils.rb +15 -15
 - data/test/event_equality.rb +50 -50
 - data/test/test_event.rb +120 -122
 - data/test/test_io.rb +35 -48
 - data/test/test_sequence.rb +60 -60
 - data/test/test_track.rb +154 -154
 - data/test/test_varlen.rb +23 -25
 - metadata +65 -57
 
    
        data/install.rb
    CHANGED
    
    | 
         @@ -5,53 +5,64 @@ 
     | 
|
| 
       5 
5 
     | 
    
         
             
            # This script installs midilib into the Ruby site-local library directory.
         
     | 
| 
       6 
6 
     | 
    
         
             
            #
         
     | 
| 
       7 
7 
     | 
    
         
             
            # Author:: Jim Menard (mailto:jim@jimmenard.com)
         
     | 
| 
       8 
     | 
    
         
            -
            # Copyright:: Copyright (c) 2003- 
     | 
| 
      
 8 
     | 
    
         
            +
            # Copyright:: Copyright (c) 2003-2013 by Jim Menard
         
     | 
| 
       9 
9 
     | 
    
         
             
            # License:: Distributed under the same license as Ruby.
         
     | 
| 
       10 
10 
     | 
    
         
             
            #
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
            require 'getoptlong'
         
     | 
| 
       13 
     | 
    
         
            -
            require 'ftools'
         
     | 
| 
       14 
13 
     | 
    
         
             
            require 'find'
         
     | 
| 
      
 14 
     | 
    
         
            +
            begin
         
     | 
| 
      
 15 
     | 
    
         
            +
              require 'ftools'
         
     | 
| 
      
 16 
     | 
    
         
            +
              def mkdirs(dir); File.makedirs(dir); end
         
     | 
| 
      
 17 
     | 
    
         
            +
              def install(*args); File.install(*args); end
         
     | 
| 
      
 18 
     | 
    
         
            +
            rescue LoadError
         
     | 
| 
      
 19 
     | 
    
         
            +
              require 'fileutils'
         
     | 
| 
      
 20 
     | 
    
         
            +
              def mkdirs(dir); FileUtils.mkdir_p(dir); end
         
     | 
| 
      
 21 
     | 
    
         
            +
              def install(*args)
         
     | 
| 
      
 22 
     | 
    
         
            +
                args[2] = {mode: args[2], verbose: args[3]}
         
     | 
| 
      
 23 
     | 
    
         
            +
                args.pop
         
     | 
| 
      
 24 
     | 
    
         
            +
                FileUtils.install(*args)
         
     | 
| 
      
 25 
     | 
    
         
            +
              end
         
     | 
| 
      
 26 
     | 
    
         
            +
            end
         
     | 
| 
       15 
27 
     | 
    
         | 
| 
       16 
28 
     | 
    
         
             
            SOURCE_DIR = 'lib'
         
     | 
| 
       17 
29 
     | 
    
         
             
            LIB_DIR = 'midilib'
         
     | 
| 
       18 
30 
     | 
    
         
             
            IO_DIR = File.join(LIB_DIR, 'io')
         
     | 
| 
       19 
31 
     | 
    
         | 
| 
       20 
32 
     | 
    
         
             
            def instdir
         
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
      
 33 
     | 
    
         
            +
              g = GetoptLong.new(['--install-dir', '-i', GetoptLong::REQUIRED_ARGUMENT])
         
     | 
| 
      
 34 
     | 
    
         
            +
              g.each do |name, arg|
         
     | 
| 
      
 35 
     | 
    
         
            +
                if name == '--install-dir'
         
     | 
| 
      
 36 
     | 
    
         
            +
                  return arg
         
     | 
| 
      
 37 
     | 
    
         
            +
                else
         
     | 
| 
      
 38 
     | 
    
         
            +
                  $stderr.puts "usage: $0 [--install-dir dir]"
         
     | 
| 
      
 39 
     | 
    
         
            +
                end
         
     | 
| 
      
 40 
     | 
    
         
            +
              end
         
     | 
| 
       29 
41 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
            	end
         
     | 
| 
       42 
     | 
    
         
            -
            	STDERR.puts "Can't find required file `rbconfig.rb'."
         
     | 
| 
       43 
     | 
    
         
            -
            	STDERR.puts "The `midilib' files need to be installed manually in" +
         
     | 
| 
       44 
     | 
    
         
            -
            	    " #{libdir}"
         
     | 
| 
      
 42 
     | 
    
         
            +
              begin
         
     | 
| 
      
 43 
     | 
    
         
            +
                require 'rbconfig'
         
     | 
| 
      
 44 
     | 
    
         
            +
                libdir = Config::CONFIG['sitedir'] + "/" + 
         
     | 
| 
      
 45 
     | 
    
         
            +
                  Config::CONFIG['MAJOR'] + "." +
         
     | 
| 
      
 46 
     | 
    
         
            +
                  Config::CONFIG['MINOR']
         
     | 
| 
      
 47 
     | 
    
         
            +
              rescue ScriptError
         
     | 
| 
      
 48 
     | 
    
         
            +
                $LOAD_PATH.each do |l|
         
     | 
| 
      
 49 
     | 
    
         
            +
                  if l =~ /site_ruby/ && l =~ /\d$/ && l !~ /#{PLATFORM}/
         
     | 
| 
      
 50 
     | 
    
         
            +
                    libdir = l
         
     | 
| 
      
 51 
     | 
    
         
            +
                    break
         
     | 
| 
      
 52 
     | 
    
         
            +
                  end
         
     | 
| 
       45 
53 
     | 
    
         
             
                end
         
     | 
| 
       46 
     | 
    
         
            -
                 
     | 
| 
      
 54 
     | 
    
         
            +
                STDERR.puts "Can't find required file `rbconfig.rb'."
         
     | 
| 
      
 55 
     | 
    
         
            +
                STDERR.puts "The `midilib' files need to be installed manually in #{libdir}"
         
     | 
| 
      
 56 
     | 
    
         
            +
              end
         
     | 
| 
      
 57 
     | 
    
         
            +
              return libdir
         
     | 
| 
       47 
58 
     | 
    
         
             
            end
         
     | 
| 
       48 
59 
     | 
    
         | 
| 
       49 
60 
     | 
    
         
             
            INSTALL_DIR = instdir()
         
     | 
| 
       50 
61 
     | 
    
         
             
            files = Dir.chdir('lib') { Dir['**/*.rb'] }
         
     | 
| 
       51 
62 
     | 
    
         | 
| 
       52 
     | 
    
         
            -
            files.each  
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
      
 63 
     | 
    
         
            +
            files.each do |f|
         
     | 
| 
      
 64 
     | 
    
         
            +
              dir = File.dirname(f)
         
     | 
| 
      
 65 
     | 
    
         
            +
              target_dir = File.join(INSTALL_DIR, dir)
         
     | 
| 
      
 66 
     | 
    
         
            +
              mkdirs(target_dir) unless File.exist?(target_dir)
         
     | 
| 
      
 67 
     | 
    
         
            +
              install(File.join('lib', f), File.join(INSTALL_DIR, f), 0644, true)
         
     | 
| 
      
 68 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/midilib/consts.rb
    CHANGED
    
    | 
         @@ -1,426 +1,426 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # MIDI constants.
         
     | 
| 
       2 
2 
     | 
    
         
             
            module MIDI
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
      
 4 
     | 
    
         
            +
              # Number of MIDI channels
         
     | 
| 
      
 5 
     | 
    
         
            +
              MIDI_CHANNELS = 16
         
     | 
| 
      
 6 
     | 
    
         
            +
              # Number of note per MIDI channel
         
     | 
| 
      
 7 
     | 
    
         
            +
              NOTES_PER_CHANNEL = 128
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
            #--
         
     | 
| 
       10 
     | 
    
         
            -
            # Standard MIDI File meta event defs.
         
     | 
| 
       11 
     | 
    
         
            -
            #++
         
     | 
| 
       12 
     | 
    
         
            -
                META_EVENT = 0xff
         
     | 
| 
       13 
     | 
    
         
            -
                META_SEQ_NUM = 0x00
         
     | 
| 
       14 
     | 
    
         
            -
                META_TEXT = 0x01
         
     | 
| 
       15 
     | 
    
         
            -
                META_COPYRIGHT = 0x02
         
     | 
| 
       16 
     | 
    
         
            -
                META_SEQ_NAME = 0x03
         
     | 
| 
       17 
     | 
    
         
            -
                META_INSTRUMENT = 0x04
         
     | 
| 
       18 
     | 
    
         
            -
                META_LYRIC = 0x05
         
     | 
| 
       19 
     | 
    
         
            -
                META_MARKER = 0x06
         
     | 
| 
       20 
     | 
    
         
            -
                META_CUE = 0x07
         
     | 
| 
       21 
     | 
    
         
            -
                META_MIDI_CHAN_PREFIX = 0x20
         
     | 
| 
       22 
     | 
    
         
            -
                META_TRACK_END = 0x2f
         
     | 
| 
       23 
     | 
    
         
            -
                META_SET_TEMPO = 0x51
         
     | 
| 
       24 
     | 
    
         
            -
                META_SMPTE = 0x54
         
     | 
| 
       25 
     | 
    
         
            -
                META_TIME_SIG = 0x58
         
     | 
| 
       26 
     | 
    
         
            -
                META_KEY_SIG = 0x59
         
     | 
| 
       27 
     | 
    
         
            -
                META_SEQ_SPECIF = 0x7f
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
            #--
         
     | 
| 
       30 
     | 
    
         
            -
            # Channel messages
         
     | 
| 
       31 
     | 
    
         
            -
            #++
         
     | 
| 
       32 
     | 
    
         
            -
                # Note, val
         
     | 
| 
       33 
     | 
    
         
            -
                NOTE_OFF = 0x80
         
     | 
| 
       34 
     | 
    
         
            -
                # Note, val
         
     | 
| 
       35 
     | 
    
         
            -
                NOTE_ON = 0x90
         
     | 
| 
       36 
     | 
    
         
            -
                # Note, val
         
     | 
| 
       37 
     | 
    
         
            -
                POLY_PRESSURE = 0xA0
         
     | 
| 
       38 
     | 
    
         
            -
                # Controller #, val
         
     | 
| 
       39 
     | 
    
         
            -
                CONTROLLER = 0xB0
         
     | 
| 
       40 
     | 
    
         
            -
                # Program number
         
     | 
| 
       41 
     | 
    
         
            -
                PROGRAM_CHANGE = 0xC0
         
     | 
| 
       42 
     | 
    
         
            -
                # Channel pressure
         
     | 
| 
       43 
     | 
    
         
            -
                CHANNEL_PRESSURE = 0xD0
         
     | 
| 
       44 
     | 
    
         
            -
                # LSB, MSB
         
     | 
| 
       45 
     | 
    
         
            -
                PITCH_BEND = 0xE0
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
            #--
         
     | 
| 
       48 
     | 
    
         
            -
            # System common messages
         
     | 
| 
       49 
     | 
    
         
            -
            #++
         
     | 
| 
       50 
     | 
    
         
            -
                # System exclusive start
         
     | 
| 
       51 
     | 
    
         
            -
                SYSEX = 0xF0
         
     | 
| 
       52 
     | 
    
         
            -
                # Beats from top: LSB/MSB 6 ticks = 1 beat
         
     | 
| 
       53 
     | 
    
         
            -
                SONG_POINTER = 0xF2
         
     | 
| 
       54 
     | 
    
         
            -
                # Val = number of song
         
     | 
| 
       55 
     | 
    
         
            -
                SONG_SELECT = 0xF3
         
     | 
| 
       56 
     | 
    
         
            -
                # Tune request
         
     | 
| 
       57 
     | 
    
         
            -
                TUNE_REQUEST = 0xF6
         
     | 
| 
       58 
     | 
    
         
            -
                # End of system exclusive
         
     | 
| 
       59 
     | 
    
         
            -
                EOX = 0xF7
         
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
            #--
         
     | 
| 
       62 
     | 
    
         
            -
            # System realtime messages
         
     | 
| 
       63 
     | 
    
         
            -
            #++
         
     | 
| 
       64 
     | 
    
         
            -
                # MIDI clock (24 per quarter note)
         
     | 
| 
       65 
     | 
    
         
            -
                CLOCK = 0xF8
         
     | 
| 
       66 
     | 
    
         
            -
                # Sequence start
         
     | 
| 
       67 
     | 
    
         
            -
                START = 0xFA
         
     | 
| 
       68 
     | 
    
         
            -
                # Sequence continue
         
     | 
| 
       69 
     | 
    
         
            -
                CONTINUE = 0xFB
         
     | 
| 
       70 
     | 
    
         
            -
                # Sequence stop
         
     | 
| 
       71 
     | 
    
         
            -
                STOP = 0xFC
         
     | 
| 
       72 
     | 
    
         
            -
                # Active sensing (sent every 300 ms when nothing else being sent)
         
     | 
| 
       73 
     | 
    
         
            -
                ACTIVE_SENSE = 0xFE
         
     | 
| 
       74 
     | 
    
         
            -
                # System reset
         
     | 
| 
       75 
     | 
    
         
            -
                SYSTEM_RESET = 0xFF
         
     | 
| 
       76 
     | 
    
         
            -
             
     | 
| 
       77 
     | 
    
         
            -
            # Controller numbers
         
     | 
| 
       78 
     | 
    
         
            -
            # = 0 - 31 = continuous, LSB
         
     | 
| 
       79 
     | 
    
         
            -
            # = 32 - 63 = continuous, MSB
         
     | 
| 
       80 
     | 
    
         
            -
            # = 64 - 97 = switches
         
     | 
| 
       81 
     | 
    
         
            -
                CC_MOD_WHEEL = 1
         
     | 
| 
       82 
     | 
    
         
            -
                CC_BREATH_CONTROLLER = 2
         
     | 
| 
       83 
     | 
    
         
            -
                CC_FOOT_CONTROLLER = 4
         
     | 
| 
       84 
     | 
    
         
            -
                CC_PORTAMENTO_TIME = 5
         
     | 
| 
       85 
     | 
    
         
            -
                CC_DATA_ENTRY_MSB = 6
         
     | 
| 
       86 
     | 
    
         
            -
                CC_VOLUME = 7
         
     | 
| 
       87 
     | 
    
         
            -
                CC_BALANCE = 8
         
     | 
| 
       88 
     | 
    
         
            -
                CC_PAN = 10
         
     | 
| 
       89 
     | 
    
         
            -
                CC_EXPRESSION_CONTROLLER = 11
         
     | 
| 
       90 
     | 
    
         
            -
                CC_GEN_PURPOSE_1 = 16
         
     | 
| 
       91 
     | 
    
         
            -
                CC_GEN_PURPOSE_2 = 17
         
     | 
| 
       92 
     | 
    
         
            -
                CC_GEN_PURPOSE_3 = 18
         
     | 
| 
       93 
     | 
    
         
            -
                CC_GEN_PURPOSE_4 = 19
         
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
            # [32 - 63] are LSB for [0 - 31]
         
     | 
| 
       96 
     | 
    
         
            -
                CC_DATA_ENTRY_LSB = 38
         
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
       98 
     | 
    
         
            -
            #--
         
     | 
| 
       99 
     | 
    
         
            -
            # Momentaries:
         
     | 
| 
       100 
     | 
    
         
            -
            #++
         
     | 
| 
       101 
     | 
    
         
            -
                CC_SUSTAIN = 64
         
     | 
| 
       102 
     | 
    
         
            -
                CC_PORTAMENTO = 65
         
     | 
| 
       103 
     | 
    
         
            -
                CC_SUSTENUTO = 66
         
     | 
| 
       104 
     | 
    
         
            -
                CC_SOFT_PEDAL = 67
         
     | 
| 
       105 
     | 
    
         
            -
                CC_HOLD_2 = 69
         
     | 
| 
       106 
     | 
    
         
            -
                CC_GEN_PURPOSE_5 = 50
         
     | 
| 
       107 
     | 
    
         
            -
                CC_GEN_PURPOSE_6 = 51
         
     | 
| 
       108 
     | 
    
         
            -
                CC_GEN_PURPOSE_7 = 52
         
     | 
| 
       109 
     | 
    
         
            -
                CC_GEN_PURPOSE_8 = 53
         
     | 
| 
       110 
     | 
    
         
            -
                CC_TREMELO_DEPTH = 92
         
     | 
| 
       111 
     | 
    
         
            -
                CC_CHORUS_DEPTH = 93
         
     | 
| 
       112 
     | 
    
         
            -
                CC_DETUNE_DEPTH = 94
         
     | 
| 
       113 
     | 
    
         
            -
                CC_PHASER_DEPTH = 95
         
     | 
| 
       114 
     | 
    
         
            -
                CC_DATA_INCREMENT = 96
         
     | 
| 
       115 
     | 
    
         
            -
                CC_DATA_DECREMENT = 97
         
     | 
| 
       116 
     | 
    
         
            -
                CC_NREG_PARAM_LSB = 98
         
     | 
| 
       117 
     | 
    
         
            -
                CC_NREG_PARAM_MSB = 99
         
     | 
| 
       118 
     | 
    
         
            -
                CC_REG_PARAM_LSB = 100
         
     | 
| 
       119 
     | 
    
         
            -
                CC_REG_PARAM_MSB = 101
         
     | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
            #--
         
     | 
| 
       122 
     | 
    
         
            -
            # Channel mode message values
         
     | 
| 
       123 
     | 
    
         
            -
            #++
         
     | 
| 
       124 
     | 
    
         
            -
                # Val 0 == off, 0x7f == on
         
     | 
| 
       125 
     | 
    
         
            -
                CM_LOCAL_CONTROL = 0x7A
         
     | 
| 
       126 
     | 
    
         
            -
                CM_ALL_NOTES_OFF = 0x7B # Val must be 0
         
     | 
| 
       127 
     | 
    
         
            -
                CM_OMNI_MODE_OFF = 0x7C # Val must be 0
         
     | 
| 
       128 
     | 
    
         
            -
                CM_OMNI_MODE_ON = 0x7D  # Val must be 0
         
     | 
| 
       129 
     | 
    
         
            -
                CM_MONO_MODE_ON = 0x7E  # Val = # chans
         
     | 
| 
       130 
     | 
    
         
            -
                CM_POLY_MODE_ON = 0x7F  # Val must be 0
         
     | 
| 
       131 
     | 
    
         
            -
             
     | 
| 
       132 
     | 
    
         
            -
            # Controller names
         
     | 
| 
       133 
     | 
    
         
            -
                CONTROLLER_NAMES = [
         
     | 
| 
       134 
     | 
    
         
            -
            	"0",
         
     | 
| 
       135 
     | 
    
         
            -
            	"Modulation",
         
     | 
| 
       136 
     | 
    
         
            -
            	"Breath Control",
         
     | 
| 
       137 
     | 
    
         
            -
            	"3",
         
     | 
| 
       138 
     | 
    
         
            -
            	"Foot Controller",
         
     | 
| 
       139 
     | 
    
         
            -
            	"Portamento Time",
         
     | 
| 
       140 
     | 
    
         
            -
            	"Data Entry",
         
     | 
| 
       141 
     | 
    
         
            -
            	"Volume",
         
     | 
| 
       142 
     | 
    
         
            -
            	"Balance",
         
     | 
| 
       143 
     | 
    
         
            -
            	"9",
         
     | 
| 
       144 
     | 
    
         
            -
            	"Pan",
         
     | 
| 
       145 
     | 
    
         
            -
            	"Expression Control",
         
     | 
| 
       146 
     | 
    
         
            -
            	"12", "13", "14", "15",
         
     | 
| 
       147 
     | 
    
         
            -
            	"General Controller 1",
         
     | 
| 
       148 
     | 
    
         
            -
            	"General Controller 2",
         
     | 
| 
       149 
     | 
    
         
            -
            	"General Controller 3",
         
     | 
| 
       150 
     | 
    
         
            -
            	"General Controller 4",
         
     | 
| 
       151 
     | 
    
         
            -
            	"20", "21", "22", "23", "24", "25", "26", "27", "28", "29",
         
     | 
| 
       152 
     | 
    
         
            -
            	"30", "31",
         
     | 
| 
       153 
     | 
    
         
            -
            	"32", "33", "34", "35", "36", "37", "38", "39", "40", "41",
         
     | 
| 
       154 
     | 
    
         
            -
            	"42", "43", "44", "45", "46", "47", "48", "49", "50", "51",
         
     | 
| 
       155 
     | 
    
         
            -
            	"52", "53", "54", "55", "56", "57", "58", "59", "60", "61",
         
     | 
| 
       156 
     | 
    
         
            -
            	"62", "63",
         
     | 
| 
       157 
     | 
    
         
            -
            	"Sustain Pedal",
         
     | 
| 
       158 
     | 
    
         
            -
            	"Portamento",
         
     | 
| 
       159 
     | 
    
         
            -
            	"Sostenuto",
         
     | 
| 
       160 
     | 
    
         
            -
            	"Soft Pedal",
         
     | 
| 
       161 
     | 
    
         
            -
            	"68",
         
     | 
| 
       162 
     | 
    
         
            -
            	"Hold 2",
         
     | 
| 
       163 
     | 
    
         
            -
            	"70", "71", "72", "73", "74", "75", "76", "77", "78", "79",
         
     | 
| 
       164 
     | 
    
         
            -
            	"General Controller 5",
         
     | 
| 
       165 
     | 
    
         
            -
            	"Tempo Change",
         
     | 
| 
       166 
     | 
    
         
            -
            	"General Controller 7",
         
     | 
| 
       167 
     | 
    
         
            -
            	"General Controller 8",
         
     | 
| 
       168 
     | 
    
         
            -
            	"84", "85", "86", "87", "88", "89", "90",
         
     | 
| 
       169 
     | 
    
         
            -
            	"External Effects Depth",
         
     | 
| 
       170 
     | 
    
         
            -
            	"Tremolo Depth",
         
     | 
| 
       171 
     | 
    
         
            -
            	"Chorus Depth",
         
     | 
| 
       172 
     | 
    
         
            -
            	"Detune (Celeste) Depth",
         
     | 
| 
       173 
     | 
    
         
            -
            	"Phaser Depth",
         
     | 
| 
       174 
     | 
    
         
            -
            	"Data Increment",
         
     | 
| 
       175 
     | 
    
         
            -
            	"Data Decrement",
         
     | 
| 
       176 
     | 
    
         
            -
            	"Non-Registered Param LSB",
         
     | 
| 
       177 
     | 
    
         
            -
            	"Non-Registered Param MSB",
         
     | 
| 
       178 
     | 
    
         
            -
            	"Registered Param LSB",
         
     | 
| 
       179 
     | 
    
         
            -
            	"Registered Param MSB",
         
     | 
| 
       180 
     | 
    
         
            -
            	"102", "103", "104", "105", "106", "107", "108", "109",
         
     | 
| 
       181 
     | 
    
         
            -
            	"110", "111", "112", "113", "114", "115", "116", "117",
         
     | 
| 
       182 
     | 
    
         
            -
            	"118", "119", "120",
         
     | 
| 
       183 
     | 
    
         
            -
            	"Reset All Controllers",
         
     | 
| 
       184 
     | 
    
         
            -
            	"Local Control",
         
     | 
| 
       185 
     | 
    
         
            -
            	"All Notes Off",
         
     | 
| 
       186 
     | 
    
         
            -
            	"Omni Mode Off",
         
     | 
| 
       187 
     | 
    
         
            -
            	"Omni Mode On",
         
     | 
| 
       188 
     | 
    
         
            -
            	"Mono Mode On",
         
     | 
| 
       189 
     | 
    
         
            -
            	"Poly Mode On"
         
     | 
| 
       190 
     | 
    
         
            -
                ]
         
     | 
| 
       191 
     | 
    
         
            -
             
     | 
| 
       192 
     | 
    
         
            -
            # General MIDI patch names
         
     | 
| 
       193 
     | 
    
         
            -
                GM_PATCH_NAMES = [
         
     | 
| 
       194 
     | 
    
         
            -
              #--
         
     | 
| 
       195 
     | 
    
         
            -
              # Pianos
         
     | 
| 
       196 
     | 
    
         
            -
              #++
         
     | 
| 
       197 
     | 
    
         
            -
            	"Acoustic Grand Piano",
         
     | 
| 
       198 
     | 
    
         
            -
            	"Bright Acoustic Piano",
         
     | 
| 
       199 
     | 
    
         
            -
            	"Electric Grand Piano",
         
     | 
| 
       200 
     | 
    
         
            -
            	"Honky-tonk Piano",
         
     | 
| 
       201 
     | 
    
         
            -
            	"Electric Piano 1",
         
     | 
| 
       202 
     | 
    
         
            -
            	"Electric Piano 2",
         
     | 
| 
       203 
     | 
    
         
            -
            	"Harpsichord",
         
     | 
| 
       204 
     | 
    
         
            -
            	"Clavichord",
         
     | 
| 
       205 
     | 
    
         
            -
              #--
         
     | 
| 
       206 
     | 
    
         
            -
              # Tuned Idiophones
         
     | 
| 
       207 
     | 
    
         
            -
              #++
         
     | 
| 
       208 
     | 
    
         
            -
            	"Celesta",
         
     | 
| 
       209 
     | 
    
         
            -
            	"Glockenspiel",
         
     | 
| 
       210 
     | 
    
         
            -
            	"Music Box",
         
     | 
| 
       211 
     | 
    
         
            -
            	"Vibraphone",
         
     | 
| 
       212 
     | 
    
         
            -
            	"Marimba",
         
     | 
| 
       213 
     | 
    
         
            -
            	"Xylophone",
         
     | 
| 
       214 
     | 
    
         
            -
            	"Tubular Bells",
         
     | 
| 
       215 
     | 
    
         
            -
            	"Dulcimer",
         
     | 
| 
       216 
     | 
    
         
            -
              #--
         
     | 
| 
       217 
     | 
    
         
            -
              # Organs
         
     | 
| 
       218 
     | 
    
         
            -
              #++
         
     | 
| 
       219 
     | 
    
         
            -
            	"Drawbar Organ",
         
     | 
| 
       220 
     | 
    
         
            -
            	"Percussive Organ",
         
     | 
| 
       221 
     | 
    
         
            -
            	"Rock Organ",
         
     | 
| 
       222 
     | 
    
         
            -
            	"Church Organ",
         
     | 
| 
       223 
     | 
    
         
            -
            	"Reed Organ",
         
     | 
| 
       224 
     | 
    
         
            -
            	"Accordion",
         
     | 
| 
       225 
     | 
    
         
            -
            	"Harmonica",
         
     | 
| 
       226 
     | 
    
         
            -
            	"Tango Accordion",
         
     | 
| 
       227 
     | 
    
         
            -
              #--
         
     | 
| 
       228 
     | 
    
         
            -
              # Guitars
         
     | 
| 
       229 
     | 
    
         
            -
              #++
         
     | 
| 
       230 
     | 
    
         
            -
            	"Acoustic Guitar (nylon)",
         
     | 
| 
       231 
     | 
    
         
            -
            	"Acoustic Guitar (steel)",
         
     | 
| 
       232 
     | 
    
         
            -
            	"Electric Guitar (jazz)",
         
     | 
| 
       233 
     | 
    
         
            -
            	"Electric Guitar (clean)",
         
     | 
| 
       234 
     | 
    
         
            -
            	"Electric Guitar (muted)",
         
     | 
| 
       235 
     | 
    
         
            -
            	"Overdriven Guitar",
         
     | 
| 
       236 
     | 
    
         
            -
            	"Distortion Guitar",
         
     | 
| 
       237 
     | 
    
         
            -
            	"Guitar harmonics",
         
     | 
| 
       238 
     | 
    
         
            -
              #--
         
     | 
| 
       239 
     | 
    
         
            -
              # Basses
         
     | 
| 
       240 
     | 
    
         
            -
              #++
         
     | 
| 
       241 
     | 
    
         
            -
            	"Acoustic Bass",
         
     | 
| 
       242 
     | 
    
         
            -
            	"Electric Bass (finger)",
         
     | 
| 
       243 
     | 
    
         
            -
            	"Electric Bass (pick)",
         
     | 
| 
       244 
     | 
    
         
            -
            	"Fretless Bass",
         
     | 
| 
       245 
     | 
    
         
            -
            	"Slap Bass 1",
         
     | 
| 
       246 
     | 
    
         
            -
            	"Slap Bass 2",
         
     | 
| 
       247 
     | 
    
         
            -
            	"Synth Bass 1",
         
     | 
| 
       248 
     | 
    
         
            -
            	"Synth Bass 2",
         
     | 
| 
       249 
9 
     | 
    
         
             
              #--
         
     | 
| 
       250 
     | 
    
         
            -
              #  
     | 
| 
      
 10 
     | 
    
         
            +
              # Standard MIDI File meta event defs.
         
     | 
| 
       251 
11 
     | 
    
         
             
              #++
         
     | 
| 
       252 
     | 
    
         
            -
             
     | 
| 
       253 
     | 
    
         
            -
             
     | 
| 
       254 
     | 
    
         
            -
             
     | 
| 
       255 
     | 
    
         
            -
             
     | 
| 
       256 
     | 
    
         
            -
             
     | 
| 
       257 
     | 
    
         
            -
             
     | 
| 
       258 
     | 
    
         
            -
             
     | 
| 
       259 
     | 
    
         
            -
             
     | 
| 
       260 
     | 
    
         
            -
               
     | 
| 
       261 
     | 
    
         
            -
               
     | 
| 
       262 
     | 
    
         
            -
               
     | 
| 
       263 
     | 
    
         
            -
             
     | 
| 
       264 
     | 
    
         
            -
             
     | 
| 
       265 
     | 
    
         
            -
             
     | 
| 
       266 
     | 
    
         
            -
             
     | 
| 
       267 
     | 
    
         
            -
             
     | 
| 
       268 
     | 
    
         
            -
             
     | 
| 
       269 
     | 
    
         
            -
            	"Synth Voice",
         
     | 
| 
       270 
     | 
    
         
            -
            	"Orchestra Hit",
         
     | 
| 
       271 
     | 
    
         
            -
              #--
         
     | 
| 
       272 
     | 
    
         
            -
              # Brass
         
     | 
| 
       273 
     | 
    
         
            -
              #++
         
     | 
| 
       274 
     | 
    
         
            -
            	"Trumpet",
         
     | 
| 
       275 
     | 
    
         
            -
            	"Trombone",
         
     | 
| 
       276 
     | 
    
         
            -
            	"Tuba",
         
     | 
| 
       277 
     | 
    
         
            -
            	"Muted Trumpet",
         
     | 
| 
       278 
     | 
    
         
            -
            	"French Horn",
         
     | 
| 
       279 
     | 
    
         
            -
            	"Brass Section",
         
     | 
| 
       280 
     | 
    
         
            -
            	"SynthBrass 1",
         
     | 
| 
       281 
     | 
    
         
            -
            	"SynthBrass 2",
         
     | 
| 
       282 
     | 
    
         
            -
              #--
         
     | 
| 
       283 
     | 
    
         
            -
              # Reeds
         
     | 
| 
       284 
     | 
    
         
            -
              #++
         
     | 
| 
       285 
     | 
    
         
            -
            	"Soprano Sax",		# 64
         
     | 
| 
       286 
     | 
    
         
            -
            	"Alto Sax",
         
     | 
| 
       287 
     | 
    
         
            -
            	"Tenor Sax",
         
     | 
| 
       288 
     | 
    
         
            -
            	"Baritone Sax",
         
     | 
| 
       289 
     | 
    
         
            -
            	"Oboe",
         
     | 
| 
       290 
     | 
    
         
            -
            	"English Horn",
         
     | 
| 
       291 
     | 
    
         
            -
            	"Bassoon",
         
     | 
| 
       292 
     | 
    
         
            -
            	"Clarinet",
         
     | 
| 
       293 
     | 
    
         
            -
              #--
         
     | 
| 
       294 
     | 
    
         
            -
              # Pipes
         
     | 
| 
       295 
     | 
    
         
            -
              #++
         
     | 
| 
       296 
     | 
    
         
            -
            	"Piccolo",
         
     | 
| 
       297 
     | 
    
         
            -
            	"Flute",
         
     | 
| 
       298 
     | 
    
         
            -
            	"Recorder",
         
     | 
| 
       299 
     | 
    
         
            -
            	"Pan Flute",
         
     | 
| 
       300 
     | 
    
         
            -
            	"Blown Bottle",
         
     | 
| 
       301 
     | 
    
         
            -
            	"Shakuhachi",
         
     | 
| 
       302 
     | 
    
         
            -
            	"Whistle",
         
     | 
| 
       303 
     | 
    
         
            -
            	"Ocarina",
         
     | 
| 
       304 
     | 
    
         
            -
              #--
         
     | 
| 
       305 
     | 
    
         
            -
              # Synth Leads
         
     | 
| 
       306 
     | 
    
         
            -
              #++
         
     | 
| 
       307 
     | 
    
         
            -
            	"Lead 1 (square)",
         
     | 
| 
       308 
     | 
    
         
            -
            	"Lead 2 (sawtooth)",
         
     | 
| 
       309 
     | 
    
         
            -
            	"Lead 3 (calliope)",
         
     | 
| 
       310 
     | 
    
         
            -
            	"Lead 4 (chiff)",
         
     | 
| 
       311 
     | 
    
         
            -
            	"Lead 5 (charang)",
         
     | 
| 
       312 
     | 
    
         
            -
            	"Lead 6 (voice)",
         
     | 
| 
       313 
     | 
    
         
            -
            	"Lead 7 (fifths)",
         
     | 
| 
       314 
     | 
    
         
            -
            	"Lead 8 (bass + lead)",
         
     | 
| 
      
 12 
     | 
    
         
            +
              META_EVENT = 0xff
         
     | 
| 
      
 13 
     | 
    
         
            +
              META_SEQ_NUM = 0x00
         
     | 
| 
      
 14 
     | 
    
         
            +
              META_TEXT = 0x01
         
     | 
| 
      
 15 
     | 
    
         
            +
              META_COPYRIGHT = 0x02
         
     | 
| 
      
 16 
     | 
    
         
            +
              META_SEQ_NAME = 0x03
         
     | 
| 
      
 17 
     | 
    
         
            +
              META_INSTRUMENT = 0x04
         
     | 
| 
      
 18 
     | 
    
         
            +
              META_LYRIC = 0x05
         
     | 
| 
      
 19 
     | 
    
         
            +
              META_MARKER = 0x06
         
     | 
| 
      
 20 
     | 
    
         
            +
              META_CUE = 0x07
         
     | 
| 
      
 21 
     | 
    
         
            +
              META_MIDI_CHAN_PREFIX = 0x20
         
     | 
| 
      
 22 
     | 
    
         
            +
              META_TRACK_END = 0x2f
         
     | 
| 
      
 23 
     | 
    
         
            +
              META_SET_TEMPO = 0x51
         
     | 
| 
      
 24 
     | 
    
         
            +
              META_SMPTE = 0x54
         
     | 
| 
      
 25 
     | 
    
         
            +
              META_TIME_SIG = 0x58
         
     | 
| 
      
 26 
     | 
    
         
            +
              META_KEY_SIG = 0x59
         
     | 
| 
      
 27 
     | 
    
         
            +
              META_SEQ_SPECIF = 0x7f
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
       315 
29 
     | 
    
         
             
              #--
         
     | 
| 
       316 
     | 
    
         
            -
              #  
     | 
| 
      
 30 
     | 
    
         
            +
              # Channel messages
         
     | 
| 
       317 
31 
     | 
    
         
             
              #++
         
     | 
| 
       318 
     | 
    
         
            -
             
     | 
| 
       319 
     | 
    
         
            -
             
     | 
| 
       320 
     | 
    
         
            -
             
     | 
| 
       321 
     | 
    
         
            -
             
     | 
| 
       322 
     | 
    
         
            -
             
     | 
| 
       323 
     | 
    
         
            -
             
     | 
| 
       324 
     | 
    
         
            -
             
     | 
| 
       325 
     | 
    
         
            -
             
     | 
| 
      
 32 
     | 
    
         
            +
              # Note, val
         
     | 
| 
      
 33 
     | 
    
         
            +
              NOTE_OFF = 0x80
         
     | 
| 
      
 34 
     | 
    
         
            +
              # Note, val
         
     | 
| 
      
 35 
     | 
    
         
            +
              NOTE_ON = 0x90
         
     | 
| 
      
 36 
     | 
    
         
            +
              # Note, val
         
     | 
| 
      
 37 
     | 
    
         
            +
              POLY_PRESSURE = 0xA0
         
     | 
| 
      
 38 
     | 
    
         
            +
              # Controller #, val
         
     | 
| 
      
 39 
     | 
    
         
            +
              CONTROLLER = 0xB0
         
     | 
| 
      
 40 
     | 
    
         
            +
              # Program number
         
     | 
| 
      
 41 
     | 
    
         
            +
              PROGRAM_CHANGE = 0xC0
         
     | 
| 
      
 42 
     | 
    
         
            +
              # Channel pressure
         
     | 
| 
      
 43 
     | 
    
         
            +
              CHANNEL_PRESSURE = 0xD0
         
     | 
| 
      
 44 
     | 
    
         
            +
              # LSB, MSB
         
     | 
| 
      
 45 
     | 
    
         
            +
              PITCH_BEND = 0xE0
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
       326 
47 
     | 
    
         
             
              #--
         
     | 
| 
       327 
     | 
    
         
            -
              #  
     | 
| 
      
 48 
     | 
    
         
            +
              # System common messages
         
     | 
| 
       328 
49 
     | 
    
         
             
              #++
         
     | 
| 
       329 
     | 
    
         
            -
             
     | 
| 
       330 
     | 
    
         
            -
             
     | 
| 
       331 
     | 
    
         
            -
             
     | 
| 
       332 
     | 
    
         
            -
             
     | 
| 
       333 
     | 
    
         
            -
             
     | 
| 
       334 
     | 
    
         
            -
             
     | 
| 
       335 
     | 
    
         
            -
             
     | 
| 
       336 
     | 
    
         
            -
             
     | 
| 
      
 50 
     | 
    
         
            +
              # System exclusive start
         
     | 
| 
      
 51 
     | 
    
         
            +
              SYSEX = 0xF0
         
     | 
| 
      
 52 
     | 
    
         
            +
              # Beats from top: LSB/MSB 6 ticks = 1 beat
         
     | 
| 
      
 53 
     | 
    
         
            +
              SONG_POINTER = 0xF2
         
     | 
| 
      
 54 
     | 
    
         
            +
              # Val = number of song
         
     | 
| 
      
 55 
     | 
    
         
            +
              SONG_SELECT = 0xF3
         
     | 
| 
      
 56 
     | 
    
         
            +
              # Tune request
         
     | 
| 
      
 57 
     | 
    
         
            +
              TUNE_REQUEST = 0xF6
         
     | 
| 
      
 58 
     | 
    
         
            +
              # End of system exclusive
         
     | 
| 
      
 59 
     | 
    
         
            +
              EOX = 0xF7
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
       337 
61 
     | 
    
         
             
              #--
         
     | 
| 
       338 
     | 
    
         
            -
              #  
     | 
| 
      
 62 
     | 
    
         
            +
              # System realtime messages
         
     | 
| 
       339 
63 
     | 
    
         
             
              #++
         
     | 
| 
       340 
     | 
    
         
            -
             
     | 
| 
       341 
     | 
    
         
            -
             
     | 
| 
       342 
     | 
    
         
            -
             
     | 
| 
       343 
     | 
    
         
            -
             
     | 
| 
       344 
     | 
    
         
            -
             
     | 
| 
       345 
     | 
    
         
            -
             
     | 
| 
       346 
     | 
    
         
            -
             
     | 
| 
       347 
     | 
    
         
            -
             
     | 
| 
      
 64 
     | 
    
         
            +
              # MIDI clock (24 per quarter note)
         
     | 
| 
      
 65 
     | 
    
         
            +
              CLOCK = 0xF8
         
     | 
| 
      
 66 
     | 
    
         
            +
              # Sequence start
         
     | 
| 
      
 67 
     | 
    
         
            +
              START = 0xFA
         
     | 
| 
      
 68 
     | 
    
         
            +
              # Sequence continue
         
     | 
| 
      
 69 
     | 
    
         
            +
              CONTINUE = 0xFB
         
     | 
| 
      
 70 
     | 
    
         
            +
              # Sequence stop
         
     | 
| 
      
 71 
     | 
    
         
            +
              STOP = 0xFC
         
     | 
| 
      
 72 
     | 
    
         
            +
              # Active sensing (sent every 300 ms when nothing else being sent)
         
     | 
| 
      
 73 
     | 
    
         
            +
              ACTIVE_SENSE = 0xFE
         
     | 
| 
      
 74 
     | 
    
         
            +
              # System reset
         
     | 
| 
      
 75 
     | 
    
         
            +
              SYSTEM_RESET = 0xFF
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
              # Controller numbers
         
     | 
| 
      
 78 
     | 
    
         
            +
              # = 0 - 31 = continuous, LSB
         
     | 
| 
      
 79 
     | 
    
         
            +
              # = 32 - 63 = continuous, MSB
         
     | 
| 
      
 80 
     | 
    
         
            +
              # = 64 - 97 = switches
         
     | 
| 
      
 81 
     | 
    
         
            +
              CC_MOD_WHEEL = 1
         
     | 
| 
      
 82 
     | 
    
         
            +
              CC_BREATH_CONTROLLER = 2
         
     | 
| 
      
 83 
     | 
    
         
            +
              CC_FOOT_CONTROLLER = 4
         
     | 
| 
      
 84 
     | 
    
         
            +
              CC_PORTAMENTO_TIME = 5
         
     | 
| 
      
 85 
     | 
    
         
            +
              CC_DATA_ENTRY_MSB = 6
         
     | 
| 
      
 86 
     | 
    
         
            +
              CC_VOLUME = 7
         
     | 
| 
      
 87 
     | 
    
         
            +
              CC_BALANCE = 8
         
     | 
| 
      
 88 
     | 
    
         
            +
              CC_PAN = 10
         
     | 
| 
      
 89 
     | 
    
         
            +
              CC_EXPRESSION_CONTROLLER = 11
         
     | 
| 
      
 90 
     | 
    
         
            +
              CC_GEN_PURPOSE_1 = 16
         
     | 
| 
      
 91 
     | 
    
         
            +
              CC_GEN_PURPOSE_2 = 17
         
     | 
| 
      
 92 
     | 
    
         
            +
              CC_GEN_PURPOSE_3 = 18
         
     | 
| 
      
 93 
     | 
    
         
            +
              CC_GEN_PURPOSE_4 = 19
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
              # [32 - 63] are LSB for [0 - 31]
         
     | 
| 
      
 96 
     | 
    
         
            +
              CC_DATA_ENTRY_LSB = 38
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
       348 
98 
     | 
    
         
             
              #--
         
     | 
| 
       349 
     | 
    
         
            -
              #  
     | 
| 
      
 99 
     | 
    
         
            +
              # Momentaries:
         
     | 
| 
       350 
100 
     | 
    
         
             
              #++
         
     | 
| 
       351 
     | 
    
         
            -
             
     | 
| 
       352 
     | 
    
         
            -
             
     | 
| 
       353 
     | 
    
         
            -
             
     | 
| 
       354 
     | 
    
         
            -
             
     | 
| 
       355 
     | 
    
         
            -
             
     | 
| 
       356 
     | 
    
         
            -
             
     | 
| 
       357 
     | 
    
         
            -
             
     | 
| 
       358 
     | 
    
         
            -
             
     | 
| 
      
 101 
     | 
    
         
            +
              CC_SUSTAIN = 64
         
     | 
| 
      
 102 
     | 
    
         
            +
              CC_PORTAMENTO = 65
         
     | 
| 
      
 103 
     | 
    
         
            +
              CC_SUSTENUTO = 66
         
     | 
| 
      
 104 
     | 
    
         
            +
              CC_SOFT_PEDAL = 67
         
     | 
| 
      
 105 
     | 
    
         
            +
              CC_HOLD_2 = 69
         
     | 
| 
      
 106 
     | 
    
         
            +
              CC_GEN_PURPOSE_5 = 50
         
     | 
| 
      
 107 
     | 
    
         
            +
              CC_GEN_PURPOSE_6 = 51
         
     | 
| 
      
 108 
     | 
    
         
            +
              CC_GEN_PURPOSE_7 = 52
         
     | 
| 
      
 109 
     | 
    
         
            +
              CC_GEN_PURPOSE_8 = 53
         
     | 
| 
      
 110 
     | 
    
         
            +
              CC_TREMELO_DEPTH = 92
         
     | 
| 
      
 111 
     | 
    
         
            +
              CC_CHORUS_DEPTH = 93
         
     | 
| 
      
 112 
     | 
    
         
            +
              CC_DETUNE_DEPTH = 94
         
     | 
| 
      
 113 
     | 
    
         
            +
              CC_PHASER_DEPTH = 95
         
     | 
| 
      
 114 
     | 
    
         
            +
              CC_DATA_INCREMENT = 96
         
     | 
| 
      
 115 
     | 
    
         
            +
              CC_DATA_DECREMENT = 97
         
     | 
| 
      
 116 
     | 
    
         
            +
              CC_NREG_PARAM_LSB = 98
         
     | 
| 
      
 117 
     | 
    
         
            +
              CC_NREG_PARAM_MSB = 99
         
     | 
| 
      
 118 
     | 
    
         
            +
              CC_REG_PARAM_LSB = 100
         
     | 
| 
      
 119 
     | 
    
         
            +
              CC_REG_PARAM_MSB = 101
         
     | 
| 
      
 120 
     | 
    
         
            +
             
     | 
| 
       359 
121 
     | 
    
         
             
              #--
         
     | 
| 
       360 
     | 
    
         
            -
              #  
     | 
| 
      
 122 
     | 
    
         
            +
              # Channel mode message values
         
     | 
| 
       361 
123 
     | 
    
         
             
              #++
         
     | 
| 
       362 
     | 
    
         
            -
             
     | 
| 
       363 
     | 
    
         
            -
             
     | 
| 
       364 
     | 
    
         
            -
             
     | 
| 
       365 
     | 
    
         
            -
             
     | 
| 
       366 
     | 
    
         
            -
             
     | 
| 
       367 
     | 
    
         
            -
             
     | 
| 
       368 
     | 
    
         
            -
             
     | 
| 
       369 
     | 
    
         
            -
             
     | 
| 
       370 
     | 
    
         
            -
             
     | 
| 
      
 124 
     | 
    
         
            +
              # Val 0 == off, 0x7f == on
         
     | 
| 
      
 125 
     | 
    
         
            +
              CM_LOCAL_CONTROL = 0x7A
         
     | 
| 
      
 126 
     | 
    
         
            +
              CM_ALL_NOTES_OFF = 0x7B # Val must be 0
         
     | 
| 
      
 127 
     | 
    
         
            +
              CM_OMNI_MODE_OFF = 0x7C # Val must be 0
         
     | 
| 
      
 128 
     | 
    
         
            +
              CM_OMNI_MODE_ON = 0x7D  # Val must be 0
         
     | 
| 
      
 129 
     | 
    
         
            +
              CM_MONO_MODE_ON = 0x7E  # Val = # chans
         
     | 
| 
      
 130 
     | 
    
         
            +
              CM_POLY_MODE_ON = 0x7F  # Val must be 0
         
     | 
| 
      
 131 
     | 
    
         
            +
             
     | 
| 
      
 132 
     | 
    
         
            +
              # Controller names
         
     | 
| 
      
 133 
     | 
    
         
            +
              CONTROLLER_NAMES = [
         
     | 
| 
      
 134 
     | 
    
         
            +
                "0",
         
     | 
| 
      
 135 
     | 
    
         
            +
                "Modulation",
         
     | 
| 
      
 136 
     | 
    
         
            +
                "Breath Control",
         
     | 
| 
      
 137 
     | 
    
         
            +
                "3",
         
     | 
| 
      
 138 
     | 
    
         
            +
                "Foot Controller",
         
     | 
| 
      
 139 
     | 
    
         
            +
                "Portamento Time",
         
     | 
| 
      
 140 
     | 
    
         
            +
                "Data Entry",
         
     | 
| 
      
 141 
     | 
    
         
            +
                "Volume",
         
     | 
| 
      
 142 
     | 
    
         
            +
                "Balance",
         
     | 
| 
      
 143 
     | 
    
         
            +
                "9",
         
     | 
| 
      
 144 
     | 
    
         
            +
                "Pan",
         
     | 
| 
      
 145 
     | 
    
         
            +
                "Expression Control",
         
     | 
| 
      
 146 
     | 
    
         
            +
                "12", "13", "14", "15",
         
     | 
| 
      
 147 
     | 
    
         
            +
                "General Controller 1",
         
     | 
| 
      
 148 
     | 
    
         
            +
                "General Controller 2",
         
     | 
| 
      
 149 
     | 
    
         
            +
                "General Controller 3",
         
     | 
| 
      
 150 
     | 
    
         
            +
                "General Controller 4",
         
     | 
| 
      
 151 
     | 
    
         
            +
                "20", "21", "22", "23", "24", "25", "26", "27", "28", "29",
         
     | 
| 
      
 152 
     | 
    
         
            +
                "30", "31",
         
     | 
| 
      
 153 
     | 
    
         
            +
                "32", "33", "34", "35", "36", "37", "38", "39", "40", "41",
         
     | 
| 
      
 154 
     | 
    
         
            +
                "42", "43", "44", "45", "46", "47", "48", "49", "50", "51",
         
     | 
| 
      
 155 
     | 
    
         
            +
                "52", "53", "54", "55", "56", "57", "58", "59", "60", "61",
         
     | 
| 
      
 156 
     | 
    
         
            +
                "62", "63",
         
     | 
| 
      
 157 
     | 
    
         
            +
                "Sustain Pedal",
         
     | 
| 
      
 158 
     | 
    
         
            +
                "Portamento",
         
     | 
| 
      
 159 
     | 
    
         
            +
                "Sostenuto",
         
     | 
| 
      
 160 
     | 
    
         
            +
                "Soft Pedal",
         
     | 
| 
      
 161 
     | 
    
         
            +
                "68",
         
     | 
| 
      
 162 
     | 
    
         
            +
                "Hold 2",
         
     | 
| 
      
 163 
     | 
    
         
            +
                "70", "71", "72", "73", "74", "75", "76", "77", "78", "79",
         
     | 
| 
      
 164 
     | 
    
         
            +
                "General Controller 5",
         
     | 
| 
      
 165 
     | 
    
         
            +
                "Tempo Change",
         
     | 
| 
      
 166 
     | 
    
         
            +
                "General Controller 7",
         
     | 
| 
      
 167 
     | 
    
         
            +
                "General Controller 8",
         
     | 
| 
      
 168 
     | 
    
         
            +
                "84", "85", "86", "87", "88", "89", "90",
         
     | 
| 
      
 169 
     | 
    
         
            +
                "External Effects Depth",
         
     | 
| 
      
 170 
     | 
    
         
            +
                "Tremolo Depth",
         
     | 
| 
      
 171 
     | 
    
         
            +
                "Chorus Depth",
         
     | 
| 
      
 172 
     | 
    
         
            +
                "Detune (Celeste) Depth",
         
     | 
| 
      
 173 
     | 
    
         
            +
                "Phaser Depth",
         
     | 
| 
      
 174 
     | 
    
         
            +
                "Data Increment",
         
     | 
| 
      
 175 
     | 
    
         
            +
                "Data Decrement",
         
     | 
| 
      
 176 
     | 
    
         
            +
                "Non-Registered Param LSB",
         
     | 
| 
      
 177 
     | 
    
         
            +
                "Non-Registered Param MSB",
         
     | 
| 
      
 178 
     | 
    
         
            +
                "Registered Param LSB",
         
     | 
| 
      
 179 
     | 
    
         
            +
                "Registered Param MSB",
         
     | 
| 
      
 180 
     | 
    
         
            +
                "102", "103", "104", "105", "106", "107", "108", "109",
         
     | 
| 
      
 181 
     | 
    
         
            +
                "110", "111", "112", "113", "114", "115", "116", "117",
         
     | 
| 
      
 182 
     | 
    
         
            +
                "118", "119", "120",
         
     | 
| 
      
 183 
     | 
    
         
            +
                "Reset All Controllers",
         
     | 
| 
      
 184 
     | 
    
         
            +
                "Local Control",
         
     | 
| 
      
 185 
     | 
    
         
            +
                "All Notes Off",
         
     | 
| 
      
 186 
     | 
    
         
            +
                "Omni Mode Off",
         
     | 
| 
      
 187 
     | 
    
         
            +
                "Omni Mode On",
         
     | 
| 
      
 188 
     | 
    
         
            +
                "Mono Mode On",
         
     | 
| 
      
 189 
     | 
    
         
            +
                "Poly Mode On"
         
     | 
| 
      
 190 
     | 
    
         
            +
              ]
         
     | 
| 
      
 191 
     | 
    
         
            +
             
     | 
| 
      
 192 
     | 
    
         
            +
              # General MIDI patch names
         
     | 
| 
      
 193 
     | 
    
         
            +
              GM_PATCH_NAMES = [
         
     | 
| 
      
 194 
     | 
    
         
            +
                #--
         
     | 
| 
      
 195 
     | 
    
         
            +
                # Pianos
         
     | 
| 
      
 196 
     | 
    
         
            +
                #++
         
     | 
| 
      
 197 
     | 
    
         
            +
                "Acoustic Grand Piano",
         
     | 
| 
      
 198 
     | 
    
         
            +
                "Bright Acoustic Piano",
         
     | 
| 
      
 199 
     | 
    
         
            +
                "Electric Grand Piano",
         
     | 
| 
      
 200 
     | 
    
         
            +
                "Honky-tonk Piano",
         
     | 
| 
      
 201 
     | 
    
         
            +
                "Electric Piano 1",
         
     | 
| 
      
 202 
     | 
    
         
            +
                "Electric Piano 2",
         
     | 
| 
      
 203 
     | 
    
         
            +
                "Harpsichord",
         
     | 
| 
      
 204 
     | 
    
         
            +
                "Clavichord",
         
     | 
| 
      
 205 
     | 
    
         
            +
                #--
         
     | 
| 
      
 206 
     | 
    
         
            +
                # Tuned Idiophones
         
     | 
| 
      
 207 
     | 
    
         
            +
                #++
         
     | 
| 
      
 208 
     | 
    
         
            +
                "Celesta",
         
     | 
| 
      
 209 
     | 
    
         
            +
                "Glockenspiel",
         
     | 
| 
      
 210 
     | 
    
         
            +
                "Music Box",
         
     | 
| 
      
 211 
     | 
    
         
            +
                "Vibraphone",
         
     | 
| 
      
 212 
     | 
    
         
            +
                "Marimba",
         
     | 
| 
      
 213 
     | 
    
         
            +
                "Xylophone",
         
     | 
| 
      
 214 
     | 
    
         
            +
                "Tubular Bells",
         
     | 
| 
      
 215 
     | 
    
         
            +
                "Dulcimer",
         
     | 
| 
      
 216 
     | 
    
         
            +
                #--
         
     | 
| 
      
 217 
     | 
    
         
            +
                # Organs
         
     | 
| 
      
 218 
     | 
    
         
            +
                #++
         
     | 
| 
      
 219 
     | 
    
         
            +
                "Drawbar Organ",
         
     | 
| 
      
 220 
     | 
    
         
            +
                "Percussive Organ",
         
     | 
| 
      
 221 
     | 
    
         
            +
                "Rock Organ",
         
     | 
| 
      
 222 
     | 
    
         
            +
                "Church Organ",
         
     | 
| 
      
 223 
     | 
    
         
            +
                "Reed Organ",
         
     | 
| 
      
 224 
     | 
    
         
            +
                "Accordion",
         
     | 
| 
      
 225 
     | 
    
         
            +
                "Harmonica",
         
     | 
| 
      
 226 
     | 
    
         
            +
                "Tango Accordion",
         
     | 
| 
      
 227 
     | 
    
         
            +
                #--
         
     | 
| 
      
 228 
     | 
    
         
            +
                # Guitars
         
     | 
| 
      
 229 
     | 
    
         
            +
                #++
         
     | 
| 
      
 230 
     | 
    
         
            +
                "Acoustic Guitar (nylon)",
         
     | 
| 
      
 231 
     | 
    
         
            +
                "Acoustic Guitar (steel)",
         
     | 
| 
      
 232 
     | 
    
         
            +
                "Electric Guitar (jazz)",
         
     | 
| 
      
 233 
     | 
    
         
            +
                "Electric Guitar (clean)",
         
     | 
| 
      
 234 
     | 
    
         
            +
                "Electric Guitar (muted)",
         
     | 
| 
      
 235 
     | 
    
         
            +
                "Overdriven Guitar",
         
     | 
| 
      
 236 
     | 
    
         
            +
                "Distortion Guitar",
         
     | 
| 
      
 237 
     | 
    
         
            +
                "Guitar harmonics",
         
     | 
| 
      
 238 
     | 
    
         
            +
                #--
         
     | 
| 
      
 239 
     | 
    
         
            +
                # Basses
         
     | 
| 
      
 240 
     | 
    
         
            +
                #++
         
     | 
| 
      
 241 
     | 
    
         
            +
                "Acoustic Bass",
         
     | 
| 
      
 242 
     | 
    
         
            +
                "Electric Bass (finger)",
         
     | 
| 
      
 243 
     | 
    
         
            +
                "Electric Bass (pick)",
         
     | 
| 
      
 244 
     | 
    
         
            +
                "Fretless Bass",
         
     | 
| 
      
 245 
     | 
    
         
            +
                "Slap Bass 1",
         
     | 
| 
      
 246 
     | 
    
         
            +
                "Slap Bass 2",
         
     | 
| 
      
 247 
     | 
    
         
            +
                "Synth Bass 1",
         
     | 
| 
      
 248 
     | 
    
         
            +
                "Synth Bass 2",
         
     | 
| 
      
 249 
     | 
    
         
            +
                #--
         
     | 
| 
      
 250 
     | 
    
         
            +
                # Strings
         
     | 
| 
      
 251 
     | 
    
         
            +
                #++
         
     | 
| 
      
 252 
     | 
    
         
            +
                "Violin",
         
     | 
| 
      
 253 
     | 
    
         
            +
                "Viola",
         
     | 
| 
      
 254 
     | 
    
         
            +
                "Cello",
         
     | 
| 
      
 255 
     | 
    
         
            +
                "Contrabass",
         
     | 
| 
      
 256 
     | 
    
         
            +
                "Tremolo Strings",
         
     | 
| 
      
 257 
     | 
    
         
            +
                "Pizzicato Strings",
         
     | 
| 
      
 258 
     | 
    
         
            +
                "Orchestral Harp",
         
     | 
| 
      
 259 
     | 
    
         
            +
                "Timpani",
         
     | 
| 
      
 260 
     | 
    
         
            +
                #--
         
     | 
| 
      
 261 
     | 
    
         
            +
                # Ensemble strings and voices
         
     | 
| 
      
 262 
     | 
    
         
            +
                #++
         
     | 
| 
      
 263 
     | 
    
         
            +
                "String Ensemble 1",
         
     | 
| 
      
 264 
     | 
    
         
            +
                "String Ensemble 2",
         
     | 
| 
      
 265 
     | 
    
         
            +
                "SynthStrings 1",
         
     | 
| 
      
 266 
     | 
    
         
            +
                "SynthStrings 2",
         
     | 
| 
      
 267 
     | 
    
         
            +
                "Choir Aahs",
         
     | 
| 
      
 268 
     | 
    
         
            +
                "Voice Oohs",
         
     | 
| 
      
 269 
     | 
    
         
            +
                "Synth Voice",
         
     | 
| 
      
 270 
     | 
    
         
            +
                "Orchestra Hit",
         
     | 
| 
      
 271 
     | 
    
         
            +
                #--
         
     | 
| 
      
 272 
     | 
    
         
            +
                # Brass
         
     | 
| 
      
 273 
     | 
    
         
            +
                #++
         
     | 
| 
      
 274 
     | 
    
         
            +
                "Trumpet",
         
     | 
| 
      
 275 
     | 
    
         
            +
                "Trombone",
         
     | 
| 
      
 276 
     | 
    
         
            +
                "Tuba",
         
     | 
| 
      
 277 
     | 
    
         
            +
                "Muted Trumpet",
         
     | 
| 
      
 278 
     | 
    
         
            +
                "French Horn",
         
     | 
| 
      
 279 
     | 
    
         
            +
                "Brass Section",
         
     | 
| 
      
 280 
     | 
    
         
            +
                "SynthBrass 1",
         
     | 
| 
      
 281 
     | 
    
         
            +
                "SynthBrass 2",
         
     | 
| 
      
 282 
     | 
    
         
            +
                #--
         
     | 
| 
      
 283 
     | 
    
         
            +
                # Reeds
         
     | 
| 
      
 284 
     | 
    
         
            +
                #++
         
     | 
| 
      
 285 
     | 
    
         
            +
                "Soprano Sax",		# 64
         
     | 
| 
      
 286 
     | 
    
         
            +
                "Alto Sax",
         
     | 
| 
      
 287 
     | 
    
         
            +
                "Tenor Sax",
         
     | 
| 
      
 288 
     | 
    
         
            +
                "Baritone Sax",
         
     | 
| 
      
 289 
     | 
    
         
            +
                "Oboe",
         
     | 
| 
      
 290 
     | 
    
         
            +
                "English Horn",
         
     | 
| 
      
 291 
     | 
    
         
            +
                "Bassoon",
         
     | 
| 
      
 292 
     | 
    
         
            +
                "Clarinet",
         
     | 
| 
      
 293 
     | 
    
         
            +
                #--
         
     | 
| 
      
 294 
     | 
    
         
            +
                # Pipes
         
     | 
| 
      
 295 
     | 
    
         
            +
                #++
         
     | 
| 
      
 296 
     | 
    
         
            +
                "Piccolo",
         
     | 
| 
      
 297 
     | 
    
         
            +
                "Flute",
         
     | 
| 
      
 298 
     | 
    
         
            +
                "Recorder",
         
     | 
| 
      
 299 
     | 
    
         
            +
                "Pan Flute",
         
     | 
| 
      
 300 
     | 
    
         
            +
                "Blown Bottle",
         
     | 
| 
      
 301 
     | 
    
         
            +
                "Shakuhachi",
         
     | 
| 
      
 302 
     | 
    
         
            +
                "Whistle",
         
     | 
| 
      
 303 
     | 
    
         
            +
                "Ocarina",
         
     | 
| 
      
 304 
     | 
    
         
            +
                #--
         
     | 
| 
      
 305 
     | 
    
         
            +
                # Synth Leads
         
     | 
| 
      
 306 
     | 
    
         
            +
                #++
         
     | 
| 
      
 307 
     | 
    
         
            +
                "Lead 1 (square)",
         
     | 
| 
      
 308 
     | 
    
         
            +
                "Lead 2 (sawtooth)",
         
     | 
| 
      
 309 
     | 
    
         
            +
                "Lead 3 (calliope)",
         
     | 
| 
      
 310 
     | 
    
         
            +
                "Lead 4 (chiff)",
         
     | 
| 
      
 311 
     | 
    
         
            +
                "Lead 5 (charang)",
         
     | 
| 
      
 312 
     | 
    
         
            +
                "Lead 6 (voice)",
         
     | 
| 
      
 313 
     | 
    
         
            +
                "Lead 7 (fifths)",
         
     | 
| 
      
 314 
     | 
    
         
            +
                "Lead 8 (bass + lead)",
         
     | 
| 
      
 315 
     | 
    
         
            +
                #--
         
     | 
| 
      
 316 
     | 
    
         
            +
                # Synth Pads
         
     | 
| 
      
 317 
     | 
    
         
            +
                #++
         
     | 
| 
      
 318 
     | 
    
         
            +
                "Pad 1 (new age)",
         
     | 
| 
      
 319 
     | 
    
         
            +
                "Pad 2 (warm)",
         
     | 
| 
      
 320 
     | 
    
         
            +
                "Pad 3 (polysynth)",
         
     | 
| 
      
 321 
     | 
    
         
            +
                "Pad 4 (choir)",
         
     | 
| 
      
 322 
     | 
    
         
            +
                "Pad 5 (bowed)",
         
     | 
| 
      
 323 
     | 
    
         
            +
                "Pad 6 (metallic)",
         
     | 
| 
      
 324 
     | 
    
         
            +
                "Pad 7 (halo)",
         
     | 
| 
      
 325 
     | 
    
         
            +
                "Pad 8 (sweep)",
         
     | 
| 
      
 326 
     | 
    
         
            +
                #--
         
     | 
| 
      
 327 
     | 
    
         
            +
                # Effects
         
     | 
| 
      
 328 
     | 
    
         
            +
                #++
         
     | 
| 
      
 329 
     | 
    
         
            +
                "FX 1 (rain)",
         
     | 
| 
      
 330 
     | 
    
         
            +
                "FX 2 (soundtrack)",
         
     | 
| 
      
 331 
     | 
    
         
            +
                "FX 3 (crystal)",
         
     | 
| 
      
 332 
     | 
    
         
            +
                "FX 4 (atmosphere)",
         
     | 
| 
      
 333 
     | 
    
         
            +
                "FX 5 (brightness)",
         
     | 
| 
      
 334 
     | 
    
         
            +
                "FX 6 (goblins)",
         
     | 
| 
      
 335 
     | 
    
         
            +
                "FX 7 (echoes)",
         
     | 
| 
      
 336 
     | 
    
         
            +
                "FX 8 (sci-fi)",
         
     | 
| 
      
 337 
     | 
    
         
            +
                #--
         
     | 
| 
      
 338 
     | 
    
         
            +
                # Ethnic
         
     | 
| 
      
 339 
     | 
    
         
            +
                #++
         
     | 
| 
      
 340 
     | 
    
         
            +
                "Sitar",
         
     | 
| 
      
 341 
     | 
    
         
            +
                "Banjo",
         
     | 
| 
      
 342 
     | 
    
         
            +
                "Shamisen",
         
     | 
| 
      
 343 
     | 
    
         
            +
                "Koto",
         
     | 
| 
      
 344 
     | 
    
         
            +
                "Kalimba",
         
     | 
| 
      
 345 
     | 
    
         
            +
                "Bag pipe",
         
     | 
| 
      
 346 
     | 
    
         
            +
                "Fiddle",
         
     | 
| 
      
 347 
     | 
    
         
            +
                "Shanai",
         
     | 
| 
      
 348 
     | 
    
         
            +
                #--
         
     | 
| 
      
 349 
     | 
    
         
            +
                # Percussion
         
     | 
| 
      
 350 
     | 
    
         
            +
                #++
         
     | 
| 
      
 351 
     | 
    
         
            +
                "Tinkle Bell",
         
     | 
| 
      
 352 
     | 
    
         
            +
                "Agogo",
         
     | 
| 
      
 353 
     | 
    
         
            +
                "Steel Drums",
         
     | 
| 
      
 354 
     | 
    
         
            +
                "Woodblock",
         
     | 
| 
      
 355 
     | 
    
         
            +
                "Taiko Drum",
         
     | 
| 
      
 356 
     | 
    
         
            +
                "Melodic Tom",
         
     | 
| 
      
 357 
     | 
    
         
            +
                "Synth Drum",
         
     | 
| 
      
 358 
     | 
    
         
            +
                "Reverse Cymbal",
         
     | 
| 
      
 359 
     | 
    
         
            +
                #--
         
     | 
| 
      
 360 
     | 
    
         
            +
                # Sound Effects
         
     | 
| 
      
 361 
     | 
    
         
            +
                #++
         
     | 
| 
      
 362 
     | 
    
         
            +
                "Guitar Fret Noise",
         
     | 
| 
      
 363 
     | 
    
         
            +
                "Breath Noise",
         
     | 
| 
      
 364 
     | 
    
         
            +
                "Seashore",
         
     | 
| 
      
 365 
     | 
    
         
            +
                "Bird Tweet",
         
     | 
| 
      
 366 
     | 
    
         
            +
                "Telephone Ring",
         
     | 
| 
      
 367 
     | 
    
         
            +
                "Helicopter",
         
     | 
| 
      
 368 
     | 
    
         
            +
                "Applause",
         
     | 
| 
      
 369 
     | 
    
         
            +
                "Gunshot"
         
     | 
| 
      
 370 
     | 
    
         
            +
              ]
         
     | 
| 
       371 
371 
     | 
    
         | 
| 
       372 
     | 
    
         
            -
            # GM drum notes start at 35 (C), so subtrack GM_DRUM_NOTE_LOWEST from your
         
     | 
| 
       373 
     | 
    
         
            -
            # note number before using this array.
         
     | 
| 
       374 
     | 
    
         
            -
             
     | 
| 
       375 
     | 
    
         
            -
            # General MIDI drum channel note names.
         
     | 
| 
       376 
     | 
    
         
            -
             
     | 
| 
       377 
     | 
    
         
            -
             
     | 
| 
       378 
     | 
    
         
            -
             
     | 
| 
       379 
     | 
    
         
            -
             
     | 
| 
       380 
     | 
    
         
            -
             
     | 
| 
       381 
     | 
    
         
            -
             
     | 
| 
       382 
     | 
    
         
            -
             
     | 
| 
       383 
     | 
    
         
            -
             
     | 
| 
       384 
     | 
    
         
            -
             
     | 
| 
       385 
     | 
    
         
            -
             
     | 
| 
       386 
     | 
    
         
            -
             
     | 
| 
       387 
     | 
    
         
            -
             
     | 
| 
       388 
     | 
    
         
            -
             
     | 
| 
       389 
     | 
    
         
            -
             
     | 
| 
       390 
     | 
    
         
            -
             
     | 
| 
       391 
     | 
    
         
            -
             
     | 
| 
       392 
     | 
    
         
            -
             
     | 
| 
       393 
     | 
    
         
            -
             
     | 
| 
       394 
     | 
    
         
            -
             
     | 
| 
       395 
     | 
    
         
            -
             
     | 
| 
       396 
     | 
    
         
            -
             
     | 
| 
       397 
     | 
    
         
            -
             
     | 
| 
       398 
     | 
    
         
            -
             
     | 
| 
       399 
     | 
    
         
            -
             
     | 
| 
       400 
     | 
    
         
            -
             
     | 
| 
       401 
     | 
    
         
            -
             
     | 
| 
       402 
     | 
    
         
            -
             
     | 
| 
       403 
     | 
    
         
            -
             
     | 
| 
       404 
     | 
    
         
            -
             
     | 
| 
       405 
     | 
    
         
            -
             
     | 
| 
       406 
     | 
    
         
            -
             
     | 
| 
       407 
     | 
    
         
            -
             
     | 
| 
       408 
     | 
    
         
            -
             
     | 
| 
       409 
     | 
    
         
            -
             
     | 
| 
       410 
     | 
    
         
            -
             
     | 
| 
       411 
     | 
    
         
            -
             
     | 
| 
       412 
     | 
    
         
            -
             
     | 
| 
       413 
     | 
    
         
            -
             
     | 
| 
       414 
     | 
    
         
            -
             
     | 
| 
       415 
     | 
    
         
            -
             
     | 
| 
       416 
     | 
    
         
            -
             
     | 
| 
       417 
     | 
    
         
            -
             
     | 
| 
       418 
     | 
    
         
            -
             
     | 
| 
       419 
     | 
    
         
            -
             
     | 
| 
       420 
     | 
    
         
            -
             
     | 
| 
       421 
     | 
    
         
            -
             
     | 
| 
       422 
     | 
    
         
            -
             
     | 
| 
       423 
     | 
    
         
            -
             
     | 
| 
       424 
     | 
    
         
            -
             
     | 
| 
      
 372 
     | 
    
         
            +
              # GM drum notes start at 35 (C), so subtrack GM_DRUM_NOTE_LOWEST from your
         
     | 
| 
      
 373 
     | 
    
         
            +
              # note number before using this array.
         
     | 
| 
      
 374 
     | 
    
         
            +
              GM_DRUM_NOTE_LOWEST = 35
         
     | 
| 
      
 375 
     | 
    
         
            +
              # General MIDI drum channel note names.
         
     | 
| 
      
 376 
     | 
    
         
            +
              GM_DRUM_NOTE_NAMES = [
         
     | 
| 
      
 377 
     | 
    
         
            +
                "Acoustic Bass Drum",	# 35, C
         
     | 
| 
      
 378 
     | 
    
         
            +
                "Bass Drum 1",		# 36, C#
         
     | 
| 
      
 379 
     | 
    
         
            +
                "Side Stick",		# 37, D
         
     | 
| 
      
 380 
     | 
    
         
            +
                "Acoustic Snare",           # 38, D#
         
     | 
| 
      
 381 
     | 
    
         
            +
                "Hand Clap",		# 39, E
         
     | 
| 
      
 382 
     | 
    
         
            +
                "Electric Snare",           # 40, F
         
     | 
| 
      
 383 
     | 
    
         
            +
                "Low Floor Tom",            # 41, F#
         
     | 
| 
      
 384 
     | 
    
         
            +
                "Closed Hi Hat",            # 42, G
         
     | 
| 
      
 385 
     | 
    
         
            +
                "High Floor Tom",           # 43, G#
         
     | 
| 
      
 386 
     | 
    
         
            +
                "Pedal Hi-Hat",		# 44, A
         
     | 
| 
      
 387 
     | 
    
         
            +
                "Low Tom",                  # 45, A#
         
     | 
| 
      
 388 
     | 
    
         
            +
                "Open Hi-Hat",		# 46, B
         
     | 
| 
      
 389 
     | 
    
         
            +
                "Low-Mid Tom",		# 47, C
         
     | 
| 
      
 390 
     | 
    
         
            +
                "Hi Mid Tom",		# 48, C#
         
     | 
| 
      
 391 
     | 
    
         
            +
                "Crash Cymbal 1",           # 49, D
         
     | 
| 
      
 392 
     | 
    
         
            +
                "High Tom",                 # 50, D#
         
     | 
| 
      
 393 
     | 
    
         
            +
                "Ride Cymbal 1",            # 51, E
         
     | 
| 
      
 394 
     | 
    
         
            +
                "Chinese Cymbal",           # 52, F
         
     | 
| 
      
 395 
     | 
    
         
            +
                "Ride Bell",		# 53, F#
         
     | 
| 
      
 396 
     | 
    
         
            +
                "Tambourine",		# 54, G
         
     | 
| 
      
 397 
     | 
    
         
            +
                "Splash Cymbal",            # 55, G#
         
     | 
| 
      
 398 
     | 
    
         
            +
                "Cowbell",                  # 56, A
         
     | 
| 
      
 399 
     | 
    
         
            +
                "Crash Cymbal 2",           # 57, A#
         
     | 
| 
      
 400 
     | 
    
         
            +
                "Vibraslap",		# 58, B
         
     | 
| 
      
 401 
     | 
    
         
            +
                "Ride Cymbal 2",            # 59, C
         
     | 
| 
      
 402 
     | 
    
         
            +
                "Hi Bongo",                 # 60, C#
         
     | 
| 
      
 403 
     | 
    
         
            +
                "Low Bongo",		# 61, D
         
     | 
| 
      
 404 
     | 
    
         
            +
                "Mute Hi Conga",            # 62, D#
         
     | 
| 
      
 405 
     | 
    
         
            +
                "Open Hi Conga",            # 63, E
         
     | 
| 
      
 406 
     | 
    
         
            +
                "Low Conga",		# 64, F
         
     | 
| 
      
 407 
     | 
    
         
            +
                "High Timbale",		# 65, F#
         
     | 
| 
      
 408 
     | 
    
         
            +
                "Low Timbale",		# 66, G
         
     | 
| 
      
 409 
     | 
    
         
            +
                "High Agogo",		# 67, G#
         
     | 
| 
      
 410 
     | 
    
         
            +
                "Low Agogo",		# 68, A
         
     | 
| 
      
 411 
     | 
    
         
            +
                "Cabasa",                   # 69, A#
         
     | 
| 
      
 412 
     | 
    
         
            +
                "Maracas",                  # 70, B
         
     | 
| 
      
 413 
     | 
    
         
            +
                "Short Whistle",            # 71, C
         
     | 
| 
      
 414 
     | 
    
         
            +
                "Long Whistle",		# 72, C#
         
     | 
| 
      
 415 
     | 
    
         
            +
                "Short Guiro",		# 73, D
         
     | 
| 
      
 416 
     | 
    
         
            +
                "Long Guiro",		# 74, D#
         
     | 
| 
      
 417 
     | 
    
         
            +
                "Claves",                   # 75, E
         
     | 
| 
      
 418 
     | 
    
         
            +
                "Hi Wood Block",            # 76, F
         
     | 
| 
      
 419 
     | 
    
         
            +
                "Low Wood Block",           # 77, F#
         
     | 
| 
      
 420 
     | 
    
         
            +
                "Mute Cuica",		# 78, G
         
     | 
| 
      
 421 
     | 
    
         
            +
                "Open Cuica",		# 79, G#
         
     | 
| 
      
 422 
     | 
    
         
            +
                "Mute Triangle",            # 80, A
         
     | 
| 
      
 423 
     | 
    
         
            +
                "Open Triangle"		# 81, A#
         
     | 
| 
      
 424 
     | 
    
         
            +
              ]
         
     | 
| 
       425 
425 
     | 
    
         | 
| 
       426 
426 
     | 
    
         
             
            end
         
     |