music21.editorial¶
Editorial objects store comments and other metadata associated with specific
Music21Object
elements such as Notes.
Some aspects of Editorial
objects
represent very early (pre-v0.1) versions of music21. Thus, some
pre-defined aspects might be removed from documentation in the future.
Access an editorial object by calling .editorial on any music21 object:
>>> c = clef.TrebleClef()
>>> ed = c.editorial
>>> ed
<music21.editorial.Editorial {}>
The object is lazily created on first access. To see if there is any existing editorial information without creating the object, call .hasEditorialInformation
>>> n = note.Note('C#4')
>>> n.hasEditorialInformation
False
>>> n.editorial.unedited = True
>>> n.hasEditorialInformation
True
Editorial¶
- class music21.editorial.Editorial¶
Editorial comments and special effects that can be applied to music21 objects.
>>> ed1 = editorial.Editorial() >>> ed1.backgroundHighlight = 'yellow' # non-standard. >>> ed1.backgroundHighlight 'yellow' >>> list(ed1.keys()) ['backgroundHighlight'] >>> ed1 <music21.editorial.Editorial {'backgroundHighlight': 'yellow'}>
Every GeneralNote object already has a NoteEditorial object attached to it at object.editorial. Normally you will just change that object instead.
For instance, take the case where a scribe wrote F in the score, knowing that a good singer would automatically sing F-sharp instead. We can store the editorial suggestion to sing F-sharp as a “musica ficta” accidental object:
>>> fictaSharp = pitch.Accidental('sharp') >>> n = note.Note('F') >>> n.editorial.ficta = fictaSharp >>> n.show('lily.png') # only Lilypond currently supports musica ficta
Editorial
bases
Editorial
read-only properties
Read-only properties inherited from ProtoM21Object
:
Editorial
methods
Methods inherited from ProtoM21Object
:
Editorial
instance variables
- Editorial.ficta¶
a
Accidental
object that specifies musica ficta for the note. Will only be displayed in LilyPond and then only if there is no Accidental object on the note itself
- Editorial.footnotes¶
a list of
Comment
objects that represent annotations for the object. These have specific meanings in MusicXML.
Comment¶
- class music21.editorial.Comment(text=None)¶
A comment or footnote or something else attached to a note.
>>> c = editorial.Comment('presented as C natural in the 1660 print.') >>> c <music21.editorial.Comment 'presented as C na...'>
Note that the text is truncated in representation, but it is all there in .text:
>>> c.text 'presented as C natural in the 1660 print.'
>>> c.isFootnote = True >>> c.levelInformation = 'musicological'
>>> n = note.Note('C#4') >>> n.editorial.footnotes.append(c) >>> n.editorial.footnotes[0] <music21.editorial.Comment 'presented as C na...'>
Comments have style information:
>>> c.style.color = 'red' >>> c.style.color 'red'
Comment
bases
Comment
read-only properties
Read-only properties inherited from ProtoM21Object
:
Read-only properties inherited from StyleMixin
:
Comment
read/write properties
Read/write properties inherited from StyleMixin
:
Comment
methods
Methods inherited from ProtoM21Object
: