Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brainfoolong/gdscript-midi-parser
Godot GDScript 4+ Midi File Parser and Player
https://github.com/brainfoolong/gdscript-midi-parser
gdscript godot midi parser player
Last synced: about 2 months ago
JSON representation
Godot GDScript 4+ Midi File Parser and Player
- Host: GitHub
- URL: https://github.com/brainfoolong/gdscript-midi-parser
- Owner: brainfoolong
- License: mit
- Created: 2023-12-28T12:31:15.000Z (almost 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-27T12:51:18.000Z (11 months ago)
- Last Synced: 2024-05-02T05:26:05.717Z (8 months ago)
- Topics: gdscript, godot, midi, parser, player
- Language: GDScript
- Homepage:
- Size: 48.8 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Godot GDScript 4+ Midi File Parser and Player
Parse your midi files directly with native GDScript 4+ with no other dependencies. The example also include a demo of how you can create a sound player based on the parsed midi data.
## Install
Clone/Download this repository into your project.## Usage
```python
var parser = MidiFileParser.load_file("res://yourmidi.mid")
# parser.header contains midi header data
# parser.tracks contains all midi tracks## iterate over tracks and events
for track in parser.tracks:
for event in track.events:
# do something with events here
```
## Playback DemoSee `midi_file_player_example.gd` or load and play scene `demo/midi_demo`.
It will contain all required parts (timing, _process loop) to play notes at correct times.
The demo uses a very simple generic audio signal generator. Quality is not good but frequencies are correct. It will play "Beethoven - Fur Elise", which you will know for sure.