Many synthesizers use a traditional piano style keyboard as input, but there are many other ways to play a synth! Ribbon controllers, Theremin-style antenna, touch sensors, light/distance sensors, bend sensors, button pads, knobs, and more are among the many, many possibilities when it comes to triggering and adjusting electronic instruments.
We’ll create a 32 keypad input controller using two Adafruit Trellis boards. The Trellis is a wonderful input device for a few reasons:
- It has a neutral grid arrangement that doesn’t imply a particular scale mode in the same way a piano keyboard does
- The lighted button pads that can be used to convey information, such as related notes/chords, or even sequencer steps and tempo indicators
- Its buttons and lights are multiplexed and run on the I2C protocol so it only uses two input pins on the Feather, not 64 of them as individually wired buttons and LEDs would! (Except we’d run out of pins at around a dozen...)
- Up to eight Trellis boards can be combined on a single I2C bus
You can find out a lot more info on the Trellis by heading to this learn guide.
You can follow the Trellis guide for detailed build instructions. This video will show you how I built the particular one for this project.
Be sure to solder the A0 jumper on the second board (the one on the left when viewed from the bottom side (the side without the LEDs poking up). This gives it a unique address on I2C.
Once you’ve built and connected your two Trellis boards, it’s time to wire them to the Perma-Proto PCB.
We won’t be using the interrupt, so you can leave the INT pad out of it!
The Trellis board will connect to the 3.3v power and ground of the Feather M0 Express. To make these connections neatly, solder a jumper wire from the 3.3V row to the lower power rail on the Perma-Proto board, and another one from Feather ground to the ground rail as shown here.
There will be quite a few wires connected to this synth when we're through! In order to keep things neat, you can cut a few short lengths of heat shrink tubing to fit over the Trellis wiring bundle as shown here.
Now, solder the red and black wires of the Trellis to the power and ground rails respectively, as shown here.
You can remove the Feather from the PCB temporarily to solder the yellow and green wires to SCL and SDA and shown.
You can now put the Feather M0 Express back in place on the Perma-Proto board (be careful to align the pins properly), and then place the two silicone elastomer keypads on top -- note that these need to be rotated a certain way to fit the holes in the Trellis boards properly.
Follow this guide to get the Trellis library set up in Arduino. Once you have the Trellis library installed, try opening the demo code in Arduino by clicking on File > Examples > Adafruit Trellis Library > TrellisTest then upload the code to your Feather.
You'll see the lights on the first Trellis light up and you can press the buttons to turn them on and off. Success!
To test the second Trellis, simply change the I2C address in line 74 in the Arduino code from this:
trellis.begin(0x70); // only one
trellis.begin(0x71); // only one
You'll see the second board light up now, instead. Later, we'll use both boards at the same time.