560724d116
- Fixed: SynthesizerBase subclasses' release/free now dispatch correctly (gated synths were hard-freed instead of released). - New: quickstart project template + LyrebirdQuickstartDemo. - Docs: every example typechecked or provably illustrative (426->542); ~20 wrong-API examples fixed; root docs brought under the compile guard. - Fixed: NRT/Score demo Package.swift build from terminal again. See RELEASES.md for details.
22 lines
705 B
Swift
22 lines
705 B
Swift
// SineTone.swift
|
|
// Lyrebird
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import LyrebirdSynth
|
|
|
|
// A Synthesizer is a graph built in `build()`. This one is a single sine
|
|
// oscillator, scaled down so it isn't harsh, centred to both speakers with
|
|
// Pan2 and written to output bus 0 (left) / bus 1 (right).
|
|
//
|
|
// This is the same synth the `quickstart` CLI template scaffolds:
|
|
// lyrebird new MyFirstSound --template quickstart
|
|
final class SineTone: SynthesizerBase {
|
|
override func build() {
|
|
let sin: OscSin.Audio = OscSin.Audio(freq: 440.0, mul: 0.2)
|
|
let pan: Pan2 = Pan2(input: sin, pan: 0)
|
|
output(bus: 0, source: pan)
|
|
}
|
|
}
|