| Crates.io | xsynth-realtime |
| lib.rs | xsynth-realtime |
| version | 0.3.4 |
| created_at | 2024-08-06 12:11:19.296086+00 |
| updated_at | 2025-08-09 18:28:58.937757+00 |
| description | A real-time MIDI synthesizer using XSynth. |
| homepage | https://github.com/BlackMIDIDevs/xsynth |
| repository | https://github.com/BlackMIDIDevs/xsynth |
| max_upload_size | |
| id | 1327204 |
| size | 80,226 |
The real-time rendering module within XSynth. Currently it outputs audio using cpal.
It uses an asynchronous event sending system for high performance and simple to use API.
You can find all the necessary documentation about the XSynth realtime API here: https://docs.rs/xsynth-realtime.
This is a very simple example about initializing an instance of the realtime synthesizer. For other more detailed use cases, visit the examples folder.
use xsynth_realtime::{RealtimeSynth, SynthEvent, ChannelEvent, ChannelAudioEvent};
fn main() {
// Will use the default configuration and
// default audio output device
let mut synth = RealtimeSynth::open_with_all_defaults();
// Will send a note on event in channel 0
synth.send_event(SynthEvent::Channel(
0,
ChannelEvent::Audio(ChannelAudioEvent::NoteOn {
key: 60,
vel: 127,
}),
));
// Will print the active voice count
println!("Voice Count: {}", synth.get_stats().voice_count());
// The synth is automatically dropped here
}