Skip to content

Serial Protocol

Overview

The NiftyDrum board establishes a virtual serial port over USB when connected to a computer. It also features a USART interface on the Raspberry Pi-compatible GPIO port.

USART Voltage Limit

The USART pins are 3.3V only. Exceeding this voltage may damage the board.

Command Syntax

All commands begin with a forward slash (/). Commands that require arguments follow the format:

/command arg1 arg2 arg3

Special Commands

Special commands do not require parameters. They either modify the board's behavior or provide specific information.

Command Description
/reset Reboots the board in bootloader mode.
/factory_reset Resets all settings to factory defaults.
/sn Returns the board's serial number.
/version Returns the current firmware version.

Parameters Commands

The board uses on-board EEPROM to persist parameters. The serial protocol provides the following commands to save and load these parameters.

Command Description
/load params all Loads all parameters from EEPROM.
/save params all Saves all current parameters to EEPROM.

Pad Parameters

Each pad supports six configurable parameters:

  • Threshold
  • Gain
  • Scan time
  • Mask time
  • Decay
  • MIDI note

Instrument Placeholder

The examples below use snare. Replace it with hihat, kick, crash1, tom1, tom3, ride, tom2, or crash2 as needed.

Getters

Use the following commands to retrieve pad parameter values:

Command Description Example Reply
/get snare threshold Gets the trigger threshold. 15
/get snare gain Gets the sensor gain. 1.5
/get snare scan Gets the scan time (µs). 3000 (3ms)
/get snare mask Gets the mask time (µs). 20000 (20ms)
/get snare decay Gets the decay time (µs). 60000 (60ms)
/get snare note Gets the MIDI note assigned to the pad. 36

Setters

Use the following commands to set pad parameter values:

Command Description Example Usage
/set snare threshold Sets the trigger threshold. /set snare threshold 15
/set snare gain Sets the sensor gain. /set snare gain 1.5
/set snare scan Sets the scan time (µs). /set snare scan 3000
/set snare mask Sets the mask time (µs). /set snare mask 20000
/set snare decay Sets the decay time (µs). /set snare decay 60000
/set snare note Sets the MIDI note for the pad. /set snare note 36

Value Validation

The board does not validate input values. Incorrect values may cause unexpected behavior.

Hi-Hat Controller Parameters

The hi-hat controller behaves differently.