             [leipzig.melody :as melody]
             [cljs-bach.synthesis :as synth]))
 
-(def debug false)
+(def ^:dynamic *debug* false)
 (defonce audio-context (synth/audio-context))
 (def default-delay-secs 0.05)
 

  ([notes]
   (play! notes (+ default-delay-secs (now))))
  ([notes at]
   (when debug
     (do
       (js/console.log "--- play! ---")
       (js/console.log "Now: " (now))

         (dissoc :time)
         instrument
         (play! duration (+ time at))))
   (when *debug*
     (js/console.log "Scheduling finished: " (now)))))

(defn loop!
