         (recur (assoc done group-rate ctl-proxy) (rest todo) (+ offset group-size))))))
 
 (defn- group-params
-  "Groups params by rate.  Groups a list of parameters into a
-   list of lists, one per rate."
+  "Groups params by rate.  Groups a list of parameters into a list of
+   lists, one per rate."
   [params]
   (let [by-rate (reduce (fn [mem param]
                           (let [rate (:rate param)

    (throw (IllegalArgumentException. (str "Your synth argument list is not a vector. Instead I found " (type l) ": " l)))))

(defn- mapify-params
  "Converts a list of param name val pairs to a param map. If the val
  of a param is a vector, it assumes it's a pair of [val rate] and
  sets the rate of the param accordingly. If the val is a plain
  number, it sets the rate to DEFAULT-RATE. All names are converted to
  strings"
  [params]
  (for [[p-name p-val] (partition 2 params)]
    (let [param-map

                      (:name ugen))))))
  (when-not (every? #(or (sc-ugen? %) (number? %) (string? %)) (:args ugen))
    (throw (IllegalArgumentException.
            (format "The %s ugen has an invalid argument: %s"
                    (:name ugen)
                    (first (filter
                            #(not (or (sc-ugen? %) (number? %)))
                            (:args ugen)))))))

  (let [inputs (flatten
                (map (fn [arg]
                       (cond
                                        ; constant
                         (number? arg)
                         {:src -1 :index (index-of constants (float arg))}

                                        ; control
                         (control-proxy? arg)
                         (param-input-spec grouped-params arg)

                                        ; output proxy
                         (output-proxy? arg)
                         (let [src (ugen-index ugens (:ugen arg))]
                           {:src src :index (:index arg)})

                                        ; child ugen
                         (sc-ugen? arg)
                         (let [src (ugen-index ugens arg)
                               updated-ugen (nth ugens src)]
                           (inputs-from-outputs src updated-ugen))))
                     (:args ugen)))
        ugen (assoc ugen :inputs inputs)]
    (when-not (every? (fn [{:keys [src index]}]
                        (and (not (nil? src))
                             (not (nil? index))))
                      (:inputs ugen))
      (throw (Exception.
              (format "Cannot connect ugen arguments for %s ugen with args: %s" (:name ugen) (str (seq (:args ugen)))))))

    ;;Add link back to MaxLocalBufs ugen (always at root of tree) if
    ;;ugen is a local-buf.
