Giter VIP home page Giter VIP logo

rust-fluidsynth's Introduction

rust-fluidsynth

Build status (master)

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]
git = "https://github.com/scholtzan/rust-fluidsynth"

Short example

extern crate fluidsynth;
extern crate rand;
extern crate time;

use fluidsynth::*;
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);
    }
}

rust-fluidsynth's People

Contributors

scholtzan avatar elidupree avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.