(check-for-failure x)
Determines whether its input is an Instaparse failure, throwing an exception if it is. If it isn't, passes it through so we can continue parsing.
Determines whether its input is an Instaparse failure, throwing an exception if it is. If it isn't, passes it through so we can continue parsing.
(parse-header mode cache header)
Parses the (optional) string of non-instrument-specific events that may occur at the beginning of an Alda score (e.g. setting variables, global attributes, inline Clojure code).
Parses the (optional) string of non-instrument-specific events that may occur at the beginning of an Alda score (e.g. setting variables, global attributes, inline Clojure code).
(parse-input alda-code & [mode])
Parses a string of Alda code.
If mode
is:
:lisp -- the output is Clojure code using the alda.lisp DSL (default) :map -- the output is the map of score data that would result from evaluating the code :events -- the output is a vector of events, which, when supplied as the arguments to alda.lisp/score, will result in the aforementioned map of score data
Parses a string of Alda code. If `mode` is: :lisp -- the output is Clojure code using the alda.lisp DSL (default) :map -- the output is the map of score data that would result from evaluating the code :events -- the output is a vector of events, which, when supplied as the arguments to alda.lisp/score, will result in the aforementioned map of score data
(parse-part mode cache part)
Parses the events of a single call to an instrument part.
Parses the events of a single call to an instrument part.
(remove-comments [input cache])
Strips comments from a string of Alda code.
We have to also parse Clojure expressions at this stage in order to avoid ambiguity between Alda comments and portions of Clojure expressions. But we don't want to have to parse the Clojure expressions again later, so we cache them and return them along with the code.
Strips comments from a string of Alda code. We have to also parse Clojure expressions at this stage in order to avoid ambiguity between Alda comments and portions of Clojure expressions. But we don't want to have to parse the Clojure expressions again later, so we cache them and return them along with the code.
(separate-parts [input cache])
Separates out instrument parts (including subsequent calls to existing parts).
Separates out instrument parts (including subsequent calls to existing parts).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close