     open var mix: Double = 1 {
         didSet {
             mix = (0...1).clamp(mix)
-            AudioUnitSetParameter(
-                internalAU!,
-                kDistortionParam_FinalMix,
-                kAudioUnitScope_Global, 0,
-                Float(mix) * 100.0, 0)
+            au[kDistortionParam_FinalMix] = mix * 100
         }
     }
 

            self.mix = mix

            internalEffect = AVAudioUnitEffect(audioComponentDescription: _Self.ComponentDescription)
            super.init()

            avAudioNode = internalEffect
            AudioKit.engine.attach(self.avAudioNode)
            input.addConnectionPoint(self)
            internalAU = internalEffect.audioUnit

            // Since this is the Decimator, mix it to 100% and use the final mix as the mix parameter
            AudioUnitSetParameter(internalAU!, kDistortionParam_DecimationMix, kAudioUnitScope_Global, 0, 100, 0)

            AudioUnitSetParameter(internalAU!, kDistortionParam_Decimation, kAudioUnitScope_Global, 0, Float(decimation) * 100.0, 0)
            AudioUnitSetParameter(internalAU!, kDistortionParam_Rounding, kAudioUnitScope_Global, 0, Float(rounding) * 100.0, 0)
            AudioUnitSetParameter(internalAU!, kDistortionParam_FinalMix, kAudioUnitScope_Global, 0, Float(mix) * 100.0, 0)
            //turn off the other distortion effects
            AudioUnitSetParameter(internalAU!, kDistortionParam_PolynomialMix, kAudioUnitScope_Global, 0, 0, 0)
            AudioUnitSetParameter(internalAU!, kDistortionParam_RingModMix, kAudioUnitScope_Global, 0, 0, 0)
            AudioUnitSetParameter(internalAU!, kDistortionParam_DelayMix, kAudioUnitScope_Global, 0, 0, 0)
    }

    // MARK: - Control

    open var rounding: Double = 0 {
        didSet {
            rounding = (0...1).clamp(rounding)
            au[kDistortionParam_Rounding] = rounding * 100
        }
    }

