Skip to main content
Tinkeringidk how long this will take you to read

A Hurdy Gurdy Simulator in Rust

A hurdy gurdy simulator in rust

The Hurdy Gurdy is an old instrument with a funny name. I've been thinking about the instrument on and off since I saw it listed on the Personnel for Ape of Naples by Coil many years ago and thought the name sounded interesting. I've played around with software (and hardware) instruments for years and felt like I could take a stab at a novel idea now that LLMs are sufficiently powerful in 2026. Beyond the technical curiosity and novelty of the project, there's a fundamental curiosity to explore: how do we test the code and output such that an agent can iterate on the code? This is a problem I've thrown many strategies at in my Temper project which is more of an ongoing test against agent capabilities and less of a completable project.

There are a few elegant ways to test the generated output and code. Property based testing and metamorphic testing. Property based testing has a rich history and literature, less so for metamorphic testing. To apply PBT to our project we sample from some distribution in the spaces of physical parameters, key sequences, and wheel speeds and run tests against each sample. We essentially fuzz our hurdy gurdy against a bunch of input states and ensure tests pass.

Metamorphic testing checks if some change to input produces some expected change to the output. This is handy because we don't need to specify an exact property to test rather a "delta" to validate. For instance, does pressing the key at time t produce a sample F(input) at time 0, where F is some audio output function and does pressing a key at time t+n produce a sample at F(input) at time n. In other words, does delaying the input by some seconds delay the output by a matching amount of time. Observe that this doesn't test some exact property of the system but rather a meta-property about the behavior of the system. We could write some complicated integration test to validate the actual rendered waveform of the instrument at each time however this is tricky to do in general and doesn't tell us anything about our generic system. It's also vulnerable to going out of date very quickly as our instrument is refined.