Control music with your hands. Wave your fingers to layer stems. Sweep your palm to sculpt the sound.
Ambient Conductor is a gesture-controlled music instrument that uses your webcam and hand tracking to mix audio stems and apply real-time DSP effects — no MIDI controller, no DAW, just your hands.
┌──────────────────┐ Normalized Coordinates ┌─────────────────────┐
│ Vision Loop │ ────────────────────────────▶ │ Audio Engine │
│ (MediaPipe Hands)│ Fingers → Stem Mixer │ (sounddevice + │
│ │ Wrist X → Filter Cutoff │ scipy DSP) │
│ │ Wrist Y → Delay/Reverb │ │
└──────────────────┘ └─────────────────────┘
A single hand (either left or right) controls all components of the performance simultaneously:
| Gesture / Position | Effect |
|---|---|
| Fist (0 fingers) | Only the ambient pad plays (always active) |
| 1 raised finger | + Bass line unmutes |
| 2 raised fingers | + Drums enter |
| 3+ raised fingers | + Melody/lead unmutes |
| Move left ↔ right (X) | Sweep the low-pass filter (300 Hz → 20 kHz) |
| Move down ↕ up (Y) | Control delay/reverb wet mix (dry → wet) |
Note
If you lower your hand or take it off the camera screen, the music continues playing with your last finger count (so it doesn't suddenly cut out), but the filter and echo/delay effects will reset back to their clean default values.
Press Q or Esc to quit.
cd Infinite-Museumpython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython src/generate_stems.pyThis creates 4 synthetic audio stems in stems/ (pad, bass, drums, melody) — all in C minor at 100 BPM. You can replace them with your own stems later.
python src/main.pyA camera window will open showing your hand tracking with a HUD overlay. Raise your fingers and move your hands!
To use your own audio, export 4 separate .wav files from your song:
stems/pad.wav— Ambient pad / synth layer (always playing)stems/bass.wav— Bass linestems/drums.wav— Drum trackstems/melody.wav— Vocals / lead melody
Requirements:
- All stems must be the same length (start at the same point)
- WAV format, 44100 Hz sample rate
- Mono or stereo (stereo will be mixed to mono)
python src/main.py --help| Flag | Default | Description |
|---|---|---|
--stems-dir |
stems |
Path to stems directory |
--camera |
0 |
Camera index (try 1 for external webcam) |
--no-audio |
off | Run vision-only mode (no sound) |
├── requirements.txt # Python dependencies
├── stems/ # Audio stem .wav files
│ ├── pad.wav
│ ├── bass.wav
│ ├── drums.wav
│ └── melody.wav
└── src/
├── main.py # Entry point
├── vision.py # OpenCV + MediaPipe hand tracking
├── gestures.py # Finger counting + gesture mapping
├── audio_engine.py # Real-time stem mixing via sounddevice
├── dsp.py # Butterworth filter + feedback delay
├── generate_stems.py # Synthetic stem generator utility
└── config.py # Central configuration constants
- MediaPipe Hands — 21-landmark hand tracking at 30+ FPS
- OpenCV — Webcam capture and frame display
- sounddevice — Low-latency callback-based audio I/O (PortAudio)
- SciPy — Butterworth filter design and real-time IIR filtering
- NumPy — Array math for audio and coordinate processing