Skip to main content

Module from_pitch_midi

Module from_pitch_midi 

Source
Expand description

Convert transcribed pitch→MIDI NoteEvent proposals into sequencer TimedEvent note-on / note-off pairs.

Lane AU-MIDI-BRIDGE. This reconciles two already-built pieces without reimplementing either: crate::features::pitch_midi::NoteEvent (the output of segment_notes / audio_to_midi) and crate::midi::sequencer::TimedEvent (the sequencer’s timeline event currency).

§Epistemic contract — these events are PROPOSALS

Every TimedEvent this function emits derives from a transcribed NoteEvent, which carries a per-note voicing confidence and is a proposal, never an authoritative transcription. TimedEvent is a bare (tick, status, data1, data2) POD with no room for confidence, so the proposal status cannot travel inside the event — it is a property of the path: anything produced by note_events_to_timed is proposal-grade and must be treated as such downstream (weighted, reviewed, or rejected on the originating note’s confidence). This is the opposite of events flattened from an authored/imported SMF via super::to_note_events, which are AUTHORITATIVE. See PROPOSAL_NOTE.

Zero-heap: note-on/off events are written into the caller-supplied out slice; the function allocates nothing.

Constants§

NOTE_OFF_VELOCITY
Release velocity written into the generated note-off events.
PROPOSAL_CHANNEL
The MIDI channel transcribed proposals are placed on. Transcription has no channel concept, so a single default channel is used.
PROPOSAL_NOTE
Human-readable statement of the epistemic status of every event this module emits, for surfacing in provenance / UI. Transcribed MIDI is a proposal.

Functions§

note_events_to_timed
Convert transcribed NoteEvent proposals into paired note-on / note-off TimedEvents on the sequencer timeline.