Skip to content

gwbischof/midibag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIDIBag - Musical footbags

Convert WT9011DCL motion sensor data to MIDI for music production.

You can buy a sensor here: https://witmotion-sensor.com/products/wt9011dcl-bluetooth5-0-compact-size-accelerometer-inclinometer-sensor

Features

  • WT9011DCL motion sensor support:
    • Acceleration, angular velocity, and orientation data
    • Real-time wireless data transmission at 100Hz
  • Two output modes:
    • midi: MIDI output for DAW integration (default)
    • plot: Live graphical plotting
  • Automatic sensor discovery with retry logic
  • Cross-platform support (macOS, Windows, Linux)

Installation

This project uses uv for Python package management:

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync

Usage

Quick Start

# Connect to motion sensor (MIDI CC mode - default)
uv run motion.py

# Connect with specific modes
uv run motion.py plot   # Live plotting
uv run motion.py notes  # MIDI CC + note triggers

Motion Sensor Modes

MIDI Mode (Default)

uv run motion.py

Sends sensor data as MIDI Control Changes.

Notes Mode

uv run motion.py notes

MIDI CC output plus note triggering with deadband hysteresis. Notes trigger when acceleration exceeds upper threshold (1.5g) and reset when it drops below lower threshold (0.75g).

Plot Mode

uv run motion.py plot

Live graphical plotting of sensor data with separate subplots for acceleration, angular velocity, and angles.

MIDI CC Mapping:

  • CC#20: Adjusted acceleration magnitude
  • CC#21: Angular velocity magnitude
  • CC#22-24: Raw acceleration X, Y, Z
  • CC#25-27: Raw angular velocity X, Y, Z
  • CC#28-30: Raw angles (Roll, Pitch, Yaw)

MIDI Setup

Mac

It just works, without any extra setup, because Mac has a built in virtual midi port.

Windows

Windows doesn't support virtual MIDI ports natively. You need to install a virtual MIDI driver:

Option 1: loopMIDI (Recommended)

  1. Download from: https://www.tobias-erichsen.de/software/loopmidi.html
  2. Install and run loopMIDI
  3. Click "+" to create a new virtual port
  4. The port will appear in your DAW and the Python scripts

Option 2: MIDI Yoke

  1. Download from: http://www.midiox.com/myoke.htm
  2. Install and restart your computer
  3. MIDI Yoke ports will be available system-wide

Linux

Most Linux distributions support virtual MIDI ports through ALSA:

# Load the virtual MIDI module
sudo modprobe snd-virmidi

DAW Integration

  1. Run the MIDI script
  2. In your DAW, select the virtual MIDI port as input
  3. Use MIDI Learn to map CCs to synthesizer parameters

Dependencies

  • bleak: Bluetooth LE communication
  • numpy: Numerical computing
  • matplotlib: Real-time plotting
  • python-rtmidi: MIDI output

About

Musical footbags

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages