fluidsynth-ng

Crates.iofluidsynth-ng
lib.rsfluidsynth-ng
version0.1.0
created_at2025-10-31 10:26:32.005268+00
updated_at2025-10-31 10:26:32.005268+00
descriptionFluidSynth bindings
homepage
repositoryhttps://github.com/AaronDewes/rust-fluidsynth
max_upload_size
id1909838
size73,152
Aaron Dewes (AaronDewes)

documentation

README

rust-fluidsynth

A fork of rust-fluidsynth, adjusted for modern FluidSynth.

Note: This project is currently not under active development. Not all functionality to use fluidsynth is available yet. Nevertheless, feel free to fork and and send pull requests with additional functionality or bug fixes.

FluidSynth bindings for Rust.

Bindings for FluidSynth, a software synthesizer based on the SoundFont 2 specifications, in Rust.

FluidSynth website here. A documentation of the FluidSynth API is available here.

Installation

To use rust-fluidsynth you must install FluidSynth on your computer and add this to Cargo.toml:

[dependencies.fluidsynth-ng]
git = "https://github.com/AaronDewes/rust-fluidsynth"

Short example

use fluidsynth_ng::*;
use rand::{thread_rng, Rng};
use std::thread;

fn main() {
    let mut settings = settings::Settings::new();
    let mut syn = synth::Synth::new(&mut settings);
    let _adriver = audio::AudioDriver::new(&mut settings, &mut syn);
    syn.sfload("/path/to/soundfont.sf2", 1);

    let interval = Duration::milliseconds(1000);

    for _x in 0..12 {
        let num: i32 = thread_rng().gen_range(0, 12);
        let key = 60 + num;
        syn.noteon(0, key, 80);
        thread::sleep_ms(1000);
        syn.noteoff(0, key);
    }
}
Commit count: 0

cargo fmt