feat(karplus): collapse tuning UI to a Free/Pitched switch + one Root knob
Replace the four-control tuning surface (continuous Tune Hz knob + Tuning
selector + separate Note and Octave selectors) with a single Free/Pitched
switch and one chromatic Root selector that steps every semitone from E1
(MIDI 28) to E5 (MIDI 76), captioned by note name ("E1", "A3", "E5"). The
Root selector is shown only in Pitched mode; in Free mode the continuous
Tune Hz knob drives the root as before.
- Drop the `note`/`octave` @UIParams and `noteFrequency(pitchClass:octave:)`;
add a `pitchedNote` @UIParam (MIDI note number, A3=57=220 Hz default) and
`frequency(forMidiNote:)` / `caption(forMidiNote:)` helpers.
- Knob positions are unchanged (Tune always present), so positional presets
stay aligned; only the trailing selector set varies by mode, with Voicing
pinned at index 0.
- Document the switch-before-selector pass order in Pedal.applyState as
contractual: a mode-dependent selector set (like this one) relies on it.
798 tests pass; lyrebird_external_review clean (no blocking findings).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -92,6 +92,12 @@ extension Pedal {
|
||||
/// always applied regardless of any count mismatch. Presets saved before a given control existed
|
||||
/// carry an empty array for it, leaving those controls at their defaults.
|
||||
///
|
||||
/// **Pass order is contractual: switches are restored before selectors.** A pedal whose selector
|
||||
/// *set* depends on a switch value (e.g. ``KarplusResonatorPedal``, whose Root note selector
|
||||
/// appears only in the Pitched tuning mode) relies on `tuning` being written in the switch pass
|
||||
/// before `effectSelectors` is re-read in the selector pass, so the mode-dependent selector exists
|
||||
/// to receive its value. Do not reorder these passes without revisiting such pedals.
|
||||
///
|
||||
/// - Parameter rawState: The state to restore. The `state.type` is not validated against
|
||||
/// `displayName` — the caller is responsible for matching types before calling this method.
|
||||
public func applyState(_ rawState: PedalState) {
|
||||
|
||||
Reference in New Issue
Block a user