Mx.Synths (mx v0.1.0)

Copy Markdown View Source

The synths mx ships, with the options each one takes and their defaults, as mxs lists them.

A song measures time options in beats: those a synth or effect declares in beats, such as attack, decay, sustain, release and an echo's phase, and every option ending in _slide. to_seconds/3 turns them into the seconds the engine expects, defaults included, so a synth sounds the same against the beat at any tempo; given_to_seconds/3 turns only the options given, for changing a sound that plays. A negative time is left alone, since the sample players read a sustain of -1 as "until the end of the sample". tremolo and motor are rates, picks and pulses per beat, so they are sent per second.

The effects are the synths named fx_ followed by the effect's name, and are not synths a loop can play. Its in_bus and out_bus are mx's to set, so a song cannot give them. The live audio synths read the sound card for live_audio, and the sample players play sample, so neither are synths a loop can play. tail_seconds/1 is how long an effect chain keeps sounding after its last note ends, as Sonic Pi works it out for each effect.

Summary

Functions

Refuses a number outside the range a synth's option takes, or a name it does not take, naming what it takes.

Whether an effect exists.

Whether an effect takes an option; its buses are mx's own, so they are not options.

An effect's options with its times in seconds, given in beats at a tempo.

Every effect, by its name in a song as a string.

Whether a loop can play a synth, a sampled instrument among them.

Whether an option picks a synth's sound when the note starts, so it cannot change while the note sounds: one that takes names, or one a clause of a synth written in Elixir matches on.

Forgets the catalog read from the engine, so the next use reads it again, with the synths written in Elixir known since.

The options given with their times in seconds at a tempo, and their rates per second.

Whether a synth takes an option.

How messages name a synth or a sampled instrument.

Every synth a loop can play, by name.

How long an effect chain keeps sounding after its last note ends.

A synth's options with its times in seconds at a tempo, adding its time defaults, which are in beats too.

Functions

check_value(synth, option, value)

Refuses a number outside the range a synth's option takes, or a name it does not take, naming what it takes.

effect?(effect)

Whether an effect exists.

effect_option?(effect, option)

Whether an effect takes an option; its buses are mx's own, so they are not options.

effect_to_seconds(effect, opts, tempo)

An effect's options with its times in seconds, given in beats at a tempo.

effects()

Every effect, by its name in a song as a string.

exists?(synth)

Whether a loop can play a synth, a sampled instrument among them.

fixed?(synth, option)

Whether an option picks a synth's sound when the note starts, so it cannot change while the note sounds: one that takes names, or one a clause of a synth written in Elixir matches on.

forget()

Forgets the catalog read from the engine, so the next use reads it again, with the synths written in Elixir known since.

given_to_seconds(synth, opts, tempo)

The options given with their times in seconds at a tempo, and their rates per second.

option?(synth, option)

Whether a synth takes an option.

owner(sampled)

How messages name a synth or a sampled instrument.

synths()

Every synth a loop can play, by name.

tail_seconds(chain)

How long an effect chain keeps sounding after its last note ends.

to_seconds(synth, opts, tempo)

A synth's options with its times in seconds at a tempo, adding its time defaults, which are in beats too.