r/musicprogramming • u/silentprick • 6h ago
A choir you conduct with your webcam: hand tracking in the browser drives a live choir engine
1
Upvotes
I've been building a virtual choir instrument, and this is a free experiment from it: you conduct the choir with your hands.
Try it: https://vesper.im-a-bird.com/conduct/ (works best on a computer in Chrome or Edge; there's a mouse mode if you don't want to use the camera)
How it works
- Hands → gestures. MediaPipe's hand landmarker runs in a Web Worker, on your own device. From the right hand's path I pick out the gestures conductors actually use: the preparation (the lift before an entrance), the ictus (the bottom of each beat), holds, and the cutoff (closing the hand).
- Gestures → timing. A small "follower" turns those beats into tempo. It doesn't snap to each beat; it leans toward your tempo the way a real choir does, between half and double the written speed, so you can stretch a phrase or push it forward.
- The left hand is loudness. Only its height counts, never its shape. My own left hand doesn't open fully, so I made sure curled, open and closed hands all work the same.
- The choir. The singing is synthesized live in the browser (Rust compiled to WebAssembly, running in an AudioWorklet), following the score note by note but taking its timing and dynamics from you. Each performance comes out a little different.
- The stage. The singers, the lanterns and the conductor you see from behind all react to what you do.
The camera only ever follows your hands: nothing about the picture leaves your computer.
It's a beta. I'd love to hear where the gesture reading feels off, especially from anyone who's conducted or worked with motion input.