After some discussion here about the potential need for a Csound mixer plugin for Unity I went ahead and built one. It’s Windows only for now as I’m away from my Mac for the next week or so. This plugin will work with existing Cabbage effects, so long as they only use sliders to control their parameters. I’m afraid it will remain this way until I can spend some time on creating a custom GUI.
To use it, you will need to have either Csound or Cabbage already installed. The CsoundUnity Mixer Plugin package comes with a very simple scene. An AudioSource is attached to a cube. Its output is sent to PingPongDelay effect (thanks Iain) in an AudioMixer. To create a new effect simple make a copy of the AudioPluginPingPongDelay.dll and rename it AudioPluginEffectName.dll, where EffectName should be replaced with the name of the .csd file containing the instrument code. This .csd file should reside in the same folder as the plugin dll. For example, if you create a csd file called CrazyShit.csd, you should create a copy of the plugin .dll and name it AudioPluginCrazyShit.dll. Unity insists on audio plugins being named with AudioPlugin at the start. If you call it by another name Unity won’t load it. If this all sounds a little confusing, just take a look in the Plugins/x86_64 folder. It should be clear from looking there what’s going on.
With this copying and renaming complete you can go ahead and launch Unity, and add a mixer to your project. When you click on ‘Add Effect’ you will see listed any effects you’ve created. The name of the effect as it appears in Unity is the caption() identifier used with the form widget. The names of the parameters will be the sliders’s text() identifier if there is one. Otherwise Unity will display the slider’s channel name.
Finally. This is completely untested!! I’m sharing it in the hope that @metaphysician and others will give it a test ride and let me know how it works. Please be patient. It could be weeks or months (or days!) before we have a fully stable version.
p.s. no reason why this won’t work for synths either. One just needs a parameter to enable or disable playback.