   "Returns the set of control parameter name/default-value pairs for a synth
   definition."
   [sdef]
+  (ensure-synthdef! sdef)
   (let [names (map #(keyword (:name %1)) (:pnames sdef))
         vals (:params sdef)]
   (apply hash-map (interleave names vals))))


(defn synthdef? [obj] (= ::synthdef (type obj)))

(defn- supercollider-synthdef-path
  "Returns a constructed path to a named synthdef on the current platform"
  [synth-name]

  "Produces a serialized representation of the synth definition understood
  by SuperCollider, and returns it in a byte array."
  [sdef]
  (ensure-synthdef! sdef)
  (spec-write-bytes synthdef-file-spec
    (cond
      (synthdef? sdef) (synthdef-file sdef)
