-*- mode: org; mode: visual-line; -*-
This is a starter project for Cycling ‘74’s RNBO for Max using ClojureScript and Figwheel Main instead of raw Javascript. We’ve rewritten the boilerplate JS, replaced async with Clojure channels, and so on.
The Figwheel project is in net.cassiel.max-rnbo
. In that directory, use Leiningen and lein fig:build
to launch a development environment and browser page - or, use your favourite editor with Clojure support.
Max RNBO export: target resources/public/export
. The boilerplate code in rnbo_device.cljs
fetches from here.
We are making extensive use of Clojure’s core.async in place of callbacks; this also deals with JS promises.
We are loading demo audio buffers via the property device.dataBufferDescriptions
: this gives us files or URLs as appropriate, or an entry with no file or URL for something like a groove~
object with no associated buffer in the RNBO patcher. We could also make use of the dependencies.json
file to tell us about files and URLs (it has no entries unless one of those exists), but since we can only access audio files if they have been copied across into the exports, in which case we know the paths, this doesn’t get us any further information.
We assume a JSON endpoint which will map these “empty” buffer instances to URLs for fetching files. At some stage we want these buffers to be truly dynamic, so that we can replace the audio while the patcher is running.