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

Realtime struct for CsoundUnityChild IAudioGenerator path. More...

Inheritance diagram for Csound.Unity.CsoundChildRealtime:

Public Member Functions

GeneratorInstance.Result Process (in RealtimeContext context, ProcessorInstance.Pipe pipe, ChannelBuffer buffer, GeneratorInstance.Arguments args)
 Called by Unity on every audio block (audio thread). Pulls one complete published block per channel from the parent and writes it into buffer .
void Update (ProcessorInstance.UpdatedDataContext context, ProcessorInstance.Pipe pipe)
 No-op — no pipe messages needed.

Package Attributes

int InstanceId
 Index into CsoundChildRegistry.

Properties

bool isFinite [get]
 Audio channel data is continuously produced by the parent — not finite.
bool isRealtime [get]
 Must run at the system audio rate.
DiscreteTime? length [get]
 Infinite generator — length unknown.

Detailed Description

Realtime struct for CsoundUnityChild IAudioGenerator path.

Fully unmanaged struct implementing GeneratorInstance.IRealtime. Reads audio from the snapshots the parent CsoundUnity publishes at the end of each block, reached through CsoundChildRegistry.

No call to PerformKsmps is made here — Csound processing is entirely owned by the parent's CsoundRealtime. This struct is purely a data reader.

Member Function Documentation

◆ Process()

GeneratorInstance.Result Csound.Unity.CsoundChildRealtime.Process ( in RealtimeContext context,
ProcessorInstance.Pipe pipe,
ChannelBuffer buffer,
GeneratorInstance.Arguments args )
inline

Called by Unity on every audio block (audio thread). Pulls one complete published block per channel from the parent and writes it into buffer .

Nothing here reads the parent's live working arrays: the two audio callbacks are not ordered against each other, so doing so meant sometimes seeing a block that was only half written. Taking published snapshots costs at most one DSP buffer of latency — constant, rather than varying with whichever callback happened to run first — and a parent that has stopped publishing yields silence instead of a looped last block.

Parameters
contextThe audio thread context for this block.
pipeThe pipe that carries messages between the control and audio sides.
bufferThe block to write the output into.
argsWhat Unity says about the block being rendered.
Returns
What the generator did with the block.

◆ Update()

void Csound.Unity.CsoundChildRealtime.Update ( ProcessorInstance.UpdatedDataContext context,
ProcessorInstance.Pipe pipe )
inline

No-op — no pipe messages needed.

Parameters
contextThe context Unity passes when it hands over updated data.
pipeThe pipe that carries messages between the control and audio sides.

Member Data Documentation

◆ InstanceId

int Csound.Unity.CsoundChildRealtime.InstanceId
package

Index into CsoundChildRegistry.

Property Documentation

◆ isFinite

bool Csound.Unity.CsoundChildRealtime.isFinite
get

Audio channel data is continuously produced by the parent — not finite.

◆ isRealtime

bool Csound.Unity.CsoundChildRealtime.isRealtime
get

Must run at the system audio rate.

◆ length

DiscreteTime? Csound.Unity.CsoundChildRealtime.length
get

Infinite generator — length unknown.


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