Plays a TuningFork.Score out over OSC, in time.
{:ok, client} = TuningFork.Osc.Client.start_link(port: 57_120)
{:ok, playing} = TuningFork.Osc.Out.play(client, score)
Summary
Functions
Returns a specification to start this module under a supervisor.
The messages score becomes, as {seconds, address, args}, without sending them.
Play score through client, sending one message per note when its moment arrives.
Stop, sending the :hush address first.
Types
@type t() :: pid()
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec messages(TuningFork.Score.t(), keyword()) :: [{float(), String.t(), [term()]}]
The messages score becomes, as {seconds, address, args}, without sending them.
Takes play/3's :address and :shape options.
iex> score = TuningFork.Score.new(bpm: 120, beats: 4)
iex> TuningFork.Osc.Out.messages(score)
[]
@spec play(TuningFork.Osc.Client.t(), TuningFork.Score.t(), keyword()) :: {:ok, t()} | {:error, term()}
Play score through client, sending one message per note when its moment arrives.
The player stops when the calling process exits.
Options
:address— what to send each note to, default"/play":shape— a function from aTuningFork.Voiceand its length in seconds to the argument list. Default is[freq, gain, seconds, pan], all floats:loop— start again on reaching the end, default false:hush— an address to send on stopping, default"/hush".nilsends nothing
@spec stop(t()) :: :ok
Stop, sending the :hush address first.