   (every? ar? (take n inputs)))
 
 (defcheck after-n-inputs-rest-ar [n]
-  (str "all but the first " n " inputs must be audio rate")
+  (str "All but the first " n " inputs must be audio rate")
   (every? ar? (drop n inputs)))
 
 (defcheck all-but-first-input-ar []

          (when-not ~expr ~message))))))

(defcheck same-rate-as-first-input []
  (str (name-of (first inputs)) "must be same rate as called ugen, i.e. " rate)
  (= (rate-of (first inputs)) rate))

(defcheck first-input-ar []
  (str "The first input must be audio rate. Got " (:rate-name (first inputs)))

  ^{:doc "UGen argument validation functions."
     :author "Jeff Rose & Christophe McKeon"}
  overtone.sc.machinery.ugen.check
  (:use [overtone.sc.machinery.ugen defaults]
        [overtone.util.lib :only [overtone-ugen-name]]))

(defn rate-name= [obj rate]
  (= (:rate-name obj) rate))

(defn rate= [ug rate-int]
  (= (:rate ug) rate-int))

(defn name-of [obj]
  (overtone-ugen-name (:name obj)))

(defn name-of? [obj name]
  (= (name-of obj) name))

(defn ar? [obj] (= (:rate-name obj) :ar))
(defn kr? [obj] (= (:rate-name obj) :kr))
(defn ir? [obj] (= (:rate-name obj) :ir))
(defn dr? [obj] (= (:rate-name obj) :dr))

(defmacro defcheck [name params default-message expr]
  (let [message (gensym "message")
