   (:require [tweegeemee.core :as tgm]))
 
 ;; working towards http://zine.electricobjects.com/artist-program
+;;
 ;; Still Images
 ;;
 ;; 1080px x 1920 pixels

       )
      )
     )
   {:filename "art/fn1/a%04d.png"
    :width    (* (/ 1080 10) 3)
    :height   (* (/ 1920 10) 3)
    })

  ;; ======================================================================
  ;; fun noise fn2 -- 30s/frame. [ ] Go with 1000 frames over night
  (render-animation
   [i 1000]
    (scale-for-vert-hd

;; have unsightly gaps.

;; some snippets based on mikea's code.  modified from telegenic so I
;; could use ffmpeg.  also modified to allow for parallel runs on different
;; systems
(defmacro render-animation
  "Macro to render a sequence of frames, looping with a symbolic frame counter.
   Example: (render-animation [i 10] (offset [(* i 10) 0.0 0.0] (vnoise)))"
  ([[key frame-end] src options]
   `(render-animation [~key 0 ~frame-end 1] ~src))
  ([[key frame-start frame-end] src options]
   `(render-animation [~key ~frame-start ~frame-end 1] ~src))
  ([[key frame-start frame-end frame-step] src options]
    (when-not (symbol? key) (error "render-animation needs a symbol binding for the frame number"))
    `(let [opts#  (mapcat identity options#)]
       (doseq [~key (range ~frame-start ~frame-end ~frame-step)] ;; loop over all frames, lazily. don't hold memory
         (let [im# (apply image ~src opts#)  ;; create the frame
               fn# (format (:filename options#) ~key)]
           (apply show im# opts#)            ;; show the latest frame
           (ImageIO/write im# "png" (File. fn#))))))) ;; write the frame

