Cabbage Logo
Back to Cabbage Site

Time to talk abut multichannel options

Hello,

from a user perspective, the most flexible option IMHO is to support multichannel both in the Cabbage player and in the VST export, and use the actual number of channels that the effect/synth is using. For stereo effects, export a vst with 2_in/2_out, for other configurations, export N_in/M_out. The rationale for this is “CSound fully supports multichannel” and “Cabbage is a frontend to CSound” therefore “Cabbage fully supports multichannel”. This is what I thought in the first place when I started to develop a multichannel effect in Cabbage.

Having said that, this would be of course the ideal, but I don’t known nothing about how difficult this would be to implement and to maintain in the future, how time/effort needs to be put into it and which are your priorities for the project evolution. So this is only my (uninformed) opinion.

Thanks for the feedback. One of the things preventing me from sorting out the standalone player’s multi-channel problems is that I don’t have a multi IO sound card. I’m stuck to plain old stereo I’m afraid. But I will try to get it sorted. There is not much point in offering the ability to develop multi-channel plugins if one can’t test them in the standalone player.

The best would be for the user to have the option of how many IOs they want their plugin to have when exporting. This is what most people have requested, so I’ll try to make that possible some way or another. Until I do get it sorted, don’t be afraid to press me about releasing up to date multi-channel IO builds from time to time.

Hi, coming late to the party, just wanted to share my test results with the 8 channel build.
I tested now, and it seems the CPU penalty depends on (perhaps) the ksmps and the number of plugins used. Not sure exactly how. But I ran a simple volume control plug, one with ksmps=32 and one with ksmps=512. I had 10x the 512-ksmps plug on one track and 40x the 32-ksmps plug on another track. This is in Reaper btw., and the CPU usage is read from the CPU use per track in the Performance meter in Reaper. . With 2-channel Cabbage I spent 0.27% CPU on the 512-ksmps track and 1.20% on the 32-ksmps track. With 8-channel, I spent 0.58% and 2.13% respectively. So the track with the 512-ksmps plug used 3x the CPU processing 8 channels, while the track with the 32-ksmps plug barely twice the CPU. Hmm, of course rt CPU measurements are quite rough, but at least it indicates a significant extra load on the CPU with 8 channel processing. I agree with your decision of keeping Cabbage stereo only for now, both due to the CPU usage, the standalone problems, and possible issues this might create for new users. I am also very eager to start experimenting with multichannel plugins, so I am grateful for the opportunity to get an 8-channel custom version now and then. I also tested using the exported 8-channel plugins in the same Reaper project with stereo Cabbage plugins (exported with the standard version), and this seems to work nicely. Looking forward to the N-channel solution, as that of course will be much more elegant.

Thanks for the detailed report. I can’t for the life of me think why a smaller ksmps would lead to less CPU usage, but I’ll need to profile this properly. Most DAW performance meters are nothing more than a rough guide to what’s going on. We’ll know for sure once I put it through the profiler. But this will have to wait until after the Easter break as I have no access to a decent profiler at the moment.

Hi … very late to this of course, and this is only anecdotal (personal) … but my struggle at the moment is to make a VBAP plug-in for a 22.2 system (24 channels). Looks as though the question here is whether to support 8 or keep it to stereo, so I’m guessing 24 outs isn’t on the table … but who knows, maybe you have a OS X build that would support that? My next task is to implement something like the XYPad (so far it’s just the generic UI), which is why I was hoping I could go the Cabbage route! (A side note … because of the number of channels, so far I’ve only gotten this to work as an AU in Reaper … )

I can roll you out a 24 channel version of the plugin wrapper if you like? But what are you saying about AU? Are you having issues with Reaper and multichannel plugins?

Hi all!
I didn’t noticed a significant CPU increase using multichannel version. But still i’ve not attempted complex project.
Things that need multichannel in/out.

  1. Sidechain stuff
  2. Vocoders with external mod/carrier pairs.
  3. Drum synths/samplers with different out for every sound.
  4. Multitimbral synths

etc.

a.

I can certainly see the worth of multichannel plugins. But it would be far nicer to be able to set the number of channels when exporting. I have to update Cabbage to use JUCE’s new channel bus system. I’m hoping it may provide better options for achieving this.

yeah! agree
a.

Hi,
Any news on multichannel support?
If I use a csd with nchnls=4, I seem to get a plugin that has 4 inputs and outputs in Reaper, but I get sound only from the first two channels (2 in and 2 out).

This might not be possible… but just brainstorming if it hadn’t already been suggested or thought of. It would be amazing if there could be a declaration in the cabbage section that could give a hint as to how many channels in and out are needed… for example, a stereo compressor with a mono sidechain option could ask for 3 inputs and 2 outputs, etc etc.

Similar to the idea of disabling automation on certain widgets (mentioned here: New idea: disable automation regardless of active()), the inputs and outputs would be set at runtime and not able to be modified with identchannels etc.

Another thought; Would it also possible to make specific channels “discoverable” as routing options to the daw? The sidechain example would be a great use case, the main stereo inputs should work as regular inputs as expected… with the third channel showing as a routable input. I have NO IDEA how that works behind the scenes, and perhaps it’s not standardized between DAWs… so sorry if that’s a silly or unreasonable request :wink:

I’m a bit late on this discussion. But I am interested in using Cabbage as a host for Massively Multichannel Audio. I understand that Csound is able to already achieve huge channel counts, and that Cabbage Studio is also being phased out, so it may be something that is needed only for host. I don’t really think that VST would be best for MMA output. So is there a way to easily allow MMA as host only but limit export Stereo VST’s?

BTW made up MMA but it sounds good! :wink:

it’s working fine for me here Oeyvind with the following test code:

sr = 44100
ksmps = 32
nchnls = 4
0dbfs = 1


instr 1
a1 inch 1
a2 inch 2
a3 inch 3
a4 inch 4
outq a1, a2, a3, a4
endin

Can you not simply add some info yourself to the instrument? There are info buttons that can be used to display all kind of files to the user. [quote=“t_grey, post:14, topic:175”]
I have NO IDEA how that works behind the scenes, and perhaps it’s not standardized between DAWs
[/quote]

I’ve no idea either to be honest. I so rarely ever use DAWs.

Cabbage studio is now a very essential part of Cabbage. In fact, the entire system is now built on the Cabbage Studio audio engine. As far as I can recall, Cabbage plugins support up to 64 channels.

Sorry @rorywalsh - I got confused. I though Cabbage Studio was now Cabbage 2?

I don’t think I was very clear with that, sorry. These channel hints I think would be useful at export time only, to somehow instruct the vst how many ins and outs to expect and accommodate for, which led into the idea of making them visible to the daw as well.

Sorry, I have no idea what’s going on behind the scenes, and that might just be nonsense.

Funny, almost all of my cabbage work is intended to be used in DAWs :wink:

But this already happens when you create a plugin with more than 2 in/outs, at least in some hosts. Reaper for example will advise that the plugin is multichannel and ask if you wish to set it up in that way, or revert to stereo. Or maybe I’m not understanding the issue?

You’re not alone, but I’ve always been able to build self contained instruments that do everything I would need of a DAW. Admittedly, my needs aren’t quite that extensive!

Actually, it does not work for me here. testing in Reaper.
I have a 4 channel tracl load the plugin, send audio on all 4 channels, but only get output from 2 channels after the plugin. If I bypass the plugin, I have sound on all channels. The i/o assignments for the plugin in Reaper is left as they are by default (in 1 going to plugin input 1, plugin output 1 going to channel 1 on the track, likewise for i/o 2,3,4).
I also tested letting the plugin generate noise on all 4 channels, like this
a1 rnd31 1,1
a2 rnd31 1,1
a3 rnd31 1,1
a4 rnd31 1,1
outq a1, a2, a3, a4
It still outputs sound only on channel 1 and 2

I will try on Windows later on today. I tested with OSX earlier and didn’t have any issues. For what it’s worth, do you have 4 channel output from your plugin when you open the Cabbage patcher?

Yes

I’m seeing the same behaviour on Windows. I’ll take a look. It’s strange because it works fine in the Cabbage patcher, which is basically a VST host in itself. And strange too that we get different behaviour on OSX. Leave it with me.