Skip to content

calledarian/airdrums

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

๐Ÿฅ Air Drum Kit - Interactive Computer Vision Drum Set

Created by: Arian Khademolghorani

The Air Drum Kit is a virtual drumming application that turns your webcam into a musical instrument. Using Computer Vision (OpenCV) and Color Tracking, it allows you to play drums in mid-air using any blue objectโ€”like a blue marker, a drumstick with blue tape, or even a blue toy.


โœจ Features

  • Real-time Color Tracking: Uses HSV color filtering to track blue objects with precision.
  • Virtual Overlay: Visualizes drum pads (Snare, Kick, Hi-Hat, Toms, Crash) directly on your video feed.
  • Visual Feedback: Drums light up with a red tint when struck.
  • Low-Latency Audio: Uses Pygame Mixer for responsive sound triggering.
  • Menu System: Integrated Main Menu and Credits screen.

๐Ÿ› ๏ธ Prerequisites

To run this project, you need Python 3.x installed on your machine along with a webcam.

Required Libraries

Install the dependencies using pip:

pip install opencv-python numpy pygame

๐Ÿ“‚ Project Structure

Important: For the code to run successfully, your file and folder structure must look exactly like this. The application relies on specific paths to load images and sounds.

Air-Drum-Kit/
โ”‚
โ”œโ”€โ”€ main.py       # The main Python script
โ”œโ”€โ”€ README.md             # This file
โ”‚
โ””โ”€โ”€ assets/
    โ”œโ”€โ”€ Samples/          # Audio files (.wav)
    โ”‚   โ”œโ”€โ”€ kick-808.wav
    โ”‚   โ”œโ”€โ”€ snare-808.wav
    โ”‚   โ”œโ”€โ”€ openhat-808.wav
    โ”‚   โ”œโ”€โ”€ tom-acoustic01.wav
    โ”‚   โ”œโ”€โ”€ tom-acoustic02.wav
    โ”‚   โ””โ”€โ”€ crash-808.wav
    โ”‚
    โ””โ”€โ”€ images/           # Visual assets (.png)
        โ”œโ”€โ”€ kick_drum.png
        โ”œโ”€โ”€ snare_drum.png
        โ”œโ”€โ”€ hi_hat.png
        โ”œโ”€โ”€ tom.png
        โ””โ”€โ”€ crash_cymbal.png


๐Ÿš€ How to Run

  1. Connect your webcam.
  2. Navigate to the project folder in your terminal.
  3. Run the script:
python main.py
  1. The application will open in the Main Menu.

๐ŸŽฎ Controls & Usage

The "Drumstick"

This application is tuned to detect BLUE objects.

  • Best Results: Use a bright blue marker cap, a blue fidget spinner, or wrap blue electrical tape around a pen/stick.
  • Lighting: Ensure your room is well-lit so the camera can distinguish the blue color.

Keyboard Controls

Key Action
P Play Mode (Start Drumming)
C View Credits
B Back to Main Menu
Q Quit / Exit Application

โš™๏ธ Configuration

You can tweak the settings inside the air_drum_kit.py file:

  • Window Size: Modify WINDOW_WIDTH and WINDOW_HEIGHT (Default: 640x480).
  • Color Sensitivity: If your blue object isn't being detected, adjust the HSV values:
BLUE_LOWER_BOUND = np.array([90, 50, 20])
BLUE_UPPER_BOUND = np.array([140, 255, 255])

๐Ÿค Credits

  • Developer: Arian Khademolghorani
  • Art/Drawings: Ceylin Ipek Ak
  • Audio Samples: 99Sounds
  • Libraries: OpenCV, Pygame, NumPy

๐Ÿ“ License

This project is open-source. Feel free to modify and improve it!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors