Multichannel Audio in SOUL

Dear All,

I’m trying to get the SOUL examples to work with more than 2 Output (and Input) channels.

With my Multichannel-Interface connected - from my understanding - I would have to change :

output stream float<2> audioOut
to
“output stream float<4>” is that the right approach?

Also tried output stream float out[4], following the docs.

Trying to use arrays “out[4]” tells me, that this feature is not implemented yet.

Sadly any version I tried either plays nothing or just keeps playing Mono / Stereo.
Using the Commandline Tools, the terminal also tells me i have 2 channels [0/1] even though my system clearly recognizes the 128chs of my interface and I can use them in my DAW or MaxMSP.

Any tips (or even better code examples) how this would work are appreciated!

best regards

This is odd - i’ve just tried this with a 4in/4out interface and it is also not working. SOUL itself works with multiple channels, we test quite a few scenarios and this is definitely fine. I think what is going on is the soul command line tool is asking for 2in/2out rather than what is required by the patch.

As for the ‘not implemented’ error, I think what you’ve done there is declare an output array, not an output vector? So ‘output stream float out[4]’ rather than ‘output stream float<4> out’

I’ve pushed an updated binary as a pre-release which I think addresses this problem - can you have a go with the one here and let me know if it works for your machine/device:

I’ve also tidied up some problems relating to mismatches between the code and the i/o available. As before, it’ll attach to the default input and output device, but it’ll now use as many channels as are available, unless you specify a ‘–input=’ or ‘–output=’ value on the command line

1 Like

Dear Cesare,

thank you very much! Will test it out as soon as I can! :slight_smile:

As excited as I am, sadly this doesn’t fix it for me.

Taking the classic ringtone example, changing the out stream float to float<2> works fine and gives me an expected stereo result. But changing it to anything higher than that results in an error (tested on a MacBookPro 2012 with OSX 10.13.6 + a RME UCX Interface) :

Opened CoreAudio device “Fireface UCX (23964370)”
Sample rate: 48000Hz, block size: 512, latency: 1ms, input chans: [0, 1], output chans: [0, 1]
Opening MIDI device: from Max 2
Opening MIDI device: from Max 1
Opening MIDI device: Fireface UCX (23964370) Port 2
Opening MIDI device: Fireface UCX (23964370) Port 1
Opening MIDI device: Digiface Dante (23930428) Port 1
Opening MIDI device: Euphonix MIDI Euphonix Port 4
Opening MIDI device: Euphonix MIDI Euphonix Port 3
Opening MIDI device: Euphonix MIDI Euphonix Port 2
Opening MIDI device: Euphonix MIDI Euphonix Port 1
Opening MIDI device: IAC-Treiber Bus 1
Building: /Users/strobel/Downloads/cr_4/ClassicRingtone_4ch.soul
Session empty CPU <1%
Session loaded CPU <1%
Session linked CPU <1%
Session running CPU <1%
Fatal error! run() function took too long to execute.
Process terminating…
libc++abi.dylib: terminating
Abort trap: 6

Also seems to still say I have inputs 0/1 and outs 0/1, which is clearly not the case :frowning:
using " --outputs=4 " ends in the same result btw.

UPDATE: same result on different MacBookPro (2017) and different Interface (RME Dante Digiface) aswell.

Sorry, just seen this. Can you try with the current latest release - https://github.com/soul-lang/SOUL/releases/tag/0.8.1367, there were some issues with the previous build which sneaked in and messed up that pre-release version.

Thank you again :slight_smile:
will try it out as soon as I can!

But is the code I posted correct ? If not, could you provide me a little snippet how I could test Multichannel? :slight_smile:

best regards

Yes, the correct approach is to define your output as a float<4> (assuming you 4 channels of audio), that is, you are defining the output type as a vector of 4 floats.

For example, this is classic ringtone writing to float<4> - https://soul.dev/lab/?id=3c50f19cf5671232d85c4868fd4e2933

Actually, if you define multiple outputs they will be allocated an output channel in their declaration order, so something like this - https://soul.dev/lab/?id=26d00a667e61e7f61e6ad9a3166205e7

In this case, the ringtone is being played to channels 2 and 3, and so on a stereo output you only hear the ringtone on the right channel, as by convention channel 1 is left, and channel 2 is right.

1 Like

Now it is working ! :slight_smile:
thanks again for the help and the second checking :slight_smile:

Although I’m already writing the designated project in JUCE now, this will be very handy in the future :wink:

best regards

Hey, I’m also having some strange issues with multichannel inputs.

If I use

input stream float<2> audioIn;
input stream float<2> audioOut;

I don’t get any audio passing through the plugin, but if i define two separate inputs like so:

input stream float audioInL;
input stream float audioInR;
input stream float<2> audioOut;

and then send the output to audioOut like this:

audioOut << float<2>(audioInL, audioInR);

it works fine.

For clarity, this is what doesn’t work: https://soul.dev/lab?id=2f284297a4b9819bbbfee06d416c0c22

This seems to only be an issue with my setup (JUCE AudioPluginHost on an M1 mac with Big Sur) because both options work fine on the web playground and on my Windows machine. The same thing applies when I use the JUCE project generator.