maelzel.scoring: General purpose music notation

maelzel.scoring Package

scoring

The scoring package provides functionality for representing a musical score and rendering to pdf or an image via multiple backends (lilypond, MuseScore)

scoring.core

See also

maelzel.scoring.core

The scoring.core provides the basic building blocks to define an abstract score. For scoring purposes the most basic element is the maelzel.scoring.notation.Notation. A Notation can be used to represent a Note, a Chord or a Rest. Notations can be grouped together in a maelzel.scoring.core.Part and multiple Parts form an maelzel.scoring.core.UnquantizedScore

Quantized / Unquantized

In all these cases durations are abstract and measured in quarter notes. The generated UnquantizedPart/UnquantizedScore do not have any measures or scorestructure and are not quantized to musically meaningful durations.

For quantization purposes a ScoreStruct is needed, where the structure of the score is defined (time signatures, tempi, metadata). In order to fine-tune the quantization a QuantizationProfile can be defined, or the default preset can be used. Such a QuantizationProfile allows to determine the complexity of the resulting rhythms, kinds of tuplets allowed, when to use grace-notes, etc.

Rendering

Only when an Arrangement has been quantized to a QuantizedScore it is possible to render this as pdf. The rendering process is done by first converting the quantized intermediate representation to some of the supported backend formats: lilypond or musicxml (rendered via MuseScore). Then the rendering backend is called to generate either a pdf or a png. It is also possible to export the rendered score as musicxml or even as midi.

Note

The external programs used for rendering (lilypond or MuseScore) need to be installed and present in the path. It is possible to customize the binary called when rendering in the general maelzel configuration. See Configuration

Functions

distributeNotationsByClef(notations[, ...])

rtype:

list[UnquantizedPart]

durationsCanMerge(n0, n1)

True if these Notations can be merged based on duration and start/end

fillSilences(notations[, mingap, offset])

Return a list of Notations filled with rests

makeChord(pitches, duration[, offset, ...])

Utility function to create a chord Notation

makeGroupId([parent])

Create an id to group notations together

makeNote(pitch, duration[, offset, ...])

Utility function to create a note Notation

makeRest(duration[, offset, dynamic, annotation])

Shortcut function to create a rest notation.

mergeNotations(a, b)

Merge two compatible notations to one.

mergeNotationsIfPossible(notations)

Merge the given notations into one, if possible

notationsCanMerge(n0, n1)

Returns True if n0 and n1 can be merged

notationsToCoreEvents(notations)

Convert notations to their corresponding maelzel.core Note or Chord

packInParts(notations[, maxrange, ...])

Pack a list of possibly simultaneous notations into tracks

removeSmallOverlaps(notations[, threshold])

Remove overlap between notations.

resolveOffsets(notations[, start, ...])

Fills all offsets, in place

splitNotationsAtOffsets(notations, offsets)

Split the given notations between the given offsets

tieNotations(notations)

Tie these notations inplace

Classes

NotatedDuration(base[, dots, tuplets])

Class representing the notated duration of a note

Notation(duration[, pitches, offset, ...])

This represents a notation (a rest, a note or a chord)

UnquantizedPart(notations[, name, ...])

An UnquantizedPart is a list of unquantized non-simultaneous Notation

UnquantizedScore(parts[, title])

An UnquantizedScore is a list of UnquantizedParts

Class Inheritance Diagram

digraph inheritance45da4476c7 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "NotatedDuration" [URL="api/maelzel.scoring.NotatedDuration.html#maelzel.scoring.NotatedDuration",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class representing the notated duration of a note"]; "Notation" [URL="api/maelzel.scoring.Notation.html#maelzel.scoring.Notation",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="This represents a notation (a rest, a note or a chord)"]; "UnquantizedPart" [URL="api/maelzel.scoring.UnquantizedPart.html#maelzel.scoring.UnquantizedPart",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An UnquantizedPart is a list of unquantized non-simultaneous :class:`Notation`"]; "UnquantizedScore" [URL="api/maelzel.scoring.UnquantizedScore.html#maelzel.scoring.UnquantizedScore",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An UnquantizedScore is a list of UnquantizedParts"]; }