pub struct Staff {
pub clef: Clef,
pub measures: Vec<Measure>,
pub transpose_semitones: i8,
pub tablature: Option<TablatureConfig>,
pub presentation: StaffPresentation,
}Fields§
§clef: Clef§measures: Vec<Measure>§transpose_semitones: i8Semitones to add to written pitch for concert pitch / MIDI output. -2 = Bb instrument (clarinet, trumpet), -9 = Eb instrument (alto sax), etc.
tablature: Option<TablatureConfig>§presentation: StaffPresentationImplementations§
Source§impl Staff
impl Staff
Sourcepub fn meter_at<'a>(
&'a self,
measure_index: usize,
default: &'a TimeSignature,
) -> &'a TimeSignature
pub fn meter_at<'a>( &'a self, measure_index: usize, default: &'a TimeSignature, ) -> &'a TimeSignature
The meter in force at measure_index: that bar’s time signature or the last one before
it, else default (the score’s). A bar without its own signature continues the meter
of the change before it, not the score’s opening one.
Sourcepub fn measure_beats(
&self,
measure_index: usize,
default: &TimeSignature,
) -> f64
pub fn measure_beats( &self, measure_index: usize, default: &TimeSignature, ) -> f64
A bar’s length in beats: its actual_length, else the meter in force there.
pub fn new(clef: Clef) -> Self
Sourcepub fn tablature_at(&self, measure_index: usize) -> Option<TablatureConfig>
pub fn tablature_at(&self, measure_index: usize) -> Option<TablatureConfig>
Resolve the tablature tuning and capo active at a physical measure.
A measure-local change starts at its own boundary and continues until replaced or cleared. Line-count changes are rejected by validation so the staff geometry remains stable within a system.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Staff
impl<'de> Deserialize<'de> for Staff
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Staff
impl RefUnwindSafe for Staff
impl Send for Staff
impl Sync for Staff
impl Unpin for Staff
impl UnsafeUnpin for Staff
impl UnwindSafe for Staff
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more