 ;; stick an Out ugen on synths that don't explicitly use one.
 (intern-ugens (create-ns 'overtone.ugens))
 
-(defn refer-ugens 
+(defn refer-ugens
   "This is how you (use 'overtone.ugens)."
   []
   (let [local-map (ns-map *ns*)
         ugen-map (ns-map 'overtone.ugens)
-        collisions (intersection (set (keys local-map)) 
+        collisions (intersection (set (keys local-map))
                                  (set (keys ugen-map)))]
     (doseq [v collisions]
       (ns-unmap *ns* v))

  [spec]
  (assoc spec :categories (get UGEN-CATEGORY-MAP (:name spec) [])))

(defn- with-expands 
  "Sets the :expands? attribute for ugen-spec arguments, which will inform the
  automatic channel expansion system when to expand argument."
  [spec]
  (assoc spec :args 
         (map (fn [arg] 
                (assoc arg :expands? 
                       (get UGEN-SPEC-EXPANSION-MODES (get arg :mode :standard))))
              (:args spec))))

(defn- with-fn-names
  "Generates all the function names for this ugen and adds a :fn-names map 
  that maps function names to rates, representing the output rate.

  All available rates get an explicit function name of the form <fn-name>:<rate>


; TODO: Refactor these init functions so everything just takes a ugen and a spec
   ; and outputs an updated ugen...  Should have done it like this initially...
(defn- with-init-fn
  "Creates the final argument initialization function which is applied to arguments
  at runtime to do things like re-ordering and automatic filling in of arguments.
  Typically appending input arrays as the last argument and filling in the number of
  in or out channels for those ugens that need it.

  If an init function is already present it will get called after doing the mapping and
  mode transformations."
  [spec]
  (let [map-fn (partial map-ugen-args spec)
        append-fn (partial append-seq-args spec)
