Clojure in MaxMSP


One of the things moving up my to-do list is an environment for hosting the Clojure language inside MaxMSP. Clojure is hosted on the Java JVM, just like the languages for my other MaxMSP hosting projects, Python and Groovy, although the Clojure interpreter is rather an odd beast compared to the other two. Specifically, it’s not clear to me (yet) exactly what it means to build a Max patcher with several Clojure objects inside it, and one of the strengths of Clojure is its ability to deal cleanly with concurrency and interaction between decoupled computations, so there should only really be “one” Clojure environment which everything somehow shares and uses for communication.

That aside, Clojure is good at Java interoperability, and has a built-in compiler which generates real class files for synthesised Java classes matching interfaces or extending existing classes, so getting a Clojure program into MaxMSP is just a case of configuring this machinery. (The Leiningen build tool does most of the work.)

So, proof of concept: a simple stopwatch for MaxMSP in Clojure. It’s quite stateful, and doesn’t do much with data structures or higher-order functions, so it’s a feeble example of Clojure’s power and not a very convincing use case, but it gets the ball rolling.


2 Comments so far. Leave a comment below.
  1. Timothy Bone,

    Awesome dude. Looking forward to it Nick! (When it makes its way to github, I can try to help, 🙂

Add Your Comments

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <ol> <ul> <li> <strong>