This plugin aims to make rhythm game development and music syncing easier than ever before. Import a midi file like you would any other Godot asset, this can then be paired with a "MidiPlayer" node that sends out signals every time a midi event is fired. This project is a work in progress and lacks some features, so feel free to contribute any code or ideas on the pull requests page.
2023-10-22.14-02-20_min.mp4
This GDExtension addon is only compatible with Godot version 4.1.2 and higher.
Note, due to nlaha#11, binaries for MacOS are currently unavailable, please build from source.
-
Download the latest release from https://github.com/nlaha/godot-midi/releases
-
Copy the
godot-midi
folder to your project'saddons
folder -
Enable the addon in Godot's project settings
-
Clone the repository with
git clone --recursive https://github.com/nlaha/godot-midi.git
-
Make sure you have SCons installed
-
Run
cd godot-cpp
andscons target=template_debug
orscons target=template_release
to build godot-cpp -
Run
scons target=template_debug
orscons target=template_release
in the root directory to build the extension -
Copy the
game/addons/godot_midi
folder to your project's addons folder -
Enable the plugin in the Godot project settings menu
-
Import a midi file by adding it to your project folder
-
Add a "MidiPlayer" node to your scene
- Set the midi resource you want the MidiPlayer to play
-
Connect to the "note" signal in a GDScript
func _ready(): midi_player.note.connect(my_note_callback) midi_player.play() func my_note_callback(event, track): if (event['subtype'] == MIDI_MESSAGE_NOTE_ON): # note on # do something on note on elif (event['subtype'] == MIDI_MESSAGE_NOTE_OFF): # note off # do something on note off print("[Track: " + str(track) + "] Note played: " + str(event['note']))
Open the demo project for an included music visualizer script!