This release coincides with the release of Alda 2.0.0. :tada:
alda-clj now requires Alda version 2.0.0 or greater.
The syntax for key-signature
and friends (key-sig
, key-sig!
,
key-signature!
) has changed slightly, corresponding to the same change in
Alda itself in Alda 2. See the Alda 2 migration guide
for more information about this change. To summarize:
;; Alda 1 and 2 (still works)
(key-sig "f+ c+ g+")
;; Alda 1 (no longer works in alda-clj)
(key-sig! [:a :major])
(key-sig! {:f [:sharp] :c [:sharp] :g [:sharp]})
;; Alda 2
(key-sig '(a major))
(key-sig '(f (sharp) c (sharp) g (sharp)))
Everything else about the syntax in Alda 2 and alda-clj remains the same.
Removed *alda-history*
and the clear-history
function, as they are no
longer relevant. See below about connecting to an Alda REPL server to preserve
context between evaluations.
alda
function (as well as the functions that depend on it, including
play!
) now prints stdout and stderr output from Alda as it is produced. The
stdout output is still returned at the end as a string.You can connect to an Alda REPL server (a new feature of Alda 2) via the new
connect!
function. There is also a disconnect!
if you want to undo that
and revert to the default, out-of-the box behavior, where alda play
is used
to evaluate and play scores in a separate context.
Connecting to an Alda REPL server is recommended, as it allows you to evaluate subsequent snippets of Alda code within the same context. This is great for interactive development and live coding. I've updated the Getting Started guide with more details about this new workflow, so check that out!
Added score-text
and new-score!
functions to display the current score
text and start a new score, respectively. These functions can only be used
when connected to an Alda REPL server.
Added a send-nrepl-message!
function that most of you won't ever need to
use, but if you ever do, it's there! send-nrepl-message!
is used internally
by functions like play!
when you're connected to an Alda REPL server.
Added a parse-events
function that takes any combination of strings of Alda
code and alda-clj event records, runs them through alda parse --output events
, and returns a sequence of alda-clj event records that results from
translating the JSON output.
Thanks, @wcerfgba, for the contribution!
No change; bumped version to publish improvements to the Getting Started docs.
midi-note
and ms
couldn't be used together, e.g.
(note (midi-note 60) (ms 2000))
.Added midi-note
function that can be used to specify the pitch of a note as
a MIDI note number, instead of pitch
which specifies pitch as a letter and
accidentals.
Implementation detail: added a LispForm protocol and ->lisp-form
wrapper
function. Objects that implement the LispForm protocol are representable in
alda-lisp, and ->lisp-form
returns the corresponding Lisp S-expression for
that object.
These S-expressions are rendered directly into Alda as opposed to having a
syntax representation like c+
. This allows us to make use of Alda features
that are implemented only in Lisp to avoid adding additional syntax to the
language.
Example: (->lisp-form (note (midi-note 42))) => (note (midi-note 42))
No change; bumped version to tweak the docs.
No change; bumped version to make more tweaks/fixes to the docs.
No change; bumped version to make some tweaks to documentation.
Bugfix: cram
duration can be nil
(i.e. the default duration) now.
Emitted Alda code formatting improvement: instrument calls now go on a new line.
Added a ton of docstrings! I'm not 100% sure the formatting is correct, so some parts might end up looking wonky. I don't really have a good way to test how the docs will look before I deploy them, and the docs are tied to releases, so I guess I'll just have to push additional releases if anything documentation-related needs fixing. ¯\_(ツ)_/¯
No change; bumped version to update documentation via cljdoc.
No change; bumped version while tinkering with cljdoc.
(octave :up)
generates >
, not (octave :up)
No change; I had to bump the version while tinkering with deployment setup.
Initial release. I think things are relatively stable, but report any issues you may run into!
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close