“scorechar” -- A string (in double-quotes) representing the first p-field in a score statement. This is usually “e”, “f”, or “i”.
“insname” -- A string (in double-quotes) representing a named instrument.
iinsnum -- The instrument to use for the event. This corresponds to the first p-field, p1, in a score statement.
idelay -- When (in seconds) the event will occur from the current performance time. This corresponds to the second p-field, p2, in a score statement.
idur -- How long (in seconds) the event will happen. This corresponds to the third p-field, p3, in a score statement.
ip4, ip5, ... (optional) -- Parameters representing additional p-field in a score statement. It starts with the fourth p-field, p4.
Performance
The event is added to the queue at initialisation time.
Note
Note that the event_i opcode cannot accept string p-fields. If you need to pass strings when instantiating an instrument, use the scoreline or scoreline_i opcode.
Examples
Here is an example of the event_i opcode. It uses the file event_i.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;RT audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o event_i.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1seed0gisineftgen0,0,2^10,10,1instr1;master instrumentininstr=10;number of called instancesindx=0loop:ipanrandom0,1ifreqrandom100,1000iamp=1/ininstrevent_i"i",10,0,p3,iamp,ifreq,ipanloop_ltindx,1,ininstr,loopendininstr10printp4,p5,p6ipeakrandom0,1;where is the envelope peakasigposcil3p4,p5,gisineaenvtranseg0,p3*ipeak,6,1,p3-p3*ipeak,-6,0aL,aRpan2asig*aenv,p6outsaL,aRendin</CsInstruments><CsScore>i1010i1810i11615e</CsScore></CsoundSynthesizer>