Can RNBO export c++ code that supports variable number of channels?
I'm trying to integrate Max&RNBO into a Wwise effect plug-in. In this scenario, different channel numbers need to be supported. I found that the number of channels supported by the c++ code exported by RNBO depends on the number of input nodes in the patch, and is hard-coded in the process method. Is there a way to make the patch support variable number of channels.
Hi TG Alpha,
There is not currently a way for the exported code to have a dynamic number of input channels. There are a few ways you could solve this.
Build your RNBO patch as mono and build your wwise wrapper to call N instances of your patch according to the desired number of channels. If the channels each need special logic per channel, you will also need to pass in the channel number as a parameter to the instance and program any additional logic within the mono patch to process accordingly--e.g. N-speaker audio spatialization.
Build your RNBO patch with the maximum number of input channels you wish to support, and build your wwise wrapper to pass in zeroed dummy audio buffers to any extra audio channels. For performance considerations, you would likely also want to place each channel within a subpatcher with polyphony enabled that can be turned on and off with the voice mute status, and pass in a parameter with the number of voices to control this and any other logic necessary to accommodate the specific number of channels
Hope this helps.
-Joshua
Hi Joshua Kit Clayton,
Both options sound feasible, and I'll give it a try. Thanks!
Hey TG ALPHA, I'm following the same development path.
I'm curious about what resources you're referencing to creating a Wwise plugin with RNBO export. Is there a reference you could link to me, or maybe perhaps list a few steps here?
Hi TOBYAM.
Simply put, you need to define includedirs
and files
in PremakePlugin.lua
to include the code generated by RNBO into your project. Then, you can create instances of RNBO::CoreObject
in SoundEnginePlugin
for further processing.
You can check out my previous rough implementation in the following git repo: