// SineToneUI.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT import LyrebirdSynth /// A stereo sine tone whose frequency, amplitude, and pan are live-controllable /// from the UI. The `@UIParam` slots are the same model both the SwiftUI (macOS) /// and SwiftOpenUI (Linux) controls bind to — one synthesizer, two front ends. public final class SineToneUI: SynthesizerBase { /// Frequency in Hz. Slider range: 440–880 Hz. @UIParam public var frequency: Double = 440.0 /// Output amplitude (linear gain). Knob range: 0–1. @UIParam public var amplitude: Double = 0.25 /// Stereo pan position. Knob range: -1 (hard left) … 0 (center) … +1 (hard right). @UIParam public var pan: Double = 0.0 public override init() { super.init() } public override func build() { let osc: OscSin.Audio = OscSin.Audio(freq: $frequency) output(bus: 0, source: Pan2(input: osc * $amplitude, pan: $pan)) } }