NiftyDrum

NiftyDrum is a trigger to MIDI module. It is the natural evolution of EveryDrum. It offers low latency MIDI over a USB via a USB-C connector. More info at https://niftydrum.com.
With support for 9 piezos + 1 FSR, NiftyDrum packs unmatched versatility into a Raspberry Pi Hat-form factor board. In a nutshell, NiftyDrum is an affordable way to add professional MIDI triggering to your electronic or acoustic drum setup.
Contents
Trigger to MIDI Interface
The board
NiftyDrum is a trigger to MIDI interface. It is a sensor to MIDI interface, which means that it doesn’t produce sounds, rather it sends MIDI messages over USB. To convert those messages into sounds, you need a DAW (digital audio workstation).
There are 10 inputs: 9 of which are dedicated to piezoelectric sensors, and 1that is meant to be used for an FSR sensor. Each input is to be connected to a terminal block, and all the piezo inputs have an on-board potentiometer to adjust sensitivity in case the digital gain wouldn’t be sufficient.

The board has the same form-factor as EveryDrum: it can be connected to a Raspberry Pi and follows the Raspberry Pi Hat specifications. The GPIO port is connected to the 5V, GND, and serial output of the on-board microcontroller, so the MIDI notes can be received by a Raspberry Pi without connecting a USB cable to the board.
On the board, there are two LEDs, one of which is on as long as the board is connected via USB or to a Raspberry Pi. The other LED is a status LED, it is almost always on, except when the board is transmitting serial data.
That’s a Blue Pill!
You can write your own firmware and upload it to the board! If that is something you’d like to do, read on! Otherwise, you can skip this section.
The on-board microcontroller is nothing more than the STM32F103C8T6, that’s a Blue Pill! If you are not familiar with the Blue Pill, it is a famous development board based on the STM32F103C family of microcontrollers.
If you want to hack the board and use your own firmware, you can use utilities available at TheKikGen’s repository, as the STM32 has already been flashed with the STM32F10x TKG-HID-BOOTLOADER. To enter bootloader mode and upload a firmware to the board, simply double press the on-board button.
That gives you a lot of freedom, as you can do whatever you want with the 72MHz, 64kB of flash, and 20kB of RAM that the STM32 gives you. To that end, I strongly recommend STM32duino, which will let you program the chip using the Arduino IDE.
Just like the actualy Blue Pill, the on-board LED is connected to PC13. The hi-hat controller is connected to PA3, all other analogue inputs are connected piezo inputs from PA0 to PB1.
There is also an on-board EEPROM, it is a M24C64-R, which can hold up to 8192 bytes and is accessible via I²C using the 0x50 address.
MIDI messages
Using the preloaded firmware, each piezo is considered to be a single-zone pad. Inputs are labelled with instrument names to help you wire your kit, but those names are only names, the only exception is the HHC input, which is to be used with the hi-hat controller/pedal.
Piezo inputs are treated as drum triggers. They emit two MIDI messages: note on, and note off. A note on is always followed by a note off after some delay.
The FSR (hi-hat controller) input emits more MIDI messages. It emits note on and note off messages when a foot chick is detected, and control change (CC) messages when the pedal is pressed or released. This allows for continuous monitoring of the pedal state and should allow DAWs to generate realistic hi-hat sounds.
Desktop Application
This section will show how the PC app works. It is a Windows, Mac, and Linux app that allows to control the board’s parameters, such as scan time, mask time, threshold, etc.
Legal notice / Licenses
The firmware is provided as is and can be replaced by any firmware that fits into the microcontroller flash memory, using the on-board bootloader, as described in this post.
Likewise, the bootloader can be replaced by any bootloader that is compatible with the microcontroller, using the J1 connector with a Tag Connect TC2030-NL connector.
Doing so, whether it’s for the firmware or bootloader, may break the microcontroller, so there is no guarantee that the board will still work after such operation. In that case, Ronna Technologies would not be responsible for any issues that you would encounter with the NiftyDrum product as a whole.
If you choose to keep the default bootloader and firmware, here are some things that you need to know:
- The firm
- The booloader is an unmodified version of STM32F10x TKG-HID-BOOTLOADER. It is published under the GNU GENERAL PUBLIC LICENSE Version 3.
- The firmware, on the other hand, is not open source. It may become open source at some point in the future.
- The firmware uses the following libraries: 
- State Machine Language (SML) library – BSL-1.0 license.
- SparkFun External EEPROM Arduino Library – The MIT License (MIT).
- flute: C++20 fixed-point single header library – The MIT License (MIT).
- JSMN – The MIT License (MIT).
- libmaple – The MIT License (MIT).
- USB Composite library for STM32F1 – The MIT License (MIT).
 
