CsoundUnity version compatibility with Unity 6

Hi,

For some reason, I cannot find this anywhere, or at least not openly disclosed, but what Unity versions is CsoundUnity currently compatible with?

I know that it works with Unity 2021 LTS based on example projects I’ve seen on the GitHub, but this detail is not included in the documentation. Moreover, is the current CsoundUnity version compatible with Unity 6?

Thanks in advance!

-Danny

Hi @dannycastroaudio and welcome to the forum.

Yes CsoundUnity is compatible with Unity 6.
In case you are using the new Input System there could be some issues with the samples (that you can fix by using Both Input Systems in the Player Settings), but CsoundUnity should work in every Unity version starting from 2018.1+.

Btw very soon I will release CsoundUnity 4 so if you are starting to develop something with it, my suggestion is to use the new branch, use this link in Unity Package Manager:

https://github.com/rorywalsh/CsoundUnity.git#release_4_0_0

CsoundUnity 4 is a new major version (also it is based on Csound 7!) so old code made with 3.5 or older will have to be updated, but it’s nothing worrying, I just added namespaces.

Please note that some of the package samples could be broken, I haven’t checked them all after updating the codebase.

Hopefully I can work on finalizing the release starting from next week.
There are lots of new features in the v4 package and it would be amazing if you could report bugs in this forum, specifying that you are working on CsoundUnity 4.

Thank you!

Here are the changes currently in the new version:

[4.0.0]

  • [Add] Unity Timelines integration: Channel (Fixed/Random/RandomSmooth) and Score (Score/Swarm/Arpeggio/Euclidean/Stochastic/Chord/Pattern/Step) clips, CsoundTimelineStarter
  • [Add] Audio Input Routing: connect CsoundUnity instances to feed audio into another instance’s spin buffer, with cycle detection, mute toggle and per-route level control
  • [Add] AudioRouteGraphWindow: interactive node/edge editor to visualise and edit the audio route graph across all scene instances
  • [Add] IAudioGenerator audio path for Unity 6+: drives the AudioSource directly via CsoundUnity.Process, set as default on Unity 6 (OnAudioFilterRead remains available)
  • [Add] Lifecycle API: initializeOnAwake toggle, Initialize(), Stop(), Restart()
  • [Add] CsoundUnityMidiInput: platform-agnostic MIDI input component (macOS/iOS/visionOS via CoreMIDI, Android via android.media.midi API 23+)
  • [Add] Waveform, spectrum, oscilloscope and Lissajous audio monitor in inspector (play mode, with zoom sliders)
  • [Add] OutputBuffer and OnCsoundPerformKsmps callback
  • [Add] MusicUtils: music theory utilities (scales, chords, arpeggios, Euclidean rhythms)
  • [Add] Utility scripts: AudioDisplay, FFTUtils, TableLoader, WriteAudioFileUtils, CopyFilesToPersistentDataPath, RemapUtils
  • [Add] AudioSamplesUtils.Rms() and Peak() helpers
  • [Add] CsoundUnityVectorMorph: bilinear blending between four CsoundUnityPresets with interactive editor
  • [Add] UI components: CsoundUnitySlider (hslider/vslider), CsoundUnityKnob (rslider — bounded rotary knob), CsoundUnityEncoder (encoder — endless rotary, unbounded), CsoundUnityButton, CsoundUnityToggle, CsoundUnityDropdown, CsoundUnityXYPad, CsoundUnityKeyboard, CsoundUnityLabel, CsoundUnityMeter, CsoundUnityNSlider, CsoundUnityPianoKey, CsoundUnityRangeSlider (horizontal and vertical) with prefabs
  • [Add] UI auto-layout: Create UI and Update UI buttons in the CsoundUnity inspector generate a Unity Canvas from Cabbage bounds data; CsoundUnityUISettings ScriptableObject maps widget types to prefabs and controls font scale
  • [Add] NativeAudioInput: low-latency multichannel audio input for macOS (CoreAudio/AUHAL) and Android (AAudio exclusive mode, 4ms @ 48kHz)
  • [Add] Cabbage parser: encoder widget (channel, increment, value, text/popupPrefix); form widget (size → canvas dimensions)
  • [Add] SampleInputSystemFixer: editor script that automatically patches imported sample scenes for Unity’s new Input System
  • [Add] xypad Cabbage widget support in parser and inspector
  • [Add] CSD refresh button and CREATE from template button in inspector
  • [Add] Many new samples across new and existing categories: Timelines, UI, Samplers, Collisions, Miscellaneous, Presets, Engines
  • [Add] Context menu shortcuts to quickly create CsoundUnity GameObjects
  • [Add] OnCsoundStopped and OnCsoundPerformanceFinished events
  • [Update] Csound native libraries updated to Csound 7.0 across all platforms (macOS, Windows, iOS, visionOS, Android)
  • [Update] CsoundCsharp.cs and CsoundUnityBridge.cs updated for the Csound 7 API (breaking changes: csoundCreate, csoundCompileOrc, csoundCompileCSD, csoundEventString, csoundGetChannels and others)
  • [Update] Inspector: sr/kr/ksmps redesign with single override toggle
  • [Update] CsoundUnitySlider now applies skew (logarithmic/exponential mapping) and increment (stepped values) from ChannelController
  • [Fix] CsoundFileWatcher: handle atomic saves from modern editors
  • [Fix] Presets: AssetDatabase.ImportAsset crash on JSON save, null checks in SetPreset/UpdateAssignablePresets, “To JSON” now saves alongside the SO asset by default, JSON list filtered to current CSD
  • [Fix] Cabbage parser: caption/text truncation with multiple quoted attributes on same line; whitespace before ‘(’ not recognised
  • [Fix] _channelsIndexDict wrong index when form widget is at position 0; stale entries after Domain Reload
  • [Fix] Hang on exit: send end-score event before csoundDestroy to stop indefinitely-running instruments cleanly

Hi Giovanni,

Thank you so much for your quick response! My question is primarily due to the new Enhanced Audio Foundation and the Scriptable Audio pipeline added in Q3 2025. I’m wondering if CsoundUnity 4.0 works with the Audio Random Container, or if we’re able to interact with the csd file using the Audio Random Container.

Hi Danny,

You can’t interact with the csd using the Audio Random Container as from what I can tell it is just a way to randomise the audioClip that plays in the AudioSource selecting that from an array of audioClips, so no direct interaction with the csd - ie, you cannot change the csd at runtime randomly from a set.
But definitely you can use that to change the AudioClip that CsoundUnity reads (by checking the “Process Audio Clip“ toggle).
In v4 though it should possible to stop a CsoundUnity instance at runtime, update its csd, and reinitialize the same CsoundUnity instance. So yes you will be able to set csds randomly from a set, but you will have to control the CsoundUnity instance lifecycle.

About other changes in v4, yes now the IAudioGenerator interface has been implemented and it’s the default if running on Unity 6+.
It allows a great performance boost when ksmps is 32 or above.
OnAudioFilterRead is still there to support older Unity versions.

I have yet to explore fully the Enhanced Audio Foundation but it’s next in my list, together with Root Outputs.
Related with Enhanced Audio Foundation, I have already added a plugin to support multichannel audio input for macOs and Android, way faster than using Microphone input. Possibly this could be removed completely if Enhanced Audio Foundation gives me the same features and performances.

Btw feel free to suggest any feature that you think could be useful! I will try to implement it if it makes sense.