Voice modification - The XG format provides standardized means for altering voices in real time (even individual sounds within a rhythm kit!), using MIDI control change messages and NRPNs (Non-Registered Parameter Numbers).* The composer of XG music files can therefore provide a high level of musical expressiveness by altering the level, pan position, filter cutoff frequency and/or resonance, envelope attack, decay and release rates, and effects send levels of each voice independently.  Effects - XG instruments must provide at least three different internal effects and may optionally contain additional ones such as a master graphic equalizer. The XG format allows for high-level control over these effects, using MIDI control change or system exclusive messages to select effects types, set signal routings and send and return levels, and even alter effects parameters themselves in order to create customized signal processing.  External audio input - One of the most exciting new XG features is optional support for one or more channels of external audio data. This data is input from any microphone or line-level source and is then routed to the XG instrument’s analog-to-digital (“A/D”) converter. In this way, the external signal can be processed and mixed right along with the tone generator signal, under direct realtime MIDI control. One application for this feature is in karaoke, where the composer of an XG music file can specify the precise type and amount of effects processing required for a microphone input. Multimedia authors can also use this feature to create customized settings for interactive audience participation. MIDI is a serial interface that enables multiple channels of data to be transmitted down a single wire. This is somewhat analogous to cable television, where numerous TV channels are transmitted over a single cable. The original MIDI Specification called for the “simultaneous” transmission of16 channels of musical information, which seemed like a lot back in the early 1980s, when few if any instruments had multitimbral capability. Today, a single instrument can often reproduce 16 timbres simultaneously, responding to all 16 channels of incoming MIDI data. However, due largely to limitations of transmission and processing speed, the MIDI Specification has never been amended to include more than 16 channels. The MIDI Specification defines technical details such as transmission speed, word length, and general syntax of standardized digital messages, but it is important to understand that it does not address the issue of how a tone generator will handle incoming MIDI data. For example, the number of channels that can be received, the types and numbers of voices per channel, and the methods of key assignment are all unspecified, as is the total polyphony of the tone generator. GM GM-compatible instruments are by definition multitimbral tone generators which must be able to play at least 16 timbres simultaneously in response to all 16 MIDI channels. MIDI channel 10 is used exclusively as a “rhythm channel,” playing a standardized “GM Percussion Map,” with a different percussive sound assigned to each note. These instruments must have the ability to play different sounds on each channel, with each channel polyphonic. They must have a total polyphony of at least 24 dynamically allocated voices for both melodic and percussive sounds, or 16 dynamically allocated melody voices plus 8 percussion voices. This is to ensure that any unused voice will be available to play a newly requested note regardless of channel. However, GM does not define how processing is to take place if there are no more unused voices available. GS GS-compatible instruments comply with all GM guidelines as stated above and add the ability to specify multiple rhythm channels through the use of a system exclusive message called “Use For Rhythm Part.” However, this message cannot be used for realtime change of channel assignment. Voice allocation occurs with channel 10 (the rhythm channel) taking highest priority, followed by channels 1 -> 2 ... 9 -> 11 -> 12 ... 16. Thus, GS recommends that the most important musical parts be assigned to lower MIDI channels. System exclusive messages can be used to reserve minimum numbers of voices per channel or to change the dynamic allocation routine for any channel, including channel 10. XG-compatible instruments comply with all GM guidelines as stated above and, like GS, add the ability to specify multiple rhythm channels. However, here this is accomplished through the use of a control change message (cc #0 = 7Fh) instead of system exclusive messages, allowing the assignment to be made in real time during playback of a music file. As in GM, MIDI channel 10 is normally used as a rhythm channel—this is the default setting. However, if required, channel 10 can easily be designated as a sixteenth melody channel through the use of a realtime control change message (cc #0 = 00h). For more information on the use of these messages, see the section in this Guidebook entitled “Voice Organization and Selection.” In addition, XG expands on GM and GS by increasing the minimum polyphony—all XG-compatible instruments are capable of playing 32 notes simultaneously (as opposed to 24). There is also provision for the reception of up to 32 MIDI channels, and XG instruments which are able to receive 32 MIDI channels have 32-way multitimbral capability. Furthermore, there is optional provision for the addition of one or more external audio input channels, where the incoming audio signal is A/D converted and the resulting signal’s volume, pan, and effect processing can be placed under direct realtime MIDI control, just as with other channels. As with GS, voice allocation occurs with channel 10 (the rhythm channel) taking highest priority, followed by channels 1 -> 2 ... 9 -> 11 -> 12 ... 16. If the XG instrument is capable of receiving 32 MIDI channels, processing moves to the second set of 16 channels (channels 17 - 32) after the first set (channels 1 - 16) has been processed, and here too, the rhythm channel (channel 26) takes priority. Note Messages The most basic kind of MIDI channel message (that is, a MIDI message “flagged” with a particular channel number) is the Note On message. This corresponds to the action of playing a key on the keyboard. The Note On message is actually a three-part message: The first part, called the status byte, announces the kind of message it is. The second and third parts, called data bytes, contain information describing the note number that was played and the velocity with which the note was struck (this is a measurement of the downward speed of the key as it was depressed). There are two ways that MIDI can describe the action of releasing a key on a keyboard. The most common is to use a Note On message with a velocity value of 0; this is interpreted by virtually all tone generators as having the meaning, “stop playing the specified note.” Alternatively, a Note Off message can be used. This is similar to a Note On message in that it too contains three parts—a status byte (containing a different value than the Note On message), followed by data bytes describing the note number being released and, optionally, the velocity with which it was released (this last parameter—called “release velocity”—is rarely recognized by MIDI instruments). It is more efficient to use a Note On message with a velocity of 0 to describe the release of a note because of a MIDI feature called running status. This is a rule that allows the status byte to be omitted when several messages of the same kind are transmitted in succession. The advantage of using running status is that it economizes on the amount of data transmitted—particularly important when sending a dense stream of data to a multitimbral tone generator. It’s important to realize that a note will not necessarily stop sounding when a Note Off (or Note On with velocity of 0) message is received, due to the action of the instrument’s internal envelope generators. These are devices which enable a sound to change volume, timbre, and sometimes pitch, throughout its duration. When a Note Off (or Note On with velocity of 0) message is received, the envelope generators for that note jump immediately to their release segment. A parameter called release rate (or release time) then determines how long it takes for the envelopes to return to zero; when the envelope controlling volume reaches its zero point, the sound is no longer heard. It is not required of all MIDI instruments that they respond to velocity, and even if they do, the MIDI Specification does not give any guidelines as to how they will respond, although most instruments increase the loudness (as well as, in many cases, the brilliance) of a note as higher velocity values are received. The MIDI Spec suggests the application of an exponential curve when applying velocity to volume; however, manufacturers may substitute different curves. MIDI specifies 128 note numbers (from 0 - 127) which correspond to the musical notes C2 - G8, with middle C defined as being note number 60. However, MIDI instruments do not have to necessarily cover the full range of note numbers, and there is no direction as to how notes that fall outside of the range of an instrument are to be processed. Additionally, there is no requirement that pitches be equal tempered, nor is there a defined frequency for the pitch of each key. GM GM specifies that all voices (including percussion voices played over the rhythm channel), must respond to Note On velocity messages, but need not respond to release velocity. There is a direction that the rhythm channel should ignore Note Off messages, using Note On with velocity of 0 instead. GM also stipulates that note number 69 (middle A) have a frequency of 440 Hz. In the case of melodic sounds, the scale must be equal tempered. Note numbers 36 - 96 must sound correctly, with each voice playable in the highest and lowest octaves of the key range determined for that instrument type. Pitch and temperament are not defined for percussion voices played over the rhythm channel, but note numbers 60 - 72 must play with appropriate timbre and pitch. GS In addition to the GM guidelines stated above, GS instruments use System exclusive messages to set Scale Tuning and to enable various percussive voices to respond to Note Off. XG instruments comply with all GM guidelines as stated above and add a number of new specifications:  The velocity curve is defined by the formula 20 x log (velocity 2 )/127. Release velocity is not supported.  Although in general XG instruments do not respond to Note Off messages, certain percussive voices (including brush-type drums, whistle and guiro sounds) respond to Note Off by default. System exclusive messages can be used to set other percussive voices to respond to Note Off.  As with GS, the scale temperament of XG instruments is set by the internal parameter Scale Tune (the default is equal temperament), and can be modified with system exclusive messages. Voice Organization and Selection The MIDI Specification does not include any definition of how voices are to be organized in an instrument’s ROM or RAM memory. The original version of the MIDI Spec provides for the use of specialized channel messages called program change (“pc”) messages, which enable the remote selection of 128 different voices (numbered 0 - 127, though some instruments may use alternate numbering schemes). This program change message points only to a voice number—it does not in any way “identify” a sound. Bear in mind that the current operational mode (e.g., “Performance mode,” “Tone mode,” etc.) of an instrument can also have an effect upon how a received program change message is interpreted. It is also worth noting that, upon receipt of a program change message, many older instruments turn off any held notes being produced by that channel. However, most modern multitimbral instruments allow currently-sounding notes to continue, and apply the newly received program change value to the next-played note. The MIDI instruments of the mid- and late-1980s rarely had enough memory capacity to store more than 128 voices at a time, but the instruments of today can store many hundreds—if not thousands—of voices. For this reason, a later revision of the MIDI Specification included the concept of “banks.” Each MIDI bank is a collection of up to 128 voices. Remote selection of particular voices within a bank is made, as usual, with program change messages. However, remote selection of banks is made using one or two special control change (“cc”) messages called Bank Select. These messages, which may be used separately or in conjunction with one another, are assigned to control #0 and #32. Control #0 is said to carry the Bank Select “Most Significant Bit,” or “MSB,” while control #32 is said to carry the Bank Select “Least Significant Bit,” or “LSB.” Each message on its own has 8 usable bits of data, enabling up to 128 different values to be designated. Together, the two messages yield 14 usable bits of data, enabling up to 16,384 different values to be designated. Thus, a MIDI instrument which utilizes both Bank Select messages can theoretically be directed to select any of up to 2,097,152 voices—16,384 banks of 128 voices each! The data of a received Bank Select message is preserved until the next received Bank Select message. For this reason, it is not necessary to re-transmit a Bank Select message before each program change message if you wish to access a different voice within the currently selected bank. GM In order to ensure that different tone generators play back music data in a compatible way, it is necessary that program change mes-sages select equivalent sounds on any system. GM specifies the organization of 128 melody voices into 16 groupings of 8 voices each, accessed by standard program change messages. Collectively, these are known as the GM Sound Set:a. Piano (pc # 1 - 8) i. Reed (pc # 65 - 72) b. Chromatic Percussion (pc # 9 - 16) j. Pipe (pc # 73 - 80) c. Organ (pc # 17 - 24) k. Synth Lead (pc # 81 - 88) d. Guitar (pc # 25 - 32) l. Synth Pad (pc # 89 - 96) e. Bass (pc # 33 - 40) m. Synth Effects (pc # 97 - 104) f. Strings (pc # 41 - 48) n. Ethnic (pc # 105 - 112) g. Ensemble (pc # 49 - 56) o. Percussive (pc # 113 - 120) h. Brass (pc # 57 - 64) p. SFX (pc # 121 - 128) There is no requirement that precise names be used for the voices themselves (in fact, there is some variation in the names of the voices included by different instruments in their GM Sound Set), and, in some cases (usually in lower-priced computer sound cards), the same voice may be used for two or more program numbers. More importantly, there is no stipulation as to the type of process to be used for sound generation. This means that the quality of these 128 voices can vary greatly from manufacturer to manufacturer or from model to model. In other words, two makes and models of GM-compatible instruments receiving the same program change message will not necessarily play identical sounds; however, the two sounds should, at least in theory, be similar. GM specifies that when a program change message is received while a note is playing, the currently-sounding note will continue and the newly received program change value will be applied to the next played note. GM does not restrict the total number of available voices to the 128-voice Sound Set, but it provides no support for Bank Select messages, so there is no instruction as to how additional voices may be accessed. GS The GS format refers to a “Tone Map,” which allows for 128 banks, each containing 128 “tones.” However, the GS format only defines 98 “Variation” tones in addition to the 128-voice GM Sound Set (called “Capital” tones), making for a total of 226 voices (some GS-compatible instruments do offer more voices). These Variation tones are accessed through the use of Bank Select messages (the GM Sound Set is located in Bank 0, which is the default). In most instances, only the Bank Select MSB is used and the LSB value is simply set to 0. If a GS-compatible instrument receives a Bank Select message followed by a program change message that points to an empty voice slot, the instrument plays silence. XG-compatible instruments expand greatly on the GS format by giving the Bank Select MSB and LSB separate meanings. The Bank Select MSB is used to select any of four bank types: Melody voices, SFX (Special Effects) voices, SFX kit (the SFX sounds, mapped one to a key), or Rhythm kit (various drum and percussion sounds, mapped one to a key): If the MSB is set to 00h (thus selecting Melody voices), the Bank Select LSB is then used to select any of 128 banks of voices, each containing 128 presets (which are accessed by standard MIDI program change messages).* Program change messages are also used to select different SFX voices, SFX kits or Rhythm Kits. The illustration on the following page shows how this works: * Even though the Bank Select LSB is unused when selecting SFX voices, SFX kits, or Rhythm Kits, it should be transmitted (with a data value of 0) regardless.00h : Melody voices 01h - 3Fh : Not used 40h : SFX voices 41h - 7Dh : Not used 7Eh : SFX kit 7Fh : Rhythm kit