Table of Contents

Class Operator

Namespace
Sigil.Sound
Assembly
Sigil.Sound.dll

Creating Sigil.Sound.IOperator instances without declaring a class.

public static class Operator

Inheritance

Inherited Members

Methods

From(BlockRenderer)

Wraps a lambda as an operator, for use with Sigil.Sound.Sound.Through(System.Func{Sigil.Sound.IOperator,Sigil.Sound.IOperator},System.String) and Sigil.Sound.Sound.FromOperator(System.Func{Sigil.Sound.RenderContext,Sigil.Sound.IOperator},System.String). State lives in variables the lambda captures; declare them where the operator is created, so every compile of the sound starts fresh. The same real-time rules as Sigil.Sound.IOperator.RenderBlock(System.Span{Sigil.Sound.StereoFrame}) apply.

public static IOperator From(BlockRenderer render)

Parameters

render BlockRenderer

Renders the next block. Must not allocate or block.

Returns

IOperator

Examples

Saw(110).Through(input => Operator.From(block =>
{
    input.RenderBlock(block);              // pull the input, then rework it in place
    for (int i = 0; i != block.Length; i++)
        block[i] = block[i] * 2f;
}))

From(BlockRenderer, Action?)

Like Sigil.Sound.Operator.From(Sigil.Sound.BlockRenderer), with a reset that restores the lambda's captured state. Only needed when the sound is played as a note voice and your state must start clean for every note.

public static IOperator From(BlockRenderer render, Action? reset)

Parameters

render BlockRenderer

Renders the next block. Must not allocate or block.

reset Action?

Restores the captured state to its initial values.

Returns

IOperator