Distortion
Saturation with bias and gain to model nonlinear transformations
// Configure the graph for rendering
let context = Assembler(rendering: .live).createAudioGraph()
// Configure an audio source (Renderer) from a local audio file
let url = URL(fileURLWithPath: "/path/to/audio.mp3")
let source = MediaRenderer(contentsOf: url)
// Configure the distortion effect with standard oversample
let destination = Distortion(oversample: .standard)
destination.bias = 0.01
destination.saturation = 0.5
destination.drive = 1.0
// Configure node connections
try context.connect(source: source, to: destination)
try context.connect(source: destination, to: context.destination)
source.play(after: 0)Last updated