idur1 -- duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.
idur2, idur3, etc. -- duration in seconds of subsequent segments. A zero or negative duration jumps to that segment's end value and continues with the next segment.
Performance
Durations use whole samples at audio rate and whole control periods at control rate. A positive duration that rounds to zero steps also jumps to its end value; later segments still run.
These units generate control or audio signals whose values can pass through 2 or more specified points. The sum of dur values may or may not equal the instrument's performance time: a shorter performance will truncate the specified pattern, while a longer one will cause the last value to be repeated until the end of the note.
Examples
Here is an example of the cosseg opcode. It uses the file cosseg.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac;;;realtime audio out;-iadc ;;;uncomment -iadc if realtime audio input is needed too; For Non-realtime ouput leave only the line below:;-o linseg.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=32nchnls=20dbfs=1giSineftgen0,0,2^10,10,1instr1kcps=cpspch(p4)kenvcosseg0,0.25,1,0.75,0; together = 1 secasigposcilkenv,kcps,giSineoutsasig,asigendininstr2; scaling to durationkcps=cpspch(p4)kenvcosseg0,p3*0.25,1,p3*0.75,0asigposcilkenv,kcps,giSineoutsasig,asigendininstr3; with negative valuekcps=cpspch(p4)aenvcosseg0,0.1,1,0.5,-0.9,0.4,0asigposcilaenv,kcps,giSineoutsasig,asigendin</CsInstruments><CsScore>i1017.00; = 1 sec, p3 fits exactlyi1227.00; = 2 sec, p3 truncated at 1 seci2417.00; scales to durationi2627.00; of p3i3927.00e</CsScore></CsoundSynthesizer>