Table of Contents

Class PatternSignals

Namespace
Sigil.Sound
Assembly
Sigil.Sound.Notes.dll

Turning a pattern of numbers into a signal that drives a parameter.

public static class PatternSignals

Inheritance

Inherited Members

Methods

ToSignal(Pattern<double>, double?, double, double)

A pattern of numbers as a signal: each value holds for the length of its step, in time with the music. Use it wherever a Sigil.Sound.Param goes, which replaces stepping through an array inside Fn(t => ...).

public static Sound ToSignal(this Pattern<double> pattern, double? bpm = null, double smoothSeconds = 0, double initial = 0)

Parameters

pattern Pattern<double>

The numbers, such as Mini.Numbers("400 800 1600 3200").

bpm double?

The tempo, or null to follow the host clock (or 120 without one).

smoothSeconds double

Glide time between values; after this long a jump is about 63% done. 0 steps instantly, which can click on gain, pitch and cutoff. Defaults to 0.

initial double

The value before the pattern has produced any. Defaults to 0.

Returns

Sound

Examples

Saw(110).LowPass(Mini.Numbers("400 800 1600 3200").ToSignal(smoothSeconds: 0.02), q: 4)

Remarks

A rest (~) holds the previous value rather than dropping to zero, so a filter stays where it was. Time is bound to the music the same way as Sigil.Sound.Patterns.Play(Sigil.Sound.Pattern,System.Func{Sigil.Sound.Voice,Sigil.Sound.Sound},System.Nullable{System.Double},System.Int32): with a Sigil.Sound.HostClock on the render context and no bpm, the pattern follows the host's beat position and tempo (and stays on the grid when the sound is replaced); otherwise it counts from when it starts, at bpm (120 if not given). One cycle is Sigil.Sound.Pat.BeatsPerCycle beats.

The pattern is asked once per block and the answer does not depend on the block size.