// EventVoiceSynth.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT import LyrebirdSynth /// A fixed-pitch sine voice added by a `LyrebirdProcess` body in the events demo /// (`LYREBIRD_DEMO=events`). The process's own envelope gates it, so firing an /// event in the `LyrebirdEventListPerformanceView` starts an audible, visibly /// "running" process strip. final class EventVoiceSynth: SynthesizerBase { /// Output gain, kept low so several stacked voices don't clip. private let voiceGain: Double = 0.12 private let voiceFreq: Double /// - Parameter freq: Oscillator frequency in Hz. init(freq: Double) { self.voiceFreq = freq super.init() } override func build() { let osc: OscSin.Audio = OscSin.Audio(freq: voiceFreq) output(bus: 0, source: Pan2(input: osc * voiceGain)) } }