musicscore.clef
- class musicscore.clef.Clef(sign: str = 'G', line: int | None = 2, octave_change: int = None, show: bool = True, default: bool = False, *args, **kwargs)[source]
Bases:
XMLWrapper- to_string(*args, **kwargs) str
XMLWrappermethodCalls
to_stringmethod of self.xml_object- Returns:
musicxml snippet
- property line: int | None
Set and get
value_ofXMLLine- Returns:
self.xml_object.xml_line.value_- Return type:
int, None
- property octave_change: int | None
Set and get
value_(int) ofXMLOctaveChangechild object of associatedXMLClefwhich indicates how many octaves must be added to get from written pitch to the sounding pitch.- Returns:
self.xml_object.xml_clef_octave_change.value_
- property sign: str | None
Set and get
value_ofXMLSignchild object of associatedXMLClef- Returns:
self.xml_object.xml_sign.value_- Return type:
str, None
- property xml_object: XMLElement
XMLWrappermethodThis musicscore class has an equivalent
MusicXMLclass which can be reached via this property.If an attribute is not found directly in the main class, it wll be passed on to
__get_attribute__or__set__attribute__methods ofself.xml_object. It can also use the short cut attributes ofXMLElementto get or set the first child.- Returns:
wrapped MusicXML element of type
XMLClass
- class musicscore.clef.TrebleClef(show: bool = True, octave_change: int | None = None, **kwargs)[source]
Bases:
Clef- Default parameters:
sign=’G’
line=2
- class musicscore.clef.AltoClef(show: bool = True, octave_change: int | None = None, **kwargs)[source]
Bases:
Clef- Default parameters:
sign=’C’
line=3