                                       (get arg :mode :standard)))]
                   (assoc arg :expands? expands?)))
               (:args spec))))
+
+(defn- nil-arg-checker
+  [ugen]
+  (let [args (:args ugen)]
+    (when (some nil? args)
+      (throw (IllegalArgumentException. (str "Error - attempted to call the " (:name ugen) " ugen with one or more nil arguments. This usually happens when the ugen contains arguments without defaults which haven't been explicitly called. Got " (vec args))))))
+  ugen)
 
 (defn- with-init-fn
   "Creates the final argument initialization function which is applied to

      (assoc ugen :n-outputs (count (flatten [(first n-outs-arg)])))
      ugen)))

(defn- map-ugen-args
  "Perform argument mappings for ugen args that take a keyword but need to be
  looked up in a map supplied in the spec. (e.g. envelope actions)"

                 bus->id
                 appender
                 auto-rater
                 nil-arg-checker
                 rate-checker
                 bespoke-checker)))))

