pub struct Part {
pub id: String,
pub name: String,
pub short_name: String,
pub staves: Vec<Staff>,
pub midi_channel: u8,
pub midi_program: u8,
pub midi_pitch_bends: Vec<MidiPitchBend>,
pub midi_control_changes: Vec<MidiControlChange>,
pub midi_program_changes: Vec<MidiProgramChange>,
pub midi_aftertouch: Vec<MidiAftertouch>,
pub percussion_instruments: Vec<PercussionInstrument>,
pub staff_groups: Vec<StaffGroup>,
}Fields§
§id: String§name: String§short_name: String§staves: Vec<Staff>§midi_channel: u8MIDI channel (0–15). Channel 9 is conventionally used for percussion.
midi_program: u8General MIDI program number (0–127). Default 0 = Acoustic Grand Piano.
midi_pitch_bends: Vec<MidiPitchBend>MIDI pitch-bend events preserved from interchange input, in canonical 480 PPQ ticks.
midi_control_changes: Vec<MidiControlChange>MIDI Control Change events preserved from interchange input, in canonical 480 PPQ ticks.
midi_program_changes: Vec<MidiProgramChange>MIDI Program Change events preserved from interchange input, in canonical 480 PPQ ticks.
midi_aftertouch: Vec<MidiAftertouch>MIDI key/channel aftertouch events preserved from interchange input, in canonical 480 PPQ ticks.
percussion_instruments: Vec<PercussionInstrument>MusicXML score-instrument definitions for note-level instrument IDs.
staff_groups: Vec<StaffGroup>MEI/MuseScore staff-group structure within this part.
Implementations§
Source§impl Part
impl Part
pub fn new(name: &str, short_name: &str) -> Self
Sourcepub fn percussion_instrument_for_note(
&self,
note: &Note,
) -> Option<&PercussionInstrument>
pub fn percussion_instrument_for_note( &self, note: &Note, ) -> Option<&PercussionInstrument>
Resolve the declared percussion instrument for an unpitched note.
An explicit MusicXML instrument@id always takes precedence. When no
identifier is attached, the retained display-key MIDI value is matched
against the part’s declared midi_unpitched entries. This deliberately
does not invent a sound identity for an unpitched note with no matching
declaration.