Channels

A channel is a destination for a message that is specific to one part in the performance. For example, a channel might receive a note-on message that causes the instrument on that channel to make a sound, or a program change message that assigns a different instrument to that part. (See MIDI Channel Messages.)

Under the MIDI 1.0 standard, there are 16 MIDI channels, meaning that no more than 16 instruments can be playing at one time. In order to support this standard but at the same time make more channels available to applications, DirectMusic creates channel groups. Up to 65,536 channel groups can exist at one time, each containing 16 channels, for a total of over one million channels. A particular port can be assigned any number of channel groups up to its capability to support them. Legacy MIDI hardware ports have only a single channel group.

System exclusive messages address all 16 channels within a channel group, but not other channel groups.

Every instrument in a DirectMusic performance has a unique performance channel, or PChannel. The PChannel represents a particular MIDI channel in a particular group on a particular port. When a band is selected by a performance, the instruments in that band are each mapped to a PChannel.

The actual number of notes that can be played simultaneously is limited by the number of voices available on the port. (This number can be determined from the dwVoices member of the DMUS_PORTPARAMS structure.) A voice is a set of resources dedicated to the synthesis of a single note being played on a channel. In the event that there are more notes playing than there are available voices, one or more notes will have to be suppressed by the synthesizer. The choice is determined by the priority of the voice currently playing the note, which is based in turn on the priority of the channel. By default, channels are ranked according to their index value, except that channel 10, the MIDI percussion channel, is ranked highest. However, applications and synthesizers can set their own channel priorities.

For more information on channel priority, see the Remarks for IDirectMusicPort::GetChannelPriority. See also DMUS_CHANNEL_PRIORITY_PMSG.