Music tool case study
Endless Loader
A local web tool that finds a connected Polyend Endless pedal over USB, writes a patch to it, and checks the write with a SHA-256 read-back before calling it done.
What it is
Endless Loader is a small local web tool, meant to run on a Raspberry Pi or
Ubuntu-family Linux box sitting next to the pedal rather than on my main
machine. It finds a connected Polyend Endless over USB with lsblk --json
and findmnt --json, mounts it with udisksctl if it is not already
mounted, writes the .endl patch I picked, and then reads it back and checks
the SHA-256 before it tells me the write actually worked. There is an
fsync call in there too, because a write that looks done and is not is
worse than no write at all.
Why I built it
Moving a patch onto the pedal by hand is a small, fiddly, repeatable task,
which is exactly the kind of task I do not trust myself to do carefully every
time. I wanted browse, choose, load, verify to be four clicks instead of a
manual USB dance I would eventually get wrong. Config lives in one
config.toml, with library_root pointing at where the patches live and
expected_uuid naming the pedal’s volume, which I use in preference to
expected_label because a UUID cannot accidentally match the wrong drive.
Technical shape
It is Python with a mobile-friendly browser interface, drawn as a pedal-style
control surface with labeled knobs rather than a plain file list, which is
just a lot more fun to use because it is closer to what I am actually
looking at when I reach for it.
Optional I2C LCD support means it can drive a small physical display too,
if one is attached, instead of relying on the browser alone. When
usb.auto_eject_after_write is set, it unmounts and offers to power off the
drive automatically once the verified write finishes, so I am not the one
who forgets to eject it.
What I learned
Verification matters more than cleverness once a tool is touching hardware I can only have one of at a time. The SHA-256 read-back is the least glamorous line of code in the project and the one I actually trust. Building it as a small local web app rather than a script also turned out to matter, because a phone on the same network can reach it just as easily as a laptop can, and the pedal is not always sitting next to a keyboard.
Links
- Repository: github.com/edonahue/endless-loader