I’m trying tu build a multi-effect: 1 master instrument with buttons that start instances of other instruments.
I have a problem: I can start & and stop the instrument but only 1 time.
Thankyou.
<Cabbage>
form caption("ON - OFF") size(400, 300), colour(220, 220, 220), pluginID("ON_OFF_start")
checkbox bounds(50, 30, 100, 30) channel("fx1")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
instr 10
ktrig1 chnget "fx1"
printk 0.2, ktrig1
schedwhen ktrig1, 11, 0, 10
if (ktrig1 == 0) then
turnoff2 11, 2, 0
endif
endin
instr 11
a1 oscili 0.2, 440, 1
outch 1, a1
outch 2, a1
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
f1 0 1024 10 1 1 1 1
;starts instrument 10 and runs it for a week
i10 0 z
</CsScore>
</CsoundSynthesizer>