feat(karplus): extend Free-tune range up to E5

The Free-mode Tune knob now reaches 660 Hz (E5, the top of the treble
staff), up from 400 Hz, so the resonator root can be dialled across the full
guitar range by ear. Note mode already covered this via the octave selector.

Test: Free Tune at E5 rings near 659 Hz. Full suite 795 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 14:59:16 -08:00
parent 89a34016de
commit 097c38283e
2 changed files with 18 additions and 3 deletions
@@ -259,6 +259,18 @@ struct KarplusResonatorPedalTests {
"two voicings should ring differently: tail diff \(diff) vs drone tail \(droneTail)")
}
@Test func freeModeReachesTrebleStaffTop() throws {
// Free-mode Tune now reaches E5 (≈ 659 Hz, top of the treble staff). Drone voicing shares the
// root period, so the ring's fundamental sits at the set root.
let e5: Double = 659.25
let out: [Float] = try renderPluck { pedal in
pedal.mix = 1.0; pedal.sustain = 0.9; pedal.sensitivity = 0.6
pedal.tuning = 0.0; pedal.tune = e5; pedal.voicing = 0.0
}
let f: Double = fundamentalHz(out, skip: tailSkipFrames, window: tailWindowFrames, minHz: 300.0, maxHz: 900.0)
#expect(abs(f - e5) / e5 < 0.1, "Free Tune at E5 should ring near \(e5) Hz, got \(f)")
}
@Test func renderIsDeterministic() throws {
// Every node in the bank is deterministic (no RNG), so two identical renders are bit-identical.
let a: [Float] = try renderPluck { pedal in pedal.sustain = 0.8; pedal.voicing = 2.0 }