Skip to content

Cartev112/pianoman

Repository files navigation

Piano Man - Arduino MIDI Game

Piano Man is an interactive Arduino-based music game that lets you play along with popular songs in a Guitar Hero-style format. The game features LED indicators, button controls, and a servo-controlled metronome for visual tempo feedback.

Features

  • Multiple song support with MIDI file conversion
  • 4-column LED matrix for note visualization
  • Interactive button controls for note hitting
  • Real-time scoring system with combo tracking
  • Tempo control via potentiometer
  • Visual metronome using servo motor
  • LCD display for game status and menu
  • Buzzer for audio feedback

Hardware Requirements

  • Arduino board (tested with Arduino Uno)
  • 16 LEDs arranged in a 4x4 matrix
  • 4 push buttons for note input
  • 1 navigation button
  • LCD display (I2C interface)
  • Servo motor for metronome
  • Buzzer for audio
  • Potentiometer for tempo control
  • Shift registers for LED control

Software Requirements

Arduino

  • Arduino IDE
  • Required libraries:
    • Wire.h (built-in)
    • LiquidCrystal_I2C
    • Servo

Python (for MIDI conversion)

  • Python 3.6+
  • Required packages (install via pip install -r requirements.txt):
    • mido
    • python-rtmidi (optional backend for mido)

Project Structure

piano-man/
├── src/
│   ├── arduino/
│   │   └── pianomanfinal.ino    # Main Arduino game code
│   └── python/
│       ├── midiconvert.py       # MIDI to CSV converter
│       ├── midiconvert2.py      # Enhanced MIDI converter
│       └── csv_to_arduino.py    # CSV to Arduino array converter
├── data/
│   ├── midi/                    # MIDI input files
│   └── csv/                     # Converted CSV files
├── tools/                       # Additional tools and utilities
├── requirements.txt             # Python dependencies
└── README.md                    # This file

Setup Instructions

  1. Install required Python packages:

    pip install -r requirements.txt
  2. Connect Arduino hardware according to the following pin configuration:

    • LATCH_PIN: 8
    • CLOCK_PIN: A0
    • DATA_PIN: A2
    • Button pins: 2, 3, 4, 5
    • Navigation button: 6
    • Buzzer: 7
    • Servo: 9
    • Potentiometer: A1
    • LCD: I2C (SDA/SCL)
  3. Upload the Arduino code:

    • Open src/arduino/pianomanfinal.ino in Arduino IDE
    • Select your board and port
    • Upload the code

Adding New Songs

  1. Place your MIDI file in the data/midi directory

  2. Convert MIDI to CSV format:

    python src/python/midiconvert2.py
  3. Convert CSV to Arduino array:

    python src/python/csv_to_arduino.py
  4. Add the generated array to the Arduino code and update the song list

Game Controls

  • Navigation Button:
    • Tap: Start game / Pause / Resume
    • Hold: Turn on/off
  • Note Buttons: Hit notes as they reach the bottom row
  • Potentiometer: Scroll through songs (menu) / Adjust tempo (in-game)

Scoring System

  • Hit notes accurately to score points
  • Build combos for bonus points
  • Missed notes break your combo
  • Final score displayed at game over

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors