22 lines
748 B
Swift
22 lines
748 B
Swift
// main.swift
|
|
// MainActorConsumer (Phase 201 regression fixture)
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import LyrebirdSynth
|
|
|
|
// PHASE 201 GUARANTEE: a consumer under the MainActor-default build mode subclasses
|
|
// `SynthesizerBase` and overrides `build()` with NO `nonisolated`, NO `@preconcurrency`,
|
|
// NO `@MainActor`, NO `nonisolated override init`. If this stops compiling, the
|
|
// language-side actor-isolation guarantee has regressed.
|
|
final class ToneSynth: SynthesizerBase {
|
|
@LiveParam var freq: Double = 440
|
|
override func build() {
|
|
output(bus: 0, source: OscSin.Audio(freq: $freq) * 0.2)
|
|
}
|
|
}
|
|
|
|
let synth = ToneSynth()
|
|
print("Phase 201 regression fixture OK: \(synth)")
|