by Ted Hayes
Ever wanted to write Processing sketches in Clojure? This is a quick-start project folder for the Clooj environment by Arthur Edelstein that contains a pre-built Quil library and requisite Processing libraries.
Note that as Quil is changed, the library (i.e. quil-1.0.0-SNAPSHOT.jar
) included here may not; I'm including it pre-built here for ease of use and setup. I will try to update it as necessary, though!
These instructions are also available here. Building Quil is as simple as doing lein jar
. (Yay Leiningen!)
- Clone or Download the Starter Project into a directory of your choice
- Download Clooj standalone and run it
- In Clooj, do Project > Open... and point at your new CloojProcessingProject folder
- Click on one of the example scripts in the src/ directory
- Hit Command-E to run it.
- Enjoy! Note that you don't have to close the applet window to change the code—try changing some code in the (draw) function and hit Command-Enter. Voila, the applet reflects your changes without restarting it! (This is buggy in OpenGL at the moment but works well for regular sketches.)
- For reference to the names of Processing functions in Quil, check out their API documentation.
- I made a startClooj.sh script that you need to run instead of just double-clicking on Clooj. Do
chmod +x startClooj.sh
(if necessary) and then./startClooj.sh
.- Why is this necessary? For whatever reason, to enable OpenGL support, java has to be started with the java.library.path set to the path of Processing's OGL dynamic libraries. These are different for different operating systems, so I'm not including all of them here. Hence, you'll need Processing installed.
- The script assumes that:
- You have Processing installed in /Applications. If you don't have Processing, download it and put it wherever, and change the startClooj script to point at it.
- Clooj is in /Applications and is named
clooj-0.2.8-standalone.jar
. If not, just change it in the script.
- If you've never used Clojure before, but are curious to get started, check out these online tutorials:
- Books & Wikibooks:
My understanding is that Processing's libraries (core.jar, gluegen-rt.jar, jogl.jar and opengl.jar) are licensed under the GNU Lesser General Public License, so I'm including them here for ease of use.