music21.alpha.trecento.notation¶
Tools for creating Note, Ligature and Divisione objects unique to Trecento notation.
Other objects found in medieval and renaissance music (such as rests, notes, and clef) can be found in the module music21.medren.
Also contains functions for converting Trecento notation to modern notation.
Also a good example of subclassing TinyNotation
Functions¶
-
music21.alpha.trecento.notation.
convertBrevisLength
(brevisLength, convertedStream, inpDiv=None, measureNumOffset=0)¶ Takes two required arguments, a measure object and a stream containing modern objects. Takes two optional arguments, inpDiv and measureNumOffset.
music21.alpha.trecento.notation.convertBrevisLength()
converts each of the objects in the measure to their modern equivalents using the BrevisLengthTranslator object.inpDiv is a divisione possibly coming from a some higher context. measureNumOffset helps calculate measure number.
This acts as a helper method to improve the efficiency of
music21.alpha.trecento.notation.convertTrecentoStream()
.
-
music21.alpha.trecento.notation.
convertTrecentoStream
(inpStream, inpDiv=None)¶ Take one argument: input stream. Converts an entire stream containing only mensural and trecento objects into one containing modern clef, note, and time signature objects. The converted stream preserves the structure of the original stream, converting only the mensural and trecento objects.
This stream must have all of the qualifications present in the documentation for
music21.medren.breakMensuralStreamIntoBrevisLengths()
. Furthermore, no non-mensural or non-trecento objects (other than streams and formatting) may be present in the input streams.Examples:
Anonymous, Se per dureça. Padua, Biblioteca Universitaria, MS 1115. Folio Ar.
>>> upperString = ".p. $C1 g(B) g(M) f e g f e p g(SB) f(SM) e d e(M) f p " >>> upperString += "e(SB) e(SM) f e d(M) c p " >>> upperString += "d(SB) r e p f(M) e d e d c p d(SB) c(M) d c d p e(SB) r(M) " >>> upperString += "g f e p g(SB) a(SM) g f e(M) d p " >>> upperString += "e(SB) f(SM) e d c(M) d e(L) a(SB) a p b(M) a g a g f p g f e f e f p " >>> upperString += "g(SB) g(SM) a g f e d p e(SB) r(M) f(SM) e d e(M) p d(SB) r e(M) f p " >>> upperString += "g(SB) d r(M) e p f e d e d c p d(SB) d(M) e(SB) " >>> upperString += "c(M) p d(SB) c(M) d c B c(L) " >>> upperString += "c'(SB)[D] c' p c'(SM) b a b(M) c' b c' p b(SM) a g a(M) b a b p " >>> upperString += "g(SB) g(SM) a g f e d p e(SB) r e(M) f p g f e f e f p g(SB) r g(M) f p " >>> upperString += "g(SB) f(SM) e d e(M) f e(L) a(M) b a b g(SB) p c'(M) b a c' b a p " >>> upperString += "b c' b a g a p b(SB) c'(SM) b a g(M) f p a(SB) a(M) g(SB) f(M) p " >>> upperString += "e(SB) r g(M) f p g f e f e d p c(SB) d r p a g(SM) a g f " >>> upperString += "e d p e(M) r f(SM) e d e(SB) d(Mx)"
>>> lowerString = ".p. $C3 c(L) G(B) A(SB) B c p d c r p A B c p d " >>> lowerString += "c B p lig{A<o>[DL] G} A c B A(L) " >>> lowerString += "A(SB) A p G A B p c c(M) B(SB) A(M) p G(SB) G p A B c p d A r p G[D] A p " >>> lowerString += "B B(M) c(SB) c(M) p d(SB) d(M) A(SB) A(M) p G(SB) A B C(L) " >>> lowerString += "c(SB)[D] c e(B) d c(SB) c d p e d r p c c(M) d(SB) d(M) p c(SB) r r p " >>> lowerString += "c d c(M) d e(L) d(SB)[D] e p c[D] d p e e(M) d(SB) c(M) p B(SB) A B(M) c p " >>> lowerString += "d(SB) d(M) c(SB) d(M) p e(SB) d r p c c(M) A(SB) B(M) p " >>> lowerString += "c(SB) B B p A B[D] p A B c d(Mx)"
>>> SePerDureca = stream.Stream() >>> SePerDureca.append(alpha.trecento.notation.TrecentoTinyConverter(upperString).parse( ... ).stream.flat) >>> SePerDureca.append(alpha.trecento.notation.TrecentoTinyConverter(lowerString).parse( ... ).stream.flat)
>>> SePerDurecaConverted = alpha.trecento.notation.convertTrecentoStream(SePerDureca) Converting stream ... ...
BrevisLengthTranslator¶
-
class
music21.alpha.trecento.notation.
BrevisLengthTranslator
(divisione=None, BL=None, pDS=False)¶ The class
music21.alpha.trecento.notation.BrevisLengthTranslator
takes a divisione sign and a list comprising one brevis length’s worth of mensural or trecento objects as arguments.The method
music21.alpha.trecento.notation.BrevisLengthTranslator.getKnownLengths()
takes no arguments, and returns a list of floats corresponding to the length (in minima) of each object in the list.Currently, this class is used only to improve the efficiency of
music21.medren.GeneralMensuralNote.duration
.This acts a helper class to improve the efficiency of
music21.alpha.trecento.notation.convertBrevisLength
.# >>> names = [‘SM’, ‘SM’, ‘SM’, ‘SM’, ‘SB’, ‘SB’, ‘SB’, ‘SB’, ‘SB’, ‘SM’, ‘SM’, ‘SM’] # >>> BL = [medren.MensuralNote(‘A’, n) for n in names] # >>> BL[3] = medren.MensuralRest(‘SM’) # >>> for mn in BL[-3:]: # ... mn.setFlag(‘up’, ‘left’) # >>> for mn in BL[4:9]: # ... mn.setStem(‘down’) # >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) # >>> TBL.getKnownLengths() # [0.5, 0.5, 0.5, 0.5, 4.0, 4.0, 4.0, 4.0, 4.0, 0.666..., 0.666..., 0.666...]
BrevisLengthTranslator
methods
-
BrevisLengthTranslator.
classifyUnknownNotesByType
(unchangeableNoteLengthsList)¶ returns a dictionary where keys are types of notes (‘semibrevis_downstem’) and the values are a list of indices in self.brevisLength (and unchangeableNoteLengthsList) which are those types...
>>> from music21.alpha import medren
>>> div = alpha.trecento.notation.Divisione('.n.') >>> names = ['SB', 'M', 'M', 'M', 'SB', 'M'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchangeableNoteLengths = TBL.getUnchangeableNoteLengths() >>> kldict = TBL.classifyUnknownNotesByType(unchangeableNoteLengths) >>> print(kldict['semibrevis']) [0, 4]
-
BrevisLengthTranslator.
determineStrongestMeasureLengths
(lengths, change_tup, num_tup, diff_tup, lenRem, shrinkable_indices=(), multi=None)¶ Gets all possible length combinations. Returns the lengths combination of the “strongest” list, along with the remaining length.
Parameters: - lengths – list of lengths to be updated
- change_tup – tuple, each element is the sub-list of self.brevisLength to be changed.
- num_tup – tuple, each element is an integer, the maximum number of elements in the corresponding list of change_tup that can be changed
- diff_tup – tuple, each element is the amount by which to change the elements of the corresponding list in change_tup.
- lenRem – input of the remaining SM in the measure. Gets updated and returned.
- shrinkable_indices – tuple of indices of elements able to take up slack (i.e. ending SB, or downstem SB)
>>> from music21.alpha import medren
>>> div = alpha.trecento.notation.Divisione('.n.') >>> names = ['SB', 'M', 'M', 'M', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> TBL.determineStrongestMeasureLengths([2.0, 1.0, 1.0, 1.0, 4.0], ... ([0],), (1,), (1.0,), 0.0, shrinkable_indices=(-1,)) ([3.0, 1.0, 1.0, 1.0, 3.0], 0.0)
-
BrevisLengthTranslator.
getBreveStrength
(lengths)¶ BrevisLengthTranslator._evaluateBL()
takes divisione, a brevis length’s worth of mensural or trecento objects in a list, and a list of lengths corresponding to each of those objects as arguments.This method returns the strength of the list based on those lengths. A strong list has longer notes on its stronger beats. Only valid for Trecento notation.
In this example, we test two possible interpretations for the same measure and see that the second is more logical. Note that the strength itself is meaningless except when compared to other possible lengths for the same notes.
>>> from music21.alpha import medren
>>> div = alpha.trecento.notation.Divisione('.n.') >>> names = ['SB', 'M', 'M', 'M', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> TBL.getBreveStrength([2.0, 1.0, 1.0, 1.0, 4.0]) 2.0555... >>> TBL.getBreveStrength([3.0, 1.0, 1.0, 1.0, 3.0]) 2.8333...
-
BrevisLengthTranslator.
getKnownLengths
()¶
-
BrevisLengthTranslator.
getUnchangeableNoteLengths
()¶ takes the music in self.brevisLength and returns a list where element i in this list corresponds to the length in minimas of element i in self.brevisLength. If the length cannot be determined without taking into account the context (e.g., semiminims, semibreves) then None is placed in that list.
>>> from music21.alpha import medren
>>> div = alpha.trecento.notation.Divisione('.i.') >>> names = ['SB', 'M', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> TBL.getUnchangeableNoteLengths() [None, 1.0, None]
>>> names = ['B'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> TBL.getUnchangeableNoteLengths() [6.0]
>>> names = ['L'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> TBL.getUnchangeableNoteLengths() [12.0]
>>> names = ['Mx'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> TBL.getUnchangeableNoteLengths() [24.0]
-
BrevisLengthTranslator.
translate
()¶ Translates and returns a list of lengths for all the notes in self.brevisLength
-
BrevisLengthTranslator.
translateDivI
(unchangeableNoteLengthsList=None, unknownLengthsDict=None, minRem=None)¶ >>> from music21.alpha import medren
>>> div = alpha.trecento.notation.Divisione('.i.') >>> names = ['SB', 'M', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unchlist [None, 1.0, None] >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivI(unchlist, unkldict, 5.0) [2.0, 1.0, 3.0]
-
BrevisLengthTranslator.
translateDivN
(unchangeableNoteLengthsList=None, unknownLengthsDict=None, minRem=None)¶ Translate the Novanaria (9) Divisio; returns the number of minims for each note.
>>> from music21.alpha import medren
>>> div = alpha.trecento.notation.Divisione('.n.') >>> names = ['SB', 'M', 'M', 'M', 'SB', 'M'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivN(unchlist, unkldict, 5.0) [3.0, 1.0, 1.0, 1.0, 2.0, 1.0]
>>> BL[-2].setStem('down') >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivN(unchlist, unkldict, 5.0) [2.0, 1.0, 1.0, 1.0, 3.0, 1.0]
>>> names = ['SB', 'M', 'M', 'M', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivN(unchlist, unkldict, 6.0) [3.0, 1.0, 1.0, 1.0, 3.0]
>>> names = ['SB', 'M', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivN(unchlist, unkldict, 8.0) [2.0, 1.0, 6.0]
>>> BL[0].setStem('down') >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivN(unchlist, unkldict, 8.0) [5.0, 1.0, 3.0]
-
BrevisLengthTranslator.
translateDivOD
(unchangeableNoteLengthsList=None, unknownLengthsDict=None, minRem=None)¶ Translates the octonaria and duodenaria divisions
>>> from music21.alpha import medren
>>> divO = alpha.trecento.notation.Divisione('.o.') >>> names = ['SB', 'SB', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> BL[1].setStem('down') >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(divO, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivOD(unchlist, unkldict, 8.0) [2.0, 4.0, 2.0]
>>> names = ['SM', 'SM', 'SM', 'SB', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(divO, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivOD(unchlist, unkldict, 8.0) [0.666..., 0.666..., 0.666..., 2.0, 3.999...]
>>> divD = alpha.trecento.notation.Divisione('.d.') >>> names = ['SB', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(divD, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivOD(unchlist, unkldict, 12.0) [4.0, 8.0]
>>> names = ['SB', 'SB', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(divD, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivOD(unchlist, unkldict, 12.0) [4.0, 4.0, 4.0]
>>> names = ['SB', 'SB', 'SB', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(divD, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivOD(unchlist, unkldict, 12.0) [2.0, 2.0, 4.0, 4.0]
>>> BL[1].setStem('down') >>> BL[2].setStem('down') >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(divD, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unchlist [None, None, None, None] >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivOD(unchlist, unkldict, 12.0) [2.0, 4.0, 4.0, 2.0]
>>> names = ['SB', 'SB', 'SM', 'SM', 'SM', 'SM', 'SB', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(divD, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivOD(unchlist, unkldict, 12.0) [2.0, 2.0, 0.5, 0.5, 0.5, 0.5, 2.0, 4.0]
-
BrevisLengthTranslator.
translateDivPQ
(unchangeableNoteLengthsList=None, unknownLengthsDict=None, minRem=None)¶ Translates P and Q (6 and 4)
>>> from music21.alpha import medren
>>> div = alpha.trecento.notation.Divisione('.q.') >>> names = ['SB', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivPQ(unchlist, unkldict, 4.0) [2.0, 2.0]
>>> names = ['M', 'SM', 'SM', 'SM', 'SM', 'SM'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> BL[4] = medren.MensuralRest('SM') >>> BL[1].setFlag('up', 'left') >>> BL[2].setFlag('up', 'left') >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivPQ(unchlist, unkldict, 3.0) [1.0, 0.5, 0.5, 0.666..., 0.666..., 0.666...]
>>> div = alpha.trecento.notation.Divisione('.p.') >>> names = ['SB', 'SB', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivPQ(unchlist, unkldict, 6.0) [2.0, 2.0, 2.0]
>>> names = ['M', 'SB', 'SM', 'SM'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> BL[1].setStem('down') >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivPQ(unchlist, unkldict, 5.0) [1.0, 4.0, 0.5, 0.5]
>>> names = ['SM', 'SM', 'SM', 'SM', 'SM', 'SM', 'SM', 'SB'] >>> BL = [medren.MensuralNote('A', n) for n in names] >>> BL[3] = medren.MensuralRest('SM') >>> for mn in BL[:3]: ... mn.setFlag('up', 'left') >>> TBL = alpha.trecento.notation.BrevisLengthTranslator(div, BL) >>> unchlist = TBL.getUnchangeableNoteLengths() >>> unkldict = TBL.classifyUnknownNotesByType(unchlist) >>> TBL.translateDivPQ(unchlist, unkldict, 6.0) [0.666..., 0.666..., 0.666..., 0.5, 0.5, 0.5, 0.5, 2.0]
ClefToken¶
-
class
music21.alpha.trecento.notation.
ClefToken
(token='')¶
ClefToken
bases
ClefToken
methods
-
ClefToken.
parse
(parent)¶
Divisione¶
-
class
music21.alpha.trecento.notation.
Divisione
(nameOrSymbol='.p.')¶ An object representing a divisione found in Trecento Notation. Takes one argument, nameOrSymbol. This is the name of the divisione, or its corresponding letter.
The default value for this argument is ‘.p.’
Valid names are ‘quaternaria’, ‘senaria imperfect’, ‘senaria perfecta’, ‘novenaria’, ‘octonaria’, and ‘duodenaria’.
The corresponding symbols are ‘.q.’, ‘.i.’, ‘.p.’, ‘.n.’, ‘.o.’, and ‘.d.’.
>>> d = alpha.trecento.notation.Divisione('senaria imperfecta') >>> d.standardSymbol '.i.'
>>> d = alpha.trecento.notation.Divisione('.p.') >>> d.name 'senaria perfecta'
>>> d = alpha.trecento.notation.Divisione('q') >>> d.standardSymbol '.q.'
Divisione
bases
Divisione
read-only properties
Read-only properties inherited from TimeSignature
:
Read-only properties inherited from Music21Object
:
Divisione
read/write properties
-
Divisione.
minimaPerBrevis
¶ Used to get and set the number of minima in a ‘measure’ (the number of minima before a punctus occurs) under the given divisione.
>>> n = alpha.trecento.notation.Divisione('.n.') >>> n.minimaPerBrevis 9 >>> n.minimaPerBrevis = 18 >>> n.minimaPerBrevis 18
Read/write properties inherited from TimeSignature
:
Read/write properties inherited from Music21Object
:
Divisione
methods
Methods inherited from TimeSignature
:
Methods inherited from Music21Object
:
Divisione
instance variables
Instance variables inherited from TimeSignature
:
Instance variables inherited from Music21Object
:
DivisioneToken¶
-
class
music21.alpha.trecento.notation.
DivisioneToken
(token='')¶
DivisioneToken
bases
DivisioneToken
methods
-
DivisioneToken.
parse
(parent)¶
FlagsModifier¶
-
class
music21.alpha.trecento.notation.
FlagsModifier
(modifierData, modifierString, parent)¶
FlagsModifier
bases
FlagsModifier
methods
-
FlagsModifier.
postParse
(m21Obj)¶
Methods inherited from Modifier
:
LigatureNoteheadModifier¶
-
class
music21.alpha.trecento.notation.
LigatureNoteheadModifier
(modifierData, modifierString, parent)¶
LigatureNoteheadModifier
bases
LigatureNoteheadModifier
methods
-
LigatureNoteheadModifier.
postParse
(m21Obj)¶
Methods inherited from Modifier
:
LigatureReverseModifier¶
-
class
music21.alpha.trecento.notation.
LigatureReverseModifier
(modifierData, modifierString, parent)¶
LigatureReverseModifier
bases
LigatureReverseModifier
methods
-
LigatureReverseModifier.
postParse
(n)¶
Methods inherited from Modifier
:
LigatureState¶
-
class
music21.alpha.trecento.notation.
LigatureState
(parent, stateInfo)¶ defines that the notes in here will be in a ligature
LigatureState
bases
LigatureState
methods
-
LigatureState.
affectTokenAfterParse
(n)¶
-
LigatureState.
affectTokenAfterParseBeforeModifiers
(n)¶
-
LigatureState.
end
()¶
-
LigatureState.
start
()¶
Methods inherited from State
:
LigatureStemsModifier¶
-
class
music21.alpha.trecento.notation.
LigatureStemsModifier
(modifierData, modifierString, parent)¶
LigatureStemsModifier
bases
LigatureStemsModifier
methods
-
LigatureStemsModifier.
postParse
(m21Obj)¶
Methods inherited from Modifier
:
MensuralTypeModifier¶
-
class
music21.alpha.trecento.notation.
MensuralTypeModifier
(modifierData, modifierString, parent)¶
MensuralTypeModifier
bases
MensuralTypeModifier
methods
-
MensuralTypeModifier.
postParse
(n)¶
Methods inherited from Modifier
:
Punctus¶
-
class
music21.alpha.trecento.notation.
Punctus
¶ An object representing a punctus, found in Trecento notation.
Punctus
bases
Punctus
read-only properties
-
Punctus.
fontString
¶ The utf-8 code corresponding the punctus in Cicionia font
Read-only properties inherited from Music21Object
:
Punctus
read/write properties
Read/write properties inherited from Music21Object
:
Punctus
methods
Methods inherited from Music21Object
:
Punctus
instance variables
Instance variables inherited from Music21Object
:
PunctusToken¶
-
class
music21.alpha.trecento.notation.
PunctusToken
(token='')¶
PunctusToken
bases
PunctusToken
methods
-
PunctusToken.
parse
(parent)¶
StemsModifier¶
-
class
music21.alpha.trecento.notation.
StemsModifier
(modifierData, modifierString, parent)¶
StemsModifier
bases
StemsModifier
methods
-
StemsModifier.
postParse
(m21Obj)¶
Methods inherited from Modifier
:
TrecentoNoteToken¶
-
class
music21.alpha.trecento.notation.
TrecentoNoteToken
(token='')¶ For documentation please see
music21.alpha.trecento.notation.TrecentoTinyConverter
.
TrecentoNoteToken
bases
TrecentoNoteToken
methods
-
TrecentoNoteToken.
parse
(parent=None)¶
Methods inherited from NoteToken
:
Methods inherited from NoteOrRestToken
:
TrecentoRestToken¶
-
class
music21.alpha.trecento.notation.
TrecentoRestToken
(token='')¶
TrecentoRestToken
bases
TrecentoRestToken
methods
-
TrecentoRestToken.
parse
(parent=None)¶
Methods inherited from NoteOrRestToken
:
TrecentoTinyConverter¶
-
class
music21.alpha.trecento.notation.
TrecentoTinyConverter
(stringRep='')¶ These are modified from a standard lilypond format called TinyNotation.
Here are some important points about how to create notes and streams:
Note names are: a,b,c,d,e,f,g. r indicates a rest, and p indicates a punctus.
Note octaves are specified as follows:
CC to BB: from C below bass clef to second-line B in bass clef C to B: from bass clef C to B below middle C. c to b: from middle C to the middle of treble clef c’ to b’: from C in treble clef to B above treble clef (make sure you’re NOT putting in smart quotes)
In 14th c. music, C to B and c to b will be most common
Flats, sharps, and naturals are notated as #,- (not b), and (if needed) n. If the accidental is above the staff (i.e., editorial), enclose it in parentheses: (#), etc. Make sure that flats in the key signatures are explicitly specified.
The syntax structure for a mensural note is as follows:
pitch(mensuralType)[stems]_flags
A mensuralType may be any of Mx for maxima, L for longa, B for brevis, SB for semibrevis, M for minima, or SM for semimina. For more information on mensural types, please see the documentation for
music21.medren.generalMensuralNote
.If no mensural type is specified, it is assumed to be the same as the previous note. I.e., c(SB) B c d is a string of semibreves.
>>> tTNN = alpha.trecento.notation.TrecentoTinyConverter('a(M)').parse().stream.flat.notes[0] >>> tTNN.pitch <music21.pitch.Pitch A4>
>>> tTNN.mensuralType 'minima'
An additional stem may be added by specifying direction: S for a sidestem, D for a downstem, and an empty string to reset.
For example, adding [D] to a note string would add a downstem to that note. Stems must still follow the rules outlined in
music21.medren.MensuralNote.setStem()
.>>> tTNN = alpha.trecento.notation.TrecentoTinyConverter( ... 'a(SB)[S]').parse().stream.flat.notes[0] >>> tTNN.getStems() ['side']
>>> tTNN = alpha.trecento.notation.TrecentoTinyConverter('a(M)[D]').parse().stream.flat.notes[0] >>> tTNN.getStems() ['up', 'down']
A flag may be added by specifying direction of stem and orientation of flag. Valid directions are U for up, D for down, and an empty string to reset (sidestems cannot have flags). Valid orientations are L for left, R for right, and an empty string to reset. For example, adding _DL to a note string would add a left flag to that note’s downstem. Flags must still follow the rules outlined in
music21.medren.MensuralNote.setFlag()
.>>> tTNN = alpha.trecento.notation.TrecentoTinyConverter( ... 'a(SM)_UL').parse().stream.flat.notes[0] >>> tTNN.getStems() ['up']
>>> flags = tTNN.getFlags() >>> sorted(list(flags.keys())) ['up'] >>> flags['up'] 'left'
Multiple flags may be added by placing a slash between direction-orientation pairs, as shown in the following complex example:
>>> tTNN = alpha.trecento.notation.TrecentoTinyConverter( ... 'a(SM)[D]_UL/DR').parse().stream.flat.notes[0] >>> tTNN.pitch <music21.pitch.Pitch A4> >>> tTNN.getStems() ['up', 'down']
>>> flags = tTNN.getFlags() >>> sorted(list(flags.keys())) ['down', 'up'] >>> flags['down'] 'right' >>> flags['up'] 'left'
- It is also possible to create ligatures using the TinyTrecentoNotationNote class. Put all notes in a ligature within lig{ and } symbols.
>>> ttc = alpha.trecento.notation.TrecentoTinyConverter('lig{f g a g f }').parse() >>> ts = ttc.stream >>> ts.show('text') {0.0} <music21.stream.Measure 1 offset=0.0> {0.0} <music21.clef.TrebleClef> {0.0} <music21.meter.TimeSignature 4/4> {0.0} <music21...medren.Ligature object at 0x...> {0.0} <music21.bar.Barline style=final> >>> tTNN = ts.flat.getElementsByClass('Ligature')[0] >>> tTNN <music21...medren.Ligature...> >>> [str(p) for p in tTNN.pitches] ['F4', 'G4', 'A4', 'G4', 'F4', 'C4']
The notes within a ligature have the syntax pitch<notehead>[stems](maxima). Valid notehead shapes are s for square and o for oblique. Valid stem directions are U for up and D for down, and valid orientations are L for left and R for right. To set a note of a ligature as a maxima, append (Mx) to the note string. To set a note of a ligature as reversed, append a forward slash followed by an R (“/R”) to the note string.
Note, ligatures must follow the rules outlined by
music21.medren.Ligature
.Examples:
>>> ts = alpha.trecento.notation.TrecentoTinyConverter(r'lig{f a[DL]/R}').parse().stream >>> tTNN = ts.flat.getElementsByClass('Ligature')[0] >>> tTNN.getStem(1) ('down', 'left')
>>> tTNN.isReversed(1) True
>>> tTNN = alpha.trecento.notation.TrecentoTinyConverter( ... 'lig{f<o> g a[UR] g f(Mx)}').parse().stream.flat.getElementsByClass('Ligature')[0] >>> print([n.mensuralType for n in tTNN.notes]) ['longa', 'brevis', 'semibrevis', 'semibrevis', 'maxima']
>>> tTNN.getNoteheadShape(1) 'oblique'
Separate objects in a tiny notation by spaces. To add a mensural clef to the stream, add $, followed by the clef type (F or C) to the string. If the clef line on the staff is non-standard, include that after the type.
For example, $F2 would indicate an F-clef on the second line of the staff. To add a divisione to a tiny notation stream, simply include the divisione abbreviation in the string. For example, .p. would indicate senaria perfecta.
>>> tTNS = alpha.trecento.notation.TrecentoTinyConverter( ... '$C3 .p. c(SB) d e p d(B) lig{e d c}').parse().stream.flat >>> tTNS.show('text') {0.0} <music21.bar.Barline style=final> {0.0} <music21.clef.MensuralClef> {0.0} <music21.alpha.trecento.notation.Divisione .p.> {0.0} <music21...medren.MensuralNote semibrevis C> {0.0} <music21...medren.MensuralNote semibrevis D> {0.0} <music21...medren.MensuralNote semibrevis E> {0.0} <music21.alpha.trecento.notation.Punctus...> {0.0} <music21...medren.MensuralNote brevis D> {0.0} <music21...medren.Ligature...>
TrecentoTinyConverter
bases
TrecentoTinyConverter
methods
Methods inherited from Converter
: