A Clojure library for live-coding music with Alda.
See History for a long-winded account of the path that led to alda-clj.
alda-clj is a Clojure DSL that is almost identical to the alda.lisp
DSL built
into the runtime of Alda 1.x. But instead of being part of the process that
generates and plays the Alda score, alda-clj generates a string of Alda code
and sends it to the alda
client.
The idea is simple: alda
is just a low-level tool for playing a score that's
already been written (or generated). When you want to go higher-level and create
scores programmatically, you can do so in an external process and pipe the
result to alda
. alda-clj is one way to do this.
alda-clj is intended to be used in at least two ways:
In an improv / live-coding setting, using a live Clojure REPL to generate and play music on the fly.
In a music composition setting, where the composition is a Clojure program / script that uses alda-clj to generate a score.
alda
is
available on your PATH
.alda-clj will shell out and use
alda
(wherever it's found on yourPATH
) to play your scores. If desired, you can specify an alternatealda
executable by bindingalda.core/*alda-executable*
to something else, e.g."/home/dave/Downloads/some-other-alda"
.
;; deps.edn
io.djy/alda-clj {:mvn/version "X.X.X"}
;; lein/boot
[io.djy/alda-clj "X.X.X"]
alda.core
and you're off to the races!(require '[alda.core :refer :all])
(play!
(part "piano")
(for [notes [[:c :e :g] [:c :f :a] [:c :e :g]]]
(apply chord (map #(note (pitch %)) notes))))
API documentation, a Getting Started guide and more are available at cljdoc.
There are also example scripts in this repo that will give you a sense of what you can do with alda-clj.
Ping @dave
on Slack if you have any questions or if
you just want to chat about alda-clj!
Copyright © 2018 Dave Yarwood
Distributed under the Eclipse Public License version 2.0.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close