An open API service indexing awesome lists of open source software.

https://github.com/yeswanthvelugoti/ai-virtual-drumset

Virtual Drumset is a fun and interactive computer vision project built using Python and OpenCV. It lets users play a virtual drumset by simply moving colored objects (like pens or sticks) in front of a webcam. No physical drumset required!
https://github.com/yeswanthvelugoti/ai-virtual-drumset

ai drumset imutils opencv pyautogui python

Last synced: about 2 months ago
JSON representation

Virtual Drumset is a fun and interactive computer vision project built using Python and OpenCV. It lets users play a virtual drumset by simply moving colored objects (like pens or sticks) in front of a webcam. No physical drumset required!

Awesome Lists containing this project

README

          

# ๐Ÿฅ AI-Based Virtual Drumset ๐ŸŽต

A real-time virtual drumset built using Python and OpenCV that allows you to play drums using colored objects (like sticks or markers) tracked by your webcam. When a colored object enters predefined zones on the screen, the system triggers keyboard events to simulate drum hits.

---

## ๐Ÿš€ Features

- ๐ŸŽฏ **Color-based object tracking** using HSV masking.
- ๐ŸŽฅ **Live webcam feed** processing with OpenCV.
- โŒจ๏ธ **Keyboard simulation** using PyAutoGUI to trigger drum sounds.
- ๐Ÿ“ **Interactive hit zones** detected using contour analysis.
- โšก **Real-time response** with optimized video frame handling.

---

## ๐Ÿง  How It Works

1. Capture webcam video using OpenCV.
2. Convert frames to **HSV color space** to isolate specific colors (e.g., red or blue).
3. Track motion of colored objects (drumsticks) by detecting contours.
4. Define **zones on the screen** where a hit triggers a specific keypress.
5. Use `pyautogui.press()` to simulate keypress events (e.g., mapped to drums in a DAW or online drum kit).

---

## ๐Ÿ› ๏ธ Technologies Used

- Python 3.x
- OpenCV
- NumPy
- PyAutoGUI
- Imutils

---

## ๐Ÿ“ธ Screenshots

>
![github](https://github.com/YeswanthVelugoti/Virtual-DrumSet---AI/blob/main/virtualdrumsoutput.jpg)
---

## ๐Ÿงช How to Run

### 1. Clone the repository:
```bash
git clone https://github.com/your-username/AI-virtual-drumset.git
cd AI-virtual-drumset
```

### 2. Install dependencies:
```bash
pip install opencv-python numpy pyautogui imutils
```

### 3. Run the script:
```bash
python virtual_drumset.py
```

Make sure your webcam is active. Use a red/blue colored object to simulate a drumstick.

---

## ๐ŸŽฏ Applications

- Virtual musical instrument interfaces
- Interactive music education tools
- Gesture-controlled interfaces
- Fun AI/Computer Vision projects for students and beginners

---

## ๐Ÿ™‹โ€โ™‚๏ธ Author

**Yeswanth Sai Kumar Velugoti**
[Email](mailto:yeswanthvelugoti@gmail.com) โ€ข [LinkedIn](https://www.linkedin.com/in/yeswanth-velugoti-4290741a0/)