During the i-time pass only, conditionally transfer control to the statement labeled by label.
Syntax
cigoto(condition,label)
cigotocondition,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 cigoto opcode. It uses the file cigoto-modern.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform; Audio out Audio in-odac
-d
; -iadc ;;;RT audio I/O; For Non-realtime ouput leave only the line below:; -o cigoto.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; Initialize the global variables.sr=44100kr=4410ksmps=10nchnls=1; Instrument #1.instr1; Get the value of the 4th p-field from the score.param:i=p4; If iparam is 1 then play the high note.; If not then play the low note.cigoto(param==1,highnote)igoto(lownote)highnote:freq:i=880goto(playit)lownote:freq=440playit:; Print the values of iparam and ifreq.print(param)print(freq)out(poscil(10000,freq))endin</CsInstruments><CsScore>; p4: 1 = high note, anything else = low note; Play Instrument #1 for one second, a low note.i1010; Play a Instrument #1 for one second, a high note.i1111e</CsScore></CsoundSynthesizer>
Here is an example of the cigoto opcode. It uses the file cigoto.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform; Audio out Audio in-odac -iadc ;;;RT audio I/O; For Non-realtime ouput leave only the line below:; -o cigoto.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; Initialize the global variables.sr=44100kr=4410ksmps=10nchnls=1; Instrument #1.instr1; Get the value of the 4th p-field from the score.iparam=p4; If iparam is 1 then play the high note.; If not then play the low note.cigoto(iparam==1),highnoteigotolownotehighnote:ifreq=880gotoplayitlownote:ifreq=440gotoplayitplayit:; Print the values of iparam and ifreq.printiparamprintifreqa1oscil10000,ifreq,1outa1endin</CsInstruments><CsScore>; Table #1: a simple sine wave.f1032768101; p4: 1 = high note, anything else = low note; Play Instrument #1 for one second, a low note.i1010; Play a Instrument #1 for one second, a high note.i1111e</CsScore></CsoundSynthesizer>