CsoundUnity 4.0.0-alpha.3
Loading...
Searching...
No Matches
Csound.Unity Namespace Reference

Namespaces

namespace  CsoundCSharp
namespace  MIDI
namespace  NativeAudioInput
namespace  Timelines
namespace  Utilities

Classes

class  AudioChannelReader
 Reads the audio a CsoundUnity instance publishes on one of its named audio channels, one finished block at a time, from any thread. More...
class  AudioInputRoute
 Defines a single audio-rate connection from a source CsoundUnity instance into this instance's Csound spin (input) buffer. More...
class  AudioPathShared
 The small decisions the three audio paths must make identically: which Csound channel feeds a Unity output channel, how far the startup fade has got, and what to divide a sample by. More...
class  Cabbage3Bounds
 Where a widget sits, in pixels. More...
class  Cabbage3Channel
 One channel of a widget. Cabbage 3 lets a widget carry any number of these, each with its own id and its own interaction, so they are channels rather than parts of one control. More...
class  Cabbage3ChannelLabel
 The name a channel shows in a plugin host's parameter list, never on screen. More...
class  Cabbage3Document
 The root object of a Cabbage 3 section. More...
class  Cabbage3Label
 The text a widget shows on screen. More...
class  Cabbage3Parser
 Reads the <Cabbage> JSON section of a Cabbage 3 csd into CsoundChannelController entries, the shape the Cabbage 2 line parser also produces, so presets, the inspector and the UI components see one model. More...
class  Cabbage3Range
 The numeric bounds of one Cabbage 3 channel. More...
class  Cabbage3Reading
 What reading a Cabbage 3 section produced: the channel controllers, and everything the csd declared that this version does not act on. One object, so a caller that wants the warnings does not read the csd a second time to get them. More...
class  Cabbage3Size
 A form's window size, which it carries instead of bounds. More...
class  Cabbage3Widget
 One widget. A single class for every type, because the widgets array is heterogeneous and type says which fields carry anything. More...
class  CarrierClip
 Builds the clip CsoundUnity and CsoundUnityChild put on their AudioSource when the user has not put one there themselves. It carries no audio: it exists so FMOD gives the AudioSource a DSP node, without which OnAudioFilterRead is never called at all, and so that what arrives in that callback is the gain Unity wants applied — volume, mute, distance and the panner's placement, all of it already in those samples. More...
class  CsoundArrayChannelArguments
struct  CsoundArrayChannelInfo
 Metadata for the shape observed under the same channel lock as an array copy. More...
class  CsoundArrayChannelInterop
 ABI prefixes from the bundled Csound headers; never copies or replaces an ARRAYDAT structure. More...
class  CsoundBridgeRegistry
 Shared static registry of Csound bridges for the IAudioGenerator path. More...
class  CsoundChannelController
 Utility class for controller and channels. More...
class  CsoundChannelDataArguments
struct  CsoundChildControl
 Control struct for CsoundUnityChild IAudioGenerator path. More...
class  CsoundChildEntry
 Entry stored in CsoundChildRegistry for one CsoundUnityChild instance operating in the IAudioGenerator path. More...
struct  CsoundChildRealtime
 Realtime struct for CsoundUnityChild IAudioGenerator path. More...
class  CsoundChildRegistry
 Shared static registry of CsoundChildEntry objects for the CsoundUnityChild IAudioGenerator path. More...
struct  CsoundControl
 Layer 2a — Control state (control thread). More...
class  CsoundPvsChannelArguments
struct  CsoundPvsChannelInfo
 Metadata and frame counter observed atomically with a PVS snapshot. More...
class  CsoundPvsChannelInterop
 PVSDAT/AUXCH prefixes from the bundled headers, independent of MYFLT precision. More...
struct  CsoundRealtime
 Layer 2b — Realtime state (audio thread). More...
struct  CsoundRootControl
 Control struct for the AudioPath.RootOutput path (Unity 6+). More...
struct  CsoundRootRealtime
 Realtime struct for the AudioPath.RootOutput path (Unity 6+). More...
class  CsoundSharedBuffer
 Wait-free, single-producer / multiple-consumer snapshot buffer used to hand blocks of audio from the thread that produces them to any number of threads that observe them. More...
class  CsoundTableCopyRequest
 The result of an asynchronous table copy. Poll this on the calling thread. More...
class  CsoundUnity
 Runs Csound inside a scene: compiles a .csd, performs it while the scene plays, and exposes its channels to the rest of the game. More...
class  CsoundUnityBridge
 The managed wrapper around one native Csound instance: it creates Csound, compiles the csd, and exposes the calls CsoundUnity needs — channels, score events, the spin and spout buffers, function tables and teardown. One bridge belongs to one CsoundUnity. More...
class  CsoundUnityChild
 CsoundUnityChild is a component that can output AudioChannels found in the csd of the associated CsoundUnity gameObject. More...
class  CsoundUnityMidiInput
 Platform-agnostic MIDI input component for CsoundUnity. Add this component to the same GameObject as CsoundUnity (or assign the CsoundUnity reference in the inspector). Make sure the CSD has <CsOptions> -M0 </CsOptions> to activate Csound's MIDI subsystem. More...
class  CsoundUnityPreset
 A set of control channel values for one csd, saved as an asset. More...
class  CsoundUnityVectorMorph
 Vector synthesis component: blends four CsoundUnityPreset placed at the corners of a unit square using bilinear interpolation, driven by a 2D position in [0,1]×[0,1]. Inspired by the Sequential Prophet VS and Korg Wavestation vector synthesis paradigm. More...
class  CsoundWorker
 A Csound instance on a thread of its own, started with -n -d so it touches no audio device. Used for work that must not run on the audio thread: rendering a csd to a file, and scanning a csd for the channels its orchestra allocates. More...
class  EnvironmentSettings
 This class describes a setting that is meant to be used to set Csound's Global Environment Variables. More...
interface  INativeAudioInputProvider
 Implemented by Csound.Unity.NativeAudioInput.CsoundUnityNativeAudioInput. When assigned to CsoundUnity.nativeAudioInputProvider, this method is called once per ksmps boundary (before PerformKsmps) on the Unity audio thread to write captured microphone samples into the Csound spin buffer. More...
struct  SpoutRenderer
 Drives Csound for one Unity audio block and copies spout into the block's buffer. The two Unity 6 audio paths, AudioPath.IAudioGenerator and AudioPath.RootOutput, both consist of this: they differ in where Unity hands the buffer to them, not in what they do with it, so they embed this and keep their own plumbing. More...

Enumerations

enum  CsoundArrayChannelType {
  None , Init , Control , String ,
  Audio
}
 Element types supported by the array-channel API. More...
enum  CsoundArrayChannelStatus {
  Success , Unavailable , NotFound , NotInitialized ,
  UnsupportedType , BufferTooSmall , ShapeMismatch , Busy ,
  UnsupportedPlatform , NativeError
}
 The result of an array-channel operation; invalid managed arguments throw separately. More...
enum  CsoundPvsFormat { AmplitudeFrequency , AmplitudePhase , Complex }
 Pair layout of each bin in a standard, non-sliding PVS frame. More...
enum  CsoundPvsChannelStatus {
  Success , Unavailable , NotFound , NotInitialized ,
  UnsupportedType , UnsupportedFormat , BufferTooSmall , ShapeMismatch ,
  Busy , UnsupportedPlatform , NativeError
}
 PVS channel results; invalid managed arguments throw separately. More...
enum  AudioRouteResult {
  Added , AddedWithCycle , RejectedCycle , InvalidSource ,
  AlreadyExists
}
 Result of an CsoundUnity.AddAudioInputRoute call. More...
enum  SupportedPlatform {
  MacOS , Windows , Android , iOS ,
  WebGL , visionOS
}
 Enumerates the build platforms supported by EnvironmentSettings. More...
enum  EnvironmentPathOrigin { PersistentDataPath , StreamingAssets , Absolute , Plugins }
 The base folder where to set the Environment Variables. More...
enum  AudioPath { OnAudioFilterRead = 0 , IAudioGenerator = 1 , RootOutput = 2 }
 Selects which audio path CsoundUnity uses to deliver audio. More...
enum  CsoundTableCopySubmission {
  Queued , NotReady , TableUnavailable , InvalidSource ,
  QueueFull , AudioThread , UnsupportedPlatform
}
 Whether an asynchronous table copy was queued, or why it was rejected. More...

Enumeration Type Documentation

◆ AudioPath

Selects which audio path CsoundUnity uses to deliver audio.

Enumerator
OnAudioFilterRead 

Classic Unity audio path via OnAudioFilterRead. Works on all supported Unity versions. Audio is routed through the AudioSource and AudioMixer graph.

IAudioGenerator 

Unity 6+ IAudioGenerator path. Drives the AudioSource directly — avoids the resampling step and integrates cleanly with the new Unity Audio system. Audio passes through the AudioMixer graph. Requires an AudioSource component.

RootOutput 

Unity 6+ RootOutput path. Bypasses the AudioMixer entirely — audio is mixed additively into Unity's main output. No AudioSource required; 3D spatialization and mixer effects are not applied. Ideal when the mixer is not needed or for multi-channel output beyond the AudioSource's channel count.

◆ AudioRouteResult

Result of an CsoundUnity.AddAudioInputRoute call.

Enumerator
Added 

Route added successfully; no cycle in the audio graph.

AddedWithCycle 

Route added despite a circular dependency (forceConnection was true).

RejectedCycle 

Route rejected because it would create a circular dependency.

InvalidSource 

Route rejected because source was null.

AlreadyExists 

Route not added because an identical one (same source, channel, and spin channel) already exists.

◆ CsoundArrayChannelStatus

The result of an array-channel operation; invalid managed arguments throw separately.

Enumerator
Success 

The operation completed.

Unavailable 

The Csound instance is unavailable or shutting down.

NotFound 

The named channel does not exist.

NotInitialized 

An array channel exists but has not been initialized.

UnsupportedType 

The channel element type is unsupported by the requested operation.

BufferTooSmall 

The supplied data or shape buffer is too small; reported metadata remains valid.

ShapeMismatch 

An existing channel's type/shape, or the write length, differs from the request.

Busy 

Another host array operation owns the bridge, or initialization could not suspend audio.

UnsupportedPlatform 

Array channels are unavailable in the browser bridge.

NativeError 

Native metadata, sample precision or a native operation was invalid.

◆ CsoundArrayChannelType

Element types supported by the array-channel API.

Enumerator
None 

No supported type was found.

Init 

Init-rate numeric values (i[]).

Control 

Control-rate numeric values (k[]).

String 

UTF-8 string values (S[]).

Audio 

Audio blocks (a[]), with ksmps samples per element.

◆ CsoundPvsChannelStatus

PVS channel results; invalid managed arguments throw separately.

Enumerator
Success 

The operation completed.

Unavailable 

The engine is unavailable or shutting down.

NotFound 

No channel exists under that name.

NotInitialized 

The PVS channel has no initialized frame yet.

UnsupportedType 

The name belongs to another channel type.

UnsupportedFormat 

Sliding spectra or partial tracks are outside this API's frame layout.

BufferTooSmall 

The supplied frame buffer is too short; metadata reports the required capacity.

ShapeMismatch 

The FFT/hop/window/format or exact write length does not match.

Busy 

Another host data operation owns the gate, or setup could not suspend audio.

UnsupportedPlatform 

PVS channels are unavailable in the browser bridge.

NativeError 

Native frame metadata or storage is invalid.

◆ CsoundPvsFormat

Pair layout of each bin in a standard, non-sliding PVS frame.

Enumerator
AmplitudeFrequency 

Amplitude and instantaneous frequency in Hz.

AmplitudePhase 

Amplitude and phase in radians.

Complex 

Real and imaginary Fourier coefficients.

◆ CsoundTableCopySubmission

Whether an asynchronous table copy was queued, or why it was rejected.

Enumerator
Queued 

The copy was accepted. Poll its request for completion.

NotReady 

The Csound instance is unavailable or closing.

TableUnavailable 

No function table with samples exists at this number.

InvalidSource 

The source is null or has more samples than the table.

QueueFull 

The queue is full. Retry after a queued copy completes.

AudioThread 

Submit table copies from a control thread.

UnsupportedPlatform 

The platform does not support asynchronous table copies.

◆ EnvironmentPathOrigin

The base folder where to set the Environment Variables.

Enumerator
PersistentDataPath 

The persistent data path, where the player can also write.

StreamingAssets 

The StreamingAssets folder, which keeps the files as they are.

Absolute 

An absolute path, which can be outside the Unity project.

Plugins 

The folder the Csound plugin libraries are loaded from.

◆ SupportedPlatform

Enumerates the build platforms supported by EnvironmentSettings.

Enumerator
MacOS 

macOS, which loads the CsoundLib64 bundle.

Windows 

Windows, which loads csound64.dll.

Android 

Android, which loads libcsound for the device ABI.

iOS 

iOS, where Csound is linked into the Xcode project.

WebGL 

A browser, where Csound runs as WebAssembly.

visionOS 

visionOS, which ships the iOS build of Csound.