# `Mx.Synths`
[🔗](https://github.com/mx-music/mx/blob/main/lib/mx/synths.ex#L1)

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.

# `check_value`

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

# `effect?`

Whether an effect exists.

# `effect_option?`

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

# `effect_to_seconds`

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?`

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

# `fixed?`

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`

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

# `option?`

Whether a synth takes an option.

# `owner`

How messages name a synth or a sampled instrument.

# `synths`

Every synth a loop can play, by name.

# `tail_seconds`

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

# `to_seconds`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
