RustySynth
RustySynth is a SoundFont MIDI synthesizer written in pure Rust, ported from MeltySynth.
Features
- Suitable for both real-time and offline synthesis.
- Support for standard MIDI files.
- No dependencies other than the standard library.
Examples
An example code to synthesize a simple chord:
// Load the SoundFont.
let mut sf2 = open.unwrap;
let sound_font = new;
// Create the synthesizer.
let settings = new;
let mut synthesizer = new.unwrap;
// Play some notes (middle C, E, G).
synthesizer.note_on;
synthesizer.note_on;
synthesizer.note_on;
// The output buffer (3 seconds).
let sample_count = as usize;
let mut left: = vec!;
let mut right: = vec!;
// Render the waveform.
synthesizer.render;
Another example code to synthesize a MIDI file:
// Load the SoundFont.
let mut sf2 = open.unwrap;
let sound_font = new;
// Load the MIDI file.
let mut mid = open.unwrap;
let midi_file = new;
// Create the MIDI file sequencer.
let settings = new;
let synthesizer = new.unwrap;
let mut sequencer = new;
// Play the MIDI file.
sequencer.play;
// The output buffer.
let sample_count = as usize;
let mut left: = vec!;
let mut right: = vec!;
// Render the waveform.
sequencer.render;
Todo
- Wave synthesis
- SoundFont reader
- Waveform generator
- Envelope generator
- Low-pass filter
- Vibrato LFO
- Modulation LFO
- MIDI message processing
- Note on/off
- Bank selection
- Modulation
- Volume control
- Pan
- Expression
- Hold pedal
- Program change
- Pitch bend
- Tuning
- Effects
- Reverb
- Chorus
- Other things
- Standard MIDI file support
- Performace optimization
License
RustySynth is available under the MIT license.