A circuit that plays a note based on your hand's position. Set a reference point, move your hand up or down, and listen as the pitch changes with every centimeter of movement.
The Magic Music Board lets you control pitch through physical movement. Once you power it on, the circuit locks in your starting position as (0,0). From there, moving your hand up or down changes the pitch – each centimeter of vertical movement equals one semitone. Move up 12cm and you've jumped an octave.
The built-in speaker plays whatever note your hand position corresponds to, giving you a hands-on way to explore pitch and create music through gesture.
-
Calibration – When powered up, the circuit records your current hand position as the reference point (0,0).
-
Position Tracking – An inertial measurement unit (IMU) continuously measures where your hand is relative to that starting position.
-
Height to Pitch – The magic formula is simple: 1cm vertical movement = 1 semitone. Your height above or below the reference point directly determines the pitch.
-
Audio Output – The board's speaker converts these measurements into sound. Move your hand, and the pitch changes in real time.
-
Play – Move your hand around freely and create melodies based on your movements.
The Magic Music Board can stream frequency data to any connected desktop or computer via the driver – a Go application that receives audio packets from the board over serial and plays them back with different instrument tones.
-
Serial Connection – The ESP32 sends framed binary packets containing packet ID and frequency data at 115200 baud.
-
Real-Time Playback – The driver decodes incoming packets and synthesizes audio in real time using the selected instrument tone.
-
Instrument Selection – Choose from Guitar, Piano, Flute, Violin, Vocals, or Raw Frequency to match your performance style.
Build the driver from the driver/ folder:
cd driver
go builddRun with your serial port and desired instrument:
./driver -port COM5 -tone guitar -volume 0.3Each instrument has a unique timbre based on harmonic profiles and vibrato characteristics:
- Guitar – Warm, plucky tone with rapid decay (great for percussive gestures)
- Piano – Resonant, sustained tone with bell-like quality
- Flute – Pure, airy tone with gentle vibrato
- Violin – Rich, expressive tone with natural vibrato
- Vocals – Vocal-like tone with harmonic richness
- Raw – Pure sine wave for testing and exploration
-port– Serial port name (e.g.,COM3,/dev/ttyUSB0). Auto-detected if not specified.-baud– Serial baud rate (default: 115200)-tone– Instrument tone:guitar,piano,flute,violin,vocals,raw(default:raw)-volume– Output volume from 0.0 to 1.0 (default: 0.25)-list-tones– Print available instruments and exit
Packets are framed with sync bytes for robust resynchronization:
[A5][5A] [PacketID uint32 LE] [Frequency float32 LE]
This ensures reliable communication even if debug output appears in the serial stream.
Check the platformio.ini for your board configuration. Make sure your IMU is properly calibrated before you start playing around with it so the pitch tracking is accurate.
- Build intuition for how pitch relates to physical height
- Create experimental or improvisational soundscapes
- Explore theremin-like instrument control using motion sensors
- Just have fun with gesture-based music
Note: Sound quality and accuracy improve with proper IMU calibration and a stable reference position.