soir

OVERVIEW

The ctrls module contains facilities to control settings of soir

in real-time.

CLASS

Control

Control() -> None

Base class for a control.

A control computes a value to the Soir engine about 100 times per second via the Control.fwd() call, this value is then interpolated by the C++ engine to provide a smooth transition between values.

The Control class is not meant to be created directly unless you want to implement your own control, helpers are available to create specific controls (see below).

Once a control is created, it can be referred to by using the ctrl('name') facility and can passed as a parameter to instrument calls or FXs.

Methods

fwd
fwd(self) -> None

Computes the next value of the control and advance the tick.

This is meant to be used by the soir engine.

get
get(self) -> float

Get the current value of the control.

Returns

– The current value of the control.

name
name(self) -> str

Get the name of the control.

Returns

– The name of the control.

set
set(self, **params: float) -> None

Set the control parameters.

Arguments
Name Type Description
**params The parameters to set.

FUNCTION

layout

layout() -> list[soir.rt.ctrls.Control]

Get the list of all controls.

Returns

– A list of all controls.

mk_func

mk_func(name: str, func: collections.abc.Callable[[], float]) -> None

Create a new function parameter.

Arguments

Name Type Description
name The name of the parameter.
func The function to compute the value.

mk_lfo

mk_lfo(name: str, rate: float, intensity: float = 1.0, low: float = -1.0, high: float = 1.0) -> None

Create a new LFO parameter.

Arguments

Name Type Description
name The name of the parameter.
rate The rate of the LFO in seconds.
intensity The intensity of the LFO.
low The minimum value of the LFO (defaults to -1.0).
high The maximum value of the LFO (defaults to 1.0).

mk_linear

mk_linear(name: str, start: float, end: float, duration: float) -> None

Create a new linear parameter.

Arguments

Name Type Description
name The name of the parameter.
start The start value.
end The end value.
duration The duration of the transition in seconds.

mk_val

mk_val(name: str, value: float) -> None

Create a new value parameter.

Arguments

Name Type Description
name The name of the parameter.
value The value.