Skip to content

About

Interactive air guitar system using Computer Vision and MediaPipe hand tracking to detect chord selections and strumming gestures in real time with dynamic audio playback.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Air Guitar Motion Studio

An interactive virtual guitar powered by Computer Vision, MediaPipe and Python, allowing users to play guitar chords in real time using only hand gestures and motion tracking.


📌 Overview

Air Guitar Motion Studio transforms your webcam into a playable musical instrument.

Using real-time hand tracking, the system detects:

  • Chord selection gestures
  • Strumming motions
  • Dynamic capo adjustments

The project combines gesture recognition, audio processing and interactive UI systems to simulate an air guitar experience without any physical hardware.


✨ Features

  • Real-time webcam hand tracking
  • Gesture-based chord selection
  • Motion-controlled strumming
  • Live chord playback
  • Adjustable capo system
  • Low-latency audio response
  • Interactive chord grid UI
  • Automatic audio silence trimming
  • Dynamic pitch shifting for capo simulation

🧠 How It Works

Chord Selection

Your left hand selects chords from the visual grid displayed on screen.

Supported chords:

  • C
  • D
  • E
  • F
  • G
  • A
  • Em
  • Am
  • Gm

Strumming Detection

Your right hand performs downward strumming motions.

The system:

  1. Tracks hand landmarks using MediaPipe
  2. Detects rapid vertical hand movement
  3. Triggers real-time chord playback

🏗 System Architecture

Computer Vision

  • OpenCV → Webcam input & rendering
  • MediaPipe Hands → Real-time hand landmark tracking

Audio Processing

  • Pygame Mixer → Real-time sound playback
  • Pydub → Audio preprocessing & silence trimming
  • NumPy → Dynamic pitch shifting & interpolation

Gesture Recognition

  • Handedness detection
  • Motion threshold analysis
  • Strumming cooldown logic
  • Grid-based chord mapping

📂 Project Structure

.
├── assets/
│   └── chords/
│       ├── C.wav
│       ├── D.wav
│       ├── E.wav
│       └── ...
├── main.py
├── requirements.txt
└── README.md

Installation

1️⃣ Clone the Repository

git clone https://github.com/chngzyashley-spec/air-guitar.git
cd air-guitar

2️⃣ (Optional but Recommended) Create a Virtual Environment

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate

Windows

python -m venv .venv
.venv\Scripts\activate

If you are using VS Code, make sure your Python Interpreter is set to the .venv environment.


3️⃣ Install Dependencies

pip install -r requirements.txt

🎮 Controls

Key Action
[ Decrease capo
] Increase capo
0 Reset capo
q Quit application

🖐 Gesture Controls

Left Hand

  • Hover over the chord grid to select chords

Right Hand

  • Perform downward strumming gestures to play

💻 Technologies Used

  • Python
  • OpenCV
  • MediaPipe
  • Pygame
  • NumPy
  • Pydub
  • Computer Vision
  • Gesture Recognition
  • Audio Signal Processing

🎯 Learning Goals

This project explores:

  • Real-time Computer Vision
  • Gesture recognition systems
  • Audio signal processing
  • Human-computer interaction
  • Interactive media applications

About

Interactive air guitar system using Computer Vision and MediaPipe hand tracking to detect chord selections and strumming gestures in real time with dynamic audio playback.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages