What one Sonic Pi thread carries while its code runs, and the score it played.
Summary
Functions
Put a voice, or several, at the thread's time under one node reference.
Close the innermost effect.
Change an open effect's options for everything played after this moment.
Record a change to every note under ref, taking effect at the thread's time.
Draw from the thread's generator with fun, keeping the generator that comes back.
A thread at time zero, seeded from seed. capture: true collects loops; ambient: true marks a thread nobody started a round or a buffer for.
Open an effect around what is played until close_fx/2.
What the thread played, as a score.
Seconds for beats at the thread's tempo.
Move the thread on by beats.
Types
@type t() :: %TuningFork.SonicPi.Thread{ ambient: boolean(), bpm: float(), capture: boolean(), events: [event()], fx: %{ required(reference()) => %{ name: atom(), opts: keyword(), segment: reference() } }, fx_stack: [reference()], loops: [{atom(), (-> term()), map(), float()}], now: float(), rand: TuningFork.Rand.t(), sample_defaults: keyword(), segments: %{required(reference()) => keyword()}, synth: atom() | String.t() | TuningFork.Voice.t(), synth_defaults: keyword(), transpose: integer() }
Functions
@spec add(t(), TuningFork.Voice.t() | [TuningFork.Voice.t()], reference(), keyword()) :: t()
Put a voice, or several, at the thread's time under one node reference.
Close the innermost effect.
Change an open effect's options for everything played after this moment.
Record a change to every note under ref, taking effect at the thread's time.
@spec draw(t(), (TuningFork.Rand.t() -> {value, TuningFork.Rand.t()})) :: {value, t()} when value: term()
Draw from the thread's generator with fun, keeping the generator that comes back.
A thread at time zero, seeded from seed. capture: true collects loops; ambient: true marks a thread nobody started a round or a buffer for.
Open an effect around what is played until close_fx/2.
@spec score(t(), :loop | :once) :: {:ok, TuningFork.Score.t()} | {:error, String.t()}
What the thread played, as a score.
As a :loop, the default, the score is as long as the thread slept, and
{:error, message} comes back when it never slept. Played :once, the score runs to the
end of the last note if that is later, and only a thread that played nothing is an error.
Seconds for beats at the thread's tempo.
Move the thread on by beats.