← Work

Software

Custom Arpeggiator

Gesture-controlled MIDI controller — BBC micro:bit, HC-SR04 sensor, Pure Data.

MicroPython Pure Data MIDI micro:bit Hardware
Custom Arpeggiator

Background

This project turns a BBC micro:bit and an HC-SR04 ultrasonic distance sensor into a gesture-controlled MIDI arpeggiator. Hand distance above the sensor controls note selection; the micro:bit sends serial data to Pure Data on a laptop, which generates the MIDI output.

It was built during my MSc and performed at a live student showcase. The goal was to explore tangible interaction with music software — using physical gesture rather than a keyboard or knob.

Features

  • HC-SR04 ultrasonic sensor reads hand distance (5–50 cm range)
  • BBC micro:bit running MicroPython processes sensor data and emits serial messages
  • Pure Data patch receives serial input and maps distance to MIDI note values
  • Arpeggio pattern (up, down, random) selectable via micro:bit buttons A and B
  • BPM controlled by a separate analogue pot read via the micro:bit edge connector
  • Works with any DAW or hardware synth accepting MIDI input

Limitations

  • Serial-to-MIDI pipeline adds ~20 ms latency — fine for live performance, not for tight sequencing
  • HC-SR04 is sensitive to hand angle; flat palm works, fist or angled hand causes missed readings
  • Pure Data patch is not polished for distribution — requires manual COM port configuration
  • No presets or saved patterns

What I learned

The project proved that hardware prototyping with microcontrollers and data-driven patching in Pure Data is a fast way to prototype novel controllers. The main challenge was noise-filtering the ultrasonic readings in MicroPython before passing them downstream — a moving average window solved most of it.