rslider will not recall correctly if the default value is nonzero.
When default is nonzero, the slider will always have the default value when plugin loads, even if another setting was saved in the song (Reaper project).
This recalls to default
rslider channel(“amp”), bounds(130, 25, 70, 70), text(“amp”), range(0, 1, 1, 0.35)
This recalls to saved value in song:
rslider channel(“amp”), bounds(130, 25, 70, 70), text(“amp”), range(0, 1, 0, 0.35)
Full csd here:
<Cabbage>
form size(340, 130), caption("Mincer"), pluginID("minc")
rslider channel("timpoint"), bounds(10, 25, 70, 70), text("timpoint"), range(0, 1, 0, 1, 0.001)
rslider channel("timefine"), bounds(70, 25, 70, 70), text("timefine"), range(0, 1, 0, 1, 0.001)
rslider channel("amp"), bounds(130, 25, 70, 70), text("amp"), range(0, 1, 1, 0.35)
rslider channel("pitch"), bounds(190, 25, 70, 70), text("pitch"), range(0, 2, 1, 1, 0.001)
rslider channel("feedback"), bounds(250, 25, 70, 70), text("feedback"), range(0, 1, 0, 1, 0.001)
;csoundoutput bounds(4, 212, 648, 150)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 64
nchnls = 2
0dbfs=1
gi4 ftgen 0, 0, 0, 1, "Askil2_4_mono.wav", 0, 0, 0
; live input buffer table for granular effects processing
giLiveFeedLen = 524288
giLiveFeedLenSec = giLiveFeedLen/sr
giLiveFeed ftgen 0, 0, giLiveFeedLen+1, 2, 0 ; create empty buffer for live input
;***************************************************
;record input to buffer
;***************************************************
instr 1
a1 inch 1 ; signal input
;test signal
;a1 diskin "StruglKor.wav", 1, 0, 0
;aout = a1 * 0.1
; outs aout, aout
aFeed chnget "afeedback" ; feedback from audio output
kFeed chnget "feedback" ; feedback gain
a1 = a1 + (aFeed*kFeed) ; mix feedback with live input
; write audio to table
iAudioTable = giLiveFeed
iLength = ftlen(iAudioTable)
gkstartFollow tablewa iAudioTable, a1, 0 ; write audio a1 to table
gkstartFollow = (gkstartFollow > (giLiveFeedLen-1) ? 0 : gkstartFollow) ; reset kstart when table is full
tablegpw iAudioTable ; update table guard point (for interpolation)
chnset gkstartFollow, "kstartFollow" ; output the buffer position to chn
endin
;***************************************************
;mincer stretch
;***************************************************
instr 2
ifftsize = 1024
ktimptM chnget "timpoint"
ktimptF chnget "timefine"
ktimptM = ktimptM + (ktimptF*0.04)
kamp chnget "amp"
kpitch chnget "pitch"
ktimpt phasor 1/giLiveFeedLenSec
;printks "time %f \n", 0.2, (ktimptM*giLiveFeedLenSec)+(gkstartFollow/sr)+1/kr
atimpt interp (-ktimptM*giLiveFeedLenSec)+(gkstartFollow/sr)-((ifftsize/sr)*kpitch)
klock = 1
a1 mincer atimpt, kamp, kpitch, giLiveFeed, klock, ifftsize
chnset a1, "afeedback"
outs a1, a1
endin
</CsInstruments>
<CsScore>
f1 0 1024 10 1
i1 0 84600
i2 0 84600
</CsScore>
</CsoundSynthesizer>