Live coding visuals Clojure and openFrameworks

Live coding visuals with Clojure and openFrameworks.
You can edit shader programs using Lisp and send them just in time to the Not Analog server.

For live editing Atom and its prot-REPL plugin is used.

Clojure transforms you code snippet to fragment shader programs and send them to an openFramework based visualization server.

(ns lv.demo)
(use 'lv.core)

(def decay (atom 1.0))
(reset! decay 1.0)
(uniform :u0 #(swap! decay (fn [v] (max (/ v 1.005) 0.01))))
(uniform :u0 #(swap! decay (fn [v] (min (* v 1.05)  1.0))))
(uniform :u0 #(+ 1))

(raster :r0
  (v 1)
  (dotimes [n (* u0 11)]
    (set dir (ifeven n 1 -1))
    (set speed (* dir (+ n 1) 0.011 f))
    (v (* v (distance  (* (vec2 x y) 2)
                       (vec2 (cos speed)
                             (sin speed)))))
  )
  (set edge 2.0)
  (set border 0.25)
  (v (smoothstep (- edge border) (+ edge border) (* v 5)))
)

(render)
(raster :r1 [r0]
  (rot (* f 0.05))
  (v (- 1 r0.v))
)

(raster :r2 [r0 r1]
  (kaleid (* 2 (sin01 (* 0.05 f))))
  (repeat-x 2) (repeat-y 2)
  (v (mod (+ r0.v r1.v) 1.0))
)

(render 3)
(raster :r3 [r0 r2 r3]
  (repeat-y -1.01)
  (repeat-x -1.01)
  (v (* 1.05 r0.v (mix r2.v r3.v 0.975)))
)

Software used