This opcode outputs a trigger signal that informs when any one of its k-rate arguments has changed. Useful with valuator widgets or MIDI controllers.
ktrig - Outputs a value of 1 when any of the k-rate signals has changed, otherwise outputs 0.
kvar1 [, kvar2,..., kvarN] - k-rate variables to watch for changes.
Here is an example of the changed opcode. It uses the file changed.csd.
Example 59. Example of the changed opcode.
<CsoundSynthesizer>
<CsOptions>
-odac -B441 -b441
</CsOptions>
<CsInstruments>
sr = 44100
kr = 100
ksmps = 441
nchnls = 2
instr 1
ksig oscil 2,0.5,1
kint = int(ksig)
ktrig changed kint
printk 0.2, kint
printk2 ktrig
endin
</CsInstruments>
<CsScore>
f 1 0 1024 10 1
i 1 0 20
</CsScore>
</CsoundSynthesizer>