Skip to content

🪛 fx

fx

The fx module provides a set of audio effects that can be applied to tracks in the soir engine. Each track can have a set of effects with corresponding parameters, which are typically defined using the tracks.setup() function.

Cookbook

Setup tracks with effects

tracks.setup({
    'bass': tracks.mk_sampler(fxs={
        'rev': fx.mk_chorus(),
    }),
})

Fx(name='unnamed', type='unknown', mix=None, extra=None) dataclass

Representation of a Soir FX.

Attributes:

Name Type Description
name str

The name of the effect.

type str

The effect type.

mix float | None

The mix parameter of the effect. Defaults to None.

extra str | None

Extra parameters for the effect, JSON encoded. Defaults to None.

mk(type, mix=None, extra=None)

Creates a new Fx.

Parameters:

Name Type Description Default
type str

The effect type.

required
mix float

The mix parameter of the effect. Defaults to None.

None
extra dict

The extra parameters of the effect. Default to None.

None

mk_chorus(time=0.5, depth=0.5, rate=0.5)

Creates a new Chorus FX.

Parameters:

Name Type Description Default
time float | Control

The time parameter of the chorus effect. Defaults to 0.5.

0.5
depth float | Control

The depth parameter of the chorus effect. Defaults to 0.5.

0.5
rate float | Control

The rate parameter of the chorus effect. Defaults to 0.5.

0.5

mk_lpf(mix=None, cutoff=0.5)

Creates a new Low Pass Filter FX.

Parameters:

Name Type Description Default
mix

The mix parameter of the low pass filter effect. Defaults to None.

None
cutoff float | Control

The cutoff frequency of the low pass filter in the [0.0, 1.0] range. Defaults to 0.5.

0.5

mk_reverb(mix=None, time=0.01, wet=0.75, dry=0.25)

Creates a new Reverb FX.

Parameters:

Name Type Description Default
mix

The mix parameter of the chorus effect. Defaults to None.

None
time

The time parameter of the reverb effect in the [0.0, 1.0] range. Defaults to 0.01.

0.01
dry

The dry parameter of the reverb effect in the [0.0, 1.0] range. Defaults to 0.25.

0.25
wet

The wet parameter of the reverb effect in the [0.0, 1.0] range. Defaults to 0.75.

0.75