Turn your webcam into a high-speed, low-latency spatial instrument.
- ⚡ Zero-Lag Audio: Custom Pygame mixer implementation for <10ms latency.
- ✋ High-Precision Tracking: Powered by MediaPipe Hands for millimeter-accurate hit detection.
-
🌊 Physics-Based Audio: Volume scales with your hand velocity (
$v = \Delta y / \Delta t$ ). - ✨ Holographic UI: Semi-transparent, futuristic HUD with ripple visual effects.
- 📷 Universal Support: Works with laptop webcams and external USB cameras.
-
Clone the repository
git clone https://github.com/alexbuildstech/virtual-physics-drum-kit.git cd virtual-physics-drum-kit -
Create a Virtual Environment
python -m venv venv source venv/bin/activate # Linux/Mac # venv\Scripts\activate # Windows
-
Install Dependencies
pip install -r requirements.txt
Note: Requires MediaPipe, OpenCV, Pygame, and NumPy.
-
Run the App
python main.py
By default, it uses the built-in webcam.
-
Using an External USB Camera If you have a fancy USB camera connected:
python main.py --camera 1
(Use
check_camera_index.pyif you aren't sure which index to use) -
Drumming
- Snare: Top Left
- Hi-Hat: Bottom Left
- Tom: Top Right
- Kick: Bottom Right
Strike the air in these zones! The harder you hit, the louder the sound.
- Core: Python 3.12
- Vision: MediaPipe Hands (Landmark Tracking)
- Audio: Pygame Mixer (Buffer size 512 for low latency)
- Visuals: OpenCV (cv2) for overlay and particle effects
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.