 (defn- group-clear*
   "Free all child synth nodes in a group."
   [group]
+  (ensure-connected!)
   (snd "/g_freeAll" (to-synth-id group))
   :clear)
 

  groups and synthesizer instances residing on the audio server."
  ([] (group-node-tree* 0))
  ([id & [ctls?]]
   (let [ctls? (if (or (= 1 ctls?) (= true ctls?)) 1 0)]
     (let [reply-p (recv "/g_queryTree.reply")
           _ (snd "/g_queryTree" id ctls?)
          tree (:args (deref! reply-p))]
       (with-meta (parse-node-tree tree)
         {:type ::node-tree})))))

(defprotocol ISynthGroup
  (group-prepend-node [group node])

(defn node-map-controls*
  "Connect a node's controls to a control bus."
  [node names-busses]
  (ensure-connected!)
  (let [node-id (to-synth-id node)
        names-busses (bussify (stringify names-busses))]
    (apply snd "/n_map" node-id names-busses)))
