 (defn oscillator
   [type freq]
   (fn [context at duration]
-    (section
+    (generator
       (doto (.createOscillator context)
         (-> .-frequency .-value (set! 0))
         (-> .-frequency (plug freq context at duration))

          data (.getChannelData buffer 0)]
      (doseq [i (range sample-rate)]
        (aset data i (generate-bit!)))
      (section
        (doto (.createBufferSource context)
          (-> .-buffer (set! buffer))
          (.start at))))))

  (synth context at duration))

(defn destination [context at duration]
  (sink (.-destination context)))

(defn plug [param input context at duration]
  "Plug an input into an audio parameter, accepting both numbers and synths."
