music21.musicxml.mxObjects¶
This module defines an object representation of MusicXML, used for converting to and from MusicXML and music21.
Functions¶
-
music21.musicxml.mxObjects.
booleanToYesNo
(value)¶
-
music21.musicxml.mxObjects.
yesNoToBoolean
(value)¶
Accidental¶
-
class
music21.musicxml.mxObjects.
Accidental
¶
Accidental
bases
MusicXMLElement
XMLNode
Accidental
read/write properties
Read/write properties inherited from XMLNode
:
|
Accidental
methods
Methods inherited from XMLNode
:
|
|
|
AccidentalMark¶
-
class
music21.musicxml.mxObjects.
AccidentalMark
(type=None)¶ Used inside an ornament definition; chardata holds the accidental type
AccidentalMark
bases
MusicXMLElement
XMLNode
AccidentalMark
read/write properties
Read/write properties inherited from XMLNode
:
|
AccidentalMark
methods
Methods inherited from XMLNode
:
|
|
|
ArticulationMark¶
-
class
music21.musicxml.mxObjects.
ArticulationMark
(tag)¶ This is not an XML object, but a container for all XML articulation tags.
ArticulationMark
bases
MusicXMLElement
XMLNode
ArticulationMark
read/write properties
Read/write properties inherited from XMLNode
:
|
ArticulationMark
methods
Methods inherited from XMLNode
:
|
|
|
Articulations¶
-
class
music21.musicxml.mxObjects.
Articulations
(type=None)¶
Articulations
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Articulations
read/write properties
Read/write properties inherited from XMLNode
:
|
Articulations
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Attributes¶
-
class
music21.musicxml.mxObjects.
Attributes
¶
Attributes
bases
MusicXMLElement
XMLNode
Attributes
read/write properties
Read/write properties inherited from XMLNode
:
|
Attributes
methods
-
Attributes.
setDefaultDivisions
()¶ Utility to just set the divisions parameters
-
Attributes.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
Backup¶
-
class
music21.musicxml.mxObjects.
Backup
(type=None)¶
Backup
bases
MusicXMLElement
XMLNode
Backup
read/write properties
Read/write properties inherited from XMLNode
:
|
Backup
methods
Methods inherited from XMLNode
:
|
|
|
Barline¶
-
class
music21.musicxml.mxObjects.
Barline
¶
Barline
bases
MusicXMLElement
XMLNode
Barline
read/write properties
Read/write properties inherited from XMLNode
:
|
Barline
methods
Methods inherited from XMLNode
:
|
|
|
Bass¶
-
class
music21.musicxml.mxObjects.
Bass
¶ A root defines a pitch, with a step and an alter
Bass
bases
MusicXMLElement
XMLNode
Bass
read/write properties
Read/write properties inherited from XMLNode
:
|
Bass
methods
Methods inherited from XMLNode
:
|
|
|
Beam¶
-
class
music21.musicxml.mxObjects.
Beam
¶ Beams are specified is individual objects for each beam, in order, where the beam number refers to its duration representation (8th, 16th, etc) and its character data specifies whether it is begin/continue/end (for normal beams) or backward hook/forward wook (for beams that do not continue are attached only to the staff). These character data values can be mixed: one beam can continue while another can hook or end.
1 = 8th 2 = 16th 3 = 32th 4 = 64th 5 = 128th 6 = 256th
From musicxml.xsd:
Beam values include begin, continue, end, forward hook, and backward hook. Up to six concurrent beam levels are available to cover up to 256th notes. The repeater attribute, used for tremolos, needs to be specified with a “yes” value for each beam using it. Beams that have a begin value can also have a fan attribute to indicate accelerandos and ritardandos using fanned beams. The fan attribute may also be used with a continue value if the fanning direction changes on that note. The value is “none” if not specified.
Note that the beam number does not distinguish sets of beams that overlap, as it does for slur and other elements. Beaming groups are distinguished by being in different voices and/or the presence or absence of grace and cue
Beam
bases
MusicXMLElement
XMLNode
Beam
read/write properties
Read/write properties inherited from XMLNode
:
|
Beam
methods
Methods inherited from XMLNode
:
|
|
|
BeatType¶
-
class
music21.musicxml.mxObjects.
BeatType
(charData=None)¶
BeatType
bases
MusicXMLElement
XMLNode
BeatType
read/write properties
Read/write properties inherited from XMLNode
:
|
BeatType
methods
Methods inherited from XMLNode
:
|
|
|
BeatUnit¶
-
class
music21.musicxml.mxObjects.
BeatUnit
(charData=None)¶ Part of <metronome> tags
BeatUnit
bases
MusicXMLElement
XMLNode
BeatUnit
read/write properties
Read/write properties inherited from XMLNode
:
|
BeatUnit
methods
Methods inherited from XMLNode
:
|
|
|
BeatUnitDot¶
-
class
music21.musicxml.mxObjects.
BeatUnitDot
¶ Part of <metronome> tags
BeatUnitDot
bases
MusicXMLElement
XMLNode
BeatUnitDot
read/write properties
Read/write properties inherited from XMLNode
:
|
BeatUnitDot
methods
Methods inherited from XMLNode
:
|
|
|
Beats¶
-
class
music21.musicxml.mxObjects.
Beats
(charData=None)¶
Beats
bases
MusicXMLElement
XMLNode
Beats
read/write properties
Read/write properties inherited from XMLNode
:
|
Beats
methods
Methods inherited from XMLNode
:
|
|
|
Bracket¶
-
class
music21.musicxml.mxObjects.
Bracket
(type=None)¶ >>> b = musicxml.mxObjects.Bracket() >>> b.tag 'bracket'
Bracket
bases
MusicXMLElement
XMLNode
Bracket
read/write properties
Read/write properties inherited from XMLNode
:
|
Bracket
methods
Methods inherited from XMLNode
:
|
|
|
Clef¶
-
class
music21.musicxml.mxObjects.
Clef
¶
Clef
bases
MusicXMLElement
XMLNode
Clef
read/write properties
Read/write properties inherited from XMLNode
:
|
Clef
methods
-
Clef.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
Coda¶
-
class
music21.musicxml.mxObjects.
Coda
(type=None)¶
Coda
bases
MusicXMLElement
XMLNode
Coda
read/write properties
Read/write properties inherited from XMLNode
:
|
Coda
methods
Methods inherited from XMLNode
:
|
|
|
Creator¶
-
class
music21.musicxml.mxObjects.
Creator
¶
Creator
bases
MusicXMLElement
XMLNode
Creator
read/write properties
Read/write properties inherited from XMLNode
:
|
Creator
methods
-
Creator.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
Credit¶
-
class
music21.musicxml.mxObjects.
Credit
¶ The credit tag stores on or more credit-words tags, defining text positioned on a page.
Credit
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Credit
read/write properties
Read/write properties inherited from XMLNode
:
|
Credit
methods
-
Credit.
setDefaults
()¶
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
CreditWords¶
-
class
music21.musicxml.mxObjects.
CreditWords
(charData=None)¶
CreditWords
bases
MusicXMLElement
XMLNode
CreditWords
read/write properties
Read/write properties inherited from XMLNode
:
|
CreditWords
methods
-
CreditWords.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
Dashes¶
-
class
music21.musicxml.mxObjects.
Dashes
(type=None)¶ >>> d = musicxml.mxObjects.Dashes() >>> d.tag 'dashes'
Dashes
bases
MusicXMLElement
XMLNode
Dashes
read/write properties
Read/write properties inherited from XMLNode
:
|
Dashes
methods
Methods inherited from XMLNode
:
|
|
|
Defaults¶
-
class
music21.musicxml.mxObjects.
Defaults
¶
Defaults
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Defaults
read/write properties
Read/write properties inherited from XMLNode
:
|
Defaults
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Degree¶
-
class
music21.musicxml.mxObjects.
Degree
¶ The degree type is used to add, alter, or subtract individual notes in the chord.
Degree
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Degree
read/write properties
Read/write properties inherited from XMLNode
:
|
Degree
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
DegreeAlter¶
-
class
music21.musicxml.mxObjects.
DegreeAlter
¶ Chromatic alteration of current degree
DegreeAlter
bases
MusicXMLElement
XMLNode
DegreeAlter
read/write properties
Read/write properties inherited from XMLNode
:
|
DegreeAlter
methods
Methods inherited from XMLNode
:
|
|
|
DegreeType¶
-
class
music21.musicxml.mxObjects.
DegreeType
¶ addition, alteration, subtraction relative to the kind of current chord
DegreeType
bases
MusicXMLElement
XMLNode
DegreeType
read/write properties
Read/write properties inherited from XMLNode
:
|
DegreeType
methods
Methods inherited from XMLNode
:
|
|
|
DegreeValue¶
-
class
music21.musicxml.mxObjects.
DegreeValue
¶ Stores 1 for root, 3 for third, etc
DegreeValue
bases
MusicXMLElement
XMLNode
DegreeValue
read/write properties
Read/write properties inherited from XMLNode
:
|
DegreeValue
methods
Methods inherited from XMLNode
:
|
|
|
DelayedTurn¶
-
class
music21.musicxml.mxObjects.
DelayedTurn
(type=None)¶
DelayedTurn
bases
MusicXMLElement
XMLNode
DelayedTurn
read/write properties
Read/write properties inherited from XMLNode
:
|
DelayedTurn
methods
Methods inherited from XMLNode
:
|
|
|
Direction¶
-
class
music21.musicxml.mxObjects.
Direction
¶ One or more Direction objects are found in measures, after an attributes object. Within the Direction object may be a number of objects, including DirectionType, Sound.
Direction
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Direction
read/write properties
Read/write properties inherited from XMLNode
:
|
Direction
methods
-
Direction.
getBracket
()¶ Search this direction and determine if it contains a segno mark.
>>> a = musicxml.mxObjects.Direction() >>> b = musicxml.mxObjects.DirectionType() >>> c = musicxml.mxObjects.Bracket() >>> b.append(c) >>> a.append(b) >>> a.getBracket() is not None True
-
Direction.
getCoda
()¶ Search this direction and determine if it contains a coda mark.
>>> a = musicxml.mxObjects.Direction() >>> b = musicxml.mxObjects.DirectionType() >>> c = musicxml.mxObjects.Coda() >>> b.append(c) >>> a.append(b) >>> a.getCoda() is not None True
-
Direction.
getDashes
()¶ Search this direction and determine if it contains a segno mark.
>>> a = musicxml.mxObjects.Direction() >>> b = musicxml.mxObjects.DirectionType() >>> c = musicxml.mxObjects.Dashes() >>> b.append(c) >>> a.append(b) >>> a.getDashes() is not None True
-
Direction.
getDynamicMark
()¶ Search this direction and determine if it contains a dynamic mark, return, otherwise, return None
>>> a = musicxml.mxObjects.Direction() >>> b = musicxml.mxObjects.DirectionType() >>> c = musicxml.mxObjects.Dynamics() >>> d = musicxml.mxObjects.DynamicMark('f') >>> c.append(d) >>> b.append(c) >>> a.append(b) >>> a.getDynamicMark() is not None True
-
Direction.
getMetronome
()¶ Search this direction and determine if it contains a dynamic mark.
>>> a = musicxml.mxObjects.Direction() >>> b = musicxml.mxObjects.DirectionType() >>> c = musicxml.mxObjects.Metronome() >>> b.append(c) >>> a.append(b) >>> a.getMetronome() is not None True
-
Direction.
getSegno
()¶ Search this direction and determine if it contains a segno mark.
>>> a = musicxml.mxObjects.Direction() >>> b = musicxml.mxObjects.DirectionType() >>> c = musicxml.mxObjects.Segno() >>> b.append(c) >>> a.append(b) >>> a.getSegno() is not None True
-
Direction.
getWedge
()¶ Search this direction and determine if it contains a dynamic mark.
>>> a = musicxml.mxObjects.Direction() >>> b = musicxml.mxObjects.DirectionType() >>> c = musicxml.mxObjects.Wedge('crescendo') >>> b.append(c) >>> a.append(b) >>> a.getWedge() is not None True
-
Direction.
getWords
()¶ Search this direction and determine if it contains a Words entity.
>>> a = musicxml.mxObjects.Direction() >>> b = musicxml.mxObjects.DirectionType() >>> c = musicxml.mxObjects.Words('crescendo') >>> b.append(c) >>> a.append(b) >>> a.getWords() == [c] True >>> a.getWords()[0].charData 'crescendo'
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
DirectionType¶
-
class
music21.musicxml.mxObjects.
DirectionType
¶ DirectionType stores objects like Pedal, dynamics, wedge, and words
DirectionType
bases
MusicXMLElementList
MusicXMLElement
XMLNode
DirectionType
read/write properties
Read/write properties inherited from XMLNode
:
|
DirectionType
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
DisplayOctave¶
-
class
music21.musicxml.mxObjects.
DisplayOctave
(type=None)¶
DisplayOctave
bases
MusicXMLElement
XMLNode
DisplayOctave
read/write properties
Read/write properties inherited from XMLNode
:
|
DisplayOctave
methods
Methods inherited from XMLNode
:
|
|
|
DisplayStep¶
-
class
music21.musicxml.mxObjects.
DisplayStep
(type=None)¶
DisplayStep
bases
MusicXMLElement
XMLNode
DisplayStep
read/write properties
Read/write properties inherited from XMLNode
:
|
DisplayStep
methods
Methods inherited from XMLNode
:
|
|
|
Dot¶
-
class
music21.musicxml.mxObjects.
Dot
(type=None)¶
Dot
bases
MusicXMLElement
XMLNode
Dot
read/write properties
Read/write properties inherited from XMLNode
:
|
Dot
methods
Methods inherited from XMLNode
:
|
|
|
DynamicMark¶
-
class
music21.musicxml.mxObjects.
DynamicMark
(tag)¶ This is not an XML object in the normal sense, but a container for all XML dynamic tags. Dynamic tags have no attributes or elements. Tags inlcude common marks such as p, pp, ff, etc.
DynamicMark
bases
MusicXMLElement
XMLNode
DynamicMark
read/write properties
Read/write properties inherited from XMLNode
:
|
DynamicMark
methods
Methods inherited from XMLNode
:
|
|
|
Dynamics¶
-
class
music21.musicxml.mxObjects.
Dynamics
(type=None)¶
Dynamics
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Dynamics
read/write properties
Read/write properties inherited from XMLNode
:
|
Dynamics
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Encoding¶
-
class
music21.musicxml.mxObjects.
Encoding
¶
Encoding
bases
MusicXMLElement
XMLNode
Encoding
read/write properties
Read/write properties inherited from XMLNode
:
|
Encoding
methods
Methods inherited from XMLNode
:
|
|
|
Ending¶
-
class
music21.musicxml.mxObjects.
Ending
¶ Ending tags are stored in Barline tags to indicate the start ane end of a repeat bracket, used to designate an alternate repeat.
Ending
bases
MusicXMLElement
XMLNode
Ending
read/write properties
Read/write properties inherited from XMLNode
:
|
Ending
methods
Methods inherited from XMLNode
:
|
|
|
Fermata¶
-
class
music21.musicxml.mxObjects.
Fermata
(type=None)¶
Fermata
bases
MusicXMLElement
XMLNode
Fermata
read/write properties
Read/write properties inherited from XMLNode
:
|
Fermata
methods
Methods inherited from XMLNode
:
|
|
|
Forward¶
-
class
music21.musicxml.mxObjects.
Forward
(type=None)¶
Forward
bases
MusicXMLElement
XMLNode
Forward
read/write properties
Read/write properties inherited from XMLNode
:
|
Forward
methods
Methods inherited from XMLNode
:
|
|
|
Glissando¶
-
class
music21.musicxml.mxObjects.
Glissando
(type=None)¶ >>> g = musicxml.mxObjects.Glissando() >>> g.tag 'glissando'
Glissando
bases
MusicXMLElement
XMLNode
Glissando
read/write properties
Read/write properties inherited from XMLNode
:
|
Glissando
methods
Methods inherited from XMLNode
:
|
|
|
Grace¶
-
class
music21.musicxml.mxObjects.
Grace
(type=None)¶
Grace
bases
MusicXMLElement
XMLNode
Grace
read/write properties
Read/write properties inherited from XMLNode
:
|
Grace
methods
Methods inherited from XMLNode
:
|
|
|
Harmony¶
-
class
music21.musicxml.mxObjects.
Harmony
¶ A harmony tag stores a root, kind – eventually becomes converted to a music21 ChordSymbol object (not Harmony; though ChordSymbol is a subclass of the music21 object called Harmony, which also deals with Figured bass and Roman Numerals.
Harmony
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Harmony
read/write properties
Read/write properties inherited from XMLNode
:
|
Harmony
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Identification¶
-
class
music21.musicxml.mxObjects.
Identification
¶
Identification
bases
MusicXMLElement
XMLNode
Identification
read/write properties
Read/write properties inherited from XMLNode
:
|
Identification
methods
-
Identification.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
InvertedMordent¶
-
class
music21.musicxml.mxObjects.
InvertedMordent
(type=None)¶
InvertedMordent
bases
MusicXMLElement
XMLNode
InvertedMordent
read/write properties
Read/write properties inherited from XMLNode
:
|
InvertedMordent
methods
Methods inherited from XMLNode
:
|
|
|
InvertedTurn¶
-
class
music21.musicxml.mxObjects.
InvertedTurn
(type=None)¶
InvertedTurn
bases
MusicXMLElement
XMLNode
InvertedTurn
read/write properties
Read/write properties inherited from XMLNode
:
|
InvertedTurn
methods
Methods inherited from XMLNode
:
|
|
|
Key¶
-
class
music21.musicxml.mxObjects.
Key
¶
Key
bases
MusicXMLElement
XMLNode
Key
read/write properties
Read/write properties inherited from XMLNode
:
|
Key
methods
-
Key.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
KeyAlter¶
-
class
music21.musicxml.mxObjects.
KeyAlter
¶
KeyAlter
bases
MusicXMLElement
XMLNode
KeyAlter
read/write properties
Read/write properties inherited from XMLNode
:
|
KeyAlter
methods
Methods inherited from XMLNode
:
|
|
|
KeyOctave¶
-
class
music21.musicxml.mxObjects.
KeyOctave
¶
KeyOctave
bases
MusicXMLElement
XMLNode
KeyOctave
read/write properties
Read/write properties inherited from XMLNode
:
|
KeyOctave
methods
Methods inherited from XMLNode
:
|
|
|
KeyStep¶
-
class
music21.musicxml.mxObjects.
KeyStep
¶
KeyStep
bases
MusicXMLElement
XMLNode
KeyStep
read/write properties
Read/write properties inherited from XMLNode
:
|
KeyStep
methods
Methods inherited from XMLNode
:
|
|
|
Kind¶
-
class
music21.musicxml.mxObjects.
Kind
¶ A harmony tag stores a root, kind
Kind
bases
MusicXMLElement
XMLNode
Kind
read/write properties
Read/write properties inherited from XMLNode
:
|
Kind
methods
Methods inherited from XMLNode
:
|
|
|
Lyric¶
-
class
music21.musicxml.mxObjects.
Lyric
(number=None)¶ Multiple Lyric objects can be defined within a single Note.
Lyric
bases
MusicXMLElement
XMLNode
Lyric
read/write properties
Read/write properties inherited from XMLNode
:
|
Lyric
methods
-
Lyric.
filterLyric
(text)¶ Remove and fix character strings that cause problems in MusicXML
Methods inherited from XMLNode
:
|
|
|
MIDIInstrument¶
-
class
music21.musicxml.mxObjects.
MIDIInstrument
¶
MIDIInstrument
bases
MusicXMLElement
XMLNode
MIDIInstrument
read/write properties
Read/write properties inherited from XMLNode
:
|
MIDIInstrument
methods
Methods inherited from XMLNode
:
|
|
|
Measure¶
-
class
music21.musicxml.mxObjects.
Measure
¶
Measure
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Measure
read/write properties
Read/write properties inherited from XMLNode
:
|
Measure
methods
-
Measure.
getVoiceCount
()¶ Return the number of voices defined in this Measure; this must be called after update().
-
Measure.
getVoiceIndices
()¶ Return a list of unique sorted voice ids.
-
Measure.
setDefaults
()¶
-
Measure.
update
()¶ This method looks at all note, forward, and backup objects and updates divisons and attributes references
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
MeasureStyle¶
-
class
music21.musicxml.mxObjects.
MeasureStyle
¶
MeasureStyle
bases
MusicXMLElement
XMLNode
MeasureStyle
read/write properties
Read/write properties inherited from XMLNode
:
|
MeasureStyle
methods
Methods inherited from XMLNode
:
|
|
|
Metronome¶
-
class
music21.musicxml.mxObjects.
Metronome
(charData=None)¶ A direction type used to store tempo indications, consisting of a <beat-unit> tag (a duration) as well as a <per-unit> tag (a number). Also used to store metric modulations.
>>> m = musicxml.mxObjects.Metronome() >>> bu1 = musicxml.mxObjects.BeatUnit('half') >>> m.append(bu1) >>> m.isMetricModulation() False
Metronome
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Metronome
read/write properties
Read/write properties inherited from XMLNode
:
|
Metronome
methods
-
Metronome.
isMetricModulation
()¶ Return True if this Metronome defines a metric modulation. If there are more than on <beat-unit> tag, than this is True
>>> m = musicxml.mxObjects.Metronome() >>> bu1 = musicxml.mxObjects.BeatUnit('half') >>> bu2 = musicxml.mxObjects.BeatUnit('quarter') >>> m.append(bu1) >>> m.append(bu2) >>> m.isMetricModulation() True
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Mordent¶
-
class
music21.musicxml.mxObjects.
Mordent
(type=None)¶
Mordent
bases
MusicXMLElement
XMLNode
Mordent
read/write properties
Read/write properties inherited from XMLNode
:
|
Mordent
methods
Methods inherited from XMLNode
:
|
|
|
MusicXMLElement¶
-
class
music21.musicxml.mxObjects.
MusicXMLElement
¶ MusicXML elements are an abstraction of MusicXML into an object oriented framework. Some, not all, of MusicXML elements are represented as objects. Some sub-elements are much more simply placed as attributes of parent objects. These simple elements have only a tag and character data. Elements that have attributes and/or sub-elements, however, must be represented as objects.
MusicXMLElement
bases
XMLNode
MusicXMLElement
read/write properties
Read/write properties inherited from XMLNode
:
|
MusicXMLElement
methods
Methods inherited from XMLNode
:
|
|
|
MusicXMLElementList¶
-
class
music21.musicxml.mxObjects.
MusicXMLElementList
¶ - MusicXML that is designed to function as a list. In general,
- this is an element this only used to contain other Elements. List operations permit easy access and manipuation.
Note that design here mirrors that of node.py NodeList, but this needs to be a subclass of of MusicXMLElement
MusicXMLElementList
bases
MusicXMLElement
XMLNode
MusicXMLElementList
read/write properties
Read/write properties inherited from XMLNode
:
|
MusicXMLElementList
methods
-
MusicXMLElementList.
append
(item)¶
-
MusicXMLElementList.
insert
(position, item)¶
Methods inherited from XMLNode
:
|
|
|
Notations¶
-
class
music21.musicxml.mxObjects.
Notations
(type=None)¶ Notations contains many elements, including Ornaments. Most of these are stored in the .componentList
Notations
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Notations
read/write properties
Read/write properties inherited from XMLNode
:
|
Notations
methods
-
Notations.
getArticulations
()¶ A quick way to get all articulations objects; there may be more than one.
Returns a list of ArticulationMark objects
-
Notations.
getFermatas
()¶ Get all Fermatas from the componentList as a list
-
Notations.
getGlissandi
()¶ Get all glissandi objects stored on components. There can be more than one.
>>> g1 = musicxml.mxObjects.Glissando() >>> g2 = musicxml.mxObjects.Glissando() >>> n = musicxml.mxObjects.Notations() >>> n.append(g1) >>> n.append(g2) >>> n.getGlissandi() [<glissando >, <glissando >]
-
Notations.
getOrnaments
()¶ Get all ornament objects stored on componentList. There can be more than one.
-
Notations.
getSlurs
()¶ Get all Slurs from the componentList as a list
-
Notations.
getTechnical
()¶ A quick way to get all technical objects; there may be more than one.
Returns a list of TechnicalMark objects
-
Notations.
getTieds
()¶ A quick way to get all tied objects; there is likely only one, but we return a list anyhow.
-
Notations.
getTremolos
()¶ Get one or more tremolo line objects Stored in Ornaments
>>> t = musicxml.mxObjects.Tremolo() >>> o = musicxml.mxObjects.Ornaments() >>> n = musicxml.mxObjects.Notations() >>> o.append(t) >>> n.append(o) >>> n.getTremolos() [<tremolo >]
-
Notations.
getTuplets
()¶ A quick way to get all tuplets; there is likely only one, but we return a list anyhow.
-
Notations.
getWavyLines
()¶ Get one or more wavy line objects Stored in Ornaments
>>> wl = musicxml.mxObjects.WavyLine() >>> o = musicxml.mxObjects.Ornaments() >>> n = musicxml.mxObjects.Notations() >>> o.append(wl) >>> n.append(o) >>> n.getWavyLines() [<wavy-line >]
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Note¶
-
class
music21.musicxml.mxObjects.
Note
¶
Note
bases
MusicXMLElement
XMLNode
Note
read/write properties
Read/write properties inherited from XMLNode
:
|
Note
methods
-
Note.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
Notehead¶
-
class
music21.musicxml.mxObjects.
Notehead
(type=None)¶
Notehead
bases
MusicXMLElement
XMLNode
Notehead
read/write properties
Read/write properties inherited from XMLNode
:
|
Notehead
methods
Methods inherited from XMLNode
:
|
|
|
OctaveShift¶
-
class
music21.musicxml.mxObjects.
OctaveShift
(type=None)¶ >>> os = musicxml.mxObjects.OctaveShift() >>> os.tag 'octave-shift'
OctaveShift
bases
MusicXMLElement
XMLNode
OctaveShift
read/write properties
Read/write properties inherited from XMLNode
:
|
OctaveShift
methods
Methods inherited from XMLNode
:
|
|
|
Offset¶
-
class
music21.musicxml.mxObjects.
Offset
(charData=None)¶ A musicxml <offset> element can be found defined in the <direction> element. the charData stores a number that is the shift in divisions from the location of the tag.
Offset
bases
MusicXMLElement
XMLNode
Offset
read/write properties
Read/write properties inherited from XMLNode
:
|
Offset
methods
Methods inherited from XMLNode
:
|
|
|
Ornaments¶
-
class
music21.musicxml.mxObjects.
Ornaments
(type=None)¶ The Ornaments tag wraps the following musicxml entities: trill-mark, turn, delayed-turn, inverted-turn, shake, wavy-line, mordent, inverted mordent, schleifer, tremolo, other-ornament.
Ornaments are stored on the notations object.
Ornaments
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Ornaments
read/write properties
Read/write properties inherited from XMLNode
:
|
Ornaments
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
PageLayout¶
-
class
music21.musicxml.mxObjects.
PageLayout
¶
PageLayout
bases
MusicXMLElementList
MusicXMLElement
XMLNode
PageLayout
read/write properties
Read/write properties inherited from XMLNode
:
|
PageLayout
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
PageMargins¶
-
class
music21.musicxml.mxObjects.
PageMargins
¶
PageMargins
bases
MusicXMLElement
XMLNode
PageMargins
read/write properties
Read/write properties inherited from XMLNode
:
|
PageMargins
methods
Methods inherited from XMLNode
:
|
|
|
Part¶
-
class
music21.musicxml.mxObjects.
Part
¶ This assumes a part-wise part
Part
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Part
read/write properties
Read/write properties inherited from XMLNode
:
|
Part
methods
-
Part.
getStavesCount
()¶ Look ahead into the measure Attributes and return the highest number of staves used in this part.
-
Part.
setDefaults
()¶
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
PartGroup¶
-
class
music21.musicxml.mxObjects.
PartGroup
¶ The PartGroup tag is stored in the PartList, intermingled with ScorePart tags and other definitions.
PartGroup
bases
MusicXMLElement
XMLNode
PartGroup
read/write properties
Read/write properties inherited from XMLNode
:
|
PartGroup
methods
-
PartGroup.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
PartList¶
-
class
music21.musicxml.mxObjects.
PartList
¶ The PartList defines the parts, as well as their names and abbreviations.
It stores the parts in its .componentList list in order.
Additionally, the order of this list is used as a way specifying arrangements of brackets and/or braces that group parts in partGroup objects.
The order of this list thus matters.
The PartList for a score is usually accessed from the
Score
(musicxml.Score) object’s .partListObj parameter.
PartList
bases
MusicXMLElementList
MusicXMLElement
XMLNode
PartList
read/write properties
Read/write properties inherited from XMLNode
:
|
PartList
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
PerMinute¶
-
class
music21.musicxml.mxObjects.
PerMinute
(charData=None)¶ Part of <metronome> tags
PerMinute
bases
MusicXMLElement
XMLNode
PerMinute
read/write properties
Read/write properties inherited from XMLNode
:
|
PerMinute
methods
Methods inherited from XMLNode
:
|
|
|
Pitch¶
-
class
music21.musicxml.mxObjects.
Pitch
¶
Pitch
bases
MusicXMLElement
XMLNode
Pitch
read/write properties
Read/write properties inherited from XMLNode
:
|
Pitch
methods
-
Pitch.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
Print¶
-
class
music21.musicxml.mxObjects.
Print
¶
Print
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Print
read/write properties
Read/write properties inherited from XMLNode
:
|
Print
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Repeat¶
-
class
music21.musicxml.mxObjects.
Repeat
¶
Repeat
bases
MusicXMLElement
XMLNode
Repeat
read/write properties
Read/write properties inherited from XMLNode
:
|
Repeat
methods
Methods inherited from XMLNode
:
|
|
|
Rest¶
-
class
music21.musicxml.mxObjects.
Rest
(type=None)¶
Rest
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Rest
read/write properties
Read/write properties inherited from XMLNode
:
|
Rest
methods
-
Rest.
setDefaults
()¶
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Root¶
-
class
music21.musicxml.mxObjects.
Root
¶ A root defines a pitch, with a step and an alter
Root
bases
MusicXMLElement
XMLNode
Root
read/write properties
Read/write properties inherited from XMLNode
:
|
Root
methods
Methods inherited from XMLNode
:
|
|
|
Scaling¶
-
class
music21.musicxml.mxObjects.
Scaling
¶
Scaling
bases
MusicXMLElement
XMLNode
Scaling
read/write properties
Read/write properties inherited from XMLNode
:
|
Scaling
methods
Methods inherited from XMLNode
:
|
|
|
Schleifer¶
-
class
music21.musicxml.mxObjects.
Schleifer
(type=None)¶
Schleifer
bases
MusicXMLElement
XMLNode
Schleifer
read/write properties
Read/write properties inherited from XMLNode
:
|
Schleifer
methods
Methods inherited from XMLNode
:
|
|
|
Score¶
-
class
music21.musicxml.mxObjects.
Score
(m21Version=None)¶ Score is used to collect score header elements and, if available, all other MusicXML data. Score can be used for partwise or timewise scores. This object includes all MusicXML score information.
Score
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Score
read/write properties
Read/write properties inherited from XMLNode
:
|
Score
methods
-
Score.
getPart
(partId)¶ Get a part, given an id.
>>> from music21.musicxml import testPrimitive >>> from music21.musicxml import xmlHandler >>> b = xmlHandler.Document() >>> b.read(testPrimitive.ALL[0]) >>> spIdList = sorted(list(b.score.partIdToNameDict().keys())) >>> c = b.score.getPart(spIdList[0]) >>> c <part id=P1 <measure number=1 width=983 <print <system-layout... >>> isinstance(c, musicxml.mxObjects.Part) True >>> isinstance(c, stream.Part) False
-
Score.
getPartGroupData
()¶ Get part groups organized by part id in dictionaries.
Returns a list of dictionaries, each dictionary containing number, a list of part ids, and a mx PartGroup object.
-
Score.
getPartIds
()¶ A quick way to get all valid part ids in the componentList
-
Score.
getPartIdsFromPartListObj
()¶ A quick way to get all valid part ids in the partListObj for each one that is a ScorePart
-
Score.
getScorePart
(partId)¶ Get an instrument, as defined in a ScorePart object, from a Score.
>>> a = musicxml.mxObjects.Score() >>> a.setDefaults() >>> a.getScorePart('P3') == None True
>>> from music21.musicxml import testPrimitive >>> from music21.musicxml import xmlHandler >>> b = xmlHandler.Document() >>> b.read(testPrimitive.pitches01a) >>> spIdList = sorted(list(b.score.partIdToNameDict().keys())) >>> b.score.getScorePart(spIdList[0]) <score-part id=P1 part-name=MusicXML Part>
-
Score.
partIdToNameDict
()¶ A quick way to get a mapping of valid part ids to the part names from a
Score
(musicxml.Score) object in the .partListObj property.Returns a dictionary mapping part id to part-name for each
ScorePart
in .partListObj.Note that dictionaries are not sorted, so the order of .partListObj still needs to be used.
-
Score.
setDefaults
()¶
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
ScoreInstrument¶
-
class
music21.musicxml.mxObjects.
ScoreInstrument
¶
ScoreInstrument
bases
MusicXMLElement
XMLNode
ScoreInstrument
read/write properties
Read/write properties inherited from XMLNode
:
|
ScoreInstrument
methods
Methods inherited from XMLNode
:
|
|
|
ScorePart¶
-
class
music21.musicxml.mxObjects.
ScorePart
¶ Lives in a PartList
ScorePart
bases
MusicXMLElement
XMLNode
ScorePart
read/write properties
Read/write properties inherited from XMLNode
:
|
ScorePart
methods
-
ScorePart.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
Segno¶
-
class
music21.musicxml.mxObjects.
Segno
(type=None)¶
Segno
bases
MusicXMLElement
XMLNode
Segno
read/write properties
Read/write properties inherited from XMLNode
:
|
Segno
methods
Methods inherited from XMLNode
:
|
|
|
Shake¶
-
class
music21.musicxml.mxObjects.
Shake
(type=None)¶
Shake
bases
MusicXMLElement
XMLNode
Shake
read/write properties
Read/write properties inherited from XMLNode
:
|
Shake
methods
Methods inherited from XMLNode
:
|
|
|
Slur¶
-
class
music21.musicxml.mxObjects.
Slur
¶
Slur
bases
MusicXMLElement
XMLNode
Slur
read/write properties
Read/write properties inherited from XMLNode
:
|
Slur
methods
Methods inherited from XMLNode
:
|
|
|
Software¶
-
class
music21.musicxml.mxObjects.
Software
¶ Defines the Software that created this MusicXML document.
Software
bases
MusicXMLElement
XMLNode
Software
read/write properties
Read/write properties inherited from XMLNode
:
|
Software
methods
-
Software.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
Sound¶
-
class
music21.musicxml.mxObjects.
Sound
(charData=None)¶ A direction type used to store a large variety of performance indications.
These tags seem to be found most often in <direction> tags, usually following a symbolic definition. For example, MetronomeMark definitions are often followed by a <sound> definition.
Other <sound> tags are found after the <attributes> tag in a measure, often defining tempo.
Sound
bases
MusicXMLElement
XMLNode
Sound
read/write properties
Read/write properties inherited from XMLNode
:
|
Sound
methods
Methods inherited from XMLNode
:
|
|
|
StaffDetails¶
-
class
music21.musicxml.mxObjects.
StaffDetails
¶
StaffDetails
bases
MusicXMLElement
XMLNode
StaffDetails
read/write properties
Read/write properties inherited from XMLNode
:
|
StaffDetails
methods
Methods inherited from XMLNode
:
|
|
|
StaffLayout¶
-
class
music21.musicxml.mxObjects.
StaffLayout
¶
StaffLayout
bases
MusicXMLElementList
MusicXMLElement
XMLNode
StaffLayout
read/write properties
Read/write properties inherited from XMLNode
:
|
StaffLayout
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
Supports¶
-
class
music21.musicxml.mxObjects.
Supports
¶ Defines what sorts of notation this encoding supports
Supports
bases
MusicXMLElement
XMLNode
Supports
read/write properties
Read/write properties inherited from XMLNode
:
|
Supports
methods
Methods inherited from XMLNode
:
|
|
|
SystemLayout¶
-
class
music21.musicxml.mxObjects.
SystemLayout
¶
SystemLayout
bases
MusicXMLElementList
MusicXMLElement
XMLNode
SystemLayout
read/write properties
Read/write properties inherited from XMLNode
:
|
SystemLayout
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
SystemMargins¶
-
class
music21.musicxml.mxObjects.
SystemMargins
¶
SystemMargins
bases
MusicXMLElement
XMLNode
SystemMargins
read/write properties
Read/write properties inherited from XMLNode
:
|
SystemMargins
methods
Methods inherited from XMLNode
:
|
|
|
Tag¶
-
class
music21.musicxml.mxObjects.
Tag
(tag, cdFlag=False, className=None)¶ Object to store tags as encountered by SAX. Tags can be open or closed based on the status attribute. Tags can store character data collected between their defined tags.
These objects are used only for finding and collecting tag attributes and elements. As we do not need character data for all tags, tags have an optional flag to select if the are to collect character data.
Tag
bases
Tag
methods
-
Tag.
clear
()¶
-
Tag.
end
()¶
-
Tag.
start
()¶
TagLib¶
-
class
music21.musicxml.mxObjects.
TagLib
¶ An object to store all MusicXML tags as
Tag
objects. Tag objects are used just to identify tags, store element contents and status in SAX parsing.With this design some tags (called simple elements) can be used simply in SAX parsing as structural monitors, but not be instantiated as objects for content delivery.
TagLib
methods
-
TagLib.
audit
()¶ A way to check for errors in SAX parsing. Assumes that all start() calls have been paired with an end() call, and that all element data has been cleared.
-
TagLib.
getClassName
(key)¶ Get the class or name, or None if none defined.
>>> tl = musicxml.mxObjects.TagLib() >>> tl.getClassName('voice')
-
TagLib.
keys
()¶
-
TagLib.
statClear
()¶
-
TagLib.
statRun
()¶
Technical¶
-
class
music21.musicxml.mxObjects.
Technical
(type=None)¶ Class for the <technical> musicxml mark which contains things like <up-bow> etc. objects
Technical
bases
MusicXMLElementList
MusicXMLElement
XMLNode
Technical
read/write properties
Read/write properties inherited from XMLNode
:
|
Technical
methods
Methods inherited from MusicXMLElementList
:
Methods inherited from XMLNode
:
|
|
|
TechnicalMark¶
-
class
music21.musicxml.mxObjects.
TechnicalMark
(tag)¶ This is not an XML object, but a container for all XML technical tags.
TechnicalMark
bases
MusicXMLElement
XMLNode
TechnicalMark
read/write properties
Read/write properties inherited from XMLNode
:
|
TechnicalMark
methods
Methods inherited from XMLNode
:
|
|
|
Tie¶
-
class
music21.musicxml.mxObjects.
Tie
(type=None)¶
Tie
bases
MusicXMLElement
XMLNode
Tie
read/write properties
Read/write properties inherited from XMLNode
:
|
Tie
methods
Methods inherited from XMLNode
:
|
|
|
Tied¶
-
class
music21.musicxml.mxObjects.
Tied
¶
Tied
bases
MusicXMLElement
XMLNode
Tied
read/write properties
Read/write properties inherited from XMLNode
:
|
Tied
methods
Methods inherited from XMLNode
:
|
|
|
Time¶
-
class
music21.musicxml.mxObjects.
Time
¶
Time
bases
MusicXMLElement
XMLNode
Time
read/write properties
Read/write properties inherited from XMLNode
:
|
Time
methods
-
Time.
setDefaults
()¶
Methods inherited from XMLNode
:
|
|
|
TimeModification¶
-
class
music21.musicxml.mxObjects.
TimeModification
¶
TimeModification
bases
MusicXMLElement
XMLNode
TimeModification
read/write properties
Read/write properties inherited from XMLNode
:
|
TimeModification
methods
Methods inherited from XMLNode
:
|
|
|
Transpose¶
-
class
music21.musicxml.mxObjects.
Transpose
¶
Transpose
bases
MusicXMLElement
XMLNode
Transpose
read/write properties
Read/write properties inherited from XMLNode
:
|
Transpose
methods
Methods inherited from XMLNode
:
|
|
|
Tremolo¶
-
class
music21.musicxml.mxObjects.
Tremolo
(type=None)¶ Tremolo may or may not extend over multiple notes. Char data may store integer number.
Tremolo
bases
MusicXMLElement
XMLNode
Tremolo
read/write properties
Read/write properties inherited from XMLNode
:
|
Tremolo
methods
Methods inherited from XMLNode
:
|
|
|
TrillMark¶
-
class
music21.musicxml.mxObjects.
TrillMark
(type=None)¶
TrillMark
bases
MusicXMLElement
XMLNode
TrillMark
read/write properties
Read/write properties inherited from XMLNode
:
|
TrillMark
methods
Methods inherited from XMLNode
:
|
|
|
Tuplet¶
-
class
music21.musicxml.mxObjects.
Tuplet
¶ Stored in notations object and governs presentation and bracket.
Tuplet
bases
MusicXMLElement
XMLNode
Tuplet
read/write properties
Read/write properties inherited from XMLNode
:
|
Tuplet
methods
Methods inherited from XMLNode
:
|
|
|
Turn¶
-
class
music21.musicxml.mxObjects.
Turn
(type=None)¶
Turn
bases
MusicXMLElement
XMLNode
Turn
read/write properties
Read/write properties inherited from XMLNode
:
|
Turn
methods
Methods inherited from XMLNode
:
|
|
|
WavyLine¶
-
class
music21.musicxml.mxObjects.
WavyLine
(type=None)¶ A wavy line that extends across many notes or measures.
>>> wl = musicxml.mxObjects.WavyLine() >>> wl.tag 'wavy-line'
WavyLine
bases
MusicXMLElement
XMLNode
WavyLine
read/write properties
Read/write properties inherited from XMLNode
:
|
WavyLine
methods
Methods inherited from XMLNode
:
|
|
|
Wedge¶
-
class
music21.musicxml.mxObjects.
Wedge
(type=None)¶ >>> w = musicxml.mxObjects.Wedge() >>> w.tag 'wedge'
Wedge
bases
MusicXMLElement
XMLNode
Wedge
read/write properties
Read/write properties inherited from XMLNode
:
|
Wedge
methods
Methods inherited from XMLNode
:
|
|
|
Words¶
-
class
music21.musicxml.mxObjects.
Words
(charData=None)¶ A direction type that can be used for arbitrary text expressions, and font formatting
Words
bases
MusicXMLElement
XMLNode
Words
read/write properties
Read/write properties inherited from XMLNode
:
|
Words
methods
Methods inherited from XMLNode
:
|
|
|