When the Function Returns Itself
Slide the tine forward, pluck, listen. Too low — slide it back. Pluck again. Still flat. Back a bit more. Pluck. There. The pitch stops drifting; it’s landed on G4. The tine’s vibrating length now produces exactly the frequency you wanted, and further adjustment would make it worse. You’ve found a fixed point.
In mathematics, a fixed point of a function f is a value x where f(x) = x. Apply the function and you get back what you started with. The process of repeatedly applying f until the output stabilizes is fixed-point iteration, and it underlies everything from Newton-Raphson root finding to the semantics of recursive programming languages.
Haskell can express the feedback loop directly with until:
tuneStep :: Double -> Double -> Double
tuneStep target freq = freq + (target - freq) * 0.3
close :: Double -> Double -> Bool
close target freq = abs (freq - target) < 0.001
pitch :: Double
pitch = until (close 392.0) (tuneStep 392.0) 300.0 -- G4 = 392 Hz
-- pitch => 391.999... (converged)
The iteration feeds each output back as the next input until it stabilizes. Here, tuneStep 392.0 keeps nudging the frequency toward G4, damping the adjustment by 0.3 each time so it converges rather than oscillating forever.
Rust doesn’t have a built-in fixed-point combinator, but the iteration is explicit:
fn tune_to(target: f64) -> f64 {
let mut freq = 300.0; // starting guess
loop {
let next = freq + (target - freq) * 0.3;
if (next - freq).abs() < 0.001 { return next; }
freq = next;
}
}
// tune_to(392.0) => 391.998...
The loop runs until successive values differ by less than a thousandth of a hertz — close enough that the ear can’t tell and the tuner needle stops wavering.
Haskell’s fix emerged from lambda calculus in the 1930s (the Y combinator, technically), but fixed-point techniques became computationally essential in the 1980s for static analysis, type inference, and dataflow optimization. Compilers use them constantly: propagate facts through a control-flow graph, re-propagate if anything changed, stop when the information stabilizes.
The kalimba’s physical process is the same structure dressed in different materials. Each pluck is an evaluation. Each slide is an iteration. You’re searching for the length where the tine’s natural frequency equals your target — where the function returns itself. Three springs cracked before I got there today, but eventually, the G converged.