Cabbage Logo
Back to Cabbage Site

Scaling CsoundUnity

An issue that came up in conversation with one of the Csound devs has got me thinking (thanks Steven!).

Each time we add a new CsoundUnity source we are creating another instance of Csound. With dozens of CsoundUnity sources it could get pretty CPU hungry. So I was thinking about creating a CsoundUnity child component. We could fill the child audio buffer with audio streamed from a master instance of CsoundUnity. That way we can use one Csound instance to generate audio for a range of components, and Unity would do the spatialisation for us :thinking:

I’m glad you had a talk about CsoundUnity with Steven!
That would be very clever!
But I really don’t know how much work it would require, I’m not totally aware of what the Csound API offers.
So maybe this could also bring the modular approach and the ability to connect things around?
Like an audio chain to be built in the inspector?
Something like Alex was saying:

Hope I’m not digressing too much.

It wouldn’t be quite simple in fact. We would only need to stream the audio out of an instrument using named channels and pick it up in the CsoundUnity child.

Not quite. This would just be a way of minimising the CPU when Csound is being used for loads of sounds. I like the idea of a modular setup, but I don’t know what the best way to do it would be :thinking:

One thing I did mention to Steve was that I don’t expect sound designs to drop all their favourite tools and use Csound for everything. There is no need when the game engines and middleware do some many things really well already. I see Csound only being used for very specific tasks like procedural audio. But the fact that it can integrate with these tools without messing anything up is a big bonus!

1 Like

Yes it is, with a lot of patience and lots of editor scripting Unity can become a proper DAW!
:sweat_smile:

1 Like