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.
- 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
- 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
- Arduino IDE
- Required libraries:
- Wire.h (built-in)
- LiquidCrystal_I2C
- Servo
- Python 3.6+
- Required packages (install via
pip install -r requirements.txt):- mido
- python-rtmidi (optional backend for mido)
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
-
Install required Python packages:
pip install -r requirements.txt
-
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)
-
Upload the Arduino code:
- Open
src/arduino/pianomanfinal.inoin Arduino IDE - Select your board and port
- Upload the code
- Open
-
Place your MIDI file in the
data/mididirectory -
Convert MIDI to CSV format:
python src/python/midiconvert2.py
-
Convert CSV to Arduino array:
python src/python/csv_to_arduino.py
-
Add the generated array to the Arduino code and update the song list
- 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)
- Hit notes accurately to score points
- Build combos for bonus points
- Missed notes break your combo
- Final score displayed at game over