Convenience functions for generating Alda events.
These functions comprise the event functions in the alda.lisp DSL.
Convenience functions for generating Alda events. These functions comprise the event functions in the alda.lisp DSL.
(apply-global-attributes)
For each instrument in :current-instruments, looks between the instrument's :last-offset and :current-offset and applies any attribute changes occurring within that window.
Both global and per-instrument attributes are applied; in the case that a per-instrument attribute is applied at the exact same time as a global attribute, the per-instrument attribute takes precedence for that instrument.
For each instrument in :current-instruments, looks between the instrument's :last-offset and :current-offset and applies any attribute changes occurring within that window. Both global and per-instrument attributes are applied; in the case that a per-instrument attribute is applied at the exact same time as a global attribute, the per-instrument attribute takes precedence for that instrument.
(at-marker name)
Set the marker at which events will be added.
Set the marker at which events will be added.
(barline)
Barlines, at least currently, do nothing when evaluated in alda.lisp.
Barlines, at least currently, do nothing when evaluated in alda.lisp.
(chord & events)
Causes every instrument in :current-instruments to play each note in the chord simultaneously at the instrument's :current-offset.
Causes every instrument in :current-instruments to play each note in the chord simultaneously at the instrument's :current-offset.
(cram & events)
A cram expression evaluates the events it contains, time-scaled based on the inner tally of beats in the events and the outer durations of each current instrument.
A cram expression evaluates the events it contains, time-scaled based on the inner tally of beats in the events and the outer durations of each current instrument.
(end-voices)
By default, the score remains in 'voice mode' until it reaches an end-voices event. This is so that if an instrument part ends with a voice group, the same voices can be appended later if the part is resumed, e.g. when building a score gradually in the Alda REPL or in a Clojure process.
The end-voices event is emitted by the parser when it parses 'V0:'.
By default, the score remains in 'voice mode' until it reaches an end-voices event. This is so that if an instrument part ends with a voice group, the same voices can be appended later if the part is resumed, e.g. when building a score gradually in the Alda REPL or in a Clojure process. The end-voices event is emitted by the parser when it parses 'V0:'.
(get-variable var-name)
Returns any number of events previously defined as a variable.
Returns any number of events previously defined as a variable.
(global-attribute attr val)
Public fn for setting global attributes in a score. e.g. (global-attribute :tempo 100)
Public fn for setting global attributes in a score. e.g. (global-attribute :tempo 100)
(global-attributes & attrs)
Convenience fn for setting multiple global attributes at once. e.g. (global-attributes :tempo 100 :volume 50)
Convenience fn for setting multiple global attributes at once. e.g. (global-attributes :tempo 100 :volume 50)
(marker name)
Places a marker at the current absolute offset. Throws an exception if there are multiple instruments active at different offsets.
Places a marker at the current absolute offset. Throws an exception if there are multiple instruments active at different offsets.
(note pitch)
(note pitch x)
(note {:keys [letter accidentals]} {:keys [beats ms slurred]} slur?)
Causes every instrument in :current-instruments to play a note at its :current-offset for the specified duration.
If no duration is specified, the note is played for the instrument's own internal duration, which will be the duration last specified on a note or rest in that instrument's part.
Causes every instrument in :current-instruments to play a note at its :current-offset for the specified duration. If no duration is specified, the note is played for the instrument's own internal duration, which will be the duration last specified on a note or rest in that instrument's part.
(part instrument-call & events)
Determines the current instrument instance(s) based on the instrument-call
and evaluates the events
within that context.
instrument-call
can either be a map containing :names and an optional
:nickname (e.g. {:names ['piano' 'trumpet'] :nickname ['trumpiano']}) or a
valid Alda instrument call string, e.g. 'piano/trumpet 'trumpiano''.
Determines the current instrument instance(s) based on the `instrument-call` and evaluates the `events` within that context. `instrument-call` can either be a map containing :names and an optional :nickname (e.g. {:names ['piano' 'trumpet'] :nickname ['trumpiano']}) or a valid Alda instrument call string, e.g. 'piano/trumpet 'trumpiano''.
(pause & [{:keys [beats ms] :as dur}])
Causes every instrument in :current-instruments to rest (not play) for the specified duration.
If no duration is specified, each instrument will rest for its own internal duration, which will be the duration last specified on a note or rest in that instrument's part.
Causes every instrument in :current-instruments to rest (not play) for the specified duration. If no duration is specified, each instrument will rest for its own internal duration, which will be the duration last specified on a note or rest in that instrument's part.
(schedule f)
Schedules an arbitrary function to be called at the current point in the score (determined by the current instrument's marker and offset).
If there are multiple current instruments, the function will be executed once for each instrument, at the marker + offset of that instrument.
Schedules an arbitrary function to be called at the current point in the score (determined by the current instrument's marker and offset). If there are multiple current instruments, the function will be executed once for each instrument, at the marker + offset of that instrument.
(set-attribute attr val)
Public fn for setting attributes in a score. e.g. (set-attribute :tempo 100)
Public fn for setting attributes in a score. e.g. (set-attribute :tempo 100)
(set-attributes & attrs)
Convenience fn for setting multiple attributes at once. e.g. (set-attributes :tempo 100 :volume 50)
Convenience fn for setting multiple attributes at once. e.g. (set-attributes :tempo 100 :volume 50)
(set-variable var-name & events)
Defines any number of events as a variable so that they can be referenced by name.
Defines any number of events as a variable so that they can be referenced by name.
(times n event)
Repeats an Alda event (or sequence of events) n
times.
Repeats an Alda event (or sequence of events) `n` times.
(voice voice-number & events)
One voice in a voice group.
One voice in a voice group.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close