Skip to main content

Module smf_provenance

Module smf_provenance 

Source
Expand description

Extract provenance (key, value) pairs from a parsed Standard MIDI File for NQuin emission.

Lane AU-MIDI-BRIDGE. Walks a parsed SmfFile’s meta-events and lifts the human-meaningful provenance — track names, tempo, time signature, key signature, sequence number, and the copyright notice — into a bounded, Copy, heap-free ProvenancePair the graph layer can turn into NQuins. Reuses the existing crate::midi::smf model; it parses nothing itself.

§Epistemic contract — SMF provenance is AUTHORITATIVE

An SMF is authored / imported content, so its embedded metadata (who named the track, the declared tempo, the copyright holder) is an authoritative assertion by the file’s author — not a transcription proposal. These pairs are safe to record as stated provenance; they carry no confidence because none is implied.

Zero-heap: pairs are written into the caller-supplied out slice; each pair stores its value inline in a fixed MAX_PROV_VALUE-byte buffer (longer text is truncated).

Structs§

ProvenancePair
One bounded provenance pair: a typed key + inline value bytes.

Enums§

ProvenanceKey
The kind of provenance a ProvenancePair carries.

Constants§

MAX_PROV_VALUE
Maximum inline value length. Track-name / copyright text longer than this is truncated; all structured values (tempo, time/key signature, sequence number) fit comfortably.
META_COPYRIGHT
SMF copyright-notice meta type (0xFF 0x02); not structurally decoded by the smf module, so it arrives as MetaEvent::Unknown.

Functions§

extract_smf_provenance
Extract provenance pairs from every track of smf into out, in track then event order.