Thanks for the response. Here’s a code example.
<Cabbage>
form caption("Stretch") size(600, 500), guiMode("queue"), pluginId("1287"), colour (0,100,0)
keyboard bounds(8, 158, 381, 95)
filebutton bounds(14, 18, 80, 40) channel("LoadButton")
rslider bounds(90, 298, 60, 60) channel("rslider10003") range(0.1, 1, 0.5, 1, 0.01)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-dm0 -n -+rtmidi=null -M0 -Q0 --midi-key=4 --midi-velocity=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
// Cabbage widgets
iWindowSize cabbageGetValue "rslider10003"
// Table upload
Sfile chnget "LoadButton"
iLen filelen Sfile
iSr filesr Sfile
iCh filenchnls Sfile
iTableSize = (iLen*iSr)*2
iSoundFileL ftgen 0, 0, iTableSize, 1, Sfile, 0, 0, 1
iSoundFileR ftgen 0, 0, iTableSize, 1, Sfile, 0, 0, 2
iNum notnum
iFreq = 2^((iNum-84)/12) // Note 84 (C5) is when pitch = 1
if (changed(k(iNum)) == 1) then
event_i "i", 2, 0, 2, iWindowSize, iSoundFileL, iFreq
endif
endin
instr 2
aoutL paulstretch 10, p4, p5
ifftsize = 4096
ioverlap = ifftsize / 4
iwinsize = ifftsize
iwinshape = 1
iFreq = p6
fftinL pvsanal aoutL, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis of the audio-signal
fftblurL pvscale fftinL, iFreq, 0
aoutPitchL pvsynth fftblurL; resynthesis
out aoutPitchL
endin
</CsInstruments>
<CsScore>
f0 z
</CsScore>
</CsoundSynthesizer>