midi-stream

[Class]
  `midi-stream`

Defines a common set of slots available in subclasses `midi-file-stream`, `midishare-stream` and `player-stream`.

`midi-stream` supports the following slot initializations:

`:channel-map` list
  A list or vector of logical channel defininitions. Each entry in the map is a two-element list: (port channel) that defines the integer port id and integer channel number of the logical channel at that position. If no list is specified the value defaults to the global variable `*midi-channel-map*`.
`:channel-tuning` {boolean | 1-15 | list}
  Determines the manner in which floating point key numbers kkk.cc are tuned, where kkk.cc is interpreted as the frequency cc cents above the MIDI integer keynum kkk. The default value is false, which means that floating point key numbers are rounded to the nearest inteter MIDI keynum as they are sent to the MIDI file or port. If the value is true then floating point events are preceded by pitch bends to make the microtonal adjustment and both messages are sent to the next available channel. By default, the entire range of channels 0-15 are cycled through in round-robin fashion to minimize the likelihood that a pitch bend value will affect a sounding note. (Set the variable `*midi-skip-drum-channel*` to true if you want to omit channel 9 from the channel rotation.) To cycle through only a subrange of channels specify a list: (true start end) where start and end specify the inclusive starting and ending bounds for the channel rotation. If the value is an integer 1-15 inclusive then floating point key numbers are quantized to that number of divisions per semitone. For example, a value of 2 will quantize floating point key numbers to to the nearest quarter-tone This method of channel tuning much more efficient than then note-by-note method, but quantization means that you will not get the precise microtonal values encoded in the key numbers. However, since the maximimum of 15 divisions per semitone provides for a quantization step size of 6.6 cents (very close to the minimum perceivable change by humans), in most cases quantization can provide a sufficiently close approximation to the actual microtonal value. By default channel allocation for quanitization starts at channel 0. To specify a different starting channel use a list: (n start), where n is the channel tuning value and start is the starting channel.
`:pitch-bend-width` integer
  Declares the pitch bend width in semitones of the synthesizer. This value is used to calculate pitch bend values for microtonal frequency resolution. The default value is 2, which means that the synthesizer uses a maximum pitch bend range of one whole step up and down.

#### See also:

- `clm-audio-stream` [Class]
- `clm-stream` [Class]
- `cmn-stream` [Class]
- `io` [Macro]
- `midi-file-stream` [Class]
- `midishare-stream` [Class]
- `player-stream` [Class]
- `sco-stream` [Class]