 ;; but in SC they are implemented using a simple integer referenced
 ;; array of float values.
 
+(derive ::audio-bus ::bus)
+(derive ::control-bus ::bus)
+
 (defn bus?
   [b]
   (and (associative? b)
-       (or (= :audio-bus (type b))
-           (= :control-bus (type b)))))
+       (or (isa? (type b) ::bus))))
 
 ; TODO: In order to allocate multi-channel busses we actually need to
 ; allocate multiple, adjacent busses, which the current bitset based

     (with-meta {:id id
                 :n-channels n-channels
                 :rate :control}
                {:type :control-bus}))))

(defn audio-bus
  "Allocate one ore more audio busses."

     (with-meta {:id id
                 :n-channels n-channels
                 :rate :audio}
                {:type ::audio-bus}))))

(defn free-bus
  [b]
  (case (type b)
    ::audio-bus   (free-id :audio-bus (:id b))
    ::control-bus (free-id :control-bus (:id b))))

; Reserve the first 11 busses for audio I/O and mixer, forever.
(dotimes [i 11]
