Skip to main content

PlaybackEvent

Struct PlaybackEvent 

Source
pub struct PlaybackEvent {
Show 21 fields pub address: Option<String>, pub source: Option<NoteAddr>, pub source_voice_number: Option<u32>, pub time_beats: f64, pub time_secs: f64, pub pitch_midi: u8, pub pitch_midi_cents: i32, pub pitch_bend_curve: Vec<GuitarBendPoint>, pub post_note_pause_beats: f64, pub articulations: Vec<Articulation>, pub chord_symbol: Option<ChordSymbol>, pub guitar_technique: Option<GuitarTechnique>, pub velocity: u8, pub duration_beats: f64, pub duration_secs: f64, pub pedal: bool, pub part_index: usize, pub channel: u8, pub program: u8, pub instrument_id: Option<String>, pub is_metronome: bool,
}
Expand description

A single sounding event suitable for audio playback engines (e.g. Web Audio, Tone.js).

Grace notes and rests are excluded. Chords are expanded to one event per pitch.

Fields§

§address: Option<String>

Stable source note address (part:staff:measure:voice:note), or None for metronome events. Chord pitches share the address of their source note.

§source: Option<NoteAddr>

Typed source address for notation hosts; None for metronome events.

§source_voice_number: Option<u32>

Original MusicXML voice number when the source used a non-default identifier. source remains the stable four-slot canonical address used by editing APIs.

§time_beats: f64

Absolute beat position from the start of the score.

§time_secs: f64

Absolute time in seconds from the start of the score.

§pitch_midi: u8

MIDI pitch number (0–127).

§pitch_midi_cents: i32

Exact sounding pitch in hundredths of a MIDI semitone.

pitch_midi is retained as a compatibility convenience for integer-MIDI hosts; microtonal-capable hosts should use this field.

§pitch_bend_curve: Vec<GuitarBendPoint>

Authored normalized pitch-bend curve for a bend-capable host. Each point is relative to pitch_midi_cents and positioned within this event’s sounding duration. Empty means the event has no authored continuous bend.

§post_note_pause_beats: f64

Authored pause requested after this note by a breath mark or caesura. The host decides how to realize the silence while preserving this deterministic beat-domain contract.

§articulations: Vec<Articulation>

Authored articulation and ornament marks for a provider to interpret. The core schedule deliberately does not invent auxiliary pitches for trill, mordent, or turn.

§chord_symbol: Option<ChordSymbol>

Authored chord symbol at this note position. It is a semantic cue for accompaniment or harmonic playback providers; acorde does not invent accompaniment notes.

§guitar_technique: Option<GuitarTechnique>

Authored guitar playing technique, when present. Providers may map this stable semantic value to keyswitches or synthesis behavior without score re-parsing.

§velocity: u8

MIDI velocity (1–127). Derived from Dynamic; defaults to 64. Boosted by +20 for Accent / Marcato articulations (clamped to 127).

§duration_beats: f64

Sounding duration in beats. Halved for Staccato / Staccatissimo.

§duration_secs: f64

Sounding duration in seconds.

§pedal: bool

True when the note has pedal_start set (sustain pedal down).

§part_index: usize

Index of the part this event originates from (useful for per-channel MIDI routing).

§channel: u8

MIDI channel of the originating part (part.midi_channel). For Tone.js channel routing.

§program: u8

Effective General MIDI program after applying any measure-local instrument change.

§instrument_id: Option<String>

Stable effective instrument ID when the part or measure declares one.

§is_metronome: bool

true for metronome click events injected via MetronomeConfig.

Trait Implementations§

Source§

impl Clone for PlaybackEvent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlaybackEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PlaybackEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PlaybackEvent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for PlaybackEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PlaybackEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.