Riff Hero
A rhythm game for your own songs

A rhythm game that turns MIDI files into notes. Java with FXGL, on hold.
- Year
- 2025
- Kind
- Game
- Role
- Solo, on hold
- Stack
- Java Language
- FXGL Library
- Mido Library
The idea
A game like Guitar Hero where you can play your own songs. I love rhythm games, and in all of them someone else picks the songs. Notes come down five lanes, played with A, D, J, K and L, and every hit or miss moves the score.
Getting the notes
The hard part is turning a song into notes. My first script listened to the audio with librosa and tried to find the notes in it, and the results weren't reliable. So I switched to MIDI files. A Python script with Mido scores every track by how many notes it has, how wide its range is and how high it sits, which skips the drums and the bass and finds the melody. Then it converts that track to JSON, with each note's time in seconds worked out from the song's tempo changes, and the game, in Java with FXGL, reads the JSON.
Even with the right notes, the music drifted away from the notes on screen, and I couldn't find why. That's where I stopped. A rhythm game where I can play any song is something I'll come back to, and when I do, I'll start over, probably not in Java. I only used FXGL because Java was what we were learning at university at the time.
- 01Java Language
The game: the lanes, the notes, hit detection and the score.
- 02FXGL Library
The game engine on top of JavaFX: the loop, the input and the menus.
- 03Mido Library
Reads the MIDI files in Python, so the script can pick the melody and export it as JSON.