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§
- Provenance
Pair - One bounded provenance pair: a typed key + inline value bytes.
Enums§
- Provenance
Key - The kind of provenance a
ProvenancePaircarries.
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 thesmfmodule, so it arrives asMetaEvent::Unknown.
Functions§
- extract_
smf_ provenance - Extract provenance pairs from every track of
smfintoout, in track then event order.