Dynamic Workflow (for LightTable)

David Schwartz edited this page Apr 15, 2015 · 4 revisions

Easy and powerful way to play and work with Quil is to use LightTable.

Start by creating a new project with leiningen using quil template. It will create clojure project containing simple sketch.

lein new quil quil-workflow

Then start the LightTable, go to

File → Open Folder → select quil-workflow

You can now view the project folder via the workspace navigator, opened by

View → Workspace

Open the core.clj file. Now press Ctrl+Shift+Enter (Command+Enter on OSX). LightTable will spawn a Clojure process, update the dependencies and connect to it. After a while you will see crazy circle spinning around the screen.

Let's add some color to the already running sketch by changing the first line of the draw function to

; (q/background 240)

Commenting out q/background will prevent screen from clearing on each frame. Now press Ctrl+Enter. This will cause LightTable to change the definition of the draw function, so you can see trail made by the circle as sketch is never cleared.

Nice part of this workflow is that you only need to reload the parts that have actually changed without restarting the whole sketch.