CsoundUnity version 3.0 is out!

Happy to announce that we have officially released CsoundUnity version 3.0!
Here is the ChangeLog:

New Features

  • Restructured the code in the form of a Unity Package (Unity - Manual: Packages).
  • Updated libraries to Csound 6.15.
  • Implemented most of the Csound API.
  • Several improvements of the Editor inspector:
    • Now the changes made to the Control Channels found in the csd are correctly serialised and saved in the Scene, and are fully compatible with Unity Inspector presets.
    • Added Edit Csd Section, to be able to edit the csd from Unity, and save its content on disk.
    • Added Test Score Section, to be able to send score to Unity when testing in Editor.
    • Added AudioChannels: the csd file is scanned for chnseta opcodes, and the resulting Audio Channels can be seen in the inspector, and publicly accessed from a dictionary.
    • Added folded groups:
      • Settings
      • Edit Csd Section
      • Test Score Section
      • Control Channels
      • AudioChannels
  • Added CsoundUnityChild, to be able to read audio from the AudioChannels of a CsoundUnity instance.
  • Added CsoundFileWatcher to detect changes made by an external program to the csds used in the scene, and update them. Add FILEWATCHER_ON in your project Scripting Define Symbols.
  • Added Android libraries, builds working on Android 64bit (it has been successfully tested on Oculus Quest).
  • Added an utility method to load samples from AudioClips (currently from Resources folder only).
  • Added CreateTable methods, to be able to create Csound tables from float arrays.
  • Added a toggle to show warnings and hard filter output samples with values higher than a threshold.
  • Cabbage widgets: Added support for ComboBoxes.
  • Added IsInitialized property and OnCsoundInitialized event.
  • Added PerformanceFinished property.
  • Added Samples: Csound Test, Basic Test, CsoundUnityChild Test, Simple Sequencer, AudioClip Reader.
  • Overriding the sample rate and control rate of the csd using Unity Audio Project Settings.
  • Improved Logging.
  • Updated macOS library to use a .bundle instead of a .framework, to be able to build for macOS straight out of the box.
  • Totally removed the need to use the StreamingAssets folder to store csds, libraries and audio files, the csd is saved into the CsoundUnity instance as soon as it is dragged in the Csd Asset inspector field.
  • Removed the overwriting of the Path variable of the operating system.

Fixes

  • Crash on exit.
  • Fixes for distorted audio output when reading mono files.
  • Build/Editor DLLNotFound issues on macOS.

Where to ask for help, report bugs, ask for new features:
Cabbage forum: use this forum for everything related to the use and the features of CsoundUnity, ask for help, report bugs, ask for new features.
Csound forum: help with Csound code, report bugs / ask for features relative to the Csound library.
Csound dischord chat: where Csound developers meet.
CsoundUnity Github repository: report specific issues with CsoundUnity, ask for new features, contribute to the development.

And now party time! :partying_face:
Very curious to see what you will create with it!

3 Likes

Like I said on the Cabbage list, I have to take my hat off to @g_b for this one. He’s restructured and updated a lot of the code base here. It now feels very much like a proper Unity package. I wonder does Unity they still have a problem with LGPL frameworks on their Asset Store? If not it would be nice to add CsoundUnity.

Sorry for the cross posting :sweat_smile:
Just wanted to be sure to reach the widest spectrum of audience :wink:

I wonder does Unity they still have a problem with LGPL frameworks on their Asset Store? If not it would be nice to add CsoundUnity.

We can try and see, I’ll let you know!

Cross-post at will! Hit everyone with this!

First post here but,

I just heard about this on the audioprogrammer discord, definitely nice work on how it sets up in Unity.

Can’t wait to try out some of the audio visual things I have already written in Unity with this. New to CSound but the machine opcode stuff seems pretty interesting for 3D. :slight_smile:

Thanks to all involved in the project. I know what it’s like trying to make bridges with audio frameworks, it ain’t easy. :wink:

1 Like

Thanks for jumping aboard!
Hope to see some great stuff soon!
You’ll find the Csound devs on this forum, so you’ll find the best answers!

1 Like

I have a lot of experience years ago with parsers and lexers, compilers and DOM code writing frameworks.

Has anybody done a node graph with Unity and CSound (that would create the csd file)? I don’t want to reinvent a wheel. But I can see from my naive perspective making a DOM in C# would make it a lot easier to work with.

I did this with an audio engine and C#/Unity, adds a lot of power.

I think that @DespairBear is working on something similar with CsoundUnity.
But he won’t create the csd file: instead, all the instruments inside the csd file will be nodes (if I understood his plan correctly).
Let’s wait for his word on this :wink:
Also @rory could be a good source of information because his framework Cabbage (based on Juce) has an integrated patcher.
Unfortunately I have no good hints on this, but I could help with some Editor stuff to connect nodes in the Unity inspector :wink:

1 Like

Alright cool, I need to learn this stuff before I start really making broad claims of what is possible, I just get excited when I see an opportunity for an abstraction layer in something like a 3D engine and audio. :wink:

My suggestion is to start reading how you can pass data around, for example using chnset
You could of course use global audio vars (have a look here to know about the different Csound vars: /chapter: B-Local-And-Global-Variables / CSOUND), but it will be less dynamic than the chnset/chnget approach.
Also Macros could be useful in this scenario: /chapter: H-Macros / CSOUND
But let’s wait for suggestions from Csound devs with more experience than me!

1 Like

Cabbage uses JUCE to implement its modular patching environment. But I think the same thing could potentially be achieved with Csound by manipulating the Csound DAG in real time. I have never tried, but I believe it might be possible to access low level orc nodes and restructure them on the fly.

Is there some example of that somewhere?

Not that I am aware off. And I might be wrong about it, but the comments underneath the csoundCompileTree() function seem to imply a new TREE can be compiled at perf-time. Victor is not on this list, but I will write him and ask if it is at least theoretically possible to do this.

1 Like

According to Victor,

CompileTree() is called when we are compiling, to parse code and create the tree, which is then compiled into instrument structures

He suggests that it might be possible to call at runtime, but is not 100%. It’s over to John ffitch now :rofl: Btw, Victor did mention he plans to do some work on this in the future, so watch this space. :+1:

1 Like

Super! Thanks for dropping the bomb :wink:

I wish more of the Csound devs would hang out here :rofl:

Me too! This forum is growing quickly!
There are already several great topics, in less than 5 months!!!
I have learned lots of new things so far!

1 Like

Thanks, I am really into this. I remember checking out CSound years ago but I was working on other audio projects, so I could never dive right in.

I spent 7 hours last night going through the FLOSS handbook, wow, I am fascinated.

Ironically I came into this forum through the AST conversation from google search(about CSound AST).

:slight_smile:

I am going all in on this, so I just need to start to understand the parser and the pipeline of data through the system.

Good luck. Feel free to keep us up to date with your findings. I think @g_b and I are keen to learn more about how this all works.

1 Like