tigoto
Transfer control at i-time when a new note is being tied onto a previously held note
Similar to igoto but effective only during an i-time pass at which a new note is being “tied” onto a previously held note. (See i Statement) It does not work when a tie has not taken place. Allows an instrument to skip initialization of units according to whether a proposed tie was in fact successful. (See also tival).
Syntax
where label is in the same instrument block and is not an expression.
Examples
Here is an example of the tigoto opcode. It uses the file tigoto.csd.
Example of the tigoto opcode. |
---|
| <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 tigoto.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
idur = abs(p3) ;make p3 positive even if p3 is negative in score
itiv tival
i1 = -1 ;assume this is tied note, so keep fase of oscili
tigoto slur ;no reinitialisation on tied notes
i1 = 0 ;first note, so reset phase
aatt line p4, idur, 0 ;primary envelope
slur:
if itiv==0 kgoto note ;no expression on first and second note
aslur linseg 0, idur*.3, p4, idur*.7, 0 ;envelope for slurred note
aatt = aatt + aslur
note:
asig oscili aatt, p5, 1, i1
outs asig, asig
endin
</CsInstruments>
<CsScore>
f1 0 4096 10 1 ;sine wave
i1 0 -5 .8 451 ;p3 = 5 seconds
i1 1.5 -1.5 .1 512
i1 3 2 .7 440 ;3 notes together--> duration = 5 seconds
e
</CsScore>
</CsoundSynthesizer>
|
Here is another example of the tigoto opcode. It uses the file tigoto2.csd.
Second example of the tigoto opcode. |
---|
| <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 tigoto2.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
; by Steven Yi 2024
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
iamp = ampdbfs(p5)
ipch = cps2pch(p4,12)
xtratim 4 ; extend the duration of the note
tigoto skipInit ; csound "jumps" to the label, skipping initialization for the code in between
; but only if this is a "tied" note
kpch = port(ipch, 0.05, ipch)
asig = vco2(iamp, kpch)
;asig = zdf_2pole(asig, min:k(10000, kpch * 16), 4) ; uncomment to use filter
asig *= linsegr(0, 1, 1, 4, 0)
out(asig, asig)
skipInit:
endin
</CsInstruments>
<CsScore>
i1 0 -.5 8.00 -12
i1 + -.5 9.00 -12
i1 + 2 6.00 -12
i1.1 .25 -.5 9.00 -12
i1.1 + -.5 10.00 -12
i1.1 + 2 7.00 -12
i1.2 1 -.25 7.00 .
i1.2 + 2 8.00 .
</CsScore>
</CsoundSynthesizer>
|
See also
Program Flow Control