Hey Cabbage Community!
I am attempting to build an XY style QuadMorpher to perform spectral morphing between four individual sources. I’ve got it running but currently only works between three of my four samples!
I have copied my .csd script below and attached a link to download the csd and standalone as well. I would be so grateful for any feedback, advice, suggestions on how to get this working!
Thanks so much,
Mitch
<Cabbage>
form caption("QuadMorph") size(500, 500), pluginId("def1"), bundle("Resources")
xypad bounds(144, 52, 200, 200) channel("x", "y") rangeX(0, 1, 0) rangeY(0, 1, 0)
button bounds(8, 8, 69, 56) channel("PlayStop") colour:1(42, 74, 255, 255) colour:0(55, 106, 132, 255) text("Off", "On")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -+rtmidi=NULL -M0
</CsOptions>
<CsInstruments>
ksmps = 32
nchnls = 2
0dbfs = 1
giSamp1 ftgen 1, 0, 0, 1, "Resources/Acoustic.wav", 0, 0, 1
giSamp2 ftgen 2, 0, 0, 1, "Resources/Banjo.wav", 0, 0, 1
giSamp3 ftgen 3, 0, 0, 1, "Resources/PianoSynth.wav", 0, 0, 1
giSamp4 ftgen 4, 0, 0, 1, "Resources/Organ.wav", 0, 0, 1
instr 1
gkPlayStop chnget "PlayStop"
if gkPlayStop==0 then
turnoff
endif
kX = cabbageGetValue:k("x")
kY = cabbageGetValue:k("y")
iAmp = 0.5
iFreq = p4
iFFTsize = 4096
ioverlap = iFFTsize / 4
iwinsize = iFFTsize
iwintype = 1
aIn1 loscil3 iAmp, 1, giSamp1, 1, 2
ain2 loscil3 iAmp, 1, giSamp2, 1, 2
ain3 loscil3 iAmp, 1, giSamp3, 1, 2
ain4 loscil3 iAmp, 1, giSamp4, 1, 2
fSig1 pvsanal aIn1, iFFTsize, ioverlap, iwinsize, iwintype
fSig2 pvsanal ain2, iFFTsize, ioverlap, iwinsize, iwintype
fSig3 pvsanal ain3, iFFTsize, ioverlap, iwinsize, iwintype
fSig4 pvsanal ain4, iFFTsize, ioverlap, iwinsize, iwintype
fMorph1 pvsmorph fSig1, fSig2, kX, kX ;Samp1 > Samp2
fMorph2 pvsmorph fMorph1, fSig3, kY, kY ;Samp2 > Samp3
fMorph3 pvsmorph fMorph2, fSig4, 1-kY, 1-kY ;Samp3 > Samp4
fMorph4 pvsmorph fMorph3, fSig1, 1-kX, 1-kX ;Samp4 > Samp1 or Samp3
aout pvsynth fMorph4
outs aout, aout
endin
//SAMPLE-TRIGGER
//======================================
instr 99
gkPlayStop chnget "PlayStop"
ktrig1 trigger gkPlayStop,0.5,0
schedkwhen ktrig1,0,0,1,0,-1
endin
</CsInstruments>
<CsScore>
f0 z
i 99 0 100000
</CsScore>
</CsoundSynthesizer>