home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / it214v3.zip / MIDI.TXT < prev    next >
Text File  |  1997-08-10  |  17KB  |  391 lines

  1.  
  2. -------------------------------------
  3. ## Impulse Tracker MIDI Supplement ##
  4. -------------------------------------
  5.  
  6. Introduction
  7. ============
  8.  
  9. The biggest new addition to Impulse Tracker 2.12 has been support for
  10. sending data out through the MIDI protocol. Earlier versions of Impulse
  11. Tracker (IT) have had support for incoming MIDI data, so it was possible to
  12. play on a 'MIDIfied' keyboard and have IT 'track' all the notes down in the
  13. pattern in realtime.
  14.  
  15. MIDI out, however, is a completely different ballgame. You in fact don't
  16. have to read this supplement at all if you wish to get MIDI working, but in
  17. order to gain full usage of MIDI out, you will have to read this in order
  18. to understand how IT's MIDI support fully works
  19.  
  20.  
  21. MIDI Support & Soundcards (Modified by Pulse)
  22. =============================================
  23.  
  24. At present, the only sound devices IT supports for MIDI output are the AMD
  25. InterWave and the Creative Labs Sound Blaster AWE32. Support for other
  26. soundcards is via the generic MPU401 driver. To use this driver, you must
  27. run "IT /S19 /A<address>" where <address> is the address of your MPU401
  28. compatible card (eg. "IT /S19 /A330"). Note that the generic MPU401 driver
  29. does *NOT* support sample playback at all.
  30.  
  31. MIDI And AWE32 Soundcards (Pulse)
  32. ---------------------------------
  33.  
  34. I have found that the Windows '95 drivers for the AWE32 are somewhat buggy.
  35. On my computer, I can use MIDI In/Out in Impulse Tracker *IF* I disable the
  36. MIDI support within Windows '95. Otherwise, it is simply not recognised. To
  37. disable the MIDI support in Windows '95, right click on "My Computer",
  38. "Properties", "Device Configuration", "Sound, Video & Game Controllers".
  39. Double click on "Creative Labs SB16 or AWE32" and go to the resources.
  40. Uncheck the "Use Automatic Settings" box if it is set and change the basic
  41. configuration to one that does NOT include the MIDI Ports 300h or 330h.
  42. (For example, Basic Configuration 0 has only 220h, 5, 1, 5 on my computer
  43.  and IT works fine in a DOS Box)
  44.  
  45.  
  46. Enabling MIDI
  47. =============
  48.  
  49. To enable MIDI output, you must first have IT on Instrument control mode
  50. rather than Sample control mode. To do this, press F12 to go to the Song
  51. Variables screen and switch control to 'Instruments' if you haven't already
  52. done so.
  53.  
  54.  
  55. MIDI & Instruments
  56. ==================
  57.  
  58. MIDI Channel
  59. ------------
  60.  
  61. New to the Pitch section of the Instrument screen (press F4 and select the
  62. "Pitch" button) are the sliders "MIDI Channel", "MIDI Program" and "MIDI
  63. Bank". Once the MIDI Channel value for that instrument is set to a value
  64. other than zero, IT will send out MIDI data whenever that instrument is
  65. encountered in a pattern, on that particular MIDI Channel. What data IT
  66. actually sends through the MIDI port will be a note on command, although
  67. this will be discussed in more detail later.
  68.  
  69. MIDI Program/MIDI Bank
  70. ----------------------
  71.  
  72. The MIDI Program and MIDI Bank sliders work in a similar manner to each
  73. other. If they have a value set to -1, IT will not transmit a program change
  74. message nor a bank change message for that instrument. If you specifically
  75. set a MIDI Program for that instrument, IT will send a 'program change'
  76. message along with the 'note on' message.
  77.  
  78. The MIDI Bank instrument setting is also the same; IT will not send a bank
  79. change message if the MIDI Bank slider is set to Off (ie: has a value of
  80. -01). If the MIDI Bank setting is active for that instrument, IT will send
  81. it along with the note on message as well.
  82.  
  83. Summary
  84. -------
  85.  
  86. IT will always send a 'note on' command for a particular MIDI channel
  87. whenever a MIDI instrument is encountered in the pattern. (A MIDI instrument
  88. is simply an instrument where the MIDI Channel value has been set to
  89. something other than "Off"). IT will also send a program change command and/or
  90. a bank change command along with the note on command if they are set active.
  91.  
  92.  
  93. More Advanced MIDI
  94. ==================
  95.  
  96. How MIDI Works
  97. --------------
  98.  
  99. MIDI is not a file format (like IT is a module format) nor is it even a file
  100. layout. MIDI is a computer protocol (or language) which is used to
  101. communicate between devices . You may like to think of it as a network,
  102. where the MIDI cables are the cables you lay between computers, and MIDI is
  103. the network protocol (such as Novell NetWare, Windows Networking or TCP/IP)
  104. used to communicate between the sound devices. When an instrument is said to
  105. be 'MIDI compliant', that means that it has support for the MIDI protocol
  106. and understands MIDI messages.
  107.  
  108. The .MID file format is simply a way to store these messages. It is a
  109. collection of MIDI data, and when a .MID file is run through a MIDI player,
  110. all the MIDI player does is send the data in the .MID file out through the
  111. computer's MIDI port. In a network analogy, if you can imagine that every
  112. single transaction run through the network was being logged to a file on
  113. your hard disk; that every single byte was being recorded to a logfile, this
  114. is what a .MID file is.
  115.  
  116. An example of MIDI Communication in IT
  117. --------------------------------------
  118.  
  119. You've read above that when IT encounters a MIDI instrument in the
  120. patterndata, it sends a 'note on' command, which is defined in the MIDI
  121. protocol to be 'Play this note on this MIDI channel at this particular
  122. velocity'. (Velocity is similar to volume ). If you play a MIDI instrument
  123. which is mapped to MIDI channel 2 at C-5 with a velocity of 64, the actual
  124. data which IT sends out to the MIDI port resembles something like this (in
  125. hex):
  126.  
  127.     Note On with parameters;
  128.         MIDI Channel: 2
  129.         Note: C-5
  130.         Velocity: 64
  131.  
  132.         Data that IT sends out (hex): 91 3C 40
  133.         Data that IT sends out (decimal): 145 60 64
  134.  
  135. We'll run through each of these three bytes step by step.
  136.  
  137. The first byte (91 in hex, or 91h) is the actual 'Note on' command. It tells
  138. the receiving MIDI device that the data which follows is part of the 'note
  139. on' data. An analogy which trackers may find useful is the effect column.
  140. There, you have an effect command and effect data; for example, the effect
  141. 'G20' can be split up into two parts--'G' and '20'. The 'G' part is the
  142. actual effect command which tells IT that you wish to perform a portamento,
  143. and the '20' part is the effect data, or in this case the spe ed at which
  144. the portamento should occur. In this MIDI example, the '9' is the MIDI
  145. command and the '1 3C 40' is the rest of the data for that command.
  146.  
  147. Now, the second digit (1 in our example) specifies the MIDI channel. MIDI
  148. channels are 0-based; that is, if you want to send to MIDI channel 6, IT
  149. specifies 05 for the actual data. MIDI channel 10 is 09h, MIDI channel 14 is
  150. 0Dh, etc. Here we're sending to MIDI channel 2, so the value sent out over
  151. MIDI is 01h.
  152.  
  153. The second byte (3Ch) is actually the note to send (C-5 here). In MIDI, all
  154. command (parameter) data is between a scale of 00h-7Fh (or 0-127 in
  155. decimal). Notes are transmitted the same way - via numbers. If you imagine
  156. C-1 is sent with a value of 00h, C#1 i s 01h, D-2 is 02h, etc, then the note
  157. we want to play, C-5, has a value of 3Ch (60 decimal).
  158.  
  159. Now the first and second bytes are done with, the third byte should be
  160. fairly easy to understand. This byte represents the velocity at which the
  161. note should be played. In our case, we want a velocity of 64, which
  162. translates to 40h, and so this is the value which is sent out.
  163.  
  164. So to recap, we have three bytes for the note on command, "91 3C 40".
  165.  
  166.         Byte 1: 91 == Note on command (on MIDI channel #2)
  167.         Byte 2: 3C == Note on data (Note to play, C-5)
  168.         Byte 3: 40 == Note on data (Velocity of 64 decimal)
  169.  
  170. Configuring IT's MIDI out data
  171. ------------------------------
  172.  
  173. Keeping the above example in mind, press Shift-F1 to get to IT's MIDI screen
  174. and press the 'MIDI Output Configuration' button. This will take you to IT's
  175. MIDI out engine. Now, if you examine the 'Note On' field, it reads:
  176.  
  177.     9c n v
  178.  
  179. This can be correlated to our above example of '91 3C 40'. Now, the 'c n v'
  180. in the Note On field corresponds to 'channel', 'note' and 'velocity'. Think
  181. of them as variables; IT will substitute the appropriate channel, note and
  182. velocity values which it encounters in the MIDI instrument information
  183. and/or patterndata.
  184.  
  185. If you now actually defined a MIDI instrument to play on MIDI channel 2, and
  186. you played it in a pattern at C-5 with velocity 64, all IT does is read the
  187. 'Note On' field from the MIDI configuration screen and substitute '1' for
  188. 'c', '3C' (C-5) for 'n' and '64' for 'v'. Therefore, IT will read '9c n v'
  189. and replace it with '91 3C 40'.
  190.  
  191. In any of the MIDI output fields, lowercase letters represent variables (or
  192. subsitutions which IT should make) and uppercase letters or numbers are
  193. constants which IT writes to the MIDI port directly without any change.
  194. Therefore, these fields are case se nsitive--for the note on command, '9c n
  195. v' is blatantly different to '9C n v'. 9c represents 'send byte 09 followed
  196. by the MIDI channel byte', whereas 9C represents 'send the byte 9C'.
  197.  
  198. In short, 0-9 and A-F are treated as hexadecimal constants and will be
  199. passed through directly. Lowercase letters will be treated as variables and
  200. substituted accordingly. Note that variables are regarded as 'full bytes' by
  201. themselves and are never part of an actual byte sequence except for the
  202. variable 'c', so '9n' is exactly the same as '09 n' or '9 n'; all of them
  203. will expand to the sequence '09 <MIDI note byte>'. 'c' is the only value
  204. that takes on a nibble (4-byte) value, due to the MIDI protocol definition.
  205. This means that 9c will actually become one byte when expanded, with the
  206. lower digit representing the channel.
  207.  
  208. IT MIDI Variables
  209. -----------------
  210.  
  211. c: MIDI channel
  212.  
  213.         This is simply the MIDI channel of which the instrument is set
  214. to, 0-based. Note that this is the only nibble sized variable.
  215.  
  216. n: note value
  217.  
  218.     A value from 00-7Fh representing the note to be played, where
  219. C-5 is 60h. 
  220.  
  221. v: velocity
  222.  
  223.     The MIDI velocity of the note.
  224.  
  225. u: volume
  226.  
  227.     Volume is similar to velocity, except that velocity does not
  228. take the volume envelope and fadeout values into account, whereas the
  229. 'u' volume variable does. 
  230.  
  231. x: pan set
  232.  
  233.         Sends a MIDI panning value. This does not take into account
  234. panning envelopes.
  235.  
  236. y: calculated pan
  237.  
  238.         Sends a MIDI panning value which does take into account
  239. panning envelopes.
  240.  
  241. a: high byte of bank select
  242. b: low byte of bank select
  243.  
  244.     These commands are only really useful in the bank change
  245. field. 
  246.  
  247. z: macro data
  248.  
  249.     (See section on macros for full explanation).
  250.  
  251. Configuring MIDI Output for Your Keyboard
  252. -----------------------------------------
  253.  
  254. In the basic IT distribution, the only fields which have any data are 'Note
  255. on', 'Note Off' and 'Program Change'. The reason for this is that these are
  256. the only commands which are set as standards by MIDI. MIDI commands such as
  257. Change Pan, Bank Select , e tc all differ from synth to synth. There's not
  258. much which can be done to solve this, you will have to look up your synth's
  259. manual to find out the exact MIDI commands it needs to issue a panning
  260. change, bank select, etc.
  261.  
  262. Some values which you may wish to try, however, will be:
  263.  
  264.     Change pan: Bc 0A x
  265.     Bank select: Bc 0 a 20 b
  266.  
  267. These may or may not work. If they do, then great, but if they don't, you
  268. will have to actually RTFM *gasp* in order to get these other commands
  269. working.
  270.  
  271.  
  272. Effect Commands & Macros
  273. ========================
  274.  
  275. Now that IT's MIDI engine is understood and the basis of MIDI communication
  276. has been laid down, perhaps the most powerful function of IT's MIDI engine,
  277. macros, will be explained.
  278.  
  279. Standard Effects
  280. ----------------
  281.  
  282. Firstly, at the moment there is NO support for standard IT effect commands
  283. (such as pitch slide, portamento, vibrato etc) to work via MIDI. This may or
  284. may not be implemented in future. Currently, however, if you perform an E01
  285. effect on a note, nothing w ill happen as far as the MIDI aspect of the
  286. instrument is concerned.
  287.  
  288. Macro Effects - SFx
  289. -------------------
  290.  
  291. The SFx command, previously used in the .MOD format as "FunkRepeat", has
  292. been changed in IT to allow for the functioning of MIDI macros. The unused
  293. Zxx command will also now play a part in MIDI functioning.
  294.  
  295. To understand how this works, it's best to take an example into account. At
  296. the beginning of this supplement, the MIDI sequence '91 3C 40' was used
  297. which was a Note On, MIDI channel #2 played at C-5 with a velocity of 64.
  298. This was represented in IT's MIDI configuration as '9c n v', so it made the
  299. appropriate substitutions to '91 3C 40'.
  300.  
  301. The Macro Setup section of IT's MIDI Output Configuration screen can be used
  302. to define your own custom MIDI command/data sequences. These can be
  303. absolutely anything you like, from a MIDI SysEx command to a Note On
  304. command. In fact, to start off, we'll tak e a Note On sequence as an example
  305. and we will attempt to emulate the same '91 3C 40' bytes, except that we'll
  306. make this sequence ourselves rather than letting IT do the work for us.
  307.  
  308. How SFx and Zxx commands relate
  309. -------------------------------
  310.  
  311. Firstly, remember that IT substitutes values when it encounters variables.
  312. If you glance at the above section on IT MIDI Variables, you'll notice that
  313. the 'z' variable represents macro data. Now that this '91 3C 40' sequence
  314. has been driven into our he ads, try setting the SF0 macro field on IT's
  315. MIDI Output Configuration screen to '91 3C z'.
  316.  
  317. Remember that the third byte in the MIDI sequence (40 in our normal
  318. example) is the velocity to send with the Note On message. The SF0 macro
  319. field you've just defined means that IT will read any Zxx effects and
  320. replace the 'z' variable in the SF0 macro with the 'xx' value from the Zxx
  321. effect. To enable the macro, simply put in a SF0 along with a Note On in the
  322. pattern data. Now, all values from Z00 to Z7F will substitute for 'z'
  323. accordingly. So, to show that our SF0 sequence will reproduce the exact same
  324. thing as our Note On command:
  325.  
  326.     C-5 01 SF0 (this will play the note on command as usual, and
  327.                 specify that the SF0 macro sequence should be
  328.                 hooked to Zxx effects).
  329.     ... .. ...
  330.     ... .. ...
  331.     ... .. ...
  332.     ... .. Z40 (this will trigger our SF0 sequence with a 'z'
  333.                 value of 40h).
  334.  
  335. The above patterndata should produce a note on event at row 0 in the
  336. pattern, and again at row 4. Now, try replacing the Z40 effect with Z7F and
  337. IT will substitute 'z' with '7F', or a velocity of 7Fh (127 decimal) in our
  338. SF0 sequence. The result should be that you'll hear a Note On with velocity
  339. 64 on row 0, and a Note On with velocity 127 on row 4; ie: the second note
  340. triggered will be twice as loud. The The sequence that IT will send will be
  341. '91 3C 7F'.
  342.  
  343. SFx commands summary
  344. --------------------
  345.  
  346. Our example above of using a 'note on' command sequence for an SFx effect is
  347. rather pointless, since IT does this effect itself. However, it has
  348. hopefully served its purpose by demonstrating how effects work.
  349.  
  350. The SFx commands, as you can see, can be redefined to absolutely any MIDI
  351. data at all. This can be something simple like a pitch slide, a complex
  352. SysEx 'set filter to aftertouch' command, or whatever you like. The
  353. possibilities are endless and are only li mited by what your synth can do;
  354. IT's SFx/Zxx combination is customisable enough to handle nearly any MIDI
  355. data you wish to output.
  356.  
  357. If you wish to take advantage of these commands, you will have to look up
  358. the manual for your synth and get stuck into the MIDI/SysEx section. Please
  359. do not come to any IT support people asking for help on this subject because
  360. every synth is different.
  361.  
  362. Z80 -> ZFF commands
  363. -------------------
  364.  
  365. The Z80 to ZFF commands are also macro sequences, but they have no 'z'
  366. variable to substitute for. They are not 'hooked' to any SFx effects, they
  367. are straight, direct macro sequences. For example, if you have a MIDI
  368. controllable effects unit (such as an Alesis MidiVerb), you may wish to
  369. assign the Z80 command to set a up a certain value for the reverb delay
  370. length. Later in the song, you can issue a Z81 command to change the reverb
  371. delay or turn it off altogether.
  372.  
  373. To summarise, the Z80 to ZFF commands are similar to SFx macro sequences,
  374. but they do not have any extra parameters (whereas the SFx macro's 'z'
  375. variables are controlled by Z00 to Z7F).
  376.  
  377.  
  378. Contact Information
  379. ===================
  380.  
  381. If there are any problems with this textfile, email ozone@post1.com or
  382. pulse@cyburbia.net.au
  383.  
  384.   __/\___/\_/\____/\____/\ .. . Andre Pang % vault        ...:
  385.  
  386.  /   /__  /   \_    \_  __) :.. mailto:ozone@post1.com . ....:
  387. (  :  /  (__:  )  |  |  _)_ : . http://www.mindflux.com.au/ .:
  388.  \___(  ______/|__;__|_____| :. irc: #trax (irc.neato.org) ..:
  389.       \/ - #ozone
  390.  
  391.