maelzel.core.symbols Module

Notation can be customized by adding so called Symbols to an object. Symbols are objects which can be attached to a note, chord, voice, etc. to modify its representation as musical notation.

Most symbols do not have any other meaning than to indicate how a certain object should be displayed as notation. In particular, they do not affect playback in any way. For example a Notehead symbol can be attached to a note to modify the notehead shape used, a Color can be attached to a voice to modify the color of all its items, a Clef can be added to a note to force a clef change at that particular moment, etc.

There are basically three kind of symbols: properties, note-attached symbols and spanners.

Property

A property modifies an attribute of the object it is attached to. For example, a SizeFactor property modifies the size of the object and, if the object is a container (a voice, for example), then all elements within that container are modified.

Functions

abstractmethod(funcobj)

A decorator indicating abstract methods.

knownSymbols()

rtype:

set[str]

makeKnownSymbol(name)

Create a symbol from a known name

makeSpanner(descr[, kind, linetype, ...])

Create a spanner from a descriptor

makeSymbol(clsname, *args, **kws)

Construct a Symbol from the symbol name and any values and/or keywords passed

parseAddSymbol(args, kws)

Parses the input of addSymbol

Classes

ABC()

Helper class that provides a standard way to create an ABC using inheritance.

Accidental([hidden, parenthesis, color, ...])

Customizes the accidental of a note

Articulation(kind[, color, placement])

Represents a note attached articulation

Beam([kind, uuid, linetype, placement, color])

Notes within a Beam spanner are beamed together

BeamBreak([location])

Symbolizes a syncopation (beam) break at the given location or at the given note

Bend(alter)

A (post) bend with an alteration up or down

Bracket([kind, uuid, linetype, placement, text])

Breath([kind, visible])

A breathmark symbol, will also break the beam at the given instant

Clef(kind)

An explicit clef sign

Color(color)

Customizes the color of an object

Dynamic(kind[, force, placement])

A notation only dynamic

EventSymbol([color, placement])

Base-class for all event-attached symbols

F

alias of Fraction

Fermata([kind])

A Fermata sign over a note

Fingering(finger)

A fingering attached to a note

GlissProperties([linetype, color, hidden])

Customizes properties of a glissando

Gracenote([slash])

Customizes properties of a gracenote

Hairpin(direction[, niente, kind, uuid, ...])

A hairpin crescendo or decrescendo

Harmonic([kind, interval])

A natural/artificial harmonic, or a sound-pitch flageolet

Hidden([color])

A hidden property can be attached to note to hide it

LineSpan([kind, uuid, linetype, placement, ...])

A line spanner

NoMerge([color, placement])

A note marked with this symbol will not be merged to a previous note

NotatedPitch(pitch)

Allows to customize the notated pitch of a note

Notehead([shape, color, parenthesis, size, ...])

Customizes the notehead shape, color, parenthesis and size

NoteheadAttachedSymbol([color, placement])

Symbols attached to a notehead (a pitch)

NoteheadLine([kind, uuid, color, linetype, text])

A line conecting two noteheads

OctaveShift([kind, octaves, uuid])

An octave shift

Ornament(kind)

Note-attached ornament (trill, mordent, prall, etc.)

Property([color])

A property is a modifier of an object itself (like a color or a size)

SizeFactor(size)

Sets the size of an object (as a factor of default size)

Slur([kind, uuid, linetype, placement, color])

A slur spanner between two notes

Spanner([kind, uuid, linetype, placement, color])

A Spanner is a line/curve between two anchors (notes/chords/rests)

Stem([hidden, color])

Customize the stem of a note

Symbol([color])

Base class for all symbols

Text(text[, placement, fontsize, italic, ...])

A note attached text expression

Transpose(interval)

Apply a transposition for notation only

Tremolo([tremtype, nummarks, relative])

A stem-attached tremolo sign

TrillLine([kind, startmark, trillpitch, ...])

Trill spanner between two notes.

VoiceSymbol([color])

Symbols which can be attached to a voice

Class Inheritance Diagram

digraph inheritance0141aa2047 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Accidental" [URL="api/maelzel.core.symbols.Accidental.html#maelzel.core.symbols.Accidental",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="Customizes the accidental of a note"]; "NoteheadAttachedSymbol" -> "Accidental" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Articulation" [URL="api/maelzel.core.symbols.Articulation.html#maelzel.core.symbols.Articulation",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="Represents a note attached articulation"]; "EventSymbol" -> "Articulation" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Beam" [URL="api/maelzel.core.symbols.Beam.html#maelzel.core.symbols.Beam",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="Notes within a Beam spanner are beamed together"]; "Spanner" -> "Beam" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BeamBreak" [URL="api/maelzel.core.symbols.BeamBreak.html#maelzel.core.symbols.BeamBreak",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="Symbolizes a syncopation (beam) break at the given location or at the given note"]; "EventSymbol" -> "BeamBreak" [arrowsize=0.5,style="setlinewidth(0.5)"]; "VoiceSymbol" -> "BeamBreak" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Bend" [URL="api/maelzel.core.symbols.Bend.html#maelzel.core.symbols.Bend",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="A (post) bend with an alteration up or down"]; "EventSymbol" -> "Bend" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Bracket" [URL="api/maelzel.core.symbols.Bracket.html#maelzel.core.symbols.Bracket",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"]; "Spanner" -> "Bracket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Breath" [URL="api/maelzel.core.symbols.Breath.html#maelzel.core.symbols.Breath",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="A breathmark symbol, will also break the beam at the given instant"]; "EventSymbol" -> "Breath" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Clef" [URL="api/maelzel.core.symbols.Clef.html#maelzel.core.symbols.Clef",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 explicit clef sign"]; "EventSymbol" -> "Clef" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Color" [URL="api/maelzel.core.symbols.Color.html#maelzel.core.symbols.Color",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="Customizes the color of an object"]; "Property" -> "Color" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Dynamic" [URL="api/maelzel.core.symbols.Dynamic.html#maelzel.core.symbols.Dynamic",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="A notation only dynamic"]; "EventSymbol" -> "Dynamic" [arrowsize=0.5,style="setlinewidth(0.5)"]; "EventSymbol" [URL="api/maelzel.core.symbols.EventSymbol.html#maelzel.core.symbols.EventSymbol",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="Base-class for all event-attached symbols"]; "Symbol" -> "EventSymbol" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Fermata" [URL="api/maelzel.core.symbols.Fermata.html#maelzel.core.symbols.Fermata",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="A Fermata sign over a note"]; "EventSymbol" -> "Fermata" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Fingering" [URL="api/maelzel.core.symbols.Fingering.html#maelzel.core.symbols.Fingering",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="A fingering attached to a note"]; "EventSymbol" -> "Fingering" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GlissProperties" [URL="api/maelzel.core.symbols.GlissProperties.html#maelzel.core.symbols.GlissProperties",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="Customizes properties of a glissando"]; "EventSymbol" -> "GlissProperties" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Gracenote" [URL="api/maelzel.core.symbols.Gracenote.html#maelzel.core.symbols.Gracenote",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="Customizes properties of a gracenote"]; "EventSymbol" -> "Gracenote" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Hairpin" [URL="api/maelzel.core.symbols.Hairpin.html#maelzel.core.symbols.Hairpin",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="A hairpin crescendo or decrescendo"]; "Spanner" -> "Hairpin" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Harmonic" [URL="api/maelzel.core.symbols.Harmonic.html#maelzel.core.symbols.Harmonic",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="A natural/artificial harmonic, or a sound-pitch flageolet"]; "EventSymbol" -> "Harmonic" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Hidden" [URL="api/maelzel.core.symbols.Hidden.html#maelzel.core.symbols.Hidden",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="A hidden property can be attached to note to hide it"]; "Property" -> "Hidden" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LineSpan" [URL="api/maelzel.core.symbols.LineSpan.html#maelzel.core.symbols.LineSpan",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="A line spanner"]; "Spanner" -> "LineSpan" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NoMerge" [URL="api/maelzel.core.symbols.NoMerge.html#maelzel.core.symbols.NoMerge",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="A note marked with this symbol will not be merged to a previous note"]; "EventSymbol" -> "NoMerge" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NotatedPitch" [URL="api/maelzel.core.symbols.NotatedPitch.html#maelzel.core.symbols.NotatedPitch",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="Allows to customize the notated pitch of a note"]; "NoteheadAttachedSymbol" -> "NotatedPitch" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Notehead" [URL="api/maelzel.core.symbols.Notehead.html#maelzel.core.symbols.Notehead",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="Customizes the notehead shape, color, parenthesis and size"]; "NoteheadAttachedSymbol" -> "Notehead" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NoteheadAttachedSymbol" [URL="api/maelzel.core.symbols.NoteheadAttachedSymbol.html#maelzel.core.symbols.NoteheadAttachedSymbol",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="Symbols attached to a notehead (a pitch)"]; "EventSymbol" -> "NoteheadAttachedSymbol" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NoteheadLine" [URL="api/maelzel.core.symbols.NoteheadLine.html#maelzel.core.symbols.NoteheadLine",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="A line conecting two noteheads"]; "Spanner" -> "NoteheadLine" [arrowsize=0.5,style="setlinewidth(0.5)"]; "OctaveShift" [URL="api/maelzel.core.symbols.OctaveShift.html#maelzel.core.symbols.OctaveShift",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 octave shift"]; "Spanner" -> "OctaveShift" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Ornament" [URL="api/maelzel.core.symbols.Ornament.html#maelzel.core.symbols.Ornament",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="Note-attached ornament (trill, mordent, prall, etc.)"]; "EventSymbol" -> "Ornament" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Property" [URL="api/maelzel.core.symbols.Property.html#maelzel.core.symbols.Property",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="A property is a modifier of an object itself (like a color or a size)"]; "Symbol" -> "Property" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SizeFactor" [URL="api/maelzel.core.symbols.SizeFactor.html#maelzel.core.symbols.SizeFactor",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="Sets the size of an object (as a factor of default size)"]; "Property" -> "SizeFactor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Slur" [URL="api/maelzel.core.symbols.Slur.html#maelzel.core.symbols.Slur",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="A slur spanner between two notes"]; "Spanner" -> "Slur" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Spanner" [URL="api/maelzel.core.symbols.Spanner.html#maelzel.core.symbols.Spanner",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="A Spanner is a line/curve between two anchors (notes/chords/rests)"]; "Symbol" -> "Spanner" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Stem" [URL="api/maelzel.core.symbols.Stem.html#maelzel.core.symbols.Stem",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="Customize the stem of a note"]; "EventSymbol" -> "Stem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Symbol" [URL="api/maelzel.core.symbols.Symbol.html#maelzel.core.symbols.Symbol",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="Base class for all symbols"]; "Text" [URL="api/maelzel.core.symbols.Text.html#maelzel.core.symbols.Text",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="A note attached text expression"]; "EventSymbol" -> "Text" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Transpose" [URL="api/maelzel.core.symbols.Transpose.html#maelzel.core.symbols.Transpose",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="Apply a transposition for notation only"]; "EventSymbol" -> "Transpose" [arrowsize=0.5,style="setlinewidth(0.5)"]; "VoiceSymbol" -> "Transpose" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Tremolo" [URL="api/maelzel.core.symbols.Tremolo.html#maelzel.core.symbols.Tremolo",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="A stem-attached tremolo sign"]; "EventSymbol" -> "Tremolo" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TrillLine" [URL="api/maelzel.core.symbols.TrillLine.html#maelzel.core.symbols.TrillLine",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="Trill spanner between two notes."]; "Spanner" -> "TrillLine" [arrowsize=0.5,style="setlinewidth(0.5)"]; "VoiceSymbol" [URL="api/maelzel.core.symbols.VoiceSymbol.html#maelzel.core.symbols.VoiceSymbol",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="Symbols which can be attached to a voice"]; "Symbol" -> "VoiceSymbol" [arrowsize=0.5,style="setlinewidth(0.5)"]; }