I have created an example with your code. Yup, something up. Give me a moment…
Actually, it works fine for me here:
<Cabbage>
form size(500, 300), caption("Untitled")
soundfiler bounds(10, 34, 300, 200), file("DutchLadyTalking.aif"), visible(0), identChannel("waveform_ident0")
soundfiler bounds(10, 34, 300, 200), file("pianoMood.wav"), identChannel("waveform_ident1")
button bounds(352, 47, 80, 40), channel("switch")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -m0d
</CsOptions>
<CsInstruments>
nchnls = 2
0dbfs = 1
instr SwitchWaveSecure
String sprintfk "visible(%d)",0
Soundfiler sprintfk "waveform_ident%d", p5
prints Soundfiler
chnset String, Soundfiler
String sprintfk "visible(%d)",1
Soundfiler sprintfk "waveform_ident%d", p4
prints Soundfiler
chnset String, Soundfiler
endin
instr 1
kSwitch chnget "switch"
if changed:k(kSwitch) == 1 then
if kSwitch == 1 then
event "i", "SwitchWaveSecure", 0, 0.1, 0, 1
else
event "i", "SwitchWaveSecure", 0, 0.1, 1, 0
endif
endif
endin
</CsInstruments>
<CsScore>
i1 0 z
</CsScore>
</CsoundSynthesizer>
I had accidentally set guiMode()
to queue in my form. Of course it won’t work then, because identChannels are supported.