------------------------------------- ## Impulse Tracker MIDI Supplement ## ------------------------------------- Introduction ============ The biggest new addition to Impulse Tracker 2.12 has been support for sending data out through the MIDI protocol. Earlier versions of Impulse Tracker (IT) have had support for incoming MIDI data, so it was possible to play on a 'MIDIfied' keyboard and have IT 'track' all the notes down in the pattern in realtime. MIDI out, however, is a completely different ballgame. You in fact don't have to read this supplement at all if you wish to get MIDI working, but in order to gain full usage of MIDI out, you will have to read this in order to understand how IT's MIDI support fully works MIDI Support & Soundcards (Modified by Pulse) ============================================= At present, the only sound devices IT supports for MIDI output are the AMD InterWave and the Creative Labs Sound Blaster AWE32. Support for other soundcards is via the generic MPU401 driver. To use this driver, you must run "IT /S19 /A
" where is the address of your MPU401 compatible card (eg. "IT /S19 /A330"). Note that the generic MPU401 driver does *NOT* support sample playback at all. MIDI And AWE32 Soundcards (Pulse) --------------------------------- I have found that the Windows '95 drivers for the AWE32 are somewhat buggy. On my computer, I can use MIDI In/Out in Impulse Tracker *IF* I disable the MIDI support within Windows '95. Otherwise, it is simply not recognised. To disable the MIDI support in Windows '95, right click on "My Computer", "Properties", "Device Configuration", "Sound, Video & Game Controllers". Double click on "Creative Labs SB16 or AWE32" and go to the resources. Uncheck the "Use Automatic Settings" box if it is set and change the basic configuration to one that does NOT include the MIDI Ports 300h or 330h. (For example, Basic Configuration 0 has only 220h, 5, 1, 5 on my computer and IT works fine in a DOS Box) Enabling MIDI ============= To enable MIDI output, you must first have IT on Instrument control mode rather than Sample control mode. To do this, press F12 to go to the Song Variables screen and switch control to 'Instruments' if you haven't already done so. MIDI & Instruments ================== MIDI Channel ------------ New to the Pitch section of the Instrument screen (press F4 and select the "Pitch" button) are the sliders "MIDI Channel", "MIDI Program" and "MIDI Bank". Once the MIDI Channel value for that instrument is set to a value other than zero, IT will send out MIDI data whenever that instrument is encountered in a pattern, on that particular MIDI Channel. What data IT actually sends through the MIDI port will be a note on command, although this will be discussed in more detail later. MIDI Program/MIDI Bank ---------------------- The MIDI Program and MIDI Bank sliders work in a similar manner to each other. If they have a value set to -1, IT will not transmit a program change message nor a bank change message for that instrument. If you specifically set a MIDI Program for that instrument, IT will send a 'program change' message along with the 'note on' message. The MIDI Bank instrument setting is also the same; IT will not send a bank change message if the MIDI Bank slider is set to Off (ie: has a value of -01). If the MIDI Bank setting is active for that instrument, IT will send it along with the note on message as well. Summary ------- IT will always send a 'note on' command for a particular MIDI channel whenever a MIDI instrument is encountered in the pattern. (A MIDI instrument is simply an instrument where the MIDI Channel value has been set to something other than "Off"). IT will also send a program change command and/or a bank change command along with the note on command if they are set active. More Advanced MIDI ================== How MIDI Works -------------- MIDI is not a file format (like IT is a module format) nor is it even a file layout. MIDI is a computer protocol (or language) which is used to communicate between devices . You may like to think of it as a network, where the MIDI cables are the cables you lay between computers, and MIDI is the network protocol (such as Novell NetWare, Windows Networking or TCP/IP) used to communicate between the sound devices. When an instrument is said to be 'MIDI compliant', that means that it has support for the MIDI protocol and understands MIDI messages. The .MID file format is simply a way to store these messages. It is a collection of MIDI data, and when a .MID file is run through a MIDI player, all the MIDI player does is send the data in the .MID file out through the computer's MIDI port. In a network analogy, if you can imagine that every single transaction run through the network was being logged to a file on your hard disk; that every single byte was being recorded to a logfile, this is what a .MID file is. An example of MIDI Communication in IT -------------------------------------- You've read above that when IT encounters a MIDI instrument in the patterndata, it sends a 'note on' command, which is defined in the MIDI protocol to be 'Play this note on this MIDI channel at this particular velocity'. (Velocity is similar to volume ). If you play a MIDI instrument which is mapped to MIDI channel 2 at C-5 with a velocity of 64, the actual data which IT sends out to the MIDI port resembles something like this (in hex): Note On with parameters; MIDI Channel: 2 Note: C-5 Velocity: 64 Data that IT sends out (hex): 91 3C 40 Data that IT sends out (decimal): 145 60 64 We'll run through each of these three bytes step by step. The first byte (91 in hex, or 91h) is the actual 'Note on' command. It tells the receiving MIDI device that the data which follows is part of the 'note on' data. An analogy which trackers may find useful is the effect column. There, you have an effect command and effect data; for example, the effect 'G20' can be split up into two parts--'G' and '20'. The 'G' part is the actual effect command which tells IT that you wish to perform a portamento, and the '20' part is the effect data, or in this case the spe ed at which the portamento should occur. In this MIDI example, the '9' is the MIDI command and the '1 3C 40' is the rest of the data for that command. Now, the second digit (1 in our example) specifies the MIDI channel. MIDI channels are 0-based; that is, if you want to send to MIDI channel 6, IT specifies 05 for the actual data. MIDI channel 10 is 09h, MIDI channel 14 is 0Dh, etc. Here we're sending to MIDI channel 2, so the value sent out over MIDI is 01h. The second byte (3Ch) is actually the note to send (C-5 here). In MIDI, all command (parameter) data is between a scale of 00h-7Fh (or 0-127 in decimal). Notes are transmitted the same way - via numbers. If you imagine C-1 is sent with a value of 00h, C#1 i s 01h, D-2 is 02h, etc, then the note we want to play, C-5, has a value of 3Ch (60 decimal). Now the first and second bytes are done with, the third byte should be fairly easy to understand. This byte represents the velocity at which the note should be played. In our case, we want a velocity of 64, which translates to 40h, and so this is the value which is sent out. So to recap, we have three bytes for the note on command, "91 3C 40". Byte 1: 91 == Note on command (on MIDI channel #2) Byte 2: 3C == Note on data (Note to play, C-5) Byte 3: 40 == Note on data (Velocity of 64 decimal) Configuring IT's MIDI out data ------------------------------ Keeping the above example in mind, press Shift-F1 to get to IT's MIDI screen and press the 'MIDI Output Configuration' button. This will take you to IT's MIDI out engine. Now, if you examine the 'Note On' field, it reads: 9c n v This can be correlated to our above example of '91 3C 40'. Now, the 'c n v' in the Note On field corresponds to 'channel', 'note' and 'velocity'. Think of them as variables; IT will substitute the appropriate channel, note and velocity values which it encounters in the MIDI instrument information and/or patterndata. If you now actually defined a MIDI instrument to play on MIDI channel 2, and you played it in a pattern at C-5 with velocity 64, all IT does is read the 'Note On' field from the MIDI configuration screen and substitute '1' for 'c', '3C' (C-5) for 'n' and '64' for 'v'. Therefore, IT will read '9c n v' and replace it with '91 3C 40'. In any of the MIDI output fields, lowercase letters represent variables (or subsitutions which IT should make) and uppercase letters or numbers are constants which IT writes to the MIDI port directly without any change. Therefore, these fields are case se nsitive--for the note on command, '9c n v' is blatantly different to '9C n v'. 9c represents 'send byte 09 followed by the MIDI channel byte', whereas 9C represents 'send the byte 9C'. In short, 0-9 and A-F are treated as hexadecimal constants and will be passed through directly. Lowercase letters will be treated as variables and substituted accordingly. Note that variables are regarded as 'full bytes' by themselves and are never part of an actual byte sequence except for the variable 'c', so '9n' is exactly the same as '09 n' or '9 n'; all of them will expand to the sequence '09