         guard let inputNode = input else {
             return
         }
-
+        input?.connect(to: inputMixer)
         var inputsConnectionPoints = inputNode.connectionPoints
-        inputsConnectionPoints.append(AVAudioConnectionPoint(node: environmentNode,
-                                                             bus: environmentNode.numberOfInputs))
+        inputsConnectionPoints.append(AVAudioConnectionPoint(node: inputMixer.avAudioNode,
+                                                             bus: inputMixer.nextInput.bus))
 
         let format = AVAudioFormat(standardFormatWithSampleRate: AKSettings.sampleRate, channels: 1)
 
         AudioKit.engine.connect(inputNode.avAudioNode, to: inputsConnectionPoints, fromBus: 0, format: format)
     }
-
+    public var inputNode: AVAudioNode {
+        return inputMixer.avAudioNode
+    }
+    open override func detach() {
+        AudioKit.detach(nodes: [environmentNode, inputMixer.avAudioNode])
+    }
 }

        }
    }

    /// Initialize the panner node
    ///
    /// - Parameters:

//

/// 3-D Spatialization of the input
open class AK3DPanner: AKNode, AKInput {
    fileprivate let environmentNode = AVAudioEnvironmentNode()

    /// Position of sound source along x-axis
