Conditionally transfer control to label on every pass. (Combination of cigoto and ckgoto)
Syntax
cggoto(condition,label)
cggotocondition,label
where label is in the same instrument block and is not an expression, and where condition uses one of the Relational operators (<, =, <=, ==, !=) (and = for convenience, see also under Conditional Values).
Examples
Here is an example of the cggoto opcode. It uses the file cggoto-modern.csd.
<CsoundSynthesizer><CsOptions>; Audio out Audio in No messages-odac
-d
; -iadc ;;;RT audio I/O; -o cggoto.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; Initialize the global variables.sr=44100ksmps=10nchnls=1; Instrument #1.instr1i1=p4; If i1 is equal to one, play a high note.; Otherwise play a low note.cggoto(i1==1,highnote)lownote:a1=poscil(10000,220)goto(playit)highnote:a1=poscil(10000,440)playit:out(a1)endin</CsInstruments><CsScore>; Play lownote for one second.i1011; Play highnote for one second.i1112e</CsScore></CsoundSynthesizer>
Here is an example of the cggoto opcode. It uses the file cggoto.csd.
<CsoundSynthesizer><CsOptions>; Audio out Audio in No messages-odac -iadc -d ;;;RT audio I/O; -o cggoto.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; Initialize the global variables.sr=44100ksmps=10nchnls=1; Instrument #1.instr1i1=p4; If i1 is equal to one, play a high note.; Otherwise play a low note.cggoto(i1==1),highnotelownote:a1oscil10000,220,1gotoplayithighnote:a1oscil10000,440,1gotoplayitplayit:outa1endin</CsInstruments><CsScore>; Table #1: a simple sine wave.f1032768101; Play lownote for one second.i1011; Play highnote for one second.i1112e</CsScore></CsoundSynthesizer>