Automation
How to automate parameters and smooth ramps to create transitions
// 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.wav")
let source = FileRenderer(contentsOf: url)
// CConfigure real-time gain automation
source.$gain.linearRampValue(to: 0.1, at: 2)
source.$gain.setValue(to: 1.0, at: 3)
source.$gain.exponentialRampValue(to: 0.1, at: 5)
source.$gain.setValue(to: 1.0, at: 7)
// Configure node connections
try context.connect(source: source, to: context.destination)
source.play(after: 0)Last updated