pub enum Clef {
Treble,
Bass,
Alto,
Tenor,
Percussion,
Treble8vb,
Treble8va,
Bass8vb,
Bass8va,
Soprano,
MezzoSoprano,
Baritone,
}Variants§
Treble
Bass
Alto
Tenor
Percussion
Treble8vb
Treble clef with an 8 below: sounds an octave lower (tenor voice, guitar).
Treble8va
Treble clef with an 8 above: sounds an octave higher.
Bass8vb
Bass clef with an 8 below: sounds an octave lower (contrabass, bass guitar).
Bass8va
Bass clef with an 8 above: sounds an octave higher.
Soprano
C clef on the bottom line.
MezzoSoprano
C clef on the second line.
Baritone
C clef on the top line.
Implementations§
Source§impl Clef
impl Clef
pub fn to_musicxml_sign(&self) -> &'static str
pub fn musicxml_line(&self) -> u8
Sourcepub fn octave_change(&self) -> i8
pub fn octave_change(&self) -> i8
Octaves the music sounds above (+) or below (−) the written notes: the small 8 on the
clef (MusicXML <clef-octave-change>, MEI @clef.dis/@dis.place).
Sourcepub fn without_octave(&self) -> Clef
pub fn without_octave(&self) -> Clef
The clef without its octave mark.
Sourcepub fn from_sign(
sign: &str,
line: Option<u8>,
octave_change: i8,
) -> Option<Clef>
pub fn from_sign( sign: &str, line: Option<u8>, octave_change: i8, ) -> Option<Clef>
The clef for a sign (G, F, C, percussion), a staff line (1 = bottom) and an
octave change (±1), as MusicXML, MEI and MuseScore describe clefs. None for
combinations the model does not have (French violin clef, a 15ma clef, sub-bass clef).
Sourcepub fn from_name(name: &str) -> Option<Clef>
pub fn from_name(name: &str) -> Option<Clef>
The clef named as in score JSON ("Treble", "Treble8vb", "MezzoSoprano", …).
Sourcepub fn middle_line_midi(&self) -> u8
pub fn middle_line_midi(&self) -> u8
MIDI note number of the middle staff line (used for stem direction heuristics).