A polyphonic Synth type whose multiple oscillators generate sound via amplitude and frequency envelopes.
synth.play_note((duration_in_ms, pitch_in_hz))
. Synth
will automatically find an idle Voice
to use (or retrigger the oldest one).Rust
for event in stream.by_ref() {
match event {
Event::Out(buffer) => synth.audio_requested(buffer, SETTINGS),
..
}
}
See an example here.
synth uses PortAudio as a cross-platform audio backend. The rust-portaudio dependency will first try to find an already installed version on your system before trying to download it and build PortAudio itself.
MIT - Same license as PortAudio.