#midi-file #bevy #sound-font #plugin #rustysynth

bevy_rustysynth

A plugin which adds MIDI file and soundfont audio support to the bevy engine via rustysynth

6 releases

0.3.0 Dec 9, 2024
0.2.1 Sep 20, 2024
0.1.2 Sep 10, 2024

#224 in Audio

Download history 317/week @ 2024-09-18 16/week @ 2024-09-25 4/week @ 2024-10-02 5/week @ 2024-10-09 1/week @ 2024-10-16 1/week @ 2024-10-30 1/week @ 2024-11-06 109/week @ 2024-12-04 56/week @ 2024-12-11 8/week @ 2024-12-18 10/week @ 2024-12-25 52/week @ 2025-01-01

176 downloads per month

0BSD OR MIT OR Apache-2.0

4MB
197 lines

bevy_rustysynth

Crates License Tag Build

A plugin which adds MIDI file and soundfont audio support to the bevy engine via rustysynth.

Compatibility

Crate Version Bevy Version
0.1-0.2 0.14

Installation

crates.io

[dependencies]
bevy_rustysynth = "0.2"

Using git URL in Cargo.toml

[dependencies.bevy_rustysynth]
git = "https://github.com/exvacuum/bevy_rustysynth.git"

Usage

In main.rs:

use bevy::prelude::*;
use bevy_rustysynth::*;

fn main() {
    App::new()
        .add_plugins((
            DefaultPlugins,
            RustySynthPlugin {
                soundfont: // Bring your own soundfont or enable the "hl4mgm" feature to use a terrible 4MB default
            }
        ))
        .run();
}

Then you can load and play a MIDI like any other audio file:

let midi_handle = asset_server.load::<MidiAudio>("example.mid");

commands.spawn(AudioSourceBundle {
    source: midi_handle,
    ..Default::default()
});

License

This crate is licensed under your choice of 0BSD, Apache-2.0, or MIT license.

Dependencies

~27–57MB
~1M SLoC