// KnobDemoSynth.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT import LyrebirdSynth /// A minimal sine-tone synthesizer whose frequency and amplitude are `@UIParam` /// slots, so the Linux GTK4 knobs bind to the same RT-safe parameter model the /// macOS SwiftUI controls use. Turning a knob updates the atomic the render /// thread reads at the next block — audible immediately when a live ALSA device /// is present. final class KnobDemoSynth: SynthesizerBase { @UIParam var frequency: Double = 220.0 @UIParam var amplitude: Double = 0.2 override func build() { let osc: OscSin.Audio = OscSin.Audio(freq: $frequency) output(bus: 0, source: Pan2(input: osc * $amplitude)) } }