bugfixes, better MusicXML support and 1.1.0

This commit is contained in:
2026-06-10 08:41:07 -07:00
parent 6d3a0930a1
commit f59fd3b55a
228 changed files with 32271 additions and 2586 deletions
@@ -9,9 +9,10 @@
/* Begin PBXBuildFile section */
C8D0000000000000000000C /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D00000000000000000007 /* main.swift */; };
C8D0000000000000000000D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D00000000000000000008 /* AppDelegate.swift */; };
C8D0000000000000000000F /* LyrebirdUI in Frameworks */ = {isa = PBXBuildFile; productRef = C8D0000000000000000001D /* LyrebirdUI */; };
C8D00000000000000000021 /* LyrebirdLiveCompile in Frameworks */ = {isa = PBXBuildFile; productRef = C8D0000000000000000001F /* LyrebirdLiveCompile */; };
C8D00000000000000000022 /* LyrebirdLiveCompileUI in Frameworks */ = {isa = PBXBuildFile; productRef = C8D00000000000000000020 /* LyrebirdLiveCompileUI */; };
C8D0000000000000000000F /* LyrebirdDynamic in Frameworks */ = {isa = PBXBuildFile; productRef = C8D0000000000000000001D /* LyrebirdDynamic */; };
C8D00000000000000000022 /* LyrebirdLiveCompileUIDynamic in Frameworks */ = {isa = PBXBuildFile; productRef = C8D00000000000000000020 /* LyrebirdLiveCompileUIDynamic */; };
C8D00000000000000000036 /* LyrebirdDynamic in Embed Frameworks */ = {isa = PBXBuildFile; productRef = C8D0000000000000000001D /* LyrebirdDynamic */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
C8D00000000000000000034 /* LyrebirdLiveCompileUIDynamic in Embed Frameworks */ = {isa = PBXBuildFile; productRef = C8D00000000000000000020 /* LyrebirdLiveCompileUIDynamic */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -27,14 +28,28 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C8D0000000000000000000F /* LyrebirdUI in Frameworks */,
C8D00000000000000000021 /* LyrebirdLiveCompile in Frameworks */,
C8D00000000000000000022 /* LyrebirdLiveCompileUI in Frameworks */,
C8D0000000000000000000F /* LyrebirdDynamic in Frameworks */,
C8D00000000000000000022 /* LyrebirdLiveCompileUIDynamic in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXCopyFilesBuildPhase section */
C8D00000000000000000035 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
C8D00000000000000000036 /* LyrebirdDynamic in Embed Frameworks */,
C8D00000000000000000034 /* LyrebirdLiveCompileUIDynamic in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXGroup section */
C8D00000000000000000002 = {
isa = PBXGroup;
@@ -73,6 +88,7 @@
C8D00000000000000000011 /* Sources */,
C8D00000000000000000012 /* Frameworks */,
C8D00000000000000000013 /* Resources */,
C8D00000000000000000035 /* Embed Frameworks */,
);
buildRules = (
);
@@ -80,9 +96,8 @@
);
name = LyrebirdScratchDemo;
packageProductDependencies = (
C8D0000000000000000001D /* LyrebirdUI */,
C8D0000000000000000001F /* LyrebirdLiveCompile */,
C8D00000000000000000020 /* LyrebirdLiveCompileUI */,
C8D0000000000000000001D /* LyrebirdDynamic */,
C8D00000000000000000020 /* LyrebirdLiveCompileUIDynamic */,
);
productName = LyrebirdScratchDemo;
productReference = C8D00000000000000000004 /* LyrebirdScratchDemo.app */;
@@ -248,6 +263,10 @@
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
// Xcode 26 explicit-module-build regression: SPM dynamic-library
// framework binaries (LyrebirdDynamic / LyrebirdLiveCompileUIDynamic)
// are not emitted under the integrated driver. Classic driver fixes it.
SWIFT_USE_INTEGRATED_DRIVER = NO;
};
name = Debug;
};
@@ -303,6 +322,8 @@
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
// Xcode 26 explicit-module-build regression — see Debug config.
SWIFT_USE_INTEGRATED_DRIVER = NO;
};
name = Release;
};
@@ -341,20 +362,15 @@
/* End XCLocalSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
C8D0000000000000000001D /* LyrebirdUI */ = {
C8D0000000000000000001D /* LyrebirdDynamic */ = {
isa = XCSwiftPackageProductDependency;
package = C8D0000000000000000001B /* XCLocalSwiftPackageReference "../.." */;
productName = LyrebirdUI;
productName = LyrebirdDynamic;
};
C8D0000000000000000001F /* LyrebirdLiveCompile */ = {
C8D00000000000000000020 /* LyrebirdLiveCompileUIDynamic */ = {
isa = XCSwiftPackageProductDependency;
package = C8D0000000000000000001E /* XCLocalSwiftPackageReference "../../LiveCompile" */;
productName = LyrebirdLiveCompile;
};
C8D00000000000000000020 /* LyrebirdLiveCompileUI */ = {
isa = XCSwiftPackageProductDependency;
package = C8D0000000000000000001E /* XCLocalSwiftPackageReference "../../LiveCompile" */;
productName = LyrebirdLiveCompileUI;
productName = LyrebirdLiveCompileUIDynamic;
};
/* End XCSwiftPackageProductDependency section */
};
@@ -0,0 +1,24 @@
{
"originHash" : "52fa7c84ca46dcb1ce0f4374a4fb0a5d2c97be57f306d91b8e9efb54af7c3c9e",
"pins" : [
{
"identity" : "linenoise-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/andybest/linenoise-swift",
"state" : {
"revision" : "afc897c02b030af7333105c4fedcd843a8339238",
"version" : "0.0.3"
}
},
{
"identity" : "nimble",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Quick/Nimble.git",
"state" : {
"revision" : "e9d769113660769a4d9dd3afb855562c0b7ae7b0",
"version" : "7.3.4"
}
}
],
"version" : 3
}
@@ -7,18 +7,28 @@
import AppKit
import SwiftUI
import LyrebirdSynth
import LyrebirdUI
import LyrebirdLiveCompile
// LyrebirdLiveCompile (LiveSession, …) is re-exported by LyrebirdLiveCompileUI.
import LyrebirdLiveCompileUI
// This demo deliberately does NOT link `LyrebirdUI`. The live-compile stack
// (`LyrebirdLiveCompileUIDynamic`) dynamic-links the single shared
// `LyrebirdDynamic.framework` copy of `LyrebirdSynth`; linking the static
// `LyrebirdUI` product would static-fold a SECOND copy of every `LyrebirdSynth`
// ObjC class into the app binary (intra-package `LyrebirdUI → LyrebirdSynth` is
// always a static edge), producing duplicate-class registration and the
// "mysterious crashes" the runtime warns about. The only `LyrebirdUI` symbol
// this demo used was `LyrebirdWindow`, an `NSWindow`/`NSHostingController`
// wrapper with no `LyrebirdSynth` dependency — inlined below instead.
final class AppDelegate: NSObject, NSApplicationDelegate {
let engine: SynthesisEngine
let session: LiveSession
var model: LyrebirdScratchModel?
var menuController: LyrebirdScratchMenuController?
var window: LyrebirdWindow?
var window: NSWindow?
@MainActor
init(engine: SynthesisEngine) {
self.engine = engine
self.session = LiveSession(engine: engine)
@@ -32,20 +42,30 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
print("[LyrebirdScratchDemo] Engine failed to start: \(error)")
}
let model = LyrebirdScratchModel(session: session)
let model: LyrebirdScratchModel = LyrebirdScratchModel(session: session)
self.model = model
let menuController = LyrebirdScratchMenuController(model: model)
let menuController: LyrebirdScratchMenuController = LyrebirdScratchMenuController(model: model)
menuController.installMainMenu()
self.menuController = menuController
window = LyrebirdWindow(
title: "Lyrebird — Live Scratch",
width: 720,
height: 560
let windowWidth: CGFloat = 720
let windowHeight: CGFloat = 560
let hosting: NSHostingController<LyrebirdScratchView> =
NSHostingController(rootView: LyrebirdScratchView(model: model))
let initialSize: CGSize = CGSize(width: windowWidth, height: windowHeight)
let win: NSWindow = NSWindow(
contentRect: NSRect(origin: .zero, size: initialSize),
styleMask: [.titled, .closable, .resizable, .miniaturizable],
backing: .buffered,
defer: false
)
window?.open {
LyrebirdScratchView(model: model)
}
// Keep ownership in Swift — NSWindow defaults to releasing on close.
win.isReleasedWhenClosed = false
win.title = "Lyrebird — Live Scratch"
win.contentViewController = hosting
win.center()
win.makeKeyAndOrderFront(nil)
self.window = win
}
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
@@ -17,7 +17,7 @@
This app is a direct-distribution developer tool, not a Mac App Store
submission. Sandbox OFF is the only viable configuration for v1.
Phase 147 polish can revisit if an XPC-worker approach is adopted.
This could be revisited if an XPC-worker approach is adopted.
com.apple.security.app-sandbox key is absent (defaults false).
-->
@@ -6,9 +6,8 @@
import AppKit
import LyrebirdSynth
import LyrebirdLiveCompile
let engine = SynthesisEngine(
let engine: SynthesisEngine = SynthesisEngine(
blockSize: 512,
sampleRate: 48000,
numOutputChannels: 2,
@@ -16,8 +15,14 @@ let engine = SynthesisEngine(
driver: CoreAudioDriver()
)
let delegate = AppDelegate(engine: engine)
let app = NSApplication.shared
app.setActivationPolicy(.regular)
app.delegate = delegate
app.run()
// AppDelegate.init is `@MainActor` (mirrors the other demos' bootstrap — since
// `SynthesizerBase` is `@MainActor`, AppKit-side construction is main-actor
// isolated). 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()
}