pymusicxml.spanners.StartTrill¶
-
class
pymusicxml.spanners.
StartTrill
(id: Any = 1, placement: Union[pymusicxml.enums.StaffPlacement, str] = 'above', accidental: Union[pymusicxml.enums.AccidentalType, str] = None)[source]¶ Bases:
pymusicxml.score_components.Notation
,pymusicxml.score_components.StartNumberedSpanner
Starts a trill spanner with a wavy line.
- Parameters
id – each spanner is given an id to distinguish it from other spanners of the same type. In the MusicXML standard, this is a number from 1 to 6, but in pymusicxml it is allowed to be anything (including, for instance, a string). These ids are then converted to numbers on export.
placement – Where to place the direction in relation to the staff (“above” or “below”)
accidental – Accidental annotation to go on the trill (“flat-flat”, “flat”, “natural”, “sharp”, or “double-sharp”)
Methods
render
()Renders this component to a tuple of ElementTree.Element.
Inherited Methods
export_to_file
(file_path[, pretty_print])Exports this musical object (wrapped as a score) to the given file path.
to_xml
([pretty_print])Renders this component to MusicXML, adding a version tag, but not wrapping it up as a full score.
view_in_software
(command)Uses the given terminal command to create a score out of this musical object, and open it in music notation software.
Wraps this component in a
Score
so that it can be exported and viewedAttributes
-
render
() → Sequence[xml.etree.ElementTree.Element][source]¶ Renders this component to a tuple of ElementTree.Element. (The reason for making it a tuple is that musical objects like chords are represented by several notes side by side, with all but the first containing a </chord> tag.)
-
MID_TYPES
: Sequence[pymusicxml.score_components.MidNumberedSpanner] = ()¶
-
export_to_file
(file_path: str, pretty_print: bool = True) → None¶ Exports this musical object (wrapped as a score) to the given file path.
- Parameters
file_path – The path of the file we want to write to.
pretty_print – If True, breaks the MusicXML onto multiple lines, with indentation
-
to_xml
(pretty_print: bool = False) → str¶ Renders this component to MusicXML, adding a version tag, but not wrapping it up as a full score.
- Parameters
pretty_print – If True, breaks the MusicXML onto multiple lines, with indentation
-
view_in_software
(command: str) → None¶ Uses the given terminal command to create a score out of this musical object, and open it in music notation software.
- Parameters
command – The terminal command corresponding to the software with which we want to open the score.
-
wrap_as_score
() → pymusicxml.score_components.Score¶ Wraps this component in a
Score
so that it can be exported and viewed