            right. The output of Balance2 remains a stereo signal." }
 
 
-    {:name "Rotate2",
-     :args [{:name "x",
-             :doc "input signal"}
-
-            {:name "y",
-             :doc "input signal"}
-
-            {:name "pos",
-             :default 0.0,
-             :doc "angle to rotate around the circle from -1 to +1. -1
+   {:name "Rotate2",
+    :args [{:name "x",
+            :doc "input signal"}
+
+           {:name "y",
+            :doc "input signal"}
+
+           {:name "pos",
+            :default 0.0,
+            :doc "angle to rotate around the circle from -1 to +1. -1
                    is 180 degrees, -0.5 is left, 0 is forward, +0.5 is
                    right, +1 is behind." }]
-     :num-outs 2
-     :check [(nth-input-stream? 0)
-             (nth-input-stream? 1)]
-     :doc "Rotate2 can be used for rotating an ambisonic B-format sound
+    :num-outs 2
+    :check [(nth-input-stream? 0)
+            (nth-input-stream? 1)]
+    :doc "Rotate2 can be used for rotating an ambisonic B-format sound
            field around an axis.
 
            Rotate2 does an equal power rotation so it also works well on

;; }

(def specs
  (map
   #(assoc % :check (when-ar (first-input-ar)))
   [

    {:name "Pan2"
     :args [{:name "in"
             :doc "input signal"}

            {:name "pos"
             :default 0.0
             :doc "pan position, -1 is left, +1 is right"}

            {:name "level"
             :default 1.0
             :doc "a control rate level input"}]

     :num-outs 2
     :check (nth-input-stream? 0)
     :doc "Two channel (stereo) equal power panner."}


    {:name "LinPan2"
     :extends "Pan2"
     :doc "Two channel (stereo) linear panner. This one sounds more like
           the Rhodes tremolo than Pan2." }


    {:name "Pan4",
     :args [{:name "in",
             :doc "input signal"}

            {:name "xpos",
             :default 0.0,
             :doc "x pan position from -1 to +1 (left to right)"}

            {:name "ypos",
             :default 0.0,
             :doc "y pan position from -1 to +1 (back to front)"}

            {:name "level",
             :default 1.0,
             :doc "a control rate level input."}]

     :num-outs 4
     :check (nth-input-stream? 0)
     :doc "Four channel equal power panner. Outputs are in order
           LeftFront, RightFront, LeftBack, RightBack." }


    {:name "Balance2",
     :args [{:name "left",
             :doc "channel 1 of input stereo signal"}

            {:name "right",
             :doc "channel 2 of input stereo signal"}

            {:name "pos",
             :default 0.0,
             :doc "pan position, -1 is left, +1 is right"}

            {:name "level",
             :default 1.0,
             :doc "a control rate level input."}]

     :num-outs 2
     :doc "Equal power panning balances two channels; by panning, you
           are favouring one or other channel in the mix, and the other
           loses power. The middle pan position (pos=0.0) corresponds to
           the original stereo mix; full left (pos of -1) is essentially

           rotation around a circle." }


   {:name "PanB",
    :args [{:name "in",
            :doc "input signal"}

           {:name "azimuth",
            :default 0.0,
            :doc "in radians, -pi to +pi"}

           {:name "elevation",
            :default 0.0,
            :doc "in radians, -0.5pi to +0.5pi"}

           {:name "gain",
            :default 1.0,
            :doc "a control rate level input"}]

    :num-outs 4
    :check (nth-input-stream? 0)
    :doc "Ambisonic B format panner. Output channels are in order
           W,X,Y,Z." }


   {:name "PanB2",
    :args [{:name "in",
            :doc "input signal"}

           {:name "azimuth",
            :default 0.0,
            :doc "position around the circle from -1 to +1. -1 is
                   behind, -0.5 is left, 0 is forward, +0.5 is right, +1
                   is behind." }

           {:name "gain",
            :default 1.0,
            :doc "amplitude control"}]

    :num-outs 3
    :check (nth-input-stream? 0)
    :doc "Encode a mono signal to two dimensional ambisonic B-format."}


   {:name "BiPanB2",
    :args [{:name "in-a",
            :doc "input signal A"}

           {:name "in-b",
            :doc "input signal B"}

           {:name "azimuth",
            :doc "position around the circle from -1 to +1. -1 is
                   behind, -0.5 is left, 0 is forward, +0.5 is right, +1
                   is behind." }

           {:name "gain",
            :default 1.0,
            :doc "amplitude control"}]

    :num-outs 3
    :check [(when-ar (first-n-inputs-ar 2))
            (nth-input-stream? 0)
            (nth-input-stream? 1)]
    :doc "Encode a two channel signal to two dimensional ambisonic
           B-format.  This puts two channels at opposite poles of a 2D
           ambisonic field.  This is one way to map a stereo sound onto
           a soundfield.  It is equivalent to:
