 (derive ControlBus ::bus)
 
 (defn bus?
-
   "Returns true if the specified bus is a map representing a bus (either control
   or audio) "
   [bus]

;; but in SC they are implemented using a simple integer referenced
;; array of float values.

(defrecord AudioBus [id n-channels rate name]
  to-sc-id*
  (to-sc-id [this] (:id this)))

(defrecord ControlBus [id n-channels rate name]
  to-sc-id*
  (to-sc-id [this] (:id this)))

(defmethod print-method AudioBus [b w]
  (.write w (format "#<audio-bus: %s %s %d>"

     (let [id (alloc-id :audio-bus n-channels)]
       (AudioBus. id n-channels :audio name))))

; Reserve busses for overtone
(defonce ___reserve-overtone-busses____
  (dotimes [i AUDIO-BUS-RESERVE-COUNT]
