(export! score output-filename)
Exports an Alda score to a MIDI file.
Exports an Alda score to a MIDI file.
(play! score & args)
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 result map containing the following values:
:score The full score being played.
:stop! A function that, when called mid-playback, will stop any further events from playing.
:wait A function that will sleep for the duration of the score. This is useful if you want to playback asynchronously, perform some actions, then wait until playback is complete before proceeding.
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 result map containing the following values: :score The full score being played. :stop! A function that, when called mid-playback, will stop any further events from playing. :wait A function that will sleep for the duration of the score. This is useful if you want to playback asynchronously, perform some actions, then wait until playback is complete before proceeding.
(set-up! score)
(set-up! {:keys [audio-context] :as score} audio-type)
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.
(stop-playback! {:keys [audio-context] :as score})
(stop-playback! {:keys [audio-context] :as score} audio-type)
Stop playback, but leave the score in a state where playback can be resumed.
Stop playback, but leave the score in a state where playback can be resumed.
(tear-down! {:keys [audio-context] :as score})
(tear-down! {:keys [audio-context] :as score} audio-type)
Completely clean up after a score.
Playback may not necessarily be resumed after doing this.
Completely clean up after a score. Playback may not necessarily be resumed after doing this.
(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