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

Layer 2a — Control state (control thread). More...

Inheritance diagram for Csound.Unity.CsoundControl:

Public Member Functions

void Configure (ControlContext context, ref CsoundRealtime realtime, in AudioFormat format, out GeneratorInstance.Setup setup, ref GeneratorInstance.Properties properties)
 Called on the control thread at first use and on every audio-system reconfiguration. Synchronises the realtime struct's InstanceId.
void Dispose (ControlContext context, ref CsoundRealtime realtime)
 No teardown needed in Phase 1.
void Update (ControlContext context, ProcessorInstance.Pipe pipe)
 No pipe messages sent in Phase 1.
ProcessorInstance.Response OnMessage (ControlContext context, ProcessorInstance.Pipe pipe, ProcessorInstance.Message message)
 No incoming messages handled in Phase 1.

Package Attributes

int InstanceId
 Index into CsoundBridgeRegistry.

Properties

bool isFinite [get]
 Csound runs indefinitely; not finite.
bool isRealtime [get]
 Csound must process in real time at system rate.
DiscreteTime? length [get]
 Unknown length (infinite).

Detailed Description

Layer 2a — Control state (control thread).

Fully unmanaged struct implementing GeneratorInstance.IControl (with CsoundRealtime) and GeneratorInstance.ICapabilities. Unity requires TControl to be unmanaged (same constraint as TRealtime), so this struct stores only an int InstanceId and resolves the bridge through CsoundBridgeRegistry, the same registry the realtime struct uses.

Unity calls Configure on the control thread when the generator is first used and again whenever the audio system reconfigures — not once per audio block. Unity's own documentation is explicit about this, and adds that during a reconfiguration the instance is suspended from processing, so its properties can be modified safely from there. Nothing reacts to a reconfiguration yet; see the audio-path documentation.

Member Function Documentation

◆ Configure()

void Csound.Unity.CsoundControl.Configure ( ControlContext context,
ref CsoundRealtime realtime,
in AudioFormat format,
out GeneratorInstance.Setup setup,
ref GeneratorInstance.Properties properties )
inline

Called on the control thread at first use and on every audio-system reconfiguration. Synchronises the realtime struct's InstanceId.

Parameters
contextThe control thread context Unity passes in.
realtimeThe unmanaged realtime struct Unity keeps for this instance.
formatThe audio format Unity is configuring.
setupFilled with the setup Unity needs for the instance.
propertiesThe instance properties, which this may adjust.

◆ Dispose()

void Csound.Unity.CsoundControl.Dispose ( ControlContext context,
ref CsoundRealtime realtime )
inline

No teardown needed in Phase 1.

Parameters
contextThe control thread context Unity passes in.
realtimeThe unmanaged realtime struct Unity keeps for this instance.

◆ OnMessage()

ProcessorInstance.Response Csound.Unity.CsoundControl.OnMessage ( ControlContext context,
ProcessorInstance.Pipe pipe,
ProcessorInstance.Message message )
inline

No incoming messages handled in Phase 1.

Parameters
contextThe control thread context Unity passes in.
pipeThe pipe that carries messages between the control and audio sides.
messageThe message Unity is delivering.
Returns
Whether the message was handled.

◆ Update()

void Csound.Unity.CsoundControl.Update ( ControlContext context,
ProcessorInstance.Pipe pipe )
inline

No pipe messages sent in Phase 1.

Parameters
contextThe control thread context Unity passes in.
pipeThe pipe that carries messages between the control and audio sides.

Member Data Documentation

◆ InstanceId

int Csound.Unity.CsoundControl.InstanceId
package

Index into CsoundBridgeRegistry.

Property Documentation

◆ isFinite

bool Csound.Unity.CsoundControl.isFinite
get

Csound runs indefinitely; not finite.

◆ isRealtime

bool Csound.Unity.CsoundControl.isRealtime
get

Csound must process in real time at system rate.

◆ length

DiscreteTime? Csound.Unity.CsoundControl.length
get

Unknown length (infinite).


The documentation for this struct was generated from the following file: