 
 (defonce ^{:dynamic true} *inactive-node-modification-error* :exception)
 
-(defn inactive-node-modification-error
+(defn- inactive-node-modification-error
   "The default error behaviour triggered when a user attempts to either
   control or kill an inactive node."
   [err-msg]

  "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)))

(defn node-map-n-controls*
  "Connect N controls of a node to a set of sequential control busses,
  starting at the given control name."
  [node start-control start-bus n]
  (ensure-connected!)
  (assert (bus? start-bus) "Invalid start-bus")
  (let [node-id (to-synth-id node)]
    (snd "/n_mapn" node-id (first (stringify [start-control])) (bus-id start-bus) n)))

(defn- group-post-tree*
  "Posts a representation of this group's node subtree, i.e. all the
  groups and synths contained within it, optionally including the
  current control values for synths."
  [id with-args?]
  (ensure-connected!)
  (snd "/g_dumpTree" id with-args?))

(defn- group-prepend-node*
  "Add a synth node to the end of a group list."
  [group node]
  (ensure-connected!)
  (let [group-id (to-synth-id group)
        node-id  (to-synth-id node)]
    (snd "/g_head" group-id node-id)))

(defn- group-append-node*
  "Add a synth node to the end of a group list."
  [group node]
  (ensure-connected!)
  (let [group-id (to-synth-id group)
        node-id  (to-synth-id node)]
    (snd "/g_tail" group-id node-id)))

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

(defn- group-deep-clear*
  "Free all child synth nodes in and below this group in other child
  groups."
  [group]
  (ensure-connected!)
  (snd "/g_deepFree" (to-synth-id group))
  :clear)

(extend java.lang.Long
  ISynthNode

  "Pause a running synth node."
  [node]
  (ensure-connected!)
  (ensure-node-active! node "Attempting to pause a node that has been destroyed.")
  (snd "/n_run" (to-synth-id node) 0)
  node)

(defn node-start*
  "Start a paused synth node."
  [node]
  (ensure-connected!)
  (ensure-node-active! node "Attempting to start a node that has been destroyed.")
  (snd "/n_run" (to-synth-id node) 1)
  node)

(defn node-place*
  "Place a node :before or :after another node."
  [node position target]
  (ensure-connected!)
  (ensure-node-active! node "Attempting to relocate a node that has been destroyed.")
  (let [node-id   (to-synth-id node)
        target-id (to-synth-id target)]
    (cond
      (= :before position) (snd "/n_before" node-id target-id)
      (= :after  position) (snd "/n_after" node-id target-id))
    node))

(defn node-control*
  "Set control values for a node."
  [node name-values]
  (ensure-connected!)
  (ensure-node-active! node "Attempting to control a node that has been destroyed.")
  (apply snd "/n_set" (to-synth-id node) (floatify (stringify (bus->id name-values))))
  node)

(defn node-get-control
  "Get one or more synth control values by name.  Returns a map of
