Expand description
Parse rondocode’s rondo language and synthesize multichannel audio in native Rust.
The default build has no dependencies or audio-device requirement. Enable
bevy for RondocodePlugin and custom assets.
This is an experimental port with partial upstream compatibility. Cross-language audio parity has not been validated.
use rondorust::{Song, RenderOptions};
let song = Song::parse("bpm 120\nsynth tone\n sine\n * adsr .005 .1 .5 .1\nplay tone\n c4 e4 g4 c5")?;
let audio = song.render(RenderOptions { cycles: 2.0, ..Default::default() })?;
assert!(audio.peak() > 0.0);Modules§
- bevy
- Bevy 0.19 custom audio assets and
.rondo/.rondocodeasset loading. - pattern
- Pure cycle-based mini-notation queries. A cycle is one musical bar.
Structs§
- Audio
Buffer - Interleaved PCM. Cloning shares sample storage.
- Audio
Stream - A bounded native synthesis stream. Each item is one
[left, right]frame. - Ddsp
Frame - One audio-rate DDSP input frame. Pitch is in Hz; breath is a dB offset.
- Ddsp
Settings - Fixed DDSP options. Absent options use the host model’s upstream defaults.
- Diagnostic
- A diagnostic with a one-based source position.
- Host
Resources - Explicit resources; the core never fetches models or launches runtimes.
- Note
Event - A scheduled note. Times and durations are in seconds from playback start.
- Render
Options - Playback and offline rendering configuration. A cycle is a bar, and a tail adds silence after the final gates so effects can finish ringing.
- Sample
- Mono PCM at its original rate. Playback resamples by linear interpolation.
- Sample
Bank - Named samples, explicitly supplied by the host. Missing resources are errors.
- Scale
- A tuning specified as semitone offsets and a repeating interval.
- Singing
Request - A whole vocal phrase to bake into mono PCM before playback. Melody and lyrics use upstream mini notation; cycles determines their total duration.
- Song
- A parsed and compiled rondo score. Clones share immutable signal graphs.
Enums§
- Error
- Parsing, validation, resource, and output errors.
Traits§
- Ddsp
Factory - A host model adapter. Report all per-voice storage before it is allocated. Shared immutable model weights may be owned by the factory.
- Ddsp
Voice - A single preallocated neural voice. These methods run on the audio thread and must not allocate or block. Return finite stereo PCM.
- Singing
Renderer - Host vocal model/phrase renderer, called only during stream construction.
Functions§
- midi_
to_ frequency - note_
to_ midi - Scientific note names, including accidentals and negative octaves. Bare names default to octave four; accidentals carry across octave boundaries.
- write_
wav - Write a little-endian 16-bit multichannel RIFF/WAVE stream without a WAV dependency. Float PCM is clamped at conversion; the original buffer is unchanged.