Cabbage Logo
Back to Cabbage Site

[ALTERNATIVE FOUND] "Connect" opcode doesn't work in Cabbage2

Hey Rory,
I’m trying to test the connect opcode of CSound but even when I copy&paste the example (http://www.csounds.com/manual/html/connect.html) Cabbage tells me that I forgot a variable name…
But I can’t find what I missed, so I think it’s a big

I’m trying to use connect to virtually connect a Cabbage effect after a Cabbage Synth, (like you would do in a daw) maybe it’s just not the way it works ?

Thanks in advance for your help !


Windows7 64bits
Cabbage 2

That’s odd, maybe those opposed aren’t included with that version of Csound. It’s quite easy to do this without the connect opcode. Using audio rate chnset/chnget opcodes will give your the same thing and more. Let me know if you can work it out. Otherwise I can try to put together a simple example one I get back from my travels.

1 Like

Thanks ! I’ll try that then when I’ll have time !
I’ll let you know ! Enjoy your travels :wink:

Alright, I gave it a try and it doesn’t work as expected :

  • It successfully connects the two intruments, BUT I tried with a reverb and the sounds plays endlessly unless I set ksmps to 1 (It’s set to 256 usually, this provide a good compromise with memory usage)
  • I can’t play 2 notes of the same instruments through my reverb

I can provide a quick example if you want, what I really want to achieve is to set, say, a reverb after my main instrument and I’d like it to act the same way as it is when I set the Cabbage reverb after my synth in my DAW

I actually would like to include the Cabbage reverb example in my synth if it’s more clear

Any clues ? Thanks for your help !

Try this one test.csd (1.2 KB)

<Cabbage>
form caption("Untitled") size(400, 300), colour(58, 110, 182), pluginid("def1")
keyboard bounds(0, 8, 400, 100)
rslider bounds(24, 132, 60, 60) range(0, 1, 0, 1, 0.001), channel("revFdbk") text("Rev Fdbk")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

;instrument will be triggered by keyboard widget
instr 1
    aEnv madsr .1, .5, .5, 1
    aOsc oscili aEnv*p5, p4

    ; use chnmix because you may have several 
    ; instances of this instrument playing at any one time
    chnmix aOsc, "output"
endin

;always on reverb instrument
instr REVERB
    ;get audio from channel
    aIn chnget "output"
    aL, aR reverbsc aIn, aIn, chnget:k("revFdbk"), 10000
    
    ; perform crude mixing of wet/dry signal
    aMix ntrpol aIn, aL+aR, chnget:k("revFdbk")
    out aMix, aMix

    ; clear signal so it's doesn't
    ; accumulate over time and produce 
    ; unwanted audio
    chnclear "output"
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
i1 0 z
i"REVERB" 0 z
</CsScore>
</CsoundSynthesizer>
1 Like

Thanks for your quick reply ! I tried with chnset / chnget but didn’t know about the chnmix opcode !
I’ll try this as soon as I come back from my vacation but I’m almost sure it will do as expected !

EDIT : Thanks so much it works perfectly :wink: