Hi everyone, I’m doing some work with cabbage and I’m having trouble getting my reverb to work and cannot figure out what I’m missing/doing incorrectly.
I’ve instantiated my global variables and routed my sends, I think correctly… Yet I can’t get my reverb instrument to play? I can’t spot whatever I’m missing, or probably routing incorrectly.
So far, my audio plays correctly! But alas, no FX.
Maybe a second pair of eyes can help me out?
<Cabbage> bounds(0, 0, 0, 0)
form caption("Simple Synth") size(650, 300), colour(255, 255, 255), guiMode("queue"), pluginID("def1")
keyboard bounds(18, 170, 568, 121)
rslider bounds(308, 82, 70, 70), channel("att"), range(0, 1, 0.01, 1, 0.01), text("Attack") textColour(0, 0, 0, 255)
rslider bounds(388, 82, 70, 70), channel("dec"), range(0, 1, 0.5, 1, 0.01), text("Decay") textColour(0, 0, 0, 255)
rslider bounds(458, 82, 70, 70), channel("sus"), range(0, 1, 0.5, 1, 0.01), text("Sustain") textColour(0, 0, 0, 255)
rslider bounds(530, 82, 70, 70), channel("rel"), range(0, 1, 0.7, 1, 0.01), text("Release") textColour(0, 0, 0, 255)
rslider bounds(462, 10, 70, 70), channel("cutoff"), range(0, 22000, 2000, 0.5, 0.01), text("Cut-Off") textColour(0, 0, 0, 255)
rslider bounds(532, 10, 70, 70), channel("res"), range(0, 1, 0.7, 1, 0.01), text("Resonance") textColour(0, 0, 0, 255)
rslider bounds(8, 84, 70, 70), channel("LFOFreq"), range(0, 10, 0, 1, 0.01), text("LFO Freq") textColour(0, 0, 0, 255)
rslider bounds(595, 215, 51, 59), channel("amp"), range(0, 1, 0.7, 1, 0.01), text("Gain") textColour(0, 0, 0, 255)
rslider bounds(4, 6, 60, 60) channel("RvbMix") range(0, 1, 0, 1, 0.001) text("Reverb") fontColour(0, 0, 0, 255) textColour(0, 0, 0, 255)
rslider bounds(68, 6, 60, 60) channel("RvbSize") range(0, 1, 0, 1, 0.001) text("Size") fontColour(0, 0, 0, 255) textColour(0, 0, 0, 255)
;Preset Box
combobox bounds(208, 8, 100, 25), populate("*.snaps"), channel("combo1") channelType("string") value("0.0") automatable(0)
filebutton bounds(146, 8, 60, 25), text("Save", "Save"), populate("*.snaps"),mode("named preset") channel("filebutton1")
filebutton bounds(312, 8, 60, 25), text("Remove", "Remove"), populate("*.snaps", "test"), mode("remove preset") channel("filebutton6")
;VU
vmeter bounds(610, 10, 12, 162) channel("vu1") outlineColour(0, 0, 0, 255), overlayColour(0, 0, 0, 255) meterColour:0(255, 0, 0, 255) meterColour:1(255, 255, 0, 255) meterColour:2(0, 255, 0, 255)
vmeter bounds(628, 12, 12, 160) channel("vu2") value(0) outlineColour(0, 0, 0), overlayColour(0, 0, 0) meterColour:0(255, 0, 0) meterColour:1(255, 255, 0) meterColour:2(0, 255, 0) outlineThickness(1)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
gaSendL, gaSendR init 0 ; global reverb audio is init on start
gkRvbMix chnget "RvbMix" ;Reverb Send Amount (0-1) obtaining value from chan. "RvbMix"
cabbageSetValue "RvbMix", 0.8
cabbageSetValue "RvbSize", 0.6
cabbageSetValue "amp", 0.5
;......................................... INIT Param values set.
;instrument will be triggered by keyboard widget
instr 1
iFreq = p4
iAmp = p5
gkAmp chnget "amp"
gkRvbSize chnget "RvbSize"
iAtt chnget "att"
iDec chnget "dec"
iSus chnget "sus"
iRel chnget "rel"
kRes chnget "res"
kCutOff chnget "cutoff"
kLFOFreq chnget "LFOFreq"
;......................................... Obtaining values from channels
kEnv madsr iAtt, iDec, iSus, iRel
aOut vco2 iAmp, iFreq
kLFO lfo 1, kLFOFreq, 5
aLP moogladder aOut, kLFO*kCutOff, kRes
asig = aLP*kEnv
aL = asig
aR = asig
outs aL * gkAmp, aR * gkAmp
;feeding meters starts here
k1 rms asig * gkAmp, 30
k2 rms asig * gkAmp , 30
gaSendL = gaSendL + aL
gaSendR = gaSendR + aR
cabbageSetValue "vu1", portk(k1*10, .25), metro(10)
cabbageSetValue "vu2", portk(k2*10, .25), metro(10)
endin
instr 99 ;reverb
a2L, a2R reverbsc gaSendL, gaSendR, .8, 12000
outs a2L * gkRvbMix, a2R * gkRvbMix
clear gaSendL,gaSendR
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
</CsScore>
i 99 0 60000
</CsoundSynthesizer>