Skip to main content

qualia_audio/midi/bridge/
mod.rs

1//! Bridge — reconcile transcription, authored MIDI, the sequencer, and the
2//! sonic-token transport. Re-exports only (AU-MIDI-BRIDGE).
3//!
4//! This lane wires already-built pieces together without reimplementing them:
5//!
6//! - [`note_events_to_timed`] — transcribed [`crate::features::pitch_midi::NoteEvent`]
7//!   PROPOSALS → sequencer [`crate::midi::sequencer::TimedEvent`] note-on/off pairs.
8//! - [`pair_note_events`] — a timed MIDI stream (sequencer / flattened SMF track,
9//!   AUTHORITATIVE) → whole [`PairedNote`]s.
10//! - [`midi_to_sonic_token`] / [`sonic_token_to_midi`] — canonical
11//!   [`crate::midi::message::MidiMessage`] ↔ a packed `u64` `SonicToken()`-shaped
12//!   word mirroring core-db's `net/sonic_token.rs`.
13//! - [`extract_smf_provenance`] — a parsed [`crate::midi::smf::SmfFile`] → bounded
14//!   [`ProvenancePair`]s for NQuin emission.
15//!
16//! Epistemic distinction preserved throughout: transcribed MIDI is a *proposal*
17//! (carries confidence at its source), authored / imported SMF MIDI is
18//! *authoritative*. See each submodule's docs.
19
20pub mod from_pitch_midi;
21pub mod smf_provenance;
22pub mod sonic_token;
23pub mod to_note_events;
24
25pub use from_pitch_midi::{
26    note_events_to_timed, NOTE_OFF_VELOCITY, PROPOSAL_CHANNEL, PROPOSAL_NOTE,
27};
28pub use smf_provenance::{
29    extract_smf_provenance, ProvenanceKey, ProvenancePair, MAX_PROV_VALUE, META_COPYRIGHT,
30};
31pub use sonic_token::{midi_to_sonic_token, sonic_token_to_midi, SonicEventType, SONIC_MAGIC};
32pub use to_note_events::{pair_note_events, PairedNote, MAX_OPEN_NOTES};