midion Real-time MIDI:Note Output midion midion Generates MIDI note messages at k-rate. Description Generates MIDI note messages at k-rate. Syntax midion kchn, knum, kvel Performance kchn -- MIDI channel number (1-16) knum -- note number (0-127) kvel -- velocity (0-127) midion (k-rate note on) plays MIDI notes with current kchn, knum and kvel. These arguments can be varied at k-rate. Each time the MIDI converted value of any of these arguments changes, last MIDI note played by current instance of midion is immediately turned off and a new note with the new argument values is activated. This opcode, as well as moscil, can generate very complex melodic textures if controlled by complex k-rate signals. Any number of midion opcodes can appear in the same Csound instrument, allowing a counterpoint-style polyphony within a single instrument. Examples Here is a simple example of the midion opcode. It uses the file midion_simple.csd. Simple Example of the midion opcode. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. This example generates a minor chord over every note received on the MIDI input. It generates MIDI notes on csound's MIDI output, so be sure to connect something. Here is another example of the midion opcode. It uses the file midion_scale.csd. Example of the midion opcode to generate random notes from a scale. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. This example generates random notes from a given scale for every note received on the MIDI input. It generates MIDI notes on csound's MIDI output, so be sure to connect something. See Also moscil, midion2, noteon, noteoff, noteondur, noteondur2 Credits Author: &namegabriel; Italy May 1997 Thanks goes to &namerasmus; for pointing out the correct MIDI channel and controller number ranges.