(play! score & [event-set])
Plays an Alda score, optionally from given start/end marks determined by play-opts.
Optionally takes as a second argument a set of events to play (which could be pre-filtered, e.g. for playing only a portion of the score).
In either case, the offsets of the events to be played are shifted back such that the earliest event's offset is 0 -- this is so that playback will start immediately.
Returns a function that, when called mid-playback, will stop any further events from playing.
Plays an Alda score, optionally from given start/end marks determined by *play-opts*. Optionally takes as a second argument a set of events to play (which could be pre-filtered, e.g. for playing only a portion of the score). In either case, the offsets of the events to be played are shifted back such that the earliest event's offset is 0 -- this is so that playback will start immediately. Returns a function that, when called mid-playback, will stop any further events from playing.
(refresh! audio-ctx audio-type & [score])
Performs any actions that may be needed each time the play!
function is
called. e.g. for MIDI, load instruments into channels (this needs to be
done every time play!
is called because new instruments may have been
added to the score between calls to play!
, when using Alda live.)
Performs any actions that may be needed each time the `play!` function is called. e.g. for MIDI, load instruments into channels (this needs to be done every time `play!` is called because new instruments may have been added to the score between calls to `play!`, when using Alda live.)
(set-up! {:keys [audio-context] :as score})
(set-up! audio-ctx audio-type & [score])
Does any necessary setup for one or more audio types. e.g. for MIDI, create and open a MIDI synth.
Does any necessary setup for one or more audio types. e.g. for MIDI, create and open a MIDI synth.
Kicks off a note/event, using the appropriate method based on the type of the instrument.
Kicks off a note/event, using the appropriate method based on the type of the instrument.
Ends a note/event, using the appropriate method based on the type of the instrument.
Ends a note/event, using the appropriate method based on the type of the instrument.
(tear-down! {:keys [audio-context] :as score})
(tear-down! audio-ctx audio-type & [score])
Does any necessary clean-up at the end. e.g. for MIDI, close the MIDI synth.
Does any necessary clean-up at the end. e.g. for MIDI, close the MIDI synth.
(with-play-opts opts & body)
Apply opts
as overrides to play-opts when executing body
Apply `opts` as overrides to *play-opts* when executing `body`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close