home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / mididsm2.zip / mididsm.INF (.txt) < prev    next >
OS/2 Help File  |  1995-08-02  |  83KB  |  2,394 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. Please read this document in entirety.  I took the time to make it explicit, 
  5. clear, and very useful.  It took me longer to write it than it will ever take 
  6. you to read it.  Therefore, you owe it to both of us to read it.  OK? 
  7.  
  8. MF_DSM is an OS/2 2.X command line application that converts a MIDI (sequencer) 
  9. file into a text file that can be viewed and edited with a text editor.  In 
  10. other words, it "disassembles" the MIDI file into human readable "source code". 
  11. In this way, you can visually see the contents of the MIDI file; what notes are 
  12. being played, when the notes are being played, what other "events" are in the 
  13. file, etc.  The display of this information is very musician friendly, allowing 
  14. one to easily change/augment/delete the contents simply by editing the text. 
  15.  
  16. MF_ASM is an OS/2 2.X command line application that converts a text file such 
  17. as that produced by MF_DSM back into a MIDI file.  In other words, it 
  18. "assembles" the "source code" into a MIDI file.  Furthermore, MF_DSM recognizes 
  19. certain directives that tell it to further process chunks of the source code, 
  20. thus allowing one to easily transpose notes in a track, filter events (ie, 
  21. split apart tracks) by MIDI channels/note numbers/event types, remap note 
  22. numbers to new note numbers, remap events to new MIDI channels, adjust overall 
  23. volume of the notes in a track, and replace all note-offs with 0 velocity 
  24. note-ons.  In addition to these "global" adjustments that can be easily applied 
  25. to an entire track of events, you also can edit each individual event of a 
  26. track in every possible way.  You can change note number (ie, pitch), note 
  27. velocity (ie, volume), aftertouch amount, program change number, pitch wheel 
  28. amount, the MIDI channel of an event, controller numbers and amounts, the time 
  29. upon which the event occurs, and edit/add/delete system 
  30. exclusive/realtime/system messages.  You can also edit/add/delete all of the 
  31. non-MIDI events that may be found in a MIDI file such as Tempo, Track and 
  32. Instrument names, Time and Key signatures, Cue Points and Markers, SMPTE time, 
  33. Lyrics, etc. 
  34.  
  35. You could even create a text file from scratch, adding "events" as easily as 
  36. cutting and pasting text in a text editor, and then create a MIDI file from the 
  37. result using MF_ASM. 
  38.  
  39. The MIDI Disassembler/Assembler offers a relatively straightforward way of 
  40. creating and editing MIDI files without requiring a sequencer program.  It may 
  41. even offer editing features that aren't found in your sequencer software. 
  42.  
  43. You ought to know a little about MIDI before editing any text files.  I wrote 
  44. an OS/2 Online Book called "The MIDI Book" which can give you all of the 
  45. details about MIDI, as well as the MIDI File Format.  The source produced by 
  46. MF_DSM is formatted using "musical terminology" wherever possible, so you don't 
  47. have to know about hexadecimal numbering and nitty gritty details like that, 
  48. but for more involved editing, you may need to reference the MIDI 
  49. specification. 
  50.  
  51. Version 1.1 corrects bugs related to Unknown Chunks and the "Hold Pd" and "Soft 
  52. Pd" controllers (which are now "HoldPd" and "SoftPd".  1.1 also knows about 
  53. "Bank Switch" controller.  Version 1.2 corrects bugs in interchanging the 
  54. coarse and fine NRPN controllers, adds the RPN controllers and All Sound Off 
  55. controller, and uses GENMIDI.DLL. 
  56.  
  57.  
  58. Some of the words in this manual are highlighted in bold text, such as 
  59. Handshake.  These are words that refer to MF_ASM "keywords" or fields that are 
  60. part of the source code text file.  Other words are in colored text such as 
  61. Channel Pressure.  These refer to MIDI messages (ie, data).  Underlined words, 
  62. such as Pitch Wheel, refer to hardware, such as if I was referring to the Pitch 
  63. Wheel on your MIDI unit.  Words that are in colored text such as Read This are 
  64. meant to be emphasized.  Words in italics refer to concepts, such as track. 
  65.  
  66.  
  67. ΓòÉΓòÉΓòÉ 2. Copyright ΓòÉΓòÉΓòÉ
  68.  
  69. MF_DSM, MF_ASM, MIDIFILE.DLL, GENMIDI.DLL and this manual are all copyright 
  70. 1995 by Jeff Glatt.  These items are freely distributable as long as no 
  71. internal modifications are made to the items, and copyright messages are left 
  72. intact.  There are no pagan user fees, surreptitious financial charges, or 
  73. other devious capitalist trickery associated with the use of these files. 
  74. There are no warranties of any kind with this software.  If swallowed, induce 
  75. vomiting immediately (by contemplating the aesthetics of Windows). 
  76.  
  77. I can be contacted at: 
  78.  
  79. 6 Sycamore Drive East 
  80. New Hartford, NY 13413 
  81. (315) 735-5350 
  82.  
  83.  
  84. ΓòÉΓòÉΓòÉ 3. Invoking MF_DSM and MF_ASM ΓòÉΓòÉΓòÉ
  85.  
  86. MF_DSM and MF_ASM are both used from an OS/2 Command Prompt (window or 
  87. full-screen).  Each takes arguments (ie, additional text after the program 
  88. name) when run. 
  89.  
  90. The syntax for MF_DSM is: 
  91.  
  92. MF_DSM  midifilename [/I] [/PXXX] [/Otextfilename] 
  93.  
  94. midifilename is the name of the MIDI file that you wish to convert into a text 
  95. source code file.  The other 3 args are optional.  The /I option produces only 
  96. a synopsis of the MIDI file contents, rather than creating a text file 
  97. containing info on every event in the MIDI file.  Such a synopsis is only good 
  98. for reference (ie, gives you a quick overview of what's in the MIDI file) and 
  99. can't be assembled back into a MIDI file.  Omit this option when you want to 
  100. create "source code" of a MIDI file.  The /O option allows the info to be saved 
  101. to a file on disk so that you can edit it and later assemble it.  The filename 
  102. must immediately follow the /O.  Without this option, MF_DSM simply lists the 
  103. source code to the display, and doesn't save it.  The /P option allows you to 
  104. override the MIDI file's inherent Division (which affects the way that the 
  105. time-stamps are calculated) where XXX is the desired Division (if negative, 
  106. then SMPTE times may be forced).  If any errors occur in reading the MIDI file, 
  107. an appropriate message will be displayed. 
  108.  
  109. The syntax for MF_ASM is: 
  110.  
  111. MF_ASM  textfilename [midifilename] 
  112.  
  113. textfilename is the name of the text source code file that you wish to convert 
  114. back into a MIDI file.  The other arg is optional.  This second arg is the name 
  115. of the MIDI file to produce.  If you don't supply this second arg, it defaults 
  116. to the textfilename (minus any extension), with the extension .mid added to it. 
  117. If any errors occur in creating the MIDI file, an appropriate message will be 
  118. displayed. 
  119.  
  120. Both utilities require that the MIDIFILE.DLL and GENMIDI.DLL files be in some 
  121. directory along the LIBPATH as specified in config.sys file.  These are dynamic 
  122. link libraries I wrote which can be used by C programmers to simplify reading, 
  123. writing and using MIDI files in their applications.  The documentation and 
  124. examples for such are also available separately. 
  125.  
  126.  
  127. ΓòÉΓòÉΓòÉ 4. Disassembly Format ΓòÉΓòÉΓòÉ
  128.  
  129. Disassembly is the process of taking a MIDI file (ie, a binary data file) and 
  130. turning it into a text file (ie, human readable "source code").  MF_DSM does 
  131. this. 
  132.  
  133. A MIDI file is made up of a series of musical events such as a note-on (ie, a 
  134. musician has started sounding a note on a MIDI controller).  The MIDI file 
  135. time-stamps each event so that a sequencer will know when to play it.  Some of 
  136. the events are actual MIDI events, and others are META events that don't get 
  137. output of a MIDI jack but which the sequencer uses for control of playback, 
  138. such as a Tempo event. 
  139.  
  140.  
  141. ΓòÉΓòÉΓòÉ 4.1. MThd Header line ΓòÉΓòÉΓòÉ
  142.  
  143. Upon the very first line of the source code, MF_DSM displays the overall 
  144. parameters of the MIDI file.  This line begins with the text MThd to indicate 
  145. that the file is a MIDI file.  You should never alter the MThd "ID".  The MThd 
  146. header line must precede all track data (although comment lines may be placed 
  147. ahead of it), and must start with MThd in order to mark the start of your 
  148. source code. 
  149.     Next, is the Format of the MIDI file.  All MIDI files are either format 0, 
  150. 1, or 2.  Format 0 files have only 1 track.  All of the data will be in that 1 
  151. track.  Think of that track as a complete "song" or "pattern".  Sequencers that 
  152. prefer data to be lumped together into one chunk of memory, in the order that 
  153. the events will be played, often use this format.  Format 1 and 2 can have 
  154. numerous tracks of data.  The tracks of a Format 1 are equivalent to the tracks 
  155. of a single "pattern" in a sequencer which has multiple tracks.  In other 
  156. words, you might have a track for the drums, and a track for the piano, etc, 
  157. and all of these tracks can play simultaneously, adding up to a complete song. 
  158. The very first track in Format 1 usually contains only timing events such as 
  159. Tempo events.  It may also have non-MIDI events such as Time Signature, but it 
  160. will usually not have any MIDI (ie, note) data.  This is often referred to as 
  161. the tempo map track.  Sequencers that prefer to separate the musical 
  162. performance into multiple tracks (usually so that the musician can better 
  163. isolate and edit specific musical parts) often use this format.  The Format 2 
  164. is like a bunch of Format 0 files stuck into one MIDI file.  Each track of the 
  165. Format 2 contains all of the data for one "song" or "pattern", but the MIDI 
  166. file contains many songs.  Devices that can load multiple songs or patterns 
  167. (such a drum machine) often use this format. 
  168.     The next, overall parameter is the # of tracks in the MIDI file.  For 
  169. Format 0, this is always 1. 
  170.     The last, overall parameter is the Division.  This is how the time-stamping 
  171. is referenced.  Normally, this tells you what the clock resolution is of the 
  172. MIDI file in terms of how many clocks are in a quarter note (ie, PPQN).  For 
  173. example, 96 means that the sequencer ticks off 96 hardware clock pulses for 
  174. every quarter note.  If Division is specified in terms of SMPTE rate, then 
  175. Division will be two numbers, the first being -24, -25, -29, or -30, 
  176. corresponding to the 4 SMPTE standards representing frames per second.  The 
  177. second number (a positive number) is the resolution within a frame (ie, 
  178. subframe resolution).  Typical values may be 4 (MIDI Time Code), 8, 10, 80 
  179. (SMPTE bit resolution), or 100.  The two numbers are separated with a / 
  180. character.  For example, millisecond-based timing would be specified as -25/40 
  181. (25 FPS with 40 subframes). 
  182.     The Format, # of Tracks, and Division fields must be separated with a | 
  183. character (ie, above the ENTER key).  This character is used throughout the 
  184. source code to separate fields on a line.  Here's an example of an MThd header 
  185. line: 
  186.  
  187. MThd | Format=1 | # of Tracks=2 | Division=96 
  188.  
  189.     Note that there are 4 fields.  The | may be optionally omitted after the 
  190. last field (as it is here for Division). 
  191.     The = sign is most often used to assign a value to the field.  The field's 
  192. name is to the left of the = sign, and the value is on the right.  For example, 
  193. the name of the second field above is Format.  (The MThd is the first field 
  194. even though this isn't a field that can be assigned a value).  It has been 
  195. assigned a value of 1.     Generally, you can add or subtract blank spaces 
  196. wherever you like.  For example, this is the same as above: 
  197.  
  198. MThd|Format=1|# of Tracks=2|Division=96 
  199.  
  200.     You can also add blank spaces at the beginning of the line (but don't put 
  201. other characters before the MThd).  You can even put blank spaces before or 
  202. after the = sign that assigns a value to the field.  The only exception to 
  203. adding blank spaces is in the field's name (if it has embedded spaces, like # 
  204. of Tracks does).  In other words, don't type #ofTracks.  Here's another legal 
  205. variation on formatting with blank spaces: 
  206.  
  207. MThd  |  Format = 1 |# of Tracks=2   |Division=  96 
  208.  
  209.     As you can see, you have some liberty with the use of blank spaces. 
  210.     Furthermore, capitalization is not sensitive in the field names.  For 
  211. example, DIVISION is the same as division.  So, you have some liberty with the 
  212. SHIFT key as well. 
  213.     Finally, for most events, the order of most fields can be rearranged, and 
  214. some fields can even be omitted.  There are some exceptions though.  The first 
  215. field usually has a specific purpose, and for track data events, so does the 
  216. second field.  So, the first and perhaps second can't be rearranged or omitted. 
  217. But, subsequent fields often can.  For the MThd header line, the MThd field 
  218. must be first, but the Format, # of Tracks, and Division fields can be in any 
  219. order, as so: 
  220.  
  221. MThd |  # of Tracks=2 | Division=96 | Format=1 
  222.  
  223.     So too, can you omit one or all of those 2 fields, as so: 
  224.  
  225. MThd |  Division=96 
  226.  
  227.     If you omit any field, it automatically is set to a default value, which 
  228. for Format, # of Tracks, and Division, are the values 0, 1, and 192 
  229. respectively.  So, the above example defaults to Format 0, 1 track with 96 
  230. PPQN. 
  231.     You may change the values for the Format, # of Tracks, and Division fields 
  232. (but change them to sensible values).  You should set # of Tracks to the number 
  233. of track headers that will be in your source.  Otherwise, you'll end up not 
  234. writing out extra tracks, or create a malformed MIDI file.  For Division, you 
  235. can optionally specify a SMPTE timing as described above. 
  236.  
  237.  
  238. ΓòÉΓòÉΓòÉ 4.2. Track Header line ΓòÉΓòÉΓòÉ
  239.  
  240. A MIDI file may have numerous tracks of data.  MF_DSM first lists all of the 
  241. events in the first track, in the order that they are to be played.  Then, all 
  242. of the events in the second track are listed, in the order that they are to be 
  243. played.  This repeats for as many tracks as are in the MIDI file.  The events 
  244. for the last track will be at the "bottom" of the text file.  Generally, each 
  245. event of a track is displayed upon its own line to make it easy to distinguish 
  246. one from the other. 
  247.  
  248.     So, after the MThd header line, MF_DSM starts listing the first track.  The 
  249. start of a track is always indicated by the words Track # followed by a number 
  250. telling which track it is (ie, 0 being the first track.  Note that there may be 
  251. a Track Number event also in the track.  That will be the track's real number. 
  252. The number on the track header line is only for your reference).  After the 
  253. track number, MF_DSM fills up the remainder of that line with * characters just 
  254. to highlight where the data for the track begins.  MF_ASM (the assembler) 
  255. doesn't require that these filler characters be present; but a line must start 
  256. with Track # in order to mark the start of a track's data.  As usual, blank 
  257. space can precede the Track #, which itself can be typed in lower or upper 
  258. case.  After the Track #, you can optionally place a | character followed by 
  259. more fields to be described later.  Here's an example of the track header line 
  260. for the first track: 
  261.  
  262. Track #0 ****************************************** 
  263.  
  264.     You can place blank lines between the preceding MThd header line and the 
  265. Track header line.  In fact, you can place blank lines anywhere in the source 
  266. file for improved readability. 
  267.  
  268.  
  269. ΓòÉΓòÉΓòÉ 4.3. An Event line ΓòÉΓòÉΓòÉ
  270.  
  271. After the Track header line is the track's first event, on its own line.  The 
  272. first field of an event must be its Time.  This describes the point at which 
  273. the event should be played.  The second field (separated from the Time field 
  274. with a | character) must be a text description of the event's Type, such as a 
  275. On Note event type.  Different event types may have further fields, each 
  276. separated from the next with the | character.  These additional fields are 
  277. optional, and can usually be in any order.  Usually, all of the fields must be 
  278. on one line.  Therefore, the entire event is contained upon one line of text. 
  279. All events must have the Time and Event Type fields, in that order, and these 
  280. must be at the start of the line. 
  281.  
  282.  
  283. ΓòÉΓòÉΓòÉ 4.3.1. Time Field ΓòÉΓòÉΓòÉ
  284.  
  285. The Time field is the first field of an event.  This indicates the point at 
  286. which the event should be played.  The Time is expressed in terms of musical 
  287. bars (measures), beats, and clocks (fractions of a beat) at the current time 
  288. signature.  (Note that MIDI files can have time signature changes, and the Time 
  289. field display reflects this).  The field is displayed as: 
  290.  
  291. Measure: Beat: Clock 
  292.  
  293. In other words, for any event, you know what measure, beat, and subbeat it gets 
  294. played upon. 
  295.     The first measure of a track is #1.  The first beat in a measure is #1. 
  296. The first clock within a beat is 0.  So, if an event occurs precisely upon the 
  297. 3rd beat of the 4th measure, then its clock display is: 
  298.  
  299. 4: 3: 0 
  300.  
  301. Note:  You can use any non-numeric key to separate the measures, beats, and 
  302.        clocks, including blank spaces.  For example, if using the numeric 
  303.        keypad, you might separate each field with a dot as so: 
  304.  
  305. 5.1.0 
  306.  
  307. You can also add as many blank spaces between the measures, beats, and clocks 
  308. as desired, in order to line up the measures, beats, and clocks in the same 
  309. text columns as preceding and subsequent events.
  310.  
  311. The number of beats in a measure depends upon the current time signature.  If 
  312. there is no time signature event in the MIDI file, then 4/4 time is assumed 
  313. (ie, 4 beats in a measure, and a quarter note is the beat). 
  314.  
  315. The number of fractional divisions of a beat depend upon the MThd Division and 
  316. the current time signature.  Division tells you how many subbeats are in a 
  317. quarter note.  For example, if Division is 192, then that means that there are 
  318. 192 clocks per quarter note.  Since there are 2 eighth notes in a quarter note, 
  319. then there must be 192/2 clock subbeats in an eighth note (ie, 96 clocks). 
  320. There are 4 sixteenth notes in a quarter note, so each is 192/4 clocks (ie, 48 
  321. clocks) in each 16th note.  It's best to make a chart based upon the Division, 
  322. which you can use to determine how many subbeats are in each musical note. 
  323. Here's the formula used: 
  324.  
  325. quarter                  Division in each note 
  326.  
  327. quarter note triplet     Division/1.5 in each note 
  328.  
  329. eighth                   Division/2 in each note 
  330.  
  331. eighth note triplet      Division/3 in each note 
  332.  
  333. sixteenth                Division/4 in each note 
  334.  
  335. sixteenth note triplet   Division/6 in each note 
  336.  
  337. 32nd note                Division/8 in each note 
  338.  
  339. 32nd note triplet        Division/12 in each note 
  340.  
  341. Here's a list of the number of clocks in each type of note for 192 PPQN: 
  342.  
  343. quarter                  192 
  344.  
  345. quarter note triplet     128 
  346.  
  347. eighth                   96 
  348.  
  349. eighth note triplet      64 
  350.  
  351. sixteenth                48 
  352.  
  353. sixteenth note triplet   32 
  354.  
  355. 32nd note                24 
  356.  
  357. 32nd note triplet        16 
  358.  
  359. For example, assume that a pattern is in 4/4.  You want to set an event's Time 
  360. to the 3rd measure, second beat, on the 3rd sixteenth note of that beat. 
  361. Because you need to set the time to a fraction of a beat (i.e. the 3rd 
  362. sixteenth note of the beat), you need to specify a non-zero subbeat when 
  363. entering the time.  The first sixteenth note (or the first of ANY group of 
  364. fractional beats) occurs right on the downbeat, so it would have a clock offset 
  365. of 0.  The second sixteenth would have a clock offset of 48 (according to the 
  366. above chart).  The third sixteenth would have a clock offset of 48+48.  Of 
  367. course, the fourth sixteenth would have an offset of 48+48+48.  So to set the 
  368. event upon the 3rd measure, second beat, 3rd sixteenth note would be: 
  369.  
  370. 3: 2: 96 
  371.  
  372. For SMPTE Divisions, the Time field is not displayed as measure, beats, and 
  373. subbeats, but rather one number that is simply the clock ticks from the start 
  374. of the song upon which the event occurs.  (The start of the song is at time 0). 
  375. So, if an event has a Time of 1, then it occurs 1 clock after the start of 
  376. playback. 
  377.  
  378. The Time field is separated from the next field using the | character.  So, 
  379. assuming 4/4, and you wish to place an event on the first measure, fourth beat, 
  380. second eighth note of that beat (ie, first eighth note is on the beat or at 0 
  381. subbeats, and the next is at 0+96): 
  382.  
  383. 1: 4: 96 | 
  384.  
  385.  
  386. ΓòÉΓòÉΓòÉ 4.3.2. Event Type Field ΓòÉΓòÉΓòÉ
  387.  
  388. The Event Type field is the second field of an event.  This indicates what type 
  389. of event it is, for example, a Tempo event.  So, a Tempo event would have the 
  390. text Tempo placed into the second field.  The field must be ended with the | 
  391. character. 
  392.     So, let's specify a Tempo event on the first measure, second beat (ie, 
  393. right on that beat) of the track.  Here are the required Time and Event Type 
  394. fields, with separators: 
  395.  
  396.  1:  2:   0   |  tempo   | 
  397.  
  398. Notice that I used blank space liberally.  Also, I specified the Tempo type as 
  399. all lower caps.  These are allowable options. 
  400.     Now, it makes sense that you'd want to specify the tempo.  It just so 
  401. happens that you can add fields to the Tempo event.  One field, the BPM field, 
  402. can be assigned the tempo in quarter notes per minute.  Here's how to specify a 
  403. tempo of 100 BPM at the start of a track (ie, measure 1, beat 1, 0 subbeats): 
  404.  
  405.  1:   1:   0 | tempo | BPM=100 
  406.  
  407. The BPM field is optional.  If you don't supply it, tempo defaults to 120 BPM. 
  408. Although the Time and Event Type fields must be specified for an event, and 
  409. both end with the | character, additional fields are optional.  Additional 
  410. fields should also be separated with the | character, but the | is optional 
  411. after the last field.  These rules of thumb apply to other event types as well. 
  412.     Furthermore, remember that blank space and capitalization are optional. 
  413. So, you could write the above event as so: 
  414.  
  415. 1:1:0|    TEMPO| bpm   =100 
  416.  
  417. The following sections list the defined Event Types.  Each page contains one 
  418. event type, such as the Tempo event.  The text that you type into the Event 
  419. Type field is listed (for example, Tempo).  The additional, optional fields 
  420. that can be added are also listed.  A description of what the event is used for 
  421. is included.  Any particular deviations from the general rules of thumb for 
  422. specifying an event are described.  Finally, an example of the event as it 
  423. might appear in a source code listing is given. 
  424.  
  425.  
  426. ΓòÉΓòÉΓòÉ 4.3.2.1. Off Note ΓòÉΓòÉΓòÉ
  427.  
  428. Type           Off Note 
  429.  
  430. Occurs when    You release a note that you previously pressed down on the MIDI 
  431.                unit (ie, cause the note to stop sounding). 
  432.  
  433. Other Fields   The MIDI channel upon which the note was broadcast is assigned 
  434.                to the chan field.  This will be 1 of 16 (ie, a number from 1 to 
  435.                16).  If you don't specify this field, it defaults to the same 
  436.                channel as the preceding event type which can be assigned to a 
  437.                channel (or channel 1 if no preceding event).  In other words, 
  438.                if the preceding event is an On Note with channel 2, and you 
  439.                then follow it with an Off Note event omitting the chan field, 
  440.                it defaults to channel 2. 
  441.  
  442.                The step of the 12 tone scale and octave that the note is (ie, C 
  443.                3 is middle C) is assigned to the pitch field.  Note that the 
  444.                bottom 2 octaves of the allowed MIDI note range are -2 and -1. 
  445.                The displays on some units count MIDI octaves from 0.  If you 
  446.                don't specify this field, it defaults to the same pitch as the 
  447.                preceding event type which can be assigned a pitch (or C3 if no 
  448.                such preceding event).  In other words, if the preceding event 
  449.                is an On Note of D#3, and you then follow it with an Off Note 
  450.                event omitting the pitch field, it defaults to D#3.  Also, note 
  451.                that you use a lower case B (ie, b) to specify a flat.  You can 
  452.                use double sharps and flats.  The note name, sharp or flat, and 
  453.                octave components can be separated by blank spaces.  For example 
  454.                C3 is the same as C 3. 
  455.  
  456.                The velocity (ie, how quickly you release the key) is assigned 
  457.                to the vol field.  This will be from 0 to 127.  If you don't 
  458.                specify this field, it defaults to the same volume as the 
  459.                preceding On Note or Off Note (or 64 if no such preceding 
  460.                event).  In other words, if the preceding event is an On Note 
  461.                with vol=44, and you then follow it with an Off Note event 
  462.                omitting the vol field, it defaults to 44. 
  463.  
  464.                Note:  Some MIDI units transmit Note On events with 0 velocity 
  465.                       in lieu of Note Off events.  Such events are represented 
  466.                       by the (Off) Note event type (ie, the "Off" is enclosed 
  467.                       in parenthesis)
  468.  
  469. Examples       1: 1: 0 | Off Note | chan=1 | pitch=Db2 | vol=76 
  470.                1: 2: 0 | Off Note | pitch=E 3 | vol=76  <- same chan as 
  471.                preceding event 
  472.                2: 1: 0 | Off Note | vol=55 | chan=2    <- different order of 
  473.                fields, pitch is E3 
  474.  
  475.  
  476. ΓòÉΓòÉΓòÉ 4.3.2.2. On Note ΓòÉΓòÉΓòÉ
  477.  
  478. Type           On Note 
  479.  
  480. Occurs when    You press down (ie, trigger) a note on the MIDI unit (ie, cause 
  481.                the note to sound). 
  482.  
  483. Other Fields   The MIDI channel upon which the note was broadcast is assigned 
  484.                to the chan field.  This will be 1 of 16 (ie, a number from 1 to 
  485.                16).  If you don't specify this field, it defaults to the same 
  486.                channel as the preceding event type which can be assigned to a 
  487.                channel (or channel 1 if no preceding event).  In other words, 
  488.                if the preceding event is an On Note with channel 2, and you 
  489.                then follow it with an On Note event omitting the chan field, it 
  490.                defaults to channel 2. 
  491.  
  492.                The step of the 12 tone scale and octave that the note is (ie, C 
  493.                3 is middle C) is assigned to the pitch field.  Note that the 
  494.                bottom 2 octaves of the allowed MIDI note range are -2 and -1. 
  495.                The displays on some units count MIDI octaves from 0.  If you 
  496.                don't specify this field, it defaults to the same pitch as the 
  497.                preceding event type which can be assigned a pitch (or C3 if no 
  498.                such preceding event).  In other words, if the preceding event 
  499.                is an Off Note of D#3, and you then follow it with an On Note 
  500.                event omitting the pitch field, it defaults to D#3.  Also, note 
  501.                that you use a lower case B (ie, b) to specify a flat.  You can 
  502.                use double sharps and flats.  The note name, sharp or flat, and 
  503.                octave components can be separated by blank spaces.  For example 
  504.                C3 is the same as C 3. 
  505.  
  506.                The velocity (ie, how quickly you press down the key) is 
  507.                assigned to the vol field.  This will be from 1 to 127.  Note 
  508.                that 0 for a Note On volume really means that this is a Note off 
  509.                event.  If you want that, use the (Off) Note event.  A Note on 
  510.                event can't have a zero velocity, and if you specify that, 
  511.                MF_ASM will automatically generate a velocity of 1.  If you 
  512.                don't specify this field, it defaults to the same volume as the 
  513.                preceding On Note or Off Note (or 64 if no such preceding 
  514.                event).  In other words, if the preceding event is an On Note 
  515.                with vol=44, and you then follow it with a On Note event 
  516.                omitting the vol field, it defaults to 44. 
  517.  
  518. Examples       1: 1: 0 | On Note | chan=16 | pitch=A#-1 | vol=127 
  519.                1: 2: 0 | On Note | pitch=E 1 | vol=76  <- same chan as 
  520.                preceding event 
  521.                2: 1: 0 | On Note | vol=55 | chan=2   <- different order of 
  522.                fields, pitch is E1 
  523.  
  524.  
  525. ΓòÉΓòÉΓòÉ 4.3.2.3. (Off) Note ΓòÉΓòÉΓòÉ
  526.  
  527. Type           (Off) Note 
  528.  
  529. Occurs when    You release a note that you previously pressed down on the MIDI 
  530.                unit (ie, cause the note to stop sounding). 
  531.  
  532. Other Fields   The MIDI channel upon which the note was broadcast is assigned 
  533.                to the chan field.  This will be 1 of 16 (ie, a number from 1 to 
  534.                16).  If you don't specify this field, it defaults to the same 
  535.                channel as the preceding event type which can be assigned to a 
  536.                channel (or channel 1 if no preceding event).  In other words, 
  537.                if the preceding event is an On Note with channel 2, and you 
  538.                then follow it with an (Off) Note event omitting the chan field, 
  539.                it defaults to channel 2. 
  540.  
  541.                The step of the 12 tone scale and octave that the note is (ie, C 
  542.                3 is middle C) is assigned to the pitch field.  Note that the 
  543.                bottom 2 octaves of the allowed MIDI note range are -2 and -1. 
  544.                The displays on some units count MIDI octaves from 0.  If you 
  545.                don't specify this field, it defaults to the same pitch as the 
  546.                preceding event type which can be assigned a pitch (or C3 if no 
  547.                such preceding event).  In other words, if the preceding event 
  548.                is an On Note of D#3, and you then follow it with an (Off) Note 
  549.                event omitting the pitch field, it defaults to D#3.  Also, note 
  550.                that you use a lower case B (ie, b) to specify a flat.  You can 
  551.                use double sharps and flats.  The note name, sharp or flat, and 
  552.                octave components can be separated by blank spaces.  For example 
  553.                C3 is the same as C 3. 
  554.  
  555.                Note:  This is essentially the same thing as an Off Note event, 
  556.                       except that it is often more efficient for broadcast over 
  557.                       MIDI to use this event in lieu of Off Note.  The only 
  558.                       advantage of Off Note is that it has a velocity field, 
  559.                       which is useful only if your MIDI unit can make use of 
  560.                       key release velocity (many units ignore it).
  561.  
  562. Examples       1: 1: 0 | (Off) Note | chan=1 | pitch=Db2 
  563.                1: 2: 0 | (Off) Note | pitch=E 3  <- same chan as preceding 
  564.                event 
  565.  
  566.  
  567. ΓòÉΓòÉΓòÉ 4.3.2.4. Aftertouch ΓòÉΓòÉΓòÉ
  568.  
  569. Type           Aftertouch 
  570.  
  571. Occurs when    You apply pressure to (ie, press down harder or softer on) the 
  572.                keys of a MIDI keyboard.  Or, aftertouch can be generated in 
  573.                other ways by different controllers, such as a wind controller 
  574.                measuring changes in wind pressure. 
  575.  
  576. Other Fields   The MIDI channel upon which the message was broadcast is 
  577.                assigned to the chan field.  This will be 1 of 16 (ie, a number 
  578.                from 1 to 16).  If you don't specify this field, it defaults to 
  579.                the same channel as the preceding event type which can be 
  580.                assigned to a channel (or channel 1 if no preceding event).  In 
  581.                other words, if the preceding event is an On Note with channel 
  582.                2, and you then follow it with an Aftertouch event omitting the 
  583.                chan field, it defaults to channel 2. 
  584.  
  585.                The step of the 12 tone scale and octave of the note that this 
  586.                message affects is assigned to the pitch field.  Note that the 
  587.                bottom 2 octaves of the allowed MIDI note range are -2 and -1. 
  588.                The displays on some units count MIDI octaves from 0.  If you 
  589.                don't specify this field, it defaults to the same pitch as the 
  590.                preceding event type which can be assigned a pitch (or C3 if no 
  591.                such preceding event).  In other words, if the preceding event 
  592.                is an On Note of D#3, and you then follow it with an Aftertouch 
  593.                event omitting the pitch field, it defaults to D#3.  Also, note 
  594.                that you use a lower case B (ie, b) to specify a flat.  You can 
  595.                use double sharps and flats.  The note name, sharp or flat, and 
  596.                octave components can be separated by blank spaces.  For example 
  597.                C3 is the same as C 3. 
  598.  
  599.                The aftertouch amount is assigned to the press field.  This will 
  600.                be from 0 to 127.  If omitted, it defaults to the same value as 
  601.                any preceding Aftertouch event (or 0 if no such preceding 
  602.                event). 
  603.  
  604. Examples       1: 1: 0 | Aftertouch | chan=16 | pitch=A2 | press=127 
  605.                1: 2: 0 | Aftertouch | press=76     <- same chan and pitch as 
  606.                preceding event 
  607.                2: 1: 0 | Aftertouch | press=55 | chan=1  <- different order of 
  608.                fields, pitch is E1 
  609.  
  610.  
  611. ΓòÉΓòÉΓòÉ 4.3.2.5. Controller ΓòÉΓòÉΓòÉ
  612.  
  613. Type           Controller 
  614.  
  615. Occurs when    You operate one of 128 different controllers. 
  616.  
  617. Other Fields   The MIDI channel upon which the message was broadcast is 
  618.                assigned to the chan field.  This will be 1 of 16 (ie, a number 
  619.                from 1 to 16).  If you don't specify this field, it defaults to 
  620.                the same channel as the preceding event type which can be 
  621.                assigned to a channel (or channel 1 if no preceding event).  In 
  622.                other words, if the preceding event is an On Note with channel 
  623.                2, and you then follow it with a Controller event omitting the 
  624.                chan field, it defaults to channel 2. 
  625.  
  626.                The controller number; from 0 to 127 is assigned to the contr 
  627.                field.  This tells which one of the 128 controllers was 
  628.                operated.  There are a number of defined controllers.  There are 
  629.                also some undefined controllers.  MF_DSM displays the controller 
  630.                number if the controller isn't defined, and if it's defined, a 
  631.                Controller ID is substituted instead.  Here are the IDs for 
  632.                defined controllers: 
  633.  
  634.                BankSw   (Bank Switch -- some units have more than 128 patches, 
  635.                and use this to select one of several groups of 128 patches) 
  636.                Mod H   (MOD wheel -- coarse) 
  637.                Wind H   (Breath controller -- coarse) 
  638.                Foot H    (Foot pedal -- coarse) 
  639.                PTme H   (Portamento Time -- coarse) 
  640.                SlidrH    (Slider -- coarse) 
  641.                Vol H    (Volume -- coarse) 
  642.                Bal H    (Balance -- coarse) 
  643.                Pan H    (Pan -- coarse) 
  644.                Exp H    (Expression -- coarse) 
  645.                Genr 1   (General Purpose Slider 1) 
  646.                Genr 2 
  647.                Genr 3 
  648.                Genr 4 
  649.                Mod L   (MOD wheel -- fine) 
  650.                Wind L 
  651.                Foot L 
  652.                PTme L 
  653.                SlidrL 
  654.                Vol L 
  655.                Bal L 
  656.                Pan L 
  657.                Exp L 
  658.                HoldPd  (Hold pedal On/Off) 
  659.                Porta   (Portamento On/Off) 
  660.                Susten   (Sustenuto pedal On/Off) 
  661.                SoftPd  (Soft pedal On/Off) 
  662.                Hold2   (Hold 2 pedal On/Off) 
  663.                Genr 5   (General Purpose Button 5 On/Off) 
  664.                Genr 6 
  665.                Genr 7 
  666.                Genr 8 
  667.                Effect   (Effects On/Off) 
  668.                Tremul   (Tremulo On/Off) 
  669.                Chorus   (Chorus On/Off) 
  670.                Celest   (Celeste On/Off) 
  671.                Phaser   (Phaser On/Off) 
  672.                Data +   (Data button increment) 
  673.                Data -   (Data button decrement) 
  674.                NRPN H  (Non-registered parameter - coarse) 
  675.                NRPN L  (Non-registered parameter - fine) 
  676.                RPN H  (Registered parameter - coarse) 
  677.                RPN L  (Registered parameter - fine) 
  678.                CtlOff   (All Controllers Off) 
  679.                SndOff   (All Sound Off) 
  680.                LocalK   (Local keyboard On/Off) 
  681.                NoteOf   (All Notes Off) 
  682.                OmniOf  (Omni Mode Off) 
  683.                OmniOn  (Omni Mode On) 
  684.                MonoOn  (Mono Mode On) 
  685.                PolyOn  (Poly Mode On) 
  686.  
  687.                If you prefer, you can specify one of these IDs for the contr 
  688.                field, rather than the actual number.  If you don't supply a 
  689.                controller number or ID, it defaults to the same controller as 
  690.                the preceding Controller event (or 1, ie, Mod H, if no preceding 
  691.                Controller event). 
  692.  
  693.                The controller's value is assigned to the value field.  This is 
  694.                a number from 0 to 127.  For button types, 64 to 127 values are 
  695.                ON; 0 to 63 values are OFF.  If you don't supply the value, it 
  696.                defaults to 0. 
  697.  
  698. Examples       1: 1: 0 | Controller | chan=1 | contr=Chorus | value=40 
  699.                1: 2: 0 | Controller | value=76  <- same chan and cntrl as 
  700.                preceding event 
  701.                2: 1: 0 | Controller | contr=2   <- controller 2 is set to 0 
  702.  
  703.  
  704. ΓòÉΓòÉΓòÉ 4.3.2.6. Program ΓòÉΓòÉΓòÉ
  705.  
  706. Type           Program 
  707.  
  708. Occurs when    You change a patch/preset/instrument/etc. on the MIDI unit. 
  709.  
  710. Other Fields   The MIDI channel upon which the message was broadcast is 
  711.                assigned to the chan field.  This will be 1 of 16 (ie, a number 
  712.                from 1 to 16).  If you don't specify this field, it defaults to 
  713.                the same channel as the preceding event type which can be 
  714.                assigned to a channel (or channel 1 if no preceding event).  In 
  715.                other words, if the preceding event is an On Note with channel 
  716.                2, and you then follow it with a Program event omitting the chan 
  717.                field, it defaults to channel 2. 
  718.  
  719.                The program number; from 1 to 128 is assigned to the pgm # 
  720.                field.  This tells which one of the 128 programs (or patches) on 
  721.                your MIDI unit is selected.  MF_DSM also displays the patch name 
  722.                as it should be on a MIDI unit with a General MIDI patch set, as 
  723.                a comment at the end of the line.  If you don't supply the 
  724.                Program number, it defaults to 1. 
  725.  
  726. Examples       1: 1: 0 | Program | chan=1 | pgm #=1 
  727.                1: 2: 0 | Program | pgm #=128    <- same chan as preceding event 
  728.  
  729.  
  730. ΓòÉΓòÉΓòÉ 4.3.2.7. Poly Press ΓòÉΓòÉΓòÉ
  731.  
  732. Type           Poly Press 
  733.  
  734. Occurs when    You apply pressure to (ie, press down harder or softer on) the 
  735.                keys of a MIDI keyboard.  Or, pressure can be generated in other 
  736.                ways by different controllers, such as a wind controller 
  737.                measuring changes in wind pressure. 
  738.  
  739.                Note:  The difference between Aftertouch and Polyphonic 
  740.                       (Channel) Pressure is that the latter affects all notes 
  741.                       currently sounding on the MIDI channel whereas the former 
  742.                       only affects the one note that a particular Aftertouch 
  743.                       event is associated with.
  744.  
  745. Other Fields   The MIDI channel upon which the message was broadcast is 
  746.                assigned to the chan field.  This will be 1 of 16 (ie, a number 
  747.                from 1 to 16).  If you don't specify this field, it defaults to 
  748.                the same channel as the preceding event type which can be 
  749.                assigned to a channel (or channel 1 if no preceding event).  In 
  750.                other words, if the preceding event is an On Note with channel 
  751.                2, and you then follow it with a Poly Press event omitting the 
  752.                chan field, it defaults to channel 2. 
  753.  
  754.                The pressure amount is assigned to the press field.  This will 
  755.                be from 0 to 127.  If omitted, it defaults to 0. 
  756.  
  757. Examples       2: 1: 0 | Poly Press | chan=16 | press=127 
  758.                2: 2: 0 | Poly Press | press=76    <- same chan as preceding 
  759.                event 
  760.                3: 1: 0 | Poly Press | press=55 | chan=1  <- different order of 
  761.                fields 
  762.  
  763.  
  764. ΓòÉΓòÉΓòÉ 4.3.2.8. PWhl ΓòÉΓòÉΓòÉ
  765.  
  766. Type           Pitch Wheel 
  767.  
  768. Occurs when    You move the pitch wheel. 
  769.  
  770. Other Fields   The MIDI channel upon which the message was broadcast is 
  771.                assigned to the chan field.  This will be 1 of 16 (ie, a number 
  772.                from 1 to 16).  If you don't specify this field, it defaults to 
  773.                the same channel as the preceding event type which can be 
  774.                assigned to a channel (or channel 1 if no preceding event).  In 
  775.                other words, if the preceding event is an On Note with channel 
  776.                2, and you then follow it with a Pitch Wheel event omitting the 
  777.                chan field, it defaults to channel 2. 
  778.  
  779.                The pitch transposition is assigned to the bend field.  This 
  780.                will be from -8192 to 8192.  Negative numbers indicate that the 
  781.                pitch is being lowered, and positive values indicate that the 
  782.                pitch is being raised.  A 0 indicates that the pitch wheel is 
  783.                centered (and therefore not transposing the pitch of the note). 
  784.                If you don't supply the bend amount, it defaults to 0. 
  785.  
  786. Examples       1: 1: 0 | Pitch Wheel | chan=4 | bend=-1000 
  787.                1: 2: 0 | Pitch Wheel | bend=206  <- same chan as preceding 
  788.                event 
  789.                2: 1: 0 | Pitch Wheel |    <- same chan, centered 
  790.  
  791.  
  792. ΓòÉΓòÉΓòÉ 4.3.2.9. Sysex ΓòÉΓòÉΓòÉ
  793.  
  794. Type           Sysex 
  795.  
  796. Occurs when    The MIDI unit is sending some info that is specific to that 
  797.                unit, such as a dump of its patch memory or waveform data. 
  798.  
  799. Other Fields   After the Sysex event type field, you must supply a len field, 
  800.                which tells how many data values are to be in this message 
  801.                (including the 0xF0 value that always starts a Sysex message). 
  802.                Sysex messages can be any length.  Then, you specify each one of 
  803.                those values on the lines below that event line.  In other 
  804.                words, a Sysex event can span any number of lines in the source 
  805.                code.  You only need be certain that you supply as many values 
  806.                as the len indicates.  You can place as many or as few values as 
  807.                you wish on each line.  You can specify either decimal values or 
  808.                hexadecimal values (with an 0x prepended to indicate hex). 
  809.  
  810. Examples       Assume that we wish to send the following hexadecimal values as 
  811.                a System exclusive message: F0 00 01 50 F7.  (Note that all 
  812.                Sysex messages start with F0 and almost always end with F7).  We 
  813.                wish to send this message on the 2nd measure, first beat.  Note 
  814.                that there are 5 values in this message. 
  815.  
  816.                2: 1: 0 | Sysex | len=5 
  817.                    0xF0 0x00 0x01 0x50 0xF7 
  818.  
  819.                Note that I indented the values.  You can add or remove blank 
  820.                spaces before or after any values.  Also, note that I placed all 
  821.                of the values upon one line.  I could have placed values on 
  822.                several lines, as so: 
  823.  
  824.                2: 1: 0 | Sysex | len=5 
  825.                    0xF0 0x00 
  826.                    0x01 0x50 0xF7 
  827.  
  828. For this event type, it's best to place any comment lines only after all of the 
  829. data value lines. 
  830.  
  831.  
  832. ΓòÉΓòÉΓòÉ 4.3.2.10. First Packet/Packet/Last Packet ΓòÉΓòÉΓòÉ
  833.  
  834. Type           First Packet/Packet/Last Packet 
  835.  
  836. Occurs when    The MIDI unit is sending some info that is specific to that 
  837.                unit, such as a dump of its patch memory or waveform data. 
  838.  
  839. Other Fields   These 3 event types of First Packet, Packet, and Last Packet 
  840.                essentially amount to one Sysex event.  It's just that some 
  841.                cheesy MIDI gear (like Casio trash) can't handle a complete 
  842.                Sysex message sent all at one time.  It needs the Sysex message 
  843.                to be broken up into several pieces, each sent at specific 
  844.                times.  So, the First Packet gets sent.  It always starts with a 
  845.                0xF0, but unlike the Sysex event type, it doesn't end with 0xF7. 
  846.                That's because this isn't the end of the system exclusive 
  847.                message yet.  Each one of the Packet event types contains more 
  848.                data values.  The Packet doesn't start with 0xF0, because it 
  849.                isn't the start of the system exclusive.  (The First Packet was 
  850.                the start).  Neither does the Packet end with 0xF7, because it 
  851.                isn't the end of the system exclusive (ie, there is more data to 
  852.                come).  Eventually, the Last Packet is the final "chunk" of 
  853.                data.  It ends with 0xF7.  Confused?  Well, so are the Casio 
  854.                engineers who thought up this aberration.  Like the Sysex event, 
  855.                you must supply a len with each event type, and then specify the 
  856.                values on the lines below the event line. 
  857.  
  858. Examples       1: 1: 0 | First Packet | len=3 
  859.                    0xF0 0x00 0x01 
  860.                2: 1: 0 | Packet | len=4 
  861.                    0x30 0x01 0x55 0x40 
  862.                3: 1: 0 | Packet | len=1 
  863.                    0x20 
  864.                4: 1: 0 | Last Packet | len=2 
  865.                    0x50 0xF7 
  866.  
  867. For these event types, it's best to place any comment lines only after all of 
  868. the data value lines. 
  869.  
  870.  
  871. ΓòÉΓòÉΓòÉ 4.3.2.11. Tempo ΓòÉΓòÉΓòÉ
  872.  
  873. Type           Tempo 
  874.  
  875. Occurs when    The tempo changes. 
  876.  
  877. Other Fields   The tempo in "quarter notes per minute" (ie, BPM) is assigned to 
  878.                the BPM field. 
  879.  
  880.                The tempo in "microseconds per quarter note" is assigned to the 
  881.                micros field.  The micros field allows you to specify the tempo 
  882.                in fractions of a beat. 
  883.  
  884.                Note:  MF_DSM labels this field as micros\quarter which is also acceptable.
  885.  
  886.                You can specify both fields, and if you do, the micros field has 
  887.                precedence over the BPM field.  (In other words, if you wish to 
  888.                change a tempo event of some source code produced by MF_DSM, and 
  889.                you want to change only the BPM field, then simply delete the 
  890.                micros field altogether).  If you omit both fields, the tempo 
  891.                defaults to 120 BPM. 
  892.  
  893.                If a Format 1 file, this event should only be placed in the 
  894.                first track. 
  895.  
  896. Examples       1: 1: 0 | Tempo | BPM=100 
  897.                2: 1: 0 | Tempo | micros=500000 
  898.                3: 1: 0 | Tempo | BPM=120 | micros=500000 <- micros has 
  899.                precedence 
  900.                4: 1: 0 | Tempo |   <- 120 BPM default 
  901.  
  902.  
  903. ΓòÉΓòÉΓòÉ 4.3.2.12. Time Signature ΓòÉΓòÉΓòÉ
  904.  
  905. Type           Time Sig 
  906.  
  907. Occurs when    The time signature changes. 
  908.  
  909. Other Fields   The time signature is placed into its own field.  The time 
  910.                signature is expressed as two numbers separated by a / 
  911.                character, such as 3/4 (ie, Waltz time).  If you don't supply 
  912.                the signature, it defaults to 4/4. 
  913.  
  914.                The number of MIDI clocks in a metronome click is assigned to 
  915.                the click field.  This determines how often the metronome 
  916.                clicks.  There always 24 MIDI clocks in a quarter note.  So, to 
  917.                have the metronome click every quarter note, set click to 24. 
  918.                To click every eighth note, set click to 12 (ie, half of 24). 
  919.                Etc. 
  920.  
  921.                Note:  MF_DSM labels this field as MIDI-clocks\click which is 
  922.                       also acceptable.
  923.  
  924.                The number of 32nd notes in a quarter note is assigned to the 
  925.                32nds field.  Generally, this will always be 8, but some 
  926.                notation programs allow different settings. 
  927.  
  928.                Note:  MF_DSM labels this field as 32nds\quarter which is also acceptable.
  929.  
  930.                If a Format 1 file, this event should only be placed in the 
  931.                first track. 
  932.  
  933. Examples       1: 1: 0 | Time Sig | 4/4 | click=24 | 32nds=8 
  934.                2: 1: 0 | Time Sig | 6/8 | click=12  <- 6/8 time, metronome 
  935.                clicks every eighth 
  936.  
  937. You have be careful when changing the Time Signature, since that can invalidate 
  938. the times of other, subsequent events in the track (or subsequent events in all 
  939. other tracks in Format 1).  For example, assume that you have the following: 
  940.  
  941. 1: 1: 0 | Time Signature | 4/4 
  942. 1: 4: 0 | On Note | chan=1 | pitch=C3 | vol=127 
  943.  
  944. You change the Time signature to 3/4. 
  945.  
  946. 1: 1: 0 | Time Sig | 3/4 
  947. 1: 4: 0 | On Note | chan=1 | pitch=C3 | vol=127 
  948.  
  949. Now you have a problem with the On Note event.  It's supposed to be on the 
  950. fourth beat of the first measure, but a song in 3/4 only has 3 beats in each 
  951. measure.  There is no fourth beat.  If you want to maintain the original 
  952. timing, that On Note would be on the first beat of measure 2. 
  953.  
  954. It only makes sense to place a Time Signature on the first beat of a measure. 
  955. After all, how can you change a Time Signature in the middle of a measure?  In 
  956. other words, the beat and subbeat field of a Time Signature's Time field should 
  957. always be 1 and 0 respectively.  Only the measure number may be different. 
  958.  
  959.  
  960. ΓòÉΓòÉΓòÉ 4.3.2.13. Key Signature ΓòÉΓòÉΓòÉ
  961.  
  962. Type           Key Sig 
  963.  
  964. Occurs when    The key signature changes. 
  965.  
  966. Other Fields   The key signature is contained in its own field.  You specify 
  967.                the root note, and whether the key is Major or Minor.  If you 
  968.                don't supply the key signature, it defaults to C Major. 
  969.  
  970. Examples       1: 1: 0 | Key Sig | G Major 
  971.                2: 1: 0 | Key Sig |   <- C Major default 
  972.                3: 1: 0 | Key Sig | F# minor 
  973.  
  974.  
  975. ΓòÉΓòÉΓòÉ 4.3.2.14. SMPTE ΓòÉΓòÉΓòÉ
  976.  
  977. Type           SMPTE 
  978.  
  979. Occurs at      The SMPTE time needs to be set to a certain value. 
  980.  
  981. Other Fields   The SMPTE hour is assigned to the hour field.  If you don't 
  982.                supply this, it defaults to the same hour as the preceding SMPTE 
  983.                event (or 0 if no such event). The SMPTE minutes is assigned to 
  984.                the min field.  If you don't supply this, it defaults to the 
  985.                same minute as the preceding SMPTE event (or 0 if no such 
  986.                event). The SMPTE second is assigned to the sec field.  If you 
  987.                don't supply this, it defaults to the same second as the 
  988.                preceding SMPTE event (or 0 if no such event). The SMPTE frame 
  989.                is assigned to the frame field.  If you don't supply this, it 
  990.                defaults to the same frame as the preceding SMPTE event (or 0 if 
  991.                no such event). The SMPTE subframe is assigned to the subs 
  992.                field.  If you don't supply this, it defaults to the same 
  993.                subframe as the preceding SMPTE event (or 0 if no such event). 
  994.  
  995.                Note:  The range of the subframe field will depend upon the 
  996.                       resolution of your SMPTE rate.  Usually, the MThd's 
  997.                       Division is expressed as a SMPTE rate, in which case, the 
  998.                       subframe resolution is specified there.
  999.  
  1000. Examples       1: 1: 0 | SMPTE | hour=1 | min=30 | sec=10 | frame=1 | subs=1 
  1001.  
  1002.  
  1003. ΓòÉΓòÉΓòÉ 4.3.2.15. End of track ΓòÉΓòÉΓòÉ
  1004.  
  1005. Type           End of track 
  1006.  
  1007. Occurs when    The track is ended. 
  1008.  
  1009. Other Fields   None.  Every track must end with an End of track event.  It must 
  1010.                be the last event.  The time of this event tells you exactly 
  1011.                when the track stops playing.  Make certain that you don't 
  1012.                forget the | character after the event type. 
  1013.  
  1014. Examples       33: 1: 0 | End of track | 
  1015.  
  1016.  
  1017. ΓòÉΓòÉΓòÉ 4.3.2.16. Seq # ΓòÉΓòÉΓòÉ
  1018.  
  1019. Type           Seq # 
  1020.  
  1021. Other Fields   The sequencer number is contained in its own field.  This can be 
  1022.                any number from 0 to 65,535.  It's used to identify the track, 
  1023.                and differentiate it from other tracks.  If you don't supply the 
  1024.                sequence number, it defaults to which track this happens to be 
  1025.                (ie, the first track in your source code is 0). 
  1026.  
  1027.                The track's name is assigned to the name field.  This can be any 
  1028.                amount of text.  You should enclose the text between the 
  1029.                characters < and > if you wish to place a comment at the end of 
  1030.                the line or use numbers in the track name. 
  1031.  
  1032.                If you use this event in a track, it must be the very first 
  1033.                event in the track.  You can only have one such event in the 
  1034.                track.  Two tracks should not have the same sequence number. 
  1035.  
  1036. Examples       1: 1: 0 | Seq # | 5 | name=<My track name> 
  1037.  
  1038.  
  1039. ΓòÉΓòÉΓòÉ 4.3.2.17. Text event ΓòÉΓòÉΓòÉ
  1040.  
  1041. Type           Text event 
  1042.  
  1043. Occurs when    At any point.  Generally, the sequencer uses this event to 
  1044.                display text to the enduser or to somehow "mark" or label 
  1045.                something at a certain point in the song. 
  1046.  
  1047. Other Fields   After the Text event event type field, you must supply a len 
  1048.                field, which tells how many data values (ie, text characters) 
  1049.                are to be in this event.  Text events can be any length.  Then, 
  1050.                you specify each one of those values on the lines below that 
  1051.                event line.  In other words, a Text event can span any number of 
  1052.                lines in the source code.  You only need be certain that you 
  1053.                supply as many values as the len indicates.  You can place as 
  1054.                many or as few values as you wish on each line.  You can specify 
  1055.                either decimal values or hexadecimal values (prepended with 0x) 
  1056.                that represent the ascii characters.  For example, an 'A' 
  1057.                character is 0x41.  You could specify some values as 
  1058.                hexidecimal, and others as decimal.  Alternately, you can write 
  1059.                the actual text, enclosed between the characters < and >.  If 
  1060.                the text spans several lines, you must enclose each line's text 
  1061.                with < and >.  You could supply data values as well as text 
  1062.                enclosed between < and > on the same line, but if so, MF_ASM 
  1063.                uses one or the other, whichever comes first.  In other words, 
  1064.                if the data values are placed before the text enclosed within < 
  1065.                and >, then the data values are used and the text is ignored. 
  1066.  
  1067.                Note:  MF_DSM notates Text events with both data values, 
  1068.                       followed by the equivalent text (ie, ascii characters) 
  1069.                       enclosed within < and >.  If you want to subsequently 
  1070.                       edit a Text event, and you wish to make changes via the 
  1071.                       text, then simply delete the preceding data values.
  1072.  
  1073. Examples       1: 1: 0 | Text event | len=5 
  1074.                    0x48 0x65 0x6c 0x6c 0x6f  <Hello>  note: data values 
  1075.                followed by equivalent text 
  1076.                2: 1: 0 | Text event | len=5 
  1077.                    <Hello>      note: only the text 
  1078.                3: 1: 0 | Text event | len=5 
  1079.                    0x48 0x65 0x6c 0x6c 0x6f  note: only the data values 
  1080.  
  1081.                If desired, I could break up the data values and text onto 
  1082.                multiple lines, as so: 
  1083.  
  1084.                1: 1: 0 | Text event | len=5 
  1085.                    0x48 0x65      <He> 
  1086.                    0x6c 0x6c 0x6f  <llo> 
  1087.                3: 1: 0 | Text event | len=34 
  1088.                    <Here's one that also> 
  1089.                    <spans 2 lines.> 
  1090.  
  1091. For this event type, it's best to place any comment lines only after all of the 
  1092. data value or text lines.  In addition to the | character, don't use the < or > 
  1093. characters in the comments. 
  1094.  
  1095. Normally, a text event contains data values that are in the ascii range of 
  1096. printable characters (ie, 32 to 126).  If MF_DSM disassembles a MIDI file that 
  1097. has a weird text event with a non-printable character in it, that character is 
  1098. replaced by the . (ie, dot) character.  Consider the following: 
  1099.  
  1100. 1: 1: 0 | Text event | len=1 
  1101.     0x10      <.> 
  1102.  
  1103. The text indicates a . character, but if that were really meant to be a dot 
  1104. character, the data value would be 0x2E.  What you have here is a replacement 
  1105. occurring.  If you see a dot character in the text, check that the 
  1106. corresponding data value for it is 0x2E.  If so, then that's really meant to be 
  1107. a dot character in the event.  Otherwise, you'll have to deal with data values 
  1108. when editing the event, rather than being able to express it entirely as text. 
  1109. It's possible to express some lines starting with data values, and other lines 
  1110. starting with text.  For example, assume that you wish to create a text event 
  1111. for the string Hello and null-terminate it (ie, add a zero byte to the end). 
  1112.  
  1113. 1: 1: 0 | Text event | len=1 
  1114.     <Hello>  0x48 0x65 0x6c 0x6c 0x6f  note: text before data values so MF_ASM 
  1115. uses text 
  1116.     0x00    <.>   note: data values before text so MF_ASM uses data values 
  1117.  
  1118.  
  1119. ΓòÉΓòÉΓòÉ 4.3.2.18. Copyright ΓòÉΓòÉΓòÉ
  1120.  
  1121. Type           Copyright 
  1122.  
  1123. Occurs when    At any point.  Generally, the sequencer uses this event to imbed 
  1124.                a copyright message in the data file. 
  1125.  
  1126. Other Fields   This is just a specialized version of a Text event.  See Text 
  1127.                event for details of how to supply the data values and/or actual 
  1128.                text for the event. 
  1129.  
  1130. Examples       1: 1: 0 | Copyright | len=19 
  1131.                    <(C) 1994 Jeff Glatt> 
  1132.  
  1133.  
  1134. ΓòÉΓòÉΓòÉ 4.3.2.19. Lyric ΓòÉΓòÉΓòÉ
  1135.  
  1136. Type           Lyric 
  1137.  
  1138. Occurs when    A syllable of a word in the song's lyrics occurs.  Scoring 
  1139.                programs use this. 
  1140.  
  1141. Other Fields   This is just a specialized version of a Text event.  See Text 
  1142.                event for details of how to supply the data values and/or actual 
  1143.                text for the event. 
  1144.  
  1145. Examples       1: 1: 0 | Lyric | len=3 
  1146.                    <Let> 
  1147.                1: 3: 0 | Lyric | len=2 
  1148.                    <me> 
  1149.                2: 1: 0 | Lyric | len=4 
  1150.                    <call> 
  1151.                2: 3: 0 | Lyric | len=3 
  1152.                    <you> 
  1153.                3: 1: 0 | Lyric | len=6 
  1154.                    <sweet-> 
  1155.                3: 2: 0 | Lyric | len=5 
  1156.                    <heart> 
  1157.  
  1158.  
  1159. ΓòÉΓòÉΓòÉ 4.3.2.20. Marker ΓòÉΓòÉΓòÉ
  1160.  
  1161. Type           Marker 
  1162.  
  1163. Occurs when    At any point.  Generally, the sequencer uses this event to 
  1164.                display text to the enduser or to somehow "mark" or label 
  1165.                something at a certain point in the song. 
  1166.  
  1167. Other Fields   This is just a specialized version of a Text event.  See Text 
  1168.                event for details of how to supply the data values and/or actual 
  1169.                text for the event. 
  1170.  
  1171. Examples       3: 1: 0 | Marker | len=10 
  1172.                    <Loop Start> 
  1173.  
  1174.  
  1175. ΓòÉΓòÉΓòÉ 4.3.2.21. Cue Point ΓòÉΓòÉΓòÉ
  1176.  
  1177. Type           Cue Point 
  1178.  
  1179. Occurs when    At any point.  Generally, the sequencer uses this event to 
  1180.                designate a special, non-MIDI event such as indicating a sampled 
  1181.                waveform to load and play, or allowing the user to imbed cueing 
  1182.                instructions in the MIDI file. 
  1183.  
  1184. Other Fields   This is just a specialized version of a Text event.  See Text 
  1185.                event for details of how to supply the data values and/or actual 
  1186.                text for the event. 
  1187.  
  1188. Examples       1: 1: 0 | Cue Point | len=12 
  1189.                    <A gun fires.> 
  1190.                1: 2: 0 | Cue Point | len=12 
  1191.                    <She screams.> 
  1192.  
  1193.  
  1194. ΓòÉΓòÉΓòÉ 4.3.2.22. Track name ΓòÉΓòÉΓòÉ
  1195.  
  1196. Type           Track name 
  1197.  
  1198. Occurs when    At the beginning of a track usually.  The sequencer uses this 
  1199.                event to designate a textual name for the track. 
  1200.  
  1201. Other Fields   This is just a specialized version of a Text event.  See Text 
  1202.                event for details of how to supply the data values and/or actual 
  1203.                text for the event. 
  1204.  
  1205.                Note:  If you specify a Seq # event with a name field, then you 
  1206.                       don't need to use this event.  The Seq # event duplicates 
  1207.                       the function of this event.  Of course, if you have 
  1208.                       multiple musical parts in one track (ie, a Format 0 
  1209.                       file), you might want to specify the names of all parts 
  1210.                       in the track with numerous Track name events.
  1211.  
  1212. Examples       1: 1: 0 | Track name | len=11 
  1213.                    <Weird stuff> 
  1214.  
  1215.  
  1216. ΓòÉΓòÉΓòÉ 4.3.2.23. Instrument ΓòÉΓòÉΓòÉ
  1217.  
  1218. Type           Instrument 
  1219.  
  1220. Occurs when    At the beginning of a track usually.  The sequencer uses this 
  1221.                event to indicate what kind of instrument might be playing the 
  1222.                data in the track, such as a Piano. 
  1223.  
  1224. Other Fields   This is just a specialized version of a Text event.  See Text 
  1225.                event for details of how to supply the data values and/or actual 
  1226.                text for the event. 
  1227.  
  1228. Examples       1: 1: 0 | Instrument | len=5 
  1229.                    <Piano> 
  1230.  
  1231.  
  1232. ΓòÉΓòÉΓòÉ 4.3.2.24. Unknown Meta ΓòÉΓòÉΓòÉ
  1233.  
  1234. Type           Unknown Meta 
  1235.  
  1236. Occurs when    ??? 
  1237.  
  1238. Other Fields   This exists only in case some MetaEvent is added to the MIDI 
  1239.                file specification in the future.  In that case, you can use 
  1240.                this to indicate that.  This is just a specialized version of a 
  1241.                Text event.  See Text event for details of how to supply the 
  1242.                data values and/or actual text for the event.  But, this has an 
  1243.                additional field that must be supplied; the Type field.  This 
  1244.                should be the type of that yet-to-be-defined MetaEvent. 
  1245.  
  1246. Examples       Assume that a MetaEvent known as "Loop Iterations" is defined 
  1247.                with a type of 0x0F.  Perhaps it needs one data byte that 
  1248.                specifies the number of times that a track is looped.  Here's 
  1249.                our event: 
  1250.  
  1251.                1: 1: 0 | Unknown Meta | type=0x0f | len=1 
  1252.                    12      note: I specified decimal instead of hex. That's OK. 
  1253.  
  1254.  
  1255. ΓòÉΓòÉΓòÉ 4.3.2.25. Specific ΓòÉΓòÉΓòÉ
  1256.  
  1257. Type           Specific 
  1258.  
  1259. Occurs when    ??? 
  1260.  
  1261. Other Fields   A program would use this to store data that is specific (ie, 
  1262.                Proprietary) to that program.  For example, maybe a program 
  1263.                wants to save a flag that indicates whether its "event list" 
  1264.                window is displayed or its "score window".  This is just a 
  1265.                specialized version of a Text event.  See Text event for details 
  1266.                of how to supply the data values and/or actual text for the 
  1267.                event. 
  1268.  
  1269. Examples       Assume that a program wants to store an event that contains 1 
  1270.                data byte which specifies upon what MIDI channel the program 
  1271.                recognizes controller messages sent to it (ie, for remote 
  1272.                control). 
  1273.  
  1274.                1: 1: 0 | Specific | len=1 
  1275.                    2      note: I specified decimal instead of hex. That's OK. 
  1276.  
  1277.  
  1278. ΓòÉΓòÉΓòÉ 4.3.2.26. Escape event ΓòÉΓòÉΓòÉ
  1279.  
  1280. Type           Escape event 
  1281.  
  1282. Occurs when    At any time.  This is used to imbed MIDI messages that normally 
  1283.                aren't found in a sequencer data file, such as MIDI Common and 
  1284.                Realtime messages, like Song Position Pointer. 
  1285.  
  1286. Other Fields   This is just a specialized version of a Text event.  See Text 
  1287.                event for details of how to supply the data values and/or actual 
  1288.                text for the event. 
  1289.  
  1290. Examples       Assume that you want to imbed a MIDI Song Select message in a 
  1291.                MIDI file. That has 2 bytes; the 0xF3 status, and a byte that 
  1292.                indicates the song number.  Let's make an event for song number 
  1293.                50. 
  1294.  
  1295.                1: 1: 0 | Escape event | len=2 
  1296.                    0xF3 50    note: I mixed decimal with hex. That's OK. 
  1297.  
  1298.  
  1299. ΓòÉΓòÉΓòÉ 4.3.3. Abbreviating the Event Type field ΓòÉΓòÉΓòÉ
  1300.  
  1301. You don't need to specify the entire Event Type field on an event line.  You 
  1302. only need specify enough characters to distinguish the desired type.  You can 
  1303. safely use a minimum of the first 3 characters of an event type in order to 
  1304. identify it.  For example, instead of typing On Note, you can simply type On. 
  1305. Instead of typing Off Note, you can simply type Off.  This saves some time when 
  1306. entering lots of events. 
  1307.  
  1308.  
  1309. ΓòÉΓòÉΓòÉ 4.3.4. Omitting Time Components ΓòÉΓòÉΓòÉ
  1310.  
  1311. Let's assume that we have a Tempo event on measure 1, beat 1 (ie, right on the 
  1312. downbeat), followed by a Note off event upon the same measure, but on the third 
  1313. beat.  Here are 2 such events, in the order that they must be listed: 
  1314.  
  1315.  1:   1:   0 | tempo | BPM=100 
  1316.  1:   3:   0 | note off | chan=1 | pitch=C3 | vol=100 
  1317.  
  1318. Notice that both events are on measure 1.  When an event is on the same measure 
  1319. as the preceding event, it's measure number can be omitted, as so: 
  1320.  
  1321.  1:   1:   0 | tempo | BPM=100 
  1322.     3:   0 | note off | chan=1 | pitch=C3 | vol=100 
  1323.  
  1324. This blank space makes it easier to see that the second event is in the same 
  1325. measure as the preceding event.  It doesn't matter if the preceding event is 
  1326. the same type or a different type.  You can omit the measure field of an event 
  1327. if the preceding event, whatever the type, is on the same measure. 
  1328. Furthermore, if the preceding event is upon the same measure and beat, you can 
  1329. omit both the measure and beat for the second event.  Let's assume that we have 
  1330. a third, note on event that occurs upon measure 1, beat 1, the second eighth of 
  1331. that beat (assume 192 Division). 
  1332.  
  1333.  1:   1:   0 | tempo | BPM=100 
  1334.        96 | note on | chan=1 | pitch=C3 | vol=100 
  1335.     3:   0 | note off | chan=1 | pitch=C3 | vol=100 
  1336.  
  1337. Of course, if an event is upon the same measure, beat, and subbeat, you can 
  1338. omit all 3 fields. 
  1339.  
  1340.  1:   1:   0 | tempo | BPM=100 
  1341.        96 | note on | chan=1 | pitch=C3 | vol=100 
  1342.     3:   0 | note off | chan=1 | pitch=C3 | vol=100 
  1343.         | tempo | BPM=150 
  1344.  
  1345. The above 150 BPM tempo event gets "played" upon the exact same time as the 
  1346. preceding note off event. 
  1347.     When you have large amounts of events occurring upon the same measure, 
  1348. beats, and/or subbeats, omitting time components makes it much easier to see 
  1349. where the measure and beat boundaries occur.  That makes editing easier. 
  1350. Furthermore, if you wish to move an entire excerpt of events to a new playback 
  1351. time (ie, maybe move all events in measure 4 over to measure 6), you'll have 
  1352. less time components to edit. 
  1353.     You aren't required to omit time components.  You can always specify the 
  1354. measure, beat, and subbeat for every event.  But, doing otherwise can improve 
  1355. readability and make editing time fields easier. 
  1356.     Furthermore, note that in order to omit the beat component, the measure 
  1357. component must also be the same as the preceding event.  To omit the subbeat 
  1358. component, both the beat and measure components must be the same as the 
  1359. preceding components. 
  1360.  
  1361.  
  1362. ΓòÉΓòÉΓòÉ 4.4. Unknown Chunk Header line ΓòÉΓòÉΓòÉ
  1363.  
  1364. A MIDI file may contain a chunk that is defined by the application that created 
  1365. the file.  Obviously, the purpose and contents of that chunk would be unknown 
  1366. to any other application.  An Unknown Chunk can occur anyplace that you might 
  1367. put a Track Header.  (ie, It must come after the MThd Header line, and of 
  1368. course, you can't put an Unknown Chunk in the middle of a track's data). 
  1369.     Every chunk must have an ID.  This is 4, ascii characters that uniquely 
  1370. identify the chunk.  For example, Xtra is a legal ID for a chunk.  The only 2 
  1371. ID's you can't use are MThd and MTrk, as these are already used for defined 
  1372. chunks in a MIDI file. 
  1373.     Every chunk must also have a len which is how many data values (ie, bytes) 
  1374. are contained in the chunk. 
  1375.     When MF_DSM encounters such a chunk, it displays an Unknown Chunk Header 
  1376. line with 3 fields.  The first field contains the text Unknown Chunk.  The 
  1377. second field contains the chunk's ID, enclosed with the characters < and >. 
  1378. The last field is the len. 
  1379.     The data values are then displayed upon subsequent lines, with the 
  1380. equivalent ascii characters to the left, enclosed with the characters < and >. 
  1381. (ie, This is much the same layout as with text type of events). 
  1382.  
  1383.  
  1384. ΓòÉΓòÉΓòÉ 5. Assembly Format ΓòÉΓòÉΓòÉ
  1385.  
  1386. Assembly is the process of taking a text file (ie, human readable "source 
  1387. code") describing events and headers in a MIDI file and converting it back into 
  1388. a MIDI (binary) file.  MF_ASM does this.  MF_ASM requires that you follow the 
  1389. guidelines used by MF_DSM in formatting your source code.  In addition, MF_ASM 
  1390. also supports a few additional features that you can add to the source code 
  1391. which allows further processing. 
  1392.  
  1393.  
  1394. ΓòÉΓòÉΓòÉ 5.1. Track Header fields ΓòÉΓòÉΓòÉ
  1395.  
  1396. As mentioned, the start of a track is indicated with a Track Header line.  This 
  1397. is a line that must start with the text Track # usually followed by the number 
  1398. of the track.  After this mandatory initial field, there are several other 
  1399. fields that can be added to the Track Header line.  These fields apply to all 
  1400. events within that track, and offer numerous ways of easily processing the 
  1401. entire track as a whole. 
  1402.  
  1403. Just as with the Event lines and MThd Header line, a | character is used to 
  1404. separate the fields on the Track Header line.  An = sign is used to assign 
  1405. values to fields.  The | can optionally be omitted after the last field.  For 
  1406. example, here's how you might specify a Track Header line with two of its 
  1407. possible, additional fields: 
  1408.  
  1409. Track #0 | transpose = -2 | chan=3 
  1410.  
  1411. Note how the fields are separated by a | character.  Optional fields (ie, after 
  1412. the Track # field) can appear in any order, and you may include any or all of 
  1413. the possible fields. 
  1414.  
  1415. Note:  If editing a Track Header line created by MF_DSM, it's OK to leave the * 
  1416.        filler characters at the end of the line.
  1417.  
  1418. Note that whatever fields you include on a Track Header line only affect the 
  1419. events in those tracks, and not events in other tracks.  So, you can have 
  1420. separate map and filter files, and various settings for each track.  If you 
  1421. wanted a specific setting for all tracks in the source code, you'd have to add 
  1422. the appropriate field to every Track Header line. 
  1423.  
  1424. The following sections list each possible field that can be added to the Track 
  1425. Header line.  Each page tells what the field's name is, what its purpose is, 
  1426. what values can be assigned to it, and gives an example of its use. 
  1427.  
  1428.  
  1429. ΓòÉΓòÉΓòÉ 5.1.1. Chan ΓòÉΓòÉΓòÉ
  1430.  
  1431. Field          Chan 
  1432.  
  1433. Purpose        This is a global MIDI channel setting which will override the 
  1434.                channel assignments of individual events in a track.  In other 
  1435.                words, it forces all MIDI events in the track to be on this one 
  1436.                MIDI channel.  If all of the events in a track happen to be for 
  1437.                a single musical part (which is common in Format 1 files), it 
  1438.                would make sense that all of the events would be on the same 
  1439.                MIDI channel.  In this case, the global chan can quickly 
  1440.                reassign that musical part to a different channel. 
  1441.  
  1442. Values         The desired MIDI channel is assigned to this field.  This will 
  1443.                be 1 of 16 (ie, a number from 1 to 16). 
  1444.  
  1445. Examples       Track #0 | chan=12   <- Forces all events to MIDI channel 12 
  1446.  
  1447.  
  1448. ΓòÉΓòÉΓòÉ 5.1.2. Transpose ΓòÉΓòÉΓòÉ
  1449.  
  1450. Field          Transpose 
  1451.  
  1452. Purpose        Tranposes all of the On Note, Off Note, (Off) Note, and 
  1453.                Aftertouch events in the track up or down by half steps. 
  1454.  
  1455. Values         The transpose amount, in +/- half steps is assigned to this 
  1456.                field.  This will be a number from -127 to 127. 
  1457.  
  1458.                Note:  If you specify a transpose amount that happens to 
  1459.                       transpose a note out of the MIDI note range, MF_ASM will 
  1460.                       abort with an error.  You'll have to locate that Event 
  1461.                       Line and change the note's pitch so that it remains in 
  1462.                       the legal note range after transposition (or delete the 
  1463.                       event if it isn't needed).
  1464.  
  1465. Examples       Track #0 | transpose=-1  <- transposes down a half step 
  1466.                Track #0 | transpose=2  <- transposes up a whole step 
  1467.                Track #0 | transpose = 12   <- transposes up an octave 
  1468.  
  1469.  
  1470. ΓòÉΓòÉΓòÉ 5.1.3. Vol ΓòÉΓòÉΓòÉ
  1471.  
  1472. Field          Vol 
  1473.  
  1474. Purpose        Scales the volume (ie, note velocity) of all On Note and Off 
  1475.                Note events in the track by a specified percentage.  Since note 
  1476.                velocity is most often tied to the VCA on most MIDI units, this 
  1477.                effects an overall master volume control for the track. 
  1478.  
  1479. Values         The volume percentage is assigned to this field.  This can be 
  1480.                any number from 1 to several thousand (although every note will 
  1481.                be clipped using percentages > 12800).  Percentages less than 
  1482.                100% lower the volume of a track.  Percentages > 100% raise the 
  1483.                volume of a track.  A percentage of 100% is a special case. 
  1484.                This signifies that you want MF_ASM to set all the volumes of 
  1485.                all On Note and Off Note events in the track to the same volume 
  1486.                as the first such event in the track.  Thus, you can force all 
  1487.                notes to a particular volume. 
  1488.  
  1489.                Note:  If a Vol > 100% causes some event's volume to be clipped 
  1490.                       (ie, MIDI velocity only goes up to 127), then MF_ASM will 
  1491.                       display a warning message but not abort.  Clipping a MIDI 
  1492.                       note's volume doesn't cause "distortion" the way that an 
  1493.                       overloading amp might, but rather is more like a limiter.
  1494.  
  1495. Examples       Track #0 | vol=200% <- double the volume 
  1496.                Track #0 | vol=50%     <- halve the volume 
  1497.  
  1498.                Track #0 | vol=100% 
  1499.                1: 1: 0 | On Note | pitch=C3 | vol=64  <- all volumes are forced 
  1500.                to 64 
  1501.  
  1502.  
  1503. ΓòÉΓòÉΓòÉ 5.1.4. Exclude ΓòÉΓòÉΓòÉ
  1504.  
  1505. Field          Exclude 
  1506.  
  1507. Purpose        Allows you to specify a list of MIDI channels to filter.  In 
  1508.                other words, all events on those MIDI channels will be filtered 
  1509.                out of the track when MF_ASM assembles the source code.  This is 
  1510.                useful for extracting particular musical parts from a track 
  1511.                since most musical parts are entirely contained upon one MIDI 
  1512.                channel.  This also allows converting a Format 0 file (ie, one 
  1513.                track which likely contains numerous MIDI channels) into Format 
  1514.                1 by assembling several versions of the original source listing, 
  1515.                each with a different Exclude assignment, disassembling the 
  1516.                resulting MIDI files into source listings, and combining those 
  1517.                into a source listing with multiple tracks and Format=1. 
  1518.  
  1519. Values         The MIDI channels that are to be excluded are assigned to this 
  1520.                field.  Each channel should be separated by a space or 
  1521.                non-numeric character other than | or =.  If you wish to place a 
  1522.                comment after this field, it's best to end the field with the | 
  1523.                character. 
  1524.  
  1525. Examples       Track #0 | exclude= 1, 14, 15 |  <-filters out events on 
  1526.                channels 1, 14, and 15 
  1527.                Track # | exclude = 1  14 15 |  <- same thing, with spaces 
  1528.                instead of , 
  1529.  
  1530.  
  1531. ΓòÉΓòÉΓòÉ 5.1.5. Options ΓòÉΓòÉΓòÉ
  1532.  
  1533. Field          Options 
  1534.  
  1535. Purpose        Specifies various options. 
  1536.  
  1537. Values         The specific options that you desire are assigned to this field. 
  1538.                Each option should be separated by a space.  This field should 
  1539.                always be ended with a | character.  The allowable options are: 
  1540.  
  1541.                0vel -- This converts all Off Note events in the track to (Off) 
  1542.                Note events which may reduce the size of the MIDI file or make 
  1543.                it more efficient for playback over MIDI (assuming that the file 
  1544.                has Off Note events in it).  If your MIDI unit can't make use of 
  1545.                key release velocity, you may as well use this option. 
  1546.  
  1547.                off -- Causes MF_ASM to add (Off) Note events at the end of a 
  1548.                track if any On Note events within it haven't been turned off. 
  1549.                In other words, it turns off notes that might otherwise be 
  1550.                "stuck" if you played back the track.  If you're editing 
  1551.                deleting or editing the note pitches of On Note events, remember 
  1552.                that you also have to make the respective change to the 
  1553.                subsequent Off Note or (Off) Note event that goes with that On 
  1554.                Note.  The opposite is also true.  Furthermore, if you're 
  1555.                changing around the order of events, make sure that you don't 
  1556.                reverse the order of On Note and its respective Off or (Off). 
  1557.                The Off or (Off) must come after the On.  Finally, if you're 
  1558.                inserting new On Note events, you have to make Off or (Off) 
  1559.                events for them.  This option will at least help account for 
  1560.                sloppy editing that violates the preceding rules, and result in 
  1561.                a MIDI file that doesn't have inherent stuck notes.  (But, a 
  1562.                note may end up held all of the way to the end of the track, 
  1563.                which could be musically unpleasant).  Note that MF_ASM also 
  1564.                deletes Off or (Off) events that don't have a preceding On 
  1565.                event.  (In that case, a WARNING message is displayed).  So, 
  1566.                with this option, you're at least safe from stuck notes upon 
  1567.                playing a MIDI file in which you've performed some of the 
  1568.                described edits. 
  1569.  
  1570. Examples       Track #0 | options = off |  Just "off" option 
  1571.                Track #0 | options = 0vel | <- Just 0vel option 
  1572.                Track #0 | options = 0vel off | <- both options 
  1573.  
  1574.  
  1575. ΓòÉΓòÉΓòÉ 5.1.6. Filter ΓòÉΓòÉΓòÉ
  1576.  
  1577. Field          Filter 
  1578.  
  1579. Purpose        Allows you to specify which Event Types are to be filtered from 
  1580.                the track.  You can filter any of the event types listed in the 
  1581.                Disassembly Format's Event Type Field sections.  For example, 
  1582.                you can filter all Tempo event types from a track,  making it 
  1583.                possible to easily extract a "tempo map" from a Format 0's 
  1584.                track.  Or you can do other processing such as removing 
  1585.                Aftertouch events, etc. 
  1586.  
  1587. Values         You must create another text file (in addition to your source 
  1588.                code) that contains a list of all the Event Types that you wish 
  1589.                to filter out of the track.  Each Event Type should be on its 
  1590.                own line.  You can use Event Type abbreviations if desired to 
  1591.                save typing.  Then, you assign the name of that text file to the 
  1592.                Filter field.  You should enclose the filename in double quotes 
  1593.                and end the field with a | character.  You may fully qualify the 
  1594.                filename (ie, prepend the complete path as you would on a 
  1595.                command line). 
  1596.  
  1597. Examples       Assume that you wish to filter all note events (ie, On Note, Off 
  1598.                Note, and (Off) Note) in a track.  We'll create a text file 
  1599.                called DataFile on the C: drive.  This text file should contain 
  1600.                those 3 Event Types, each on its own line, as so: 
  1601.  
  1602.                On Note 
  1603.                Off Note 
  1604.                (Off) Note 
  1605.  
  1606.                Now, we specify the Filter field as so: 
  1607.  
  1608.                Track #0 | filter="c:\datafile" 
  1609.  
  1610.  
  1611. ΓòÉΓòÉΓòÉ 5.1.7. Map ΓòÉΓòÉΓòÉ
  1612.  
  1613. Field          Map 
  1614.  
  1615. Purpose        Allows you to specify which note (and aftertouch) pitches get 
  1616.                mapped to other note pitches, and also can specify which 
  1617.                specific note (and aftertouch) pitches are to be filtered from 
  1618.                the track.  For example, you can filter all note and aftertouch 
  1619.                pitches from C3 to C4, and remap any D5 note and aftertouch to 
  1620.                F1.  This is very useful for remapping drum note assignments, or 
  1621.                filtering out musical parts that are all on the same MIDI 
  1622.                channel (in different note ranges, such as a split-keyboard 
  1623.                might produce). 
  1624.  
  1625. Values         You must create another text file (in addition to your source 
  1626.                code) that contains a list of all the pitches that you wish to 
  1627.                remap, as well as any pitches that you wish to filter out of the 
  1628.                track.  Each pitch remapping or filtering should be on its own 
  1629.                line.  For remapping, you specify the pitch that you want to be 
  1630.                remapped, followed by the pitch that you want it to be mapped 
  1631.                to.  Separate the two with an = sign.  For pitch filtering, 
  1632.                start with an = sign, and follow it with the pitch that you want 
  1633.                filtered from the track. 
  1634.  
  1635. Examples       For the following example,  we'll always create a text file 
  1636.                called DataFile on the C: drive.  So, our Track Header would 
  1637.                always look like: 
  1638.  
  1639.                Track #0 | map = "c:\datafile" | 
  1640.  
  1641.                Assume that you wish to remap all C4 pitches to D#5 and all B3 
  1642.                to F#-1.  Here's what the data file should look like: 
  1643.  
  1644.                C4 = D#5 
  1645.                B3 = F#-1 
  1646.  
  1647.                Note:  Blank spaces can be added anywhere to improve 
  1648.                       readability, just like when you specify the pitch in your 
  1649.                       source code.  Also, capitalization is optional.
  1650.  
  1651.                Assume that you wish to filter all D#5 and B3 pitches from the 
  1652.                track.  Here's what the data file should look like: 
  1653.  
  1654.                = D#5 
  1655.                = B3 
  1656.  
  1657.                Assume that you wish to remap C4 to D#5 and filter F#-1.  Here's 
  1658.                what the data file should look like: 
  1659.  
  1660.                C4 = D#5 
  1661.                  = F#-1 
  1662.  
  1663.                It doesn't matter which order you specify pitches in the file 
  1664.                (ie, low pitches before higher, etc).  But, if you normally 
  1665.                specify lower pitches first, then you can save typing on the 
  1666.                pitch after the = sign (ie, destination pitch).  If you omit the 
  1667.                destination pitch, it defaults to one higher than the previous 
  1668.                destination pitch.  For example: 
  1669.  
  1670.                C3  = C4 
  1671.                C#3 =      ;C#3 is remapped to C#4 because the preceding 
  1672.                destination pitch is C4 
  1673.                D3  =      ;D3 is remapped to D4 because the preceding 
  1674.                destination pitch is C#4 
  1675.  
  1676.                This also works on filtering.  For example, here's how to filter 
  1677.                all notes and aftertouch in the range C3 to B3 inclusive. 
  1678.  
  1679.                = C3  ;filter C3 
  1680.                =    ;filter C#3 because the preceding destination pitch is C3 
  1681.                =    ;filter D3 because the preceding destination pitch is C#3 
  1682.                =    ;filter D#3 because the preceding destination pitch is D3 
  1683.                =    ;filter E3 because the preceding destination pitch is D#3 
  1684.                =    ;filter F3 because the preceding destination pitch is E3 
  1685.                =    ;filter F#3 because the preceding destination pitch is F3 
  1686.                =    ;filter G3 because the preceding destination pitch is F#3 
  1687.                =    ;filter G#3 because the preceding destination pitch is G3 
  1688.                =    ;filter A3 because the preceding destination pitch is G#3 
  1689.                =    ;filter A#3 because the preceding destination pitch is A3 
  1690.                =    ;filter B3 because the preceding destination pitch is A#3 
  1691.  
  1692.                Note:  If you wish to put comments in a map file, it would be 
  1693.                       best to preface them with a ; or /* character, or some 
  1694.                       other non alphabetic character (other than =).
  1695.  
  1696.  
  1697. ΓòÉΓòÉΓòÉ 5.2. Commenting the source ΓòÉΓòÉΓòÉ
  1698.  
  1699. Often, it's convenient to add comments to your source code which MF_ASM should 
  1700. ignore when assembling the code.  Generally, comments are placed at the end of 
  1701. a line, or on a separate line.  An important point is that you should never use 
  1702. the | character anywhere in a comment since this is used by MF_ASM to find the 
  1703. end of fields.  Furthermore, if the comment is to appear at the end of an MThd 
  1704. Header, Track Header, or event line, you should not use the = character 
  1705. anywhere in a comment.  There may be other exceptions for individual Event 
  1706. Types.  For example, avoid using the / character in a comment at the end of a 
  1707. Time Signature event line.  Avoid using the < or > characters in a comment at 
  1708. the end of any Text type of event (ie, Marker, Cue Point, Lyric, Instrument, 
  1709. etc). 
  1710.     Generally, it's always safe to put a comment on its own line, begin the 
  1711. comment with some non alphabetic character (such as ;), and don't use the | 
  1712. character.  Follow this policy, and your comments should be transparent to the 
  1713. assembler. 
  1714.  
  1715.  
  1716. ΓòÉΓòÉΓòÉ 6. Error Messages ΓòÉΓòÉΓòÉ
  1717.  
  1718. Here are the possible error messages that you may see.  Following each message 
  1719. is a description of likely causes for that error and possible remedies. 
  1720.  
  1721.  
  1722. ΓòÉΓòÉΓòÉ 6.1. Memory Commitment Fail/Memory Allocation ΓòÉΓòÉΓòÉ
  1723.  
  1724. Synopsis       The assembler and disassembler need to allocate some memory to 
  1725.                do their work.  Either of these 2 errors means that OS/2 did not 
  1726.                grant that memory, and therefore the program can't continue. 
  1727.  
  1728. Cause          Not enough free RAM in your system, and your swap file is full. 
  1729.  
  1730. Cure           Terminate other programs that you don't need running.  Buy more 
  1731.                RAM. 
  1732.  
  1733.  
  1734. ΓòÉΓòÉΓòÉ 6.2. Can't open input file ΓòÉΓòÉΓòÉ
  1735.  
  1736. Synopsis       A file, that you asked MF_ASM to convert to MIDI, or that you 
  1737.                asked MF_DSM to convert to text, didn't open. 
  1738.  
  1739. Cause          The filename that you specified is incorrect. 
  1740.  
  1741. Cure           Check the filename that you entered.  Does it exist?  Did you 
  1742.                specify the path if it was needed? 
  1743.  
  1744. Cause          Some other program has this filename currently in use, and is 
  1745.                preventing SHARED access. 
  1746.  
  1747. Cure           Make that other program close this filename. 
  1748.  
  1749.  
  1750. ΓòÉΓòÉΓòÉ 6.3. Can't open the MIDI file to save ΓòÉΓòÉΓòÉ
  1751.  
  1752. Synopsis       A file, that you asked MF_ASM or MF_DSM to create, didn't open. 
  1753.  
  1754. Cause          The filename that you specified is incorrect. 
  1755.  
  1756. Cure           Check the filename that you entered.  Did you specify some 
  1757.                directory that doesn't exist?  The utilities only creates files; 
  1758.                not new directories. 
  1759.  
  1760. Cause          Some other program has this filename currently in use, and is 
  1761.                preventing SHARED access. 
  1762.  
  1763. Cure           Make that other program close this filename. 
  1764.  
  1765. Cause          You chose to save data upon some media that is write-protected. 
  1766.  
  1767. Cure           Remove the write-protection. 
  1768.  
  1769.  
  1770. ΓòÉΓòÉΓòÉ 6.4. Format 0 can only have 1 Track ΓòÉΓòÉΓòÉ
  1771.  
  1772. Synopsis       You've asked MF_ASM to assemble a source listing where you set 
  1773.                the MThd's Format=0 but the # of Tracks is greater than 1.  A 
  1774.                Format 0 file can only have 1 track. 
  1775.  
  1776. Cure           Either change the Format to 1 or 2 if you want more than one 
  1777.                track in the file, or change # of Tracks to 1. 
  1778.  
  1779.  
  1780. ΓòÉΓòÉΓòÉ 6.5. No MThd! Must not be a MIDI text file ΓòÉΓòÉΓòÉ
  1781.  
  1782. Synopsis       MF_ASM can't find your MThd Header line in your source code. 
  1783.  
  1784. Cause          You placed characters (other than spaces) before the MThd field 
  1785.                of the MThd Header line. 
  1786.  
  1787. Cure           Delete those characters. 
  1788.  
  1789. Cause          You forgot to put an MThd Header line in your source code. 
  1790.  
  1791. Cure           Put it in, dummy. 
  1792.  
  1793. Cause          You didn't spell MThd properly.  Capitalization isn't important, 
  1794.                but you do need the correct letters. 
  1795.  
  1796. Cure           Learn to spell. 
  1797.  
  1798.  
  1799. ΓòÉΓòÉΓòÉ 6.6. Line XXX: Event time out of order ΓòÉΓòÉΓòÉ
  1800.  
  1801. Synopsis       An event's time is out of order with respect to its placement in 
  1802.                the source code.  The XXX in the message will be the line number 
  1803.                within the source code where the error occurred. 
  1804.  
  1805. Cause          The event has a measure:beat:clock that puts it ahead of the 
  1806.                event that is on the line above it. 
  1807.  
  1808. Cure           You must place the events in the source code with respect to 
  1809.                their time-stamps.  The earliest events in a track are first 
  1810.                after their Track Header line.  Check the event before the 
  1811.                erroneous event.  Is the preceding event on a later measure 
  1812.                number than the erroneous event?  If the measures are the same, 
  1813.                is the preceding event on a later beat number than the erroneous 
  1814.                event?  If the measures and beats are both the same, is the 
  1815.                preceding event on a later clock number than the erroneous 
  1816.                event?  If so, reverse the order of the events. 
  1817.  
  1818. Cause          That erroneous line was supposed to be a comment, but MF_ASM 
  1819.                thought it was an event line, which it didn't make sense as. 
  1820.  
  1821. Cure           Make sure that you didn't use the | character in your comment. 
  1822.                Also make sure that you didn't forget the End of track event at 
  1823.                the end of any track prior to where the error occurred. 
  1824.  
  1825.  
  1826. ΓòÉΓòÉΓòÉ 6.7. Line XXX: Event time exceeds current time signature ΓòÉΓòÉΓòÉ
  1827.  
  1828. Synopsis       An event's time is out of order with respect to the current time 
  1829.                signature.  The XXX in the message will be the line number 
  1830.                within the source code where the error occurred. 
  1831.  
  1832. Cause          You changed a Time Signature such that it invalidated some event 
  1833.                time in a track, but neglected to resolve that invalidation.  In 
  1834.                other words, if an event supposedly occurs on beat 4 of some 
  1835.                measure, and you change the time signature to 3/4 (ie, there is 
  1836.                no fourth beat), then you invalidate the event's time.  This 
  1837.                could cause problems with MF_ASM calculating an event's time, 
  1838.                and result in this error message.  Furthermore, it's possible to 
  1839.                also have problems with the subbeat component if you've changed 
  1840.                the denominator of the time signature.  For example, in going 
  1841.                from 4/4 to 4/8, the beat changes from a quarter note to an 
  1842.                eighth note.  Therefore, at 192 PPQN, the beat goes from 
  1843.                spanning 192 subbeats to spanning only 192/2 subbeats.  If you 
  1844.                have a subsequent event supposedly on the 97th subbeat of a 
  1845.                beat, then you've got an invalid time. 
  1846.  
  1847. Cure           Check the Time Signature event that comes before the erroneous 
  1848.                event.  (In a Format 1, all of the Time Signatures should be in 
  1849.                the first track, and these determine time references for all 
  1850.                tracks).  That's the current time signature.  Does the beat of 
  1851.                the erroneous event jive with the Time Signature's "numerator"? 
  1852.                Does the subbeat of the erroneous event jive with the Time 
  1853.                Signature's "denominator"? 
  1854.  
  1855.  
  1856. ΓòÉΓòÉΓòÉ 6.8. Line XXX: Number of bytes supplied is less than specified length ΓòÉΓòÉΓòÉ
  1857.  
  1858. Synopsis       You didn't supply as many bytes as the len field indicates for 
  1859.                some text event (ie, Text event, Marker, Lyric, Cue Point, Track 
  1860.                name, etc) or an Unknown Chunk.  The XXX indicates the line 
  1861.                number in the source code where the erroneous event began (ie, 
  1862.                on the first line of the event, before all of the subsequent 
  1863.                data values or text). 
  1864.  
  1865. Cause          The len field specifies more values than you intended, or you 
  1866.                forgot to specify all of those values. 
  1867.  
  1868. Cure           Check the len field of the event.  Then, count how many values 
  1869.                or text characters you've supplied.  Make sure that the two 
  1870.                match. 
  1871.  
  1872. Cause          You specified text instead of data values, but forget to enclose 
  1873.                the text inbetween < and > characters. 
  1874.  
  1875. Cure           Make sure that the text  is enclosed within < and >.  If your 
  1876.                text spans multiple lines, make sure that each line of text is 
  1877.                separately enclosed with < and >. 
  1878.  
  1879.  
  1880. ΓòÉΓòÉΓòÉ 6.9. Line XXX: Can't open map file ΓòÉΓòÉΓòÉ
  1881.  
  1882. Synopsis       The filename that you supplied for a Track Header's map field 
  1883.                can't be opened.  The XXX indicates the line number where the 
  1884.                erroneous Track Header occurs in the source code. 
  1885.  
  1886. Cause          The filename that you specified is incorrect. 
  1887.  
  1888. Cure           Check the filename that you entered.  Does it exist?  Did you 
  1889.                specify the path if it was needed? 
  1890.  
  1891. Cause          Some other program has this filename currently in use, and is 
  1892.                preventing SHARED access. 
  1893.  
  1894. Cure           Make that other program close this filename. 
  1895.  
  1896.  
  1897. ΓòÉΓòÉΓòÉ 6.10. Line XXX: Can't open filter file ΓòÉΓòÉΓòÉ
  1898.  
  1899. Synopsis       The filename that you supplied for a Track Header's filter field 
  1900.                can't be opened.  The XXX indicates the line number where the 
  1901.                erroneous Track Header occurs in the source code. 
  1902.  
  1903. Cause          The filename that you specified is incorrect. 
  1904.  
  1905. Cure           Check the filename that you entered.  Does it exist?  Did you 
  1906.                specify the path if it was needed? 
  1907.  
  1908. Cause          Some other program has this filename currently in use, and is 
  1909.                preventing SHARED access. 
  1910.  
  1911. Cure           Make that other program close this filename. 
  1912.  
  1913.  
  1914. ΓòÉΓòÉΓòÉ 6.11. map file line XXX: Note out of range ΓòÉΓòÉΓòÉ
  1915.  
  1916. Synopsis       Some pitch listed in the map file is beyond the legal MIDI note 
  1917.                range.  For example G#33 is way out of range.  The XXX indicates 
  1918.                the line number upon which the bad pitch occurs in the map file. 
  1919.  
  1920. Cure           Check the pitches specified on that line.  If you have comments 
  1921.                at the end of the line, try putting a ; character at the start 
  1922.                of the comment to ensure that no numbers or letters in the 
  1923.                comment are being misinterpreted as a pitch. 
  1924.  
  1925.  
  1926. ΓòÉΓòÉΓòÉ 6.12. Line XXX: Bad channel for 'exclude' ΓòÉΓòÉΓòÉ
  1927.  
  1928. Synopsis       One of the MIDI channels that you supplied for a Track Header's 
  1929.                exclude field is not a legal MIDI channel number.  The XXX 
  1930.                indicates the line number where the erroneous Track Header 
  1931.                occurs in the source code. 
  1932.  
  1933. Cause          You specified a channel of 0 or a channel > 16. 
  1934.  
  1935. Cure           MIDI channels are 1 to 16. 
  1936.  
  1937. Cause          If the Exclude field is the last field on the Track Header line, 
  1938.                a | character hasn't closed the field, and what follows is a 
  1939.                comment, MF_DSM may be regarding numbers in the comment as MIDI 
  1940.                channels. 
  1941.  
  1942. Cure           End the Exclude field with the | character. 
  1943.  
  1944. Cause          You separated the channels with more than one, non-space 
  1945.                character (ie, exclude = 3 /// 14 /// 4). 
  1946.  
  1947. Cure           Only use blank space to separate channels, or one non-space 
  1948.                character. 
  1949.  
  1950.  
  1951. ΓòÉΓòÉΓòÉ 6.13. Line XXX: Unknown 'option' SSS ΓòÉΓòÉΓòÉ
  1952.  
  1953. Synopsis       One of the options that you supplied for a Track Header's 
  1954.                options field is not a defined option.  There are only 2; 0vel 
  1955.                and off.  The XXX indicates the line number where the erroneous 
  1956.                Track Header occurs in the source code. 
  1957.  
  1958. Cause          If the Options field is the last field on the Track Header line, 
  1959.                a | character hasn't closed the field, and what follows is a 
  1960.                comment, MF_DSM may be regarding text in the comment as options. 
  1961.  
  1962. Cure           Always end the Options field with the | character. 
  1963.  
  1964. Cause          You separated the options with a non-space character(s). 
  1965.  
  1966. Cure           Only use blank space to separate options. 
  1967.  
  1968.  
  1969. ΓòÉΓòÉΓòÉ 6.14. Line XXX: There are less Tracks defined than the '# of Tracks' indicates ΓòÉΓòÉΓòÉ
  1970.  
  1971. Synopsis       There are less Track Header lines in your source code than your 
  1972.                MThd Header's # of Tracks field indicates.  The XXX indicates 
  1973.                the line number where MF_ASM started searching for another Track 
  1974.                Header which it expected to find but never did. 
  1975.  
  1976. Cause          If your source does indeed have some Track Header line after the 
  1977.                line number displayed in the error message, then you've probably 
  1978.                made a mistake specifying the Track Header. 
  1979.  
  1980. Cure           Make sure that the Track Header line begins with Track #, and 
  1981.                that it is the first text on that line. 
  1982.  
  1983. Cause          The MThd # of Tracks indicates more tracks than you intended, or 
  1984.                you forgot to add that many Track Header lines to the source 
  1985.                code. 
  1986.  
  1987. Cure           Make sure that these conditions match. 
  1988.  
  1989.  
  1990. ΓòÉΓòÉΓòÉ 6.15. Line XXX: Undefined Event Type ΓòÉΓòÉΓòÉ
  1991.  
  1992. Synopsis       The second field of an event line (ie, the Event Type field) has 
  1993.                some text that isn't recognized as one of the defined event 
  1994.                types (as listed in the Disassembly Format's Event Type Field 
  1995.                sections).  The XXX indicates the line number where MF_ASM found 
  1996.                an event type that it didn't understand. 
  1997.  
  1998. Cause          That erroneous line was supposed to be a comment, but MF_ASM 
  1999.                thought it was an event line, which it didn't make sense as. 
  2000.  
  2001. Cure           Make sure that you didn't use the | character in your comment. 
  2002.                Also make sure that you didn't forget the End of track event at 
  2003.                the end of any track prior to where the error occurred. 
  2004.  
  2005. Cause          You misspelled the Event Type. 
  2006.  
  2007. Cure           Learn to spell. 
  2008.  
  2009. Cause          You forgot the Event Type field entirely, or didn't place it as 
  2010.                the second field. 
  2011.  
  2012. Cure           Read this entire book again, dummy, this time with your eyes 
  2013.                open. 
  2014.  
  2015.  
  2016. ΓòÉΓòÉΓòÉ 6.16. Line XXX: Missing Event Type ΓòÉΓòÉΓòÉ
  2017.  
  2018. Synopsis       MF_ASM encounters what appears to be an event line with only a 
  2019.                Time field (ie, missing all other fields).  The XXX indicates 
  2020.                the line number where MF_ASM found the erroneous line. 
  2021.  
  2022. Cause          That erroneous line was supposed to be a comment, but MF_ASM 
  2023.                thought it was an event line, which it didn't make sense as. 
  2024.  
  2025. Cure           Make sure that you didn't use the | character in your comment. 
  2026.                Also make sure that you didn't forget the End of track event at 
  2027.                the end of any track prior to where the error occurred. 
  2028.  
  2029. Cause          You forgot the Event Type field entirely, or didn't place it as 
  2030.                the second field. 
  2031.  
  2032. Cure           Read this entire book again, dummy, this time with your eyes 
  2033.                open. 
  2034.  
  2035.  
  2036. ΓòÉΓòÉΓòÉ 6.17. Line XXX: No 'End of Track' event for Track ΓòÉΓòÉΓòÉ
  2037.  
  2038. Synopsis       MF_ASM nevers found the required End of track event line at the 
  2039.                end of a track.  The XXX indicates the line number where MF_ASM 
  2040.                might have expected such an event. 
  2041.  
  2042. Cure           Make sure that the Track Header line before where the error 
  2043.                occurred has a subsequent End of track event. 
  2044.  
  2045.  
  2046. ΓòÉΓòÉΓòÉ 6.18. Line XXX: Sysex data byte has value > 127 (ie, 0x7F) ΓòÉΓòÉΓòÉ
  2047.  
  2048. Synopsis       While processing a Sysex, First Packet, Packet, or Last Packet 
  2049.                event, MF_ASM encountered a data value greater than 0x7F.  This 
  2050.                is not a legal value for a data byte in a sysex message (with 
  2051.                the exception of the first and last bytes).  The XXX indicates 
  2052.                the line number where MF_ASM encountered the illegal value. 
  2053.  
  2054. Cause          The len field of that event specifies more values than you 
  2055.                intended, or you forgot to specify all of those values. 
  2056.  
  2057. Cure           Check the len field of the event.  Then, count how many values 
  2058.                you've supplied.  Make sure that the two match. 
  2059.  
  2060. Cause          You have a comment at the end of the line which contains numeric 
  2061.                characters (ie, 1 ,2, 3, etc). 
  2062.  
  2063. Cure           For these Sysex events, it's best to place comments only after 
  2064.                all of the data values. 
  2065.  
  2066.  
  2067. ΓòÉΓòÉΓòÉ 6.19. Line XXX: Note transposed out of range ΓòÉΓòÉΓòÉ
  2068.  
  2069. Synopsis       The pitch ended up being transposed above or below the legal 
  2070.                MIDI note range.  For example, transposing a C-1 more than 12 
  2071.                half steps down will cause it to be transposed out of range. 
  2072.                The XXX indicates the line number upon which the out of range 
  2073.                transposition occurred. 
  2074.  
  2075. Cure           Change the pitch specified on that line so that it doesn't 
  2076.                transpose out of range.  Or, delete that event if it isn't 
  2077.                needed.  Or, change the Transpose amount for that track so that 
  2078.                it doesn't force the event out of range. 
  2079.  
  2080.  
  2081. ΓòÉΓòÉΓòÉ 6.20. Line XXX: Note out of range ΓòÉΓòÉΓòÉ
  2082.  
  2083. Synopsis       The specified pitch for this event is beyond the legal MIDI note 
  2084.                range.  For example G#33 is way out of range.  The XXX indicates 
  2085.                the line number in the source code upon which the bad pitch 
  2086.                occurs. 
  2087.  
  2088. Cure           Check the pitch specified on that line.  If you have a comment 
  2089.                at the end of the line, make sure that the pitch field is ended 
  2090.                with a | character, and that the comment doesn't contain | or = 
  2091.                characters. 
  2092.  
  2093.  
  2094. ΓòÉΓòÉΓòÉ 6.21. Line XXX: Unknown contr ID SSS ΓòÉΓòÉΓòÉ
  2095.  
  2096. Synopsis       The controller ID text specified for the contrl # field isn't 
  2097.                one of the defined ID's.  The XXX indicates the line number in 
  2098.                the source code upon which the erroneous event occurs. 
  2099.  
  2100. Cure           Make sure that the ID you specified is one of the ID's specified 
  2101.                on the Controller Event Type page. 
  2102.  
  2103.  
  2104. ΓòÉΓòÉΓòÉ 6.22. Line XXX: N/D Time signature doesn't make sense ΓòÉΓòÉΓòÉ
  2105.  
  2106. Synopsis       The time signature field of a Time Signature event is illegal. 
  2107.                The XXX is the line number in the source code upon which the 
  2108.                erroneous event occurs.  N is the "numerator" that MF_ASM found, 
  2109.                and D is the "denominator". 
  2110.  
  2111. Cure           Make sure that you only specify 2, 4, 8, 16, 32 for the 
  2112.                denominator.  Don't specify a 0 numerator. 
  2113.  
  2114.  
  2115. ΓòÉΓòÉΓòÉ 6.23. Line XXX: Bad KKK key signature ΓòÉΓòÉΓòÉ
  2116.  
  2117. Synopsis       The key signature field of a Key Signature event is incorrectly 
  2118.                specified.  The XXX is the line number in the source code upon 
  2119.                which the erroneous event occurs.  KKK is the key that MF_ASM 
  2120.                found. 
  2121.  
  2122. Cure           Make sure that you only specify one of the following keys (in 
  2123.                major or minor): 
  2124.                Cb  Gb  Db  Ab  Eb  Bb  F  C  G  D  A  E  B  F#  C# 
  2125.  
  2126.  
  2127. ΓòÉΓòÉΓòÉ 6.24. Had an error while saving the MIDI file ΓòÉΓòÉΓòÉ
  2128.  
  2129. Synopsis       MF_ASM encountered an error trying to write data to the MIDI 
  2130.                file that it is creating. 
  2131.  
  2132. Cause          There is no more free space upon the media to which MF_ASM is 
  2133.                writing. 
  2134.  
  2135. Cure           Save to a drive or floppy with more free space. 
  2136.  
  2137.  
  2138. ΓòÉΓòÉΓòÉ 6.25. Line XXX: Unknown field for event ΓòÉΓòÉΓòÉ
  2139.  
  2140. Synopsis       While processing an event line, MF_ASM encountered some field 
  2141.                containing a field name that it doesn't recognize for that event 
  2142.                type.  The XXX is the line number in the source code upon which 
  2143.                the extraneous field occurs. 
  2144.  
  2145. Cause          You misspelled a field name (ie, transpoze). 
  2146.  
  2147. Cure           Learn to spell. 
  2148.  
  2149. Cause          You used a | or = character in a comment at the end of the event 
  2150.                line. 
  2151.  
  2152. Cure           Do not use either of these characters in a comment at the end of 
  2153.                any event line. 
  2154.  
  2155. Cause          You used a field name that doesn't belong to this event.  For 
  2156.                example, a Poly Press event does not have a Pitch field even 
  2157.                though an On Note event does. 
  2158.  
  2159. Cure           Consult the appropriate section in the Event Types to determine 
  2160.                what field names a particular event allows. 
  2161.  
  2162.  
  2163. ΓòÉΓòÉΓòÉ 6.26. Line XXX: Deleting a note-off without a matching note-on before it ΓòÉΓòÉΓòÉ
  2164.  
  2165. Synopsis       While processing an Off Note or (Off) Note event line, MF_ASM 
  2166.                recognizes that this event does not have a respective On Note 
  2167.                event preceding it.  MF_ASM therefore deletes this Off or (Off) 
  2168.                Note since it has no purpose in the track. The XXX is the line 
  2169.                number in the source code upon which the extraneous event 
  2170.                occurs. 
  2171.  
  2172. Cause          You deleted the preceding On Note for this (Off) or Off. 
  2173.  
  2174. Cure           Remember to always delete On Note and Off or (Off) events in 
  2175.                pairs.  Every On Note must have a subsequent Off or (Off) on the 
  2176.                same channel and with the same pitch. 
  2177.  
  2178. Cause          You edited the Chan and/or Pitch fields of the preceding On Note 
  2179.                for this (Off) or Off without making the same changes to the Off 
  2180.                or (Off). 
  2181.  
  2182. Cure           Make sure that each On Note is paired with a subsequent Off or 
  2183.                (Off) event on the same channel and with the same pitch. 
  2184.  
  2185.  
  2186. ΓòÉΓòÉΓòÉ 6.27. Line XXX: Unknown field for MThd Header ΓòÉΓòÉΓòÉ
  2187.  
  2188. Synopsis       While processing an MThd Header line, MF_ASM encountered some 
  2189.                field containing a field name that it doesn't recognize for the 
  2190.                MThd.  The XXX is the line number in the source code upon which 
  2191.                the extraneous field occurs. 
  2192.  
  2193. Cause          You misspelled a field name (ie, # of traks). 
  2194.  
  2195. Cure           Learn to spell. 
  2196.  
  2197. Cause          You used a | or = character in a comment at the end of the MThd 
  2198.                Header line. 
  2199.  
  2200. Cure           Do not use either of these characters in a comment at the end of 
  2201.                any event line. 
  2202.  
  2203. Cause          You used a field name that doesn't belong to the MThd.  For 
  2204.                example, the MThd Header does not have a Chan field. 
  2205.  
  2206. Cure           Consult the MThd Header line section to determine what field 
  2207.                names an MThd Header allows. 
  2208.  
  2209.  
  2210. ΓòÉΓòÉΓòÉ 6.28. Line XXX: Unknown field for Track Header ΓòÉΓòÉΓòÉ
  2211.  
  2212. Synopsis       While processing a Track Header line, MF_ASM encountered some 
  2213.                field containing a field name that it doesn't recognize for the 
  2214.                Track Header.  The XXX is the line number in the source code 
  2215.                upon which the extraneous field occurs. 
  2216.  
  2217. Cause          You misspelled a field name (ie, transpoze). 
  2218.  
  2219. Cure           Learn to spell. 
  2220.  
  2221. Cause          You used a | or = character in a comment at the end of the Track 
  2222.                Header line. 
  2223.  
  2224. Cure           Do not use either of these characters in a comment at the end of 
  2225.                any event line. 
  2226.  
  2227. Cause          You used a field name that doesn't belong to the Track Header. 
  2228.                For example, the Track Header does not have a Format field. 
  2229.  
  2230. Cure           Consult the Track Header Fields section to determine what field 
  2231.                names a Track Header allows. 
  2232.  
  2233. Cause          You forget the | character at end of a field that requires it 
  2234.                (ie, the fields that require filenames such as map or filter 
  2235.                need to be terminated with a |, even if at the end of the Track 
  2236.                Header line). 
  2237.  
  2238. Cure           Make sure that there's a | character at the end of each field. 
  2239.  
  2240.  
  2241. ΓòÉΓòÉΓòÉ 6.29. Line XXX: Unknown field for Unknown Chunk ΓòÉΓòÉΓòÉ
  2242.  
  2243. Synopsis       While processing an Unknown Chunk, MF_ASM encountered some field 
  2244.                containing a field name that it doesn't recognize.  The XXX is 
  2245.                the line number in the source code upon which the extraneous 
  2246.                field occurs. 
  2247.  
  2248. Cause          You misspelled a field name (ie, length instead of len). 
  2249.  
  2250. Cure           Use the abbreviation. 
  2251.  
  2252. Cause          You used a | or = character in a comment at the end of the line 
  2253.                after the Unknown Chunk Header. 
  2254.  
  2255. Cure           Do not use either of these characters in a comment at the end of 
  2256.                any event line. 
  2257.  
  2258. Cause          You used a field name that doesn't belong to the Unknown Chunk. 
  2259.                The Unknown Chunk only has 2 fields; the ID and len fields. 
  2260.  
  2261. Cure           Consult the Unknown Chunk Fields section to determine what field 
  2262.                names an Unknown Chunk allows. 
  2263.  
  2264.  
  2265. ΓòÉΓòÉΓòÉ 6.30. Line XXX: Unwritten Track Header ΓòÉΓòÉΓòÉ
  2266.  
  2267. Synopsis       MF_ASM encountered more Track Header lines than the MThd # of 
  2268.                Tracks indicates.  The XXX is the line number in the source code 
  2269.                upon which the extraneous Track Header line occurs. 
  2270.  
  2271. Cause          The MThd # of Tracks indicates less tracks than you intended, or 
  2272.                you forgot to remove extra Track Header lines (and their events) 
  2273.                from the source code. 
  2274.  
  2275. Cure           Make sure that these conditions are resolved. 
  2276.  
  2277.  
  2278. ΓòÉΓòÉΓòÉ 6.31. Line XXX: Volume Clipped ΓòÉΓòÉΓòÉ
  2279.  
  2280. Synopsis       The volume supplied for an On Note or Off Note was beyond 127. 
  2281.                It was therefore clipped to 127.  The XXX is the line number in 
  2282.                the source code of the event whose volume was clipped. 
  2283.  
  2284. Cause          You set the Track Header's Vol to a very high percentage such 
  2285.                that clipping occurred. 
  2286.  
  2287. Cure           Lower the percentage, or lower the individual vol field of the 
  2288.                event that clipped. 
  2289.  
  2290. Cause          You specified a vol greater than 127. 
  2291.  
  2292. Cure           Observe that upper limit. 
  2293.  
  2294.  
  2295. ΓòÉΓòÉΓòÉ 6.32. Line XXX: The following notes haven't been turned off for Track XXX ΓòÉΓòÉΓòÉ
  2296.  
  2297. Synopsis       The end of a track was reached and there were On Note events in 
  2298.                the track which didn't have subsequent, matching Off or (Off) 
  2299.                events (ie, with the same Chan and Pitch).  MF_ASM simply 
  2300.                displays this warning message.  If you invoke the off Option 
  2301.                field in the Track Header line, then MF_ASM will automatically 
  2302.                generate the missing Off Note events.  The XXX is the Track # 
  2303.                which has "stuck notes" in it.  MF_ASM then also displays which 
  2304.                notes on each of the 16 possible MIDI channels in a track are 
  2305.                "stuck on". 
  2306.  
  2307. Cause          You deleted the respective Off Note for an On Note without also 
  2308.                deleting that On Note. 
  2309.  
  2310. Cure           Remember to always delete On Note and Off or (Off) events in 
  2311.                pairs.  Every On Note must have a subsequent Off or (Off) on the 
  2312.                same channel and with the same pitch. 
  2313.  
  2314. Cause          You edited the Chan and/or Pitch fields of an Off Note without 
  2315.                making the same changes to its preceding, respective On Note. 
  2316.  
  2317. Cure           Make sure that each On Note is paired with a subsequent Off or 
  2318.                (Off) event on the same channel and with the same pitch. 
  2319.  
  2320.  
  2321. ΓòÉΓòÉΓòÉ 6.33. Doesn't contain a MThd. Not a MIDI file ΓòÉΓòÉΓòÉ
  2322.  
  2323. Synopsis       You tried to disassemble a binary file that isn't a MIDI file. 
  2324.                All MIDI files must begin with an MThd header.  This one doesn't 
  2325.                and so it isn't a MIDI file. 
  2326.  
  2327.  
  2328. ΓòÉΓòÉΓòÉ 6.34. Found misplaced running status. ΓòÉΓòÉΓòÉ
  2329.  
  2330. Synopsis       While disassembling a MIDI file, MF_DSM discovered an aberration 
  2331.                in the format of some event in a track.  This may be a corrupt 
  2332.                file. 
  2333.  
  2334.  
  2335. ΓòÉΓòÉΓòÉ 6.35. Found an undefined status in the MIDI file ΓòÉΓòÉΓòÉ
  2336.  
  2337. Synopsis       While disassembling a MIDI file, MF_DSM discovered an aberration 
  2338.                in the format of some track.  This may be a corrupt file. 
  2339.  
  2340.  
  2341. ΓòÉΓòÉΓòÉ 6.36. This is a mal-formed MIDI file ΓòÉΓòÉΓòÉ
  2342.  
  2343. Synopsis       While disassembling a MIDI file, MF_DSM discovered an aberration 
  2344.                in the format.  This may be a corrupt file. 
  2345.  
  2346.  
  2347. ΓòÉΓòÉΓòÉ 6.37. Line XXX: Possibly less data values than len indicates ΓòÉΓòÉΓòÉ
  2348.  
  2349. Synopsis       While processing a Sysex, First Packet, Packet, or Last Packet 
  2350.                event, MF_ASM encountered what appears to be less data values 
  2351.                specified than the event's len indicates.  The XXX indicates the 
  2352.                line number where MF_ASM expected more data values, but instead 
  2353.                found a line that looks like the next event line. 
  2354.  
  2355. Cause          The len field of that event specifies more values than you 
  2356.                intended, or you forgot to specify all of those values. 
  2357.  
  2358. Cure           Check the len field of the event.  Then, count how many values 
  2359.                you've supplied.  Make sure that the two match. 
  2360.  
  2361. Cause          You have a comment which contains a | character. 
  2362.  
  2363. Cure           For these Sysex events, it's best to place comments only after 
  2364.                all of the data values, and don't use the | character. 
  2365.  
  2366.  
  2367. ΓòÉΓòÉΓòÉ 6.38. Line XXX: Possibly less data values or text than len indicates ΓòÉΓòÉΓòÉ
  2368.  
  2369. Synopsis       While processing a text type of event (ie, Track name, 
  2370.                Instrument, Marker, Cue Point, etc), MF_ASM encountered what 
  2371.                appears to be less data values or text specified than the 
  2372.                event's len indicates.  The XXX indicates the line number where 
  2373.                MF_ASM expected more data values or text, but instead found a 
  2374.                line that looks like the next event line. 
  2375.  
  2376. Cause          The len field of that event specifies more values or text 
  2377.                characters than you intended, or you forgot to specify all of 
  2378.                those values. 
  2379.  
  2380. Cure           Check the len field of the event.  Then, count how many values 
  2381.                or text characters you've supplied.  Make sure that the two 
  2382.                match. 
  2383.  
  2384. Cause          You have a comment which contains a | character. 
  2385.  
  2386. Cure           For these text events, it's best to place comments only after 
  2387.                all of the data values or text, and don't use the | character. 
  2388.  
  2389. Cause          You omitted the closing > character at the end of a line's text. 
  2390.  
  2391. Cure           Make sure that each line upon which you specify the actual text 
  2392.                (as opposed to data values representing those ascii characters) 
  2393.                has < and > characters enclosing the text. 
  2394.