Tools for creating Punctus 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.
Takes two required arguments, a measure object and a stream containing modern objects. Takes two optional arguments, inpDiv and measureNumOffset.
music21.trecento.notation.convertBrevisLength() converts each of the objects in the measure to their modern equivalents using the translateBrevisLength 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.trecento.notation.convertTrecentoStream().
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.
>>> from music21 import stream, trecento
>>> upperString = ".p. $C1 g(B) g(M) f e g f e p g(SB) f(SM) e d e(M) f p 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) 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) 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 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 c B p <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 c(SB) B B p A B[D] p A B c d(Mx)"
>>> SePerDureca = stream.Stream()
>>> SePerDureca.append(trecento.notation.TinyTrecentoNotationStream(upperString))
>>> SePerDureca.append(trecento.notation.TinyTrecentoNotationStream(lowerString))
>>> SePerDurecaConverted = trecento.notation.convertTrecentoStream(SePerDureca)
Converting stream ...
...
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.’.
>>> from music21 import trecento
>>> d = trecento.notation.Divisione('senaria imperfecta')
>>> d.standardSymbol
'.i.'
>>> d = trecento.notation.Divisione('.p.')
>>> d.name
'senaria perfecta'
>>> d = 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
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 = 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
A MeterSequence governing accent partitioning.
A MeterSequence governing automatic beaming.
A MeterSequence governing beat partitioning.
A MeterSequence governing the display of the TimeSignature.
A string representation of how to display the TimeSignature. can be “common”, “cut”, “single-number” (i.e., no denominator), or “normal” or “”.
If set to True (default is False) then the denominator will be displayed as a symbol rather than a number. Hindemith uses this in his scores. Finale and other MusicXML readers do not support this so don’t expect proper output yet.
Instance variables inherited from TimeSignature:
Instance variables inherited from Music21Object:
An object representing a punctus, found in Trecento notation.
Punctus bases
Punctus read-only properties
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
Property which returns an number (int or otherwise) depending on the class of the Music21Object that represents a priority for an object based on its class alone – used as a tie for stream sorting in case two objects have the same offset and priority. Lower numbers are sorted to the left of higher numbers. For instance, Clef, KeySignature, TimeSignature all come (in that order) before Note.
All undefined classes have classSortOrder of 20 – same as note.Note
>>> m21o = base.Music21Object()
>>> m21o.classSortOrder
20
>>> tc = clef.TrebleClef()
>>> tc.classSortOrder
0
>>> ks = key.KeySignature(3)
>>> ks.classSortOrder
1
New classes can define their own default classSortOrder
>>> class ExampleClass(base.Music21Object):
... classSortOrderDefault = 5
...
>>> ec1 = ExampleClass()
>>> ec1.classSortOrder
5
An instance of a Group object which describes arbitrary Groups that this object belongs to.
if set to True will not print upon output (only used in MusicXML output at this point and Lilypond for notes, chords, and rests).
A unique identification string (not to be confused with the default .id() method.
if set, defines the display x-position from the start of the container (in musicxml “tenths” by default)
Instance variables inherited from Music21Object:
For documentation please see music21.trecento.notation.TinyTrecentoNotationStream.
TinyTrecentoNotationNote bases
TinyTrecentoNotationNote read-only properties
Read-only properties inherited from TinyNotationNote:
TinyTrecentoNotationNote methods
Methods inherited from TinyNotationNote:
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 semibrevises.
>>> from music21 import trecento
>>> tTNN = trecento.notation.TinyTrecentoNotationNote('a(M)')
>>> tTNN.note.pitch
<music21.pitch.Pitch A4>
>>> tTNN.note.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 = trecento.notation.TinyTrecentoNotationNote('a(SB)[S]')
>>> tTNN.note.getStems()
['side']
>>> tTNN = trecento.notation.TinyTrecentoNotationNote('a(M)[D]')
>>> tTNN.note.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 orietations 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 = trecento.notation.TinyTrecentoNotationNote('a(SM){UL}')
>>> tTNN.note.getStems()
['up']
>>> tTNN.note.getFlags()
{'up': 'left'}
Multiple flags may be added by placing a space between direction-orientation pairs, as shown in the following complex example:
>>> tTNN = trecento.notation.TinyTrecentoNotationNote(
... 'a(SM)[D]{UL DR}')
>>> tTNN.note.getStems()
['up', 'down']
>>> tTNN.note.getFlags()
{'down': 'right', 'up': 'left'}
>>> tTNN = trecento.notation.TinyTrecentoNotationNote('<f g a g f >')
>>> tTNN.note
<music21.medren.Ligature...>
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 to the note string.
Note, ligatures must follow the rules outlined by music21.medren.Ligature.
Examples:
>>> from music21 import trecento
>>> tTNN = trecento.notation.TinyTrecentoNotationNote('<f a[DL]/>')
>>> tTNN.note.getStem(1)
('down', 'left')
>>> tTNN.note.isReversed(1)
True
>>> tTNN = trecento.notation.TinyTrecentoNotationNote(
... '<f*o* g a[UR] g f(Mx)>')
>>> print [n.mensuralType for n in tTNN.note.notes]
['longa', 'brevis', 'semibrevis', 'semibrevis', 'maxima']
>>> tTNN.note.getNoteheadShape(1)
'oblique'
Separate objects in a TinyNotationStream 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 = trecento.notation.TinyTrecentoNotationStream(
... '$C3 .p. c(SB) d e p d(B) <e d c>')
>>> tTNS.show('text')
{0.0} <music21.clef.MensuralClef>
{0.0} <music21.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.trecento.notation.Punctus...>
{0.0} <music21.medren.MensuralNote brevis D>
{0.0} <music21.medren.Ligature...>
TinyTrecentoNotationStream bases
TinyTrecentoNotationStream read-only properties
Read-only properties inherited from Stream:
Read-only properties inherited from Music21Object:
TinyTrecentoNotationStream read/write properties
Read/write properties inherited from Stream:
Read/write properties inherited from Music21Object:
TinyTrecentoNotationStream methods
Methods inherited from TinyNotationStream:
Methods inherited from Stream:
Methods inherited from Music21Object:
TinyTrecentoNotationStream instance variables
Boolean describing whether the Stream is automatically sorted by offset whenever necessary.
Boolean that says whether all page breaks in the piece are explicitly defined. Only used on musicxml output (maps to the musicxml <supports attribute=”new-page”> tag) and only if this is the outermost Stream being shown
Boolean that says whether all system breaks in the piece are explicitly defined. Only used on musicxml output (maps to the musicxml <supports attribute=”new-system”> tag) and only if this is the outermost Stream being shown
When this flat Stream is derived from another non-flat stream, a reference to the source Stream is stored here.
Boolean describing whether this Stream contains embedded sub-Streams or Stream subclasses (not flat).
Boolean describing whether the Stream is sorted or not.
Instance variables inherited from TinyNotationStream:
Instance variables inherited from Stream:
Instance variables inherited from Music21Object:
The class music21.trecento.notation.TranslateBrevisLength takes a divisione sign and a list comprising one brevis length’s worth of mensural or trecento objects as arguments.
The method music21.trecento.notation.TranslateBrevisLength.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.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 = trecento.notation.TranslateBrevisLength(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...]
TranslateBrevisLength methods
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 import medren, trecento
>>> div = trecento.notation.Divisione('.n.')
>>> names = ['SB', 'M', 'M', 'M', 'SB', 'M']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(div, BL)
>>> unchangeableNoteLengths = TBL.getUnchangeableNoteLengths()
>>> kldict = TBL.classifyUnknownNotesByType(unchangeableNoteLengths)
>>> print kldict['semibrevis']
[0, 4]
Gets all possible length combinations. Returns the lengths combination of the “strongest” list, along with the remaining length.
| Parameters: |
|
|---|
>>> from music21 import medren, trecento
>>> div = trecento.notation.Divisione('.n.')
>>> names = ['SB', 'M', 'M', 'M', 'SB']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(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)
TranslateBrevisLength._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 import medren, trecento
>>> div = trecento.notation.Divisione('.n.')
>>> names = ['SB', 'M', 'M', 'M', 'SB']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(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...
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 import medren, trecento
>>> div = trecento.notation.Divisione('.i.')
>>> names = ['SB', 'M','SB']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(div, BL)
>>> TBL.getUnchangeableNoteLengths()
[None, 1.0, None]
>>> names = ['B']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(div, BL)
>>> TBL.getUnchangeableNoteLengths()
[6.0]
>>> names = ['L']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(div, BL)
>>> TBL.getUnchangeableNoteLengths()
[12.0]
>>> names = ['Mx']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(div, BL)
>>> TBL.getUnchangeableNoteLengths()
[24.0]
Translates and returns a list of lengths for all the notes in self.brevisLength
>>> from music21 import medren, trecento
>>> div = trecento.notation.Divisione('.i.')
>>> names = ['SB', 'M', 'SB']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(div, BL)
>>> unchlist = TBL.getUnchangeableNoteLengths()
>>> unkldict = TBL.classifyUnknownNotesByType(unchlist)
>>> TBL.translateDivI(unchlist, unkldict, 5.0)
[2.0, 1.0, 3.0]
>>> from music21 import medren, trecento
>>> div = trecento.notation.Divisione('.n.')
>>> names = ['SB', 'M', 'M', 'M', 'SB', 'M']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(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 = trecento.notation.TranslateBrevisLength(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 = trecento.notation.TranslateBrevisLength(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 = trecento.notation.TranslateBrevisLength(div, BL)
>>> unchlist = TBL.getUnchangeableNoteLengths()
>>> unkldict = TBL.classifyUnknownNotesByType(unchlist)
>>> TBL.translateDivN(unchlist, unkldict, 8.0)
[5.0, 1.0, 3.0]
>>> from music21 import medren, trecento
>>> div = trecento.notation.Divisione('.o.')
>>> names = ['SB', 'SB', 'SB']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> BL[1].setStem('down')
>>> TBL = trecento.notation.TranslateBrevisLength(div, 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 = trecento.notation.TranslateBrevisLength(div, BL)
>>> unchlist = TBL.getUnchangeableNoteLengths()
>>> unkldict = TBL.classifyUnknownNotesByType(unchlist)
>>> TBL.translateDivOD(unchlist, unkldict, 8.0)
[0.666..., 0.666..., 0.666..., 2.0, 3.999...]
>>> div = trecento.notation.Divisione('.d.')
>>> names = ['SB', 'SB']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(div, 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 = trecento.notation.TranslateBrevisLength(div, 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 = trecento.notation.TranslateBrevisLength(div, 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 = trecento.notation.TranslateBrevisLength(div, BL)
>>> unchlist = TBL.getUnchangeableNoteLengths()
>>> 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 = trecento.notation.TranslateBrevisLength(div, 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]
>>> from music21 import medren, trecento
>>> div = trecento.notation.Divisione('.q.')
>>> names = ['SB','SB']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(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 = trecento.notation.TranslateBrevisLength(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 = trecento.notation.Divisione('.p.')
>>> names = ['SB','SB', 'SB']
>>> BL = [medren.MensuralNote('A', n) for n in names]
>>> TBL = trecento.notation.TranslateBrevisLength(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 = trecento.notation.TranslateBrevisLength(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 = trecento.notation.TranslateBrevisLength(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]