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


    public static let ComponentDescription = AudioComponentDescription(appleEffect: kAudioUnitSubType_Distortion)

    internal var internalEffect = AVAudioUnitEffect()
    internal var internalAU: AudioUnit? = nil

    fileprivate var lastKnownMix: Double = 1


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

