Tone Tram

Last edited: 2024-07-10    3 minute read

aliqot was a project I did in my undergraduate studies to build a digital music controller abstractly based on the bass guitar. The main sensing mechanism was a long row of capacitive touch sensors, intended to sense where along the neck the player was touching, and how much of their finger was touching the surface. In the end, this barely worked, and was a bit clunky to use, and I therefore didn't end up building a full-scale version of the device.

Fast forward several years, and for some reason, I have the sudden urge to revisit this idea. But first:

de Bruijn sequence

The main reason that I came back to this concept is because on a complete whim, I wanted to know whether there was a shift equivalent to the Gray code. That is, in the same way that the Gray code could be used to encode an absolute position in a series of values that progress by flipping a bit in one position, was there an equivalent code that let you do the same, but using bit shifts rather than bit flips? The main benefit of such an encoding is that instead of using N channels of bits, I could just use one channel, which saves a lot of money in magnets and a lot of labor in putting things together, plus its much easier to design and produce around one row than N rows.

It didn't take a lot of searching to come across the de Bruijn sequence. It seems applying this concept to sensing is not an uncommon practice, but much of the literature discussing it is paywalled.

By using a series of magnets and a line of hall effect sensors, I could detect the exact position of a carriage on a linear rail, rounded to the nearest magnet. If the hall effect sensors are analog, then precision goes up dramatically. In addition, because none of the sensing components contact each other, the wear over time is greatly lower than, for example, a linear potentiometer.



  • hall effect sensors
  • gluing magnets is a pain
  • modular connector that works with my cowbell pcb