pub struct PlaybackEvent {
pub time_beats: f64,
pub time_secs: f64,
pub pitch_midi: u8,
pub velocity: u8,
pub duration_beats: f64,
pub duration_secs: f64,
pub pedal: bool,
pub part_index: usize,
pub channel: u8,
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§
§time_beats: f64Absolute beat position from the start of the score.
time_secs: f64Absolute time in seconds from the start of the score.
pitch_midi: u8MIDI pitch number (0–127).
velocity: u8MIDI velocity (1–127). Derived from Dynamic; defaults to 64.
Boosted by +20 for Accent / Marcato articulations (clamped to 127).
duration_beats: f64Sounding duration in beats. Halved for Staccato / Staccatissimo.
duration_secs: f64Sounding duration in seconds.
pedal: boolTrue when the note has pedal_start set (sustain pedal down).
part_index: usizeIndex of the part this event originates from (useful for per-channel MIDI routing).
channel: u8MIDI channel of the originating part (part.midi_channel). For Tone.js channel routing.
is_metronome: booltrue for metronome click events injected via MetronomeConfig.
Trait Implementations§
Source§impl Clone for PlaybackEvent
impl Clone for PlaybackEvent
Source§fn clone(&self) -> PlaybackEvent
fn clone(&self) -> PlaybackEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more