   (reduce (fn [timeout {:keys [pitch duration volume] :as note-model}]
             (when pitch
               (c/set-timeout! clock #(play-fn osc-model note-model) timeout))
-            (+ timeout (or duration 0)))
+            (let [duration-ms (parse-duration (or duration 0))] 
+              (+ timeout duration-ms)))
           0
           notes))
 


    (when duration
      (let [duration-ms (parse-duration duration)]
        (c/set-timeout! clock #(stop-osc osc-impl) duration)))))

(defn play-note 
  "Uses a one-off oscillator to play a note.


(defn- gain-ramp [gain-node level]
  (let [time (.-currentTime (.-context gain-node))]
    (.exponentialRampToValueAtTime (.-gain gain-node) level (+ time 0.1))))

(defn- silence [gain-node]
  (gain gain-node 0))

(defn- silence-ramp [gain-node]
  (gain-ramp gain-node 0.0001))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

