As part of my by now usual, participation in the Fasma Festival in Athens, I designed a Teensy 3.2 based drum machine for the DIY workshop. As I’ve been playing around with the design for the past years, trying to modify the Teensy Audio library for ease of hacking, I managed to come up with a couple of ideas on how to implement the interaction part. The challenge was to make something small, affordable and simple enough to build in a couple of hours. That’s why it ended up as a portable, battery-powered, four voice drum machine, with four sequences.
I took a lot of initial inspiration from devices like Elektron Machines, Teenage Engineering Pocket Operators and Bastl Instruments Trinity devices.
The full feature list with later updates include:
- 4 voices (Kick, Tom, Snare and Hat) 2 Digital Oscillator modules, 2 PCM sample playback.
- 4 parameter controls per each voice. Pitch, Decay, Pitch Modulation and Distortion.
- 16 step tap patterns.
- Automation record per each step and randomizing automation.
- 4 patters, can be permanently stored on the device together with the Automation data.
- Up to 8 patterns sequence chain.
- Clock In and Output. Can be master or slave device.
- Line out and a headphone output with volume control.
- Muting voices, possibility to erase individual voices or whole patterns.
- Metronome.
- 9V battery powered, up to 7.5 hours fun time.
- Auto power off for battery saving.
- Hackable and open source.
- DIY friendly SMD components.
The Clock input and outputs are 5V level transistor buffered, so it should be impossible to blow up the MCU and can interface nicely with Eurorack Modules. Also utilizing Interrupt pins the latency is minimal.
The audio front end is a relatively generic single supply active Low Pass Filter, with a cut off of 22 kHz to remove any DAC noise, and gain stage to bump up the audio levels a bit. The headphone driver is also a simple, but maybe not very effective, implemented with four parallel Op-Amp buffers. Looking back at this a year later, a lot of improvements come to mind.
To reduce the costs of hardware and struggle of my fellow workshop participants, I concluded that the controls would have to be limited to four main pads and four knobs for parameters (excluding tempo and volume), as well as four function buttons. This means, that patterns can only be tapped in, and there is no running sequencer ( although I did build an 8 step version as a prototype, it required an additional GPIO expander). Also, it means that some trickery for locking and remembering potentiometer values for each voice parameter had to be deployed.
The Teensy MCU is a little power munching device (at least compared to the latest portable oriented Micro-controllers) with around 60 mA total current consumption in run mode. To preserve the battery life a little bit longer when left unattended, the device goes into sleep mode after approximately 30 minutes. If there is playback, only the LEDs turn off to try and reduce the power consumption. Otherwise, the whole MCU core enters a deep sleep mode but can be woken up again by pressing any button.
At heart, the audio engine is developed around the Teensy Audio Library, with some modified objects, to enable pitch modulation and envelopes for PCM sample playback. As well as some more custom libraries, which I am hoping to document well enough to be able to release some time in the future.
In the beginning, I struggled with some high pitched MCU noise coupling into the audio path. I tried to reduce this by lowering the number of ADC cycles, reducing PWM output bit depth and increasing the PWM frequency out of audio range. In the end, the most significant improvement was archived by running a wire from the split analogue ground part back to the AGND pin of the Teensy, which I failed to do in the layout initially.
For the future, I have some more ideas how to develop this a little bit more, make improvements in the layout and maybe run a couple of workshops more.
For now, you can find all the schematics, BOM and code at my usual GitHub lair.
And the accompanying website.