tinytones
tinytones is a #![no_std] Rust crate for defining and playing musical tones and melodies in embedded systems. It provides:
- Enum-based musical pitches from C0 to B8
- Standard and dotted note durations
- Frequency access as
u32orf64 - Iterator for (pitch, duration) tone playback
Predefined tones in the crate
The crate includes a few predefined melodies for convenience:
use ;
let song = new;
for in song.iter
Definiting your own Tone
You can define your own melody using the provided Pitch and Duration enums:
use ;
let melody = Melody;
let tempo = 120;
let tone = new;
for in tone.iter