Limiter (Instantaneous)

Control of short overshoots/peaks with parameter configuration

This example demonstrates how to restrict transient peaks in an audio signal using the PeakLimiter node. Unlike a traditional limiter, this processing operates with short attack and release times, controlling transients without altering the overall dynamics.

// 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/source.mp3")
let source = MediaRenderer(contentsOf: url)

// Configure a limiter and its dynamic parameters
let destination = PeakLimiter()
destination.ratio = 10.0
destination.threshold = -20.0
destination.attack = 0.01
destination.release = 0.05
destination.makeup = 0.0
destination.knee = 0.0

// Configure node connections
try context.connect(source: source, to: destination)
try context.connect(source: destination, to: context.destination)
source.play(after: 0)

The following video shows the sample code in action and its real-time processing.

circle-info

For a complete description of each class, method, and property referenced in this section, refer to the official API documentationarrow-up-right, where you will find detailed references, available components, parameters, and additional usage code examples.

Last updated