Replace stringly-typed pedal API with PedalType tokens
appendPedal(type: String, to:) is replaced by appendPedal(_ kind: PedalType, to:),
where PedalType is an extensible RawRepresentable struct with static members for
the built-in pedals:
try shoeGaze.appendPedal(.overdrive, to: board)
Discoverable/autocompleting call sites, still open for custom pedals
(PedalType("My Pedal")). rawValue == the pedal's displayName, so PedalRegistry
and the rig JSON format are unchanged — saved rigs load exactly as before.
Named PedalType (not PedalKind) to avoid colliding with Lyrebird's score-notation
PedalKind enum, which is visible when both modules are imported. The UI palette
wraps its registry-key strings as PedalType(key); demos/tests use the static
members. PedalRegistry.makePedal(type:) stays string-keyed as the serialization
boundary used by loadRig.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -72,8 +72,8 @@ let engine = SynthesisEngine(
|
||||
|
||||
let shoeGaze = ShoeGaze(engine: engine) // defaults to the test-loop signal
|
||||
let board = try shoeGaze.addBoard()
|
||||
try shoeGaze.appendPedal(type: "Overdrive", to: board)
|
||||
try shoeGaze.appendPedal(type: "Delay", to: board)
|
||||
try shoeGaze.appendPedal(.overdrive, to: board)
|
||||
try shoeGaze.appendPedal(.delay, to: board)
|
||||
try shoeGaze.finalizeBoard(board)
|
||||
|
||||
try engine.start()
|
||||
|
||||
Reference in New Issue
Block a user