A simple multi touch midi controller using the Trill sensor and Teensy LC
I recently bought one of Bela’s Trill sensors - a really nice multitouch capacitive sensor that comes in various shapes and sizes (and open source hardware !). Capacitive touch sensing is something that has been used in analog modular synthesizers for half a century. The main attraction for me as an artist is that it is incredibly response as opposed to the bulky rubber buttons you get on terrible commercial midi controllers or even high quality switches: As soon as you touch it, it sends off a signal (as opposed to a hardware button where the button has to be pressed to the point where it triggers - it sounds like nothing when put in to writing but the difference in responsiveness is incredible). Since this is a digital circuit, the response is not immediate as it is in an analog circuitry but it is very close (125 microseconds) to immediate I find.
I finally got around to making my first midi controller out of one of these (source code here), and a fairly cheap one at that ($12 for the microcontroller and £12.5 for the sensor).
I decided to make a simple controller consisting of one Trill Bar sensor hooked up to a Teensy LC microcontroller board, the cheapest of the Teensy microcontroller boards. The electronic setup for this is very simple (and explained very thoroughly in Bela’s fantastic documentation for the sensor). The Trill sensor communicates via the I2C protocol and so all you have to do is connect the sensor’s data pins to the Teensy’s data pins, and the sensor’s power pins to the teensy’s power output pins. For some microcontrollers like the Teensy LC you additionally need two pullup resistors soldered between the 3.3v output of the Teensy and each of the two data lines going into the Teensy from the Trill Bar.
As mentioned, the documentation for the Trill sensor is really great, and it has a nice overview page of the different settings and setups possible. Mine is currently running in the
CENTROID mode where it tracks the touch size and the position (x axis) on the touch bar. The sensor chip can be configured to run at different speeds and bit depths. According to documentation, the sensor can be configured to be anything in between 9 and 16 bits, but I found 11 bits to be the most usable, anything higher than that and the sensor would pick up too much noise in the readings.
Lastly, I configured the microcontroller to output 14 bit midi ( 16384 steps ), even though the sensor only picks up 3200 or 4000 steps depending on the value, this is to get a little bit more data squeezed out of it and it is fairly easy to receive 14 bit midi in SuperCollider. The firmware is setup to send triggers, locations and touch sizes on adjacent midi channels, with a maximum of 10 (it’s very hard to squeeze 10 fingers onto the trill bar (unless you’re a child I guess?)).