Cabbage Logo
Back to Cabbage Site

Mono tracks distorted

hi
does anyone can give me a tip for writing an effect plugin that works on mono AND stereo tracks?
i know how to write for mono or stereo but i can’t figure it out how it works for both.
thanks

Cabbage doesn’t support mono plugins (yet*), so if you want mono you’ll need a stereo plugin, and output the same signal to both channels. The reason you’re getting distortion is because of gibberish being sent to one of the channels.

Rory

  • I’m working on sidechain support, which forced me to redo the entire channel system, so mono plugins should probably work in the near future…
2 Likes

oh wonderful
I’m looking forward to it

Hi @prhm.i, what DAW are you using? I want to check this, but I can’t recreate the problems…

hi
I’m using cubase 10.5 also i tested with cubase 9

I haven’t worked mono in such a long time, so I don’t know if this will help… but all of my effects have an input stage where I can select which of the input channels to use, I can choose between L only, R only, L+R combined (mono), L & R (stereo), and R & L (inverted stereo).

The buttons to select use this cabbage code:

button bounds(0, 2, 20, 14), channel("mono-st"), radiogroup(101),value(1), text("St", "St"), popuptext("Stereo Input")
button bounds(20, 2, 22, 14), channel("mono-inv"), radiogroup(101), text("Inv", "Inv"), popuptext("Inverted Stereo Input")
button bounds(42, 2, 20, 14), channel("mono-lr"), radiogroup(101), text("LR", "LR"), popuptext("Mono Input: LR+LR")
button bounds(61, 2, 19, 14), channel("mono-l"), radiogroup(101), text("L", "L"), popuptext("Mono Input: L+L")
button bounds(80, 2, 19, 14), channel("mono-r"), radiogroup(101), text("R", "R"), popuptext("Mono Input: R+R")

And the csound processing code is:
kStereo chnget “mono-st”
kInvert chnget “mono-inv”
kLR chnget “mono-lr”
kLeft chnget “mono-l”
kRight chnget “mono-r”

; make a working copy for use
aSigL = aInL
aSigR = aInR

; mono input collapse snippet
if (kInvert==1) then
aSigR = aInL
aSigL = aInR
elseif (kLR==1) then
aSigL = (aSigL+aSigR)*.5
aSigR = aSigL
elseif (kLeft==1) then
aSigR = aSigL
elseif (kRight==1) then
aSigL = aSigR
endif

I’m just thinking doing something like that will let you test the input channels, and maybe you can at least work around the problem that way? Good luck!

1 Like

Hi,

I just ran into a similar issue with Logic Pro X, fyi :wink:

Hi @flaviogaete. Thanks for posting. If you want to support mono synths in Cubase, or Logic/Garageband, then you need to check if Csound is running in stereo or mono. A simple trick is something like this:

instr 1
    a1, a2 diskin2 "myStereoFile.wav", 1, 0, 1 
    if nchnls == 1 then
        out (a1+a2)/2
    else
        outs a1, a2
    endif
endin

If you want to support mono synths in Logic you need to add this test.

1 Like

Thanks! That makes sense and is very helpful.

Let us know if it works :+1: