abc-note-stream is a tiny no_std parser for the ABC music notation. It reads a static ABC tune definition and produces an iterator of note events that can be consumed by microcontroller audio tasks (PWM, DAC, etc.).
The library was originally extracted from the papajbadge-rs firmware and focuses on very small targets where heap allocations and floating point math are unavailable.
no_stdcompatible API that only depends oncore.- Parses the tune header (
L:andM:) and exposes basic validation errors. - Iterates over the body to emit frequency/duration pairs ready for playback.
- Designed to be extended with additional ornaments, accidentals, or scales as the player evolves.
use abc_note_stream::AbcIter;
static TUNE: &[u8] = br#"
X:1
T:Barka
M:6/8
L:1/8
K:C
C6 | A3 A3- | AAB cBA | G3 G3- | G3 F2 E | F3 F3- | FFG AGF | E3 E3- |
E3 C2 C | A3 A3- | AAB cBA | G3 G3- | G3 F2 E | F3 F3- | FDE FED | C6 |
"#;
let iter = AbcIter::new(TUNE, 320).expect("valid header");
for event in iter {
// Drive your PWM/DAC here using event.freq and event.duration
}The parser currently supports a subset of the ABC specification (C major/A minor scale without ornaments).
MIT. See LICENSE.