   (enqueue-param-changes pattern-key play-param-key true)
 
   ; Set start time in any PatternParam's
-  (swap! (get-pattern pattern-key) set-start-time time)
+  (swap! (get-pattern pattern-key) update :params init-pat-params time)
 
   (log/info "Starting pattern" pattern-key)
   (play-pattern time pattern-key))

  ; All pattern atoms are stored in a containing atom called "patterns " so that we can manage all the created patterns across threads.
  ; The new-params property of the pattern hash allows changing of the pattern as the pattern is being executed; when pattern changes
  ; need to occur, the changes are kept in new-params until it is safe to merge them during execution of the pattern.
  (let [merged-params (-> (merge dflt-pattern-params params)
                          (setup-params :pattern-key pattern-key))]
    (->> (atom {:name (name pattern-key) :synth synth :params merged-params :new-params {} :orig-synth synth :orig-params merged-params})
         (swap! patterns assoc pattern-key))
    (log/debug "Created pattern" pattern-key)
    true))

  [derefed-pattern]
  (log/debug "Resetting pattern" (:name derefed-pattern) "to original synth and params")
  (assoc derefed-pattern :synth (:orig-synth derefed-pattern) :params (:orig-params derefed-pattern) :reset-flag false))


;
