musicscore.key

class musicscore.key.Key(fifths: int = 0, show: bool = True, *args, **kwargs)[source]

Bases: XMLWrapper

XMLClass

alias of XMLKey

to_string(*args, **kwargs) str

XMLWrapper method

Calls to_string method of self.xml_object

Returns:

musicxml snippet

property fifths: int | None

Set and get value_ of XMLFifths child object of associated XMLKey

Returns:

self.xml_object.xml_fifths.value_

property show: bool

Set and get show attribute. If False Key object is not shown.

property xml_object: XMLElement

XMLWrapper method

This musicscore class has an equivalent MusicXML class 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 of self.xml_object. It can also use the short cut attributes of XMLElement to get or set the first child.

Returns:

wrapped MusicXML element of type XMLClass