Skip to main content

qualia_audio/midi/smf/
mod.rs

1//! Standard MIDI File (formats 0/1/2) read/write + tempo map. Re-exports only.
2//!
3//! Lane AU-MIDI-FILE. Native, dependency-free SMF I/O under the Qualia ABI:
4//!
5//! - [`read_smf`] parses an SMF byte buffer into an [`SmfFile`] (expanding
6//!   running status); [`write_smf`] serializes it back with deterministic,
7//!   round-trippable bytes.
8//! - [`build_tempo_map`] / [`TempoMap`] convert ticks ↔ seconds given the file's
9//!   [`Division`].
10//! - [`read_vlq`] / [`write_vlq`] and [`parse_meta`] / [`serialize_meta`] are the
11//!   low-level codecs.
12
13mod meta_event;
14mod read;
15mod tempo_map;
16mod vlq;
17mod write;
18
19pub use meta_event::{
20    parse_meta, serialize_meta, MetaEvent, META_END_OF_TRACK, META_KEY_SIGNATURE,
21    META_SEQUENCE_NUMBER, META_TEMPO, META_TIME_SIGNATURE, META_TRACK_NAME,
22};
23pub use read::{read_smf, Division, Event, SmfFile, Track, TrackEvent};
24pub use tempo_map::{build_tempo_map, TempoEntry, TempoMap, DEFAULT_US_PER_QUARTER};
25pub use vlq::{read_vlq, write_vlq, VLQ_MAX};
26pub use write::write_smf;