bevy_rustysynth

Crates.iobevy_rustysynth
lib.rsbevy_rustysynth
version0.6.1
created_at2024-09-09 23:14:16.864688+00
updated_at2025-08-16 18:03:51.257877+00
descriptionA plugin which adds MIDI file and soundfont audio support to the bevy engine via rustysynth.
homepage
repositoryhttps://app.radicle.xyz/nodes/seed.soaos.dev/rad:z4VSFhtipNfBxgueNyNyFA6roBxPc
max_upload_size
id1369852
size4,295,793
Silas Bartha (soaosdev)

documentation

README

bevy_rustysynth

Crates License

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

From version 0.4, the crate has undergone significant rewrites, and now works with the default bevy_audio backend (bevy_audio feature) OR bevy_kira_audio (kira feature)

Compatibility

Crate Version Bevy Version
0.6 0.16
0.5 0.15
0.2 0.14

Installation

crates.io

[dependencies]
bevy_rustysynth = "0.6"

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:

bevy_audio Example

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

commands.spawn(AudioPlayer(midi_handle));

bevy_kira_audio Example

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

audio.play(midi_handle);

License

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

Commit count: 0

cargo fmt