A MIDI file importer for Godot 3.x
This plugin aims to make rythm game development and music syncing easier than ever before. Simply import a midi file like you would any other godot asset and it will get converted to an animation, this animation can then be paired with a "MidiManager" node that sends out signals every time a midi event is fired. This project is a work in progress and is lacking some features, so feel free to contribute any code or ideas over on the pull requests page.
GodotMidi makes it easy to sync midi files to their corresponding rendered audio, just add an audio stream to the auto-generated audio stream player (a child of MidiManager) and it will play when the midi file starts.
-
Download the latest release over at https://github.com/nlaha/GodotMidi/releases
-
Extract it to your
res://addons/
folder such thatGodotMidi.cs
is located atres://addons/GodotMidi/GodotMidi.cs
-
Enable the plugin in the godot project settings menu
-
Import a midi file by adding it to your project folder
-
Add a "MidiManager" node to your scene, it will automatically add an AnimationPlayer as well
NOTE: MidiManager must be under the root of your scene, do not put it as a child of any other node
- Select the animation player and click the animation button to load an animation resource into the player
- Browse to your midi file location, if the import worked correctly, it should be selectable as an animation resource just like a normal animation would.
- Have fun! The animation player should work just as a normal animation player would, each green dot corresponds to a MIDI event and a function call to
NoteEventInput(...)
in the MidiManager node.
Simply create a method in your script with the following signature:
void NoteEvent(int note, int data, MidiEventNote.NoteType type, int track)
{
}
Similarily in GDScript (not tested)
note_event(note, data, type, track):
# my cool midi thing
Don't forget to link your function to the signal emitted by the MidiManager node!
- Track names should display somehow in the animation window
- Support entire MIDI specification (SMPTE division type, weird events, different file modes)
- Marker support
- Audio playback with synthesizer? (low priority)