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.
28 lines
767 B
Swift
28 lines
767 B
Swift
// main.swift
|
|
// Lyrebird
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import AppKit
|
|
import LyrebirdSynth
|
|
|
|
let engine = SynthesisEngine(
|
|
blockSize: 512,
|
|
sampleRate: 44100,
|
|
numOutputChannels: 2,
|
|
numInputChannels: 0,
|
|
driver: CoreAudioDriver()
|
|
)
|
|
|
|
// AppDelegate.init is @MainActor (it builds @MainActor SynthesizerBase synths
|
|
// and UI controllers). Program entry runs on the main thread, so assert main-
|
|
// actor isolation for the AppKit bootstrap rather than hopping asynchronously.
|
|
MainActor.assumeIsolated {
|
|
let delegate: AppDelegate = AppDelegate(engine: engine)
|
|
let app: NSApplication = NSApplication.shared
|
|
app.setActivationPolicy(.regular)
|
|
app.delegate = delegate
|
|
app.run()
|
|
}
|