Liking cljdoc? Tell your friends :D

alda.lisp.events

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.
raw docstring

apply-global-attributesclj

(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.
sourceraw docstring

at-markerclj

(at-marker name)

Set the marker at which events will be added.

Set the marker at which events will be added.
sourceraw docstring

barlineclj

(barline)

Barlines, at least currently, do nothing when evaluated in alda.lisp.

Barlines, at least currently, do nothing when evaluated in alda.lisp.
sourceraw docstring

chordclj

(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.
sourceraw docstring

cramclj

(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.
sourceraw docstring

end-voicesclj

(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:'.
sourceraw docstring

get-variableclj

(get-variable var-name)

Returns any number of events previously defined as a variable.

Returns any number of events previously defined as a variable.
sourceraw docstring

global-attributeclj

(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)
sourceraw docstring

global-attributesclj

(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)
sourceraw docstring

markerclj

(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.
sourceraw docstring

noteclj

(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.
sourceraw docstring

partclj

(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''.
sourceraw docstring

pauseclj

(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.
sourceraw docstring

scheduleclj

(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.
sourceraw docstring

set-attributeclj

(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)
sourceraw docstring

set-attributesclj

(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)
sourceraw docstring

set-variableclj

(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.
sourceraw docstring

timesclj

(times n event)

Repeats an Alda event (or sequence of events) n times.

Repeats an Alda event (or sequence of events) `n` times.
sourceraw docstring

voiceclj

(voice voice-number & events)

One voice in a voice group.

One voice in a voice group.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close