Hi everyone,
I simply try to iterate to a set of samples in WAV format with the help of a Cabbage Knob (each position represents one sample).
I use diskin2 and sprinfk to find and start a sample. My problem is, that it does not update the sample and play it. Only the first sample is played and it does not count up on the others and iterate.
Here is what I got so far:
<Cabbage>
form caption("Test") size(350, 200), guiMode("queue"), colour(58, 110, 182), pluginId("sfi1")
rslider bounds(20, 8, 60, 60) range(1, 12, 1, 1, 1), channel("samples"), text("sample")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
kSliderValue cabbageGetValue "samples"
printk2 kSliderValue
if changed(kSliderValue) == 1 then
SSample sprintfk "0%d.wav", kSliderValue ; kSliderValue should replace the value in sprinfk to new sample for example knob position 5 = 05.WAV
endif
a1 diskin2 SSample
prints SSample
outs a1, a1
endin
</CsInstruments>
<CsScore>
i1 0 z
</CsScore>
</CsoundSynthesizer>
Thanks!