Module containing all of the classes representing the hierarchy of a musical score.


BarRest(bar_length, …)

Class representing a bar rest.


Special duration object used for bar rests.

BeamedGroup(*args, **kwds)

Represents a group of notes/chords/rests joined under a single beam.

Chord(pitches, str]], duration, str, float], …)

Class representing a chord.

Clef(sign, line, octaves_transposition)

Class representing a musical clef

Direction(placement, …)

Abstract base class for musical directions, such as text and metronome marks.

Duration(note_type, num_dots, tuplet_ratio)

Represents a length that can be written as a single note or rest.


Abstract base class for all objects that have duration within a measure.

GraceChord(pitches, str]], duration, str, …)

Subclass of Chord representing a durationless grace chord.

GraceNote(pitch, str], duration, str, …[, …])

Subclass of Note representing a durationless grace note.

Measure(*args, **kwds)

Class representing a measure of music, perhaps with multiple voices.


Abstract base class for the middle of a Direction or Notation that spans multiple time-points.


Abstract base class for start and stop multi glisses


Abstract base class of all musical objects, providing functionality for rendering and exporting to a file.

MusicXMLContainer(*args, **kwds)

Base class for all musical objects that contain other musical objects, such as Part, Measure, and Tuplet.


Abstract base class for MusicXML Notations (glissandi, slurs).

Note(pitch, str], duration, str, float], ties)

Class representing a single, pitched note.

Notehead(notehead_name, filled)

Class representing a notehead type.


Abstract base class for part of a Direction or Notation that spans multiple time-points.

Part(*args, **kwds)

Represents a musical part/staff.

PartGroup(*args, **kwds)

Represents a part group (a group of related parts, possible connected by a bracket)

Pitch(step, octave, alteration)

Class representing a notated musical pitch.

Rest(duration, str, float], notations, str, …)

Class representing a notated rest.

Score(*args, **kwds)

Class representing a full musical score


Abstract base class for the start of a Direction or Notation that spans multiple time-points.


Abstract base class for the end of a Direction or Notation that spans multiple time-points.

Tuplet(*args, **kwds)

Represents a tuplet; same as a BeamedGroup, but with a particular time ratio associated with it.


pad_with_rests(components, desired_length)

Appends rests to a list of components to fill out the desired length