Drum kits used to be key to any serious band, however, these days, much of our music is created on computer or using a drum machine instead. [spanceac] has built a simple example of the latter, using a microcontroller to build a basic sample-based drum toy.
The brains of the operation is the STM32F100VET6B, which comes complete with a 12-bit DAC for outputting sound. It’s also got a healthy 512 KB of flash, enabling it to store the drum samples onboard without the need for extra parts. Samples are stored at a sample rate of 22,050 Hz in 16-bit resolution – decent quality for a tiny little build, even if the DAC chops that back down to 12-bits later.
[spanceac] was sure to code proper mixing into the drum machine, so that triggering a second sample doesn’t stop the first one playing. With a kick, snare, two toms, and crash and ride samples onboard, there’s plenty to get a solid beat going on the kit. It’s all built up on a small PCB with tactile buttons to activate each sound.
The demo video shows the kit performing ably; it’s not clear if there’s an issue with latency on the samples or that’s just from the difficulty of [spanceac] playing one-handed. If the former, likely some code tweaks or simply trimming silence at the start of samples would be all that was needed. Overall, it’s a neat little groovebox, and the kind of thing that’s great fun to use when jamming with other musicians. Video after the break.