947dfe427a
Extend the looper into a double-width tempo-aware pedal: - Beat-quantized transport: record start and loop close both snap to the next beat via a LyrebirdRoutine waiting on the shared clock; loop length is an exact whole-beat span. Falls back to immediate/unquantized when no clock is present. - Loop-length read-outs (frames/seconds/beats), transport state, and a sample-clock-derived play-head position for the UI timeline. - Overdub undo (pre-dub snapshot + restore), reverse playback (live rate flip), and feedback-decay overdub (overdub preLevel via a Feedback knob). - Inject the shared LyrebirdClock + SynthesisEngine into Pedal via PedalBoard/ChainRouter so tempo-aware pedals can reach them. - New double-width LooperTimelineView (state badge, length read-out, sweeping play-head) wired into PedalView via Pedal.widthUnits. Concurrency hardening from RT-safety review: a transportGeneration counter drops superseded deferred beat/undo callbacks that LyrebirdRoutine.stop() cannot recall once enqueued; the undo restore is deferred past the RT overdub gate-close; transport routines use non-blocking stop(). Note: this commit also snapshots pre-existing uncommitted work-in-progress already in the tree (MIDI control refactor, Tuner, Tempo, preset changes), which is interleaved with the looper changes through shared files and could not be split into a separately-building commit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
62 lines
2.5 KiB
Swift
62 lines
2.5 KiB
Swift
// swift-tools-version: 6.0
|
|
// ShoeGaze — a standalone guitar-pedalboard sample project for Lyrebird.
|
|
//
|
|
// Depends on the published Lyrebird package by URL. Two products:
|
|
// • LyrebirdShoeGaze — core pedal/board framework (no SwiftUI).
|
|
// • LyrebirdShoeGazeUI — SwiftUI pedalboard views (knobs + bypass toggle).
|
|
//
|
|
// Linkage note: both targets link the *static* Lyrebird products (`Lyrebird`,
|
|
// `LyrebirdUI`). SwiftPM resolves the shared `LyrebirdSynth` target once, so
|
|
// there is a single copy of the module in any consumer — no ObjC class
|
|
// double-registration. The dynamic-product dance used by `LiveCompile/` is only
|
|
// required for runtime dylib hot-swap, which ShoeGaze does not do.
|
|
//
|
|
// The demo app lives at Demo/ShoeGazeDemo.xcodeproj — open ShoeGaze.xcworkspace
|
|
// in Xcode and run the ShoeGazeDemo scheme to build it.
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "LyrebirdShoeGaze",
|
|
platforms: [.macOS(.v15), .iOS(.v18)],
|
|
products: [
|
|
.library(name: "LyrebirdShoeGaze", targets: ["LyrebirdShoeGaze"]),
|
|
.library(name: "LyrebirdShoeGazeUI", targets: ["LyrebirdShoeGazeUI"]),
|
|
],
|
|
dependencies: [
|
|
.package(url: "https://realizedsound.mooo.com/josh/Lyrebird", from: "1.2.2"),
|
|
],
|
|
targets: [
|
|
// The core target depends on LyrebirdUI as well as the synthesis core:
|
|
// pedals expose their knobs as `@UIParam`, whose projected `UIParamNode`
|
|
// (the type `ParameterKnob` binds to) lives in LyrebirdUI. Importing
|
|
// LyrebirdUI here does not pull SwiftUI into ShoeGaze's own sources —
|
|
// it only makes the `@UIParam` wrapper and `UIParamNode` visible.
|
|
.target(
|
|
name: "LyrebirdShoeGaze",
|
|
dependencies: [
|
|
.product(name: "Lyrebird", package: "Lyrebird"),
|
|
.product(name: "LyrebirdUI", package: "Lyrebird"),
|
|
],
|
|
path: "Sources/LyrebirdShoeGaze"
|
|
),
|
|
.target(
|
|
name: "LyrebirdShoeGazeUI",
|
|
dependencies: [
|
|
"LyrebirdShoeGaze",
|
|
.product(name: "LyrebirdUI", package: "Lyrebird"),
|
|
],
|
|
path: "Sources/LyrebirdShoeGazeUI"
|
|
),
|
|
.testTarget(
|
|
name: "LyrebirdShoeGazeTests",
|
|
dependencies: [
|
|
"LyrebirdShoeGaze",
|
|
"LyrebirdShoeGazeUI",
|
|
.product(name: "Lyrebird", package: "Lyrebird"),
|
|
.product(name: "LyrebirdUI", package: "Lyrebird"),
|
|
],
|
|
path: "Tests/LyrebirdShoeGazeTests"
|
|
),
|
|
]
|
|
)
|