HELP INDEX


NAME


cec_midi - Creation of midi input control port.

SYNOPSIS

cec_midi name event channel min max ?init?

STANDARD OPTIONS

event:       pbend|touch|veloc|notnum|ctrl[1-127] 
channel:     1 to 16
min & max:   real-numbers
?init?:      a real-number between min and max

DESCRIPTION


The cec_midi command creates an automatic Csound midi setup where the value of a midi event is passed on to the orchestra via a global "gk[name]" variable. The cec_midi object varies from other Cecilia objects in that it does not create an interface object except a "lag time" slider that smoothes continuous midi input. The cec_midi object is meant to be used primarily as an interface to a JLCooper MidiFader unit but will understand any kind of midi channel voice message. The values from the midi events (0-127) will be scaled between min and max .

Note that the normal Cecilia substitution is not in effect in this case. Variables are referenced in the user orchestra by their name prefixed with "gk".

When the orchestra and score are compiled, the cec_midi 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, it is important to understand that 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 cec_slider is always produced along with a cec_midi. 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 cec_midi object to also declare a "total_time" cec_slider.

EXAMPLE


The definition:
 cec_midi pitch veloc 16  0 45 10 

sets up a midi input stream named "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 scales, on a base of 0 to 127 to the a value between o and 45. The value od gkpitch is initialized at 10.

The definition:

 cec_midi amp ctrl28 16 .5 10 10 

sets up a midi input stream named "gkamp" along with a portamento slider named lag-amp. Data will be read from the value of controller #28 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.


Copyright 1996