cmidi name ?options?
-event pbend | touch | veloc | notnum
|ctrl[1-127]
determines the rtype of midi event that will control the parameter
;default notnum
-channel 1 to 16
the channel; number on which this event will arrive
-min int | float
determines the minimum value of the slider ;default
0
-max int | float
determines the maximum value of the slider ;default
127
-init int | float between min
and max
determines the initial value of the slider. ;default
0 | -min
When the orchestra and score are compiled, the cmidi object creates its own instruments to preprocess midi information within Csound. This is not normally seen by the user.
Remember that a midi instrument must be launched with a midi note-on message for it to transmit any data. Therefor, if a pitch bend message is used to control a variable, the pitchbend data will be accepted only if there is a currently active midi note. A good way to get around this problem is to program the desired JLCooper fader to delivers midi note-on messages. The user can then specify the velocity received as the data carrier. This way, a note-on message will always be sent along with the desired velocity data.
A regular cslider is always produced along with a cmidi. That slider is used to set a portamento or lag value for the midi data. The portamento value is issued automatically at init time only.
An option menu is also produced with the options: practice, midi_record, playback, load and save. The user can record any midi event with midi_record and replay them with playback. A given stream can be saved under any name with save and recalled with load. Practice allows to simply play the sliders without recording.
It is compulsory, when using the cmidi object to
also declare a "total_time" cslider.
cmidi pitch -ev veloc -ch 16 -min 0 -max 45 -init 10sets up a midi input stream that communicates with the orchestra through the global variable "gkpitch" along with a portamento slider named lag-pitch. Data will be read from the velocity value of any note-on message received on channel 16. The data will be scaled, on a base of 0 to 127 to the a value between 0 and 45. The value of gkpitch is initialized at 10.
The definition:
cec_midi amp -ev ctrl38 -ch 16 -min .5 -max 10 -init 10sets up a midi input stream named "gkamp" along with a portamento slider named lag-amp. Data will be read from the value of controller #38 received on channel 16. No data will be received if there is no currently active note on channel 16. A midi keyboard or another computer can be used to send midi note-on events just before the controller data is needed.