Tools for working with medieval and Renaissance music – see also the trecento directory which works particularly on 14th-century Italian music.
The method music21.medren.convertHouseStyle() takes a score, durationScale, barlineStyle, tieTransfer, and inPlace as arguments. Of these, only score is not optional. Default values for durationScale, barlineStyle, tieTransfer, and inPlace are 2, ‘tick’, True, and False respectively.
Changing music21.medren.convertHouseStyle.barlineStyle changes how the barlines are displayed within the piece. Changing music21.medren.convertHouseStyle.durationScale keeps ratios of note durations constant, but scales each duration by the specified value. If changing the duration scale causes tied notes, and music21.medren.convertHouseStyle.tieTransfer is set to True, the total duration is transferred to the first note, and all remaining space is left blank.
Examples: The first image shows the original score. The second image shows the score with each note’s duration scaled by 2, and with the barline style set to ‘tick’. The circled area shows a space left blank due to tieTransfer being True.
>>> from music21 import *
>>> gloria = corpus.parse('luca/gloria')
>>> from music21 import *
>>> gloria = corpus.parse('luca/gloria')
>>> newGloria = medren.convertHouseStyle(gloria, durationScale = 2, barlineStyle = 'tick', tieTransfer = True)
evaluates how well a given score works as a Stretto fuga would work at different intervals
scale all notes and TimeSignatures by the scaling amount.
returns the Score object
Converts any right barlines in the previous style (oldStyle; default = ‘regular’) to have the newStyle (such as ‘tick’, ‘none’, etc., see bar.py). Leaves alone any other barline types (such as double bars, final bars, etc.). Also changes any measures with no specified barlines (which come out as ‘regular’) to have the new style.
returns the Score object.
transfer the duration of tied notes (if possible) to the first note and fill the remaining places with invisible rests:
returns the new Score object
Inherits from: TimeSignature, Music21Object, JSONSerializer
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 *
>>> d = medren.Divisione('senaria imperfecta')
>>> d.standardSymbol
'.i.'
>>> d = medren.Divisione('.p.')
>>> d.name
'senaria perfecta'
>>> d = medren.Divisione('q')
>>> d.standardSymbol
'.q.'
Divisione attributes
Attributes without Documentation: standardSymbol, name, timeString
Attributes inherited from TimeSignature: classSortOrder, inherited, beamSequence, symbolizeDenominator, symbol, beatSequence, summedNumerator, accentSequence, displaySequence
Attributes inherited from Music21Object: isSpanner, isStream, isVariant, id, groups, hideObjectOnPrint
Divisione properties
- 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.
>>> from music21 import * >>> n = medren.Divisione('.n.') >>> n.minimaPerBrevis 9 >>> n.minimaPerBrevis = 18 >>> n.minimaPerBrevis 18Properties inherited from TimeSignature: barDuration, beatCount, beatCountName, beatDivisionCount, beatDivisionCountName, beatDivisionDurations, beatDuration, beatLengthToQuarterLengthRatio, beatSubDivisionDurations, classification, denominator, musicxml, mx, numerator, quarterLengthToBeatLengthRatio, totalLength
Properties inherited from Music21Object: activeSite, beat, beatStr, beatStrength, classes, derivationHierarchy, duration, isGrace, measureNumber, offset, priority, seconds
Properties inherited from JSONSerializer: json
Divisione methods
Methods inherited from TimeSignature: getAccent(), getAccentWeight(), getBeams(), getBeat(), getBeatDepth(), getBeatDuration(), getBeatOffsets(), getBeatProgress(), getBeatProportion(), getBeatProportionStr(), getOffsetFromBeat(), load(), loadRatio(), quarterPositionToBeat(), ratioEqual(), setAccentWeight(), setDisplay()
Methods inherited from Music21Object: searchActiveSiteByAttr(), getContextAttr(), setContextAttr(), addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSite(), hasSpannerSite(), hasVariantSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), purgeOrphans(), purgeUndeclaredIds(), removeLocationBySite(), removeLocationBySiteId(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()
Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()
Inherits from: Music21Object, JSONSerializer
The base class object for music21.medren.MensuralNote and music21.medren.MensuralRest. This is arguably the most important mensural object, since it is responsible for getting the context and determining the contextual duration of objects within both subclasses. A musci21.medren.GeneralMensuralNote object takes a mensural type or its abbreviation as an argument. The default value for this argument is ‘brevis’.
Valid mensural types are ‘maxima’, ‘longa’, ‘brevis’, ‘semibrevis’, ‘minima’, and ‘semiminima’. The corresponding abbreviations are ‘Mx’, ‘L’, ‘B’, ‘SB’, ‘M’, and ‘SM’.
The object’s mensural type can be set and accessed via the property music21.medren.GeneralMensuralNote.mensuralType. The duration of a general mensural note can be set and accessed using the property music21.medren.GeneralMensuralNote.duration. If the duration of an general mensural note cannot be determined from context, it is set to 0. For more specific examples of this, please see the music21.medren.GeneralMensuralNote.duration documentation.
Two general mensural notes are considered equal if they have the same mensural type, are present in the same context, and have the same offset within that context.
GeneralMensuralNote attributes
Attributes inherited from Music21Object: classSortOrder, isSpanner, isStream, isVariant, hideObjectOnPrint, groups, id
GeneralMensuralNote properties
- mensuralType¶
Name of the mensural length of the general mensural note (brevis, longa, etc.):
>>> from music21 import * >>> gmn = medren.GeneralMensuralNote('maxima') >>> gmn.mensuralType 'maxima' >>> gmn_1 = medren.GeneralMensuralNote('SB') >>> gmn_1.mensuralType 'semibrevis' >>> gmn_2 = medren.GeneralMensuralNote('blah') Traceback (most recent call last): MedRenException: blah is not a valid mensural type or abbreviationProperties inherited from Music21Object: activeSite, beat, beatDuration, beatStr, beatStrength, classes, derivationHierarchy, duration, isGrace, measureNumber, offset, priority, seconds
Properties inherited from JSONSerializer: json
GeneralMensuralNote methods
- updateDurationFromMensuration()¶
The duration of a music21.medren.GeneralMensuralNote object can be accessed and set using the music21.medren.GeneralMensuralNote.duration property. The duration of a general mensural note is by default 0. If the object’s subclass is not specified (music21.medren.MensuralNote or music21.medren.MensuralRest), the duration will remain 0 unless set to some other value. If a general mensural note has no context, the duration will remain 0 since duration is context dependant. Finally, if a mensural note or a mensural rest has context, but a mensuration or divisione cannot be found or determined from that context, the duration will remain 0.
Every time a duration is changed, the method music21.medren.GeneralMensuralNote.updateDurationFromMensuration`() should be called.
>>> from music21 import * >>> mn = medren.GeneralMensuralNote('B') >>> mn.duration.quarterLength 0.0 >>> mn = medren.MensuralNote('A', 'B') >>> mn.duration.quarterLength 0.0However, if subclass is given, context (a stream) is given, and a divisioned is given, duration can be determined.
>>> from music21 import * >>> s = stream.Stream() >>> s.append(medren.Divisione('.p.')) >>> for i in range(3): ... s.append(medren.MensuralNote('A', 'SB')) >>> s.append(medren.Punctus()) >>> s.append(medren.MensuralNote('B', 'SB')) >>> s.append(medren.MensuralNote('B', 'SB')) >>> s.append(medren.Punctus()) >>> s.append(medren.MensuralNote('A', 'B')) >>> for mn in s: ... if isinstance(mn, medren.GeneralMensuralNote): ... mn.updateDurationFromMensuration() ... print mn.duration.quarterLength 1.0 1.0 1.0 1.0 2.0 3.0Note: French notation not yet supported.
Methods inherited from Music21Object: searchActiveSiteByAttr(), getContextAttr(), setContextAttr(), addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSite(), hasSpannerSite(), hasVariantSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), purgeOrphans(), purgeUndeclaredIds(), removeLocationBySite(), removeLocationBySiteId(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()
Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()
Inherits from: Music21Object, JSONSerializer
An object that represents a ligature commonly found in medieval and Renaissance music. Initialization takes a list of the pitches in the ligature as a required argument. Color of the ligature is an optional argument (default is ‘black’). Color can also be set with the music21.medren.Ligature.setColor() method. Color of a ligature can be determined with the music21.medren.Ligature.getColor() method. Whether the noteheads of the ligature are filled is an optional argument (default is ‘yes’). Noteheads can be also filled with the music21.medren.Ligature.setFillStatus() method. Fill status of a ligature can be determined with the music21.medren.Ligature.getFillStatus() method.
The notes of the ligature can be accessed via the property music21.medren.Ligature.notes. The mensural length of each note is calculated automatically. To determine if a ligature is cum proprietate, use the music21.medren.Ligature.isCumProprietate() method. Similarly, to determine if a ligautre is cum perfectione, use the music21.medren.Ligature.isCumPerfectione() method. Finally, to determine if a ligature is cum opposite proprietate (C.O.P), use the music21.medren.Ligature.isCOP() method.
Noteheads can be set to have oblique shape using the music21.medren.Ligature.makeOblique() method. Similarly, oblique noteheads can be set to have a square shape using the music21.medren.Ligature.makeSquare() method. The shape of a notehead can be determined using the music21.medren.Ligature.getNoteheadShape() method. By default, all noteheads in a ligature are square.
A note in the ligature can be made to be maxima by the music21.medren.Ligature.setMaxima() method. It can be determined whether a note is a maxima by the music21.medren.Ligature.isMaxima() method. By default, no notes in a ligature are maxima.
A note in the ligature can be set to have an upstem, a downstem, or no stem by the music21.medren.Ligature.setStem() method. It can be determined whether a note has a stem by the music21.medren.Ligature.getStem() method. By default, no notes in a ligature have stems.
A note in the ligature can be ‘reversed’ by the music21.medren.Ligature.setReverse method. A ‘reversed’ note is displayed as stacked upon the preceding note (see the second note in the example). It can be determined whether a note is reversed by the music21.medren.Ligature.isReversed method. By default, no notes in a ligature are reversed. ————————————————————————————————————————————————————————————-
Example:
Roman de Fauvel. f. 1r. Paris, Bibliothèque Nationale de France, MS fr.
The ligatures outlined in blue would be constructed as follows:
>>> from music21 import *
>>> l1 = medren.Ligature(['A4','F4','G4','A4','B-4'])
>>> l1.makeOblique(0)
>>> l1.setStem(0, 'down', 'left')
>>> print [n.fullName for n in l1.notes]
['brevis A4 ', 'brevis F4 ', 'brevis G4 ', 'brevis A4 ', 'brevis B4-flat ']
>>>
>>> l2 = medren.Ligature(['F4','G4','A4','B-4','D5'])
>>> l2.setStem(4, 'down', 'left')
>>> l2.setReverse(4, True)
>>> print [(n.mensuralType, n.pitch) for n in l2.notes]
[('brevis', F4), ('brevis', G4), ('brevis', A4), ('brevis', B-4), ('longa', D5)]
Note that ligatures cannot be displayed yet.
Ligature attributes
Ligature properties
- notes¶
Returns the ligature as a list of mensural notes
>>> from music21 import * >>> l = medren.Ligature(['A4','B4']) >>> print [n.mensuralType for n in l.notes] ['brevis', 'brevis'] >>> l.makeOblique(0) >>> print [n.mensuralType for n in l.notes] ['longa', 'brevis'] >>> l = medren.Ligature(['B4','A4']) >>> print [n.mensuralType for n in l.notes] ['longa', 'longa'] >>> l.makeOblique(0) >>> print [n.mensuralType for n in l.notes] ['longa', 'brevis'] >>> l.setStem(0, 'down','left') >>> print [n.mensuralType for n in l.notes] ['brevis', 'brevis'] >>> l = medren.Ligature(['G4','A4','B4','A4']) >>> l.setStem(2, 'up','left') >>> print [n.mensuralType for n in l.notes] ['brevis', 'brevis', 'semibrevis', 'semibrevis'] >>> l = medren.Ligature(['B4','A4','G4','A4','G4','A4','F4']) >>> l.makeOblique(0) >>> l.makeOblique(4) >>> l.setStem(2, 'down', 'left') >>> l.setStem(4, 'up','left') >>> l.setMaxima(6, True) >>> print [n.mensuralType for n in l.notes] ['longa', 'brevis', 'longa', 'brevis', 'semibrevis', 'semibrevis', 'maxima']Properties inherited from Music21Object: activeSite, beat, beatDuration, beatStr, beatStrength, classes, derivationHierarchy, duration, isGrace, measureNumber, offset, priority, seconds
Properties inherited from JSONSerializer: json
Ligature methods
- getColor(index=None)¶
Take one argument: index (optional, default is None).
Returns the color of the note at the given index. If no index specified, returns the color of the ligature. If multiple colors are present, returns mixed.
- getFillStatus(index=None)¶
Take one argument: index (optional, default is None).
Returns whether the notehead is filled at the given index. If no index specified, returns whether fill status of the ligature. If noteheads are not consistent throughout the ligature, returns mixed.
- getNoteheadShape(index)¶
Takes one argument: index.
Returns the notehead shape (either square or oblique) of the note at index
- getStem(index)¶
Takes one argument: index If the note at index has a stem, it returns direction (up or down) and orientation (left, right)
- isCOP()¶
Takes no arguments
Returns True if the ligature is cum oposita proprietate (C.O.P), and False otherwise
- isCumPerfectione()¶
Takes no arguments.
Returns True if the ligature is cum perfectione, and False if the ligature is sine perfectione.
- isCumProprietate()¶
Takes no arguments.
Returns True if the ligature is cum proprietate, and False if the ligature is sine proprietate.
- isMaxima(index)¶
Takes one argument: index.
If the note at index is a maxima, returns True. Otherwise, it returns False.
- isReversed(index)¶
Takes one argument: index.
If the note at index is reversed, returns True. Otherwise, it returns False.
- makeOblique(startIndex)¶
Takes one argument: startIndex.
Make the notes at startIndex and the note following startIndex into an oblique notehead. Note that an oblique notehead cannot start on the last note of a ligature. Also, a note that is a maxima cannot be the start or end of an oblique notehead.
>>> from music21 import * >>> l = medren.Ligature(['A4','C5','B4','A4']) >>> l.makeOblique(1) >>> l.getNoteheadShape(1) 'oblique' >>> l.getNoteheadShape(2) 'oblique' >>> l.makeOblique(0) Traceback (most recent call last): MedRenException: cannot start oblique notehead at index 0 >>> l.makeOblique(2) Traceback (most recent call last): MedRenException: cannot start oblique notehead at index 2 >>> l.makeOblique(3) Traceback (most recent call last): MedRenException: no note exists at index 4
- makeSquare(index)¶
Takes one argument: index.
Sets the note at index to have a square notehead. If the note at index is part of an oblique notehead, all other notes that are part of that notehead are also set to have square noteheads.
>>> from music21 import * >>> l = medren.Ligature(['A4','C5','B4','A4']) >>> l.makeOblique(1) >>> l.makeSquare(2) >>> l.getNoteheadShape(2) 'square' >>> l.getNoteheadShape(1) 'square'
- setColor(value, index=None)¶
Takes two arguments: value, index (optional, default is None).
Sets the color of note at index to value. If no index is specified, or index is set to None, every note in the ligature is given value as a color.
>>> from music21 import * >>> l = medren.Ligature(['A4','C5','B4']) >>> l.setColor('red') >>> l.getColor() 'red' >>> l.setColor('black',1) >>> l.getColor() 'mixed'
- setFillStatus(value, index=None)¶
Takes two arguments: value, index (optional, default is None).
Sets the fill status of the notehead at index to value. If no index is specified, or if index is set to None, every notehead is give fill status value. To set a notehead as filled, value should be ‘yes’ or ‘filled’. To set a notehead as empty, value should be ‘no’ or ‘empty’ .
>>> from music21 import * >>> l = medren.Ligature(['A4','C5','B4']) >>> l.setFillStatus('filled') >>> l.getFillStatus() 'yes' >>> l.setFillStatus('no', 1) >>> l.getFillStatus() 'mixed'
- setMaxima(index, value)¶
Takes two arguments: index, value.
Sets the note at index to value. If value is True, that note is a maxima. If value if False, that note is not. A note with an oblique notehead cannot be a maxima. A note cannot be a maxima if that note has a stem. A note cannot be a maxima if the previous note has an up-stem.
>>> from music21 import * >>> l = medren.Ligature(['A4','C5','B4']) >>> l.setStem(0, 'up', 'left') >>> l.setMaxima(2, True) >>> l.isMaxima(2) True >>> l.setMaxima(1, True) Traceback (most recent call last): MedRenException: cannot make note at index 1 a maxima >>> l.setMaxima(0, True) Traceback (most recent call last): MedRenException: cannot make note at index 0 a maxima >>> l.setMaxima(2, False) >>> l.isMaxima(2) False
- setReverse(endIndex, value)¶
Takes two arguments: startIndex, value.
endIndex designates the note to be reversed. value may be True or False. Setting value to True reverses the note at endIndex. Setting value to false ‘de-reverses’ the note at endIndex.
If the note at endIndex has a stem with direction ‘down’ and orientation ‘left’, and is at least a step above the preceding note, it can be reversed. No two consecutive notes can be reversed. Also, if the note at endIndex is preceded by a note with an upstem, it cannot be reversed.
A reversed note is displayed directly on top of the preceeding note in the ligature.
>>> from music21 import * >>> l = medren.Ligature(['A4','C5','F5','F#5']) >>> l.setStem(1, 'down', 'left') >>> l.setStem(2, 'down', 'left') >>> l.setStem(3, 'down', 'left') >>> l.setReverse(1,True) >>> l.isReversed(1) True >>> l.setReverse(2,True) Traceback (most recent call last): MedRenException: the note at index 2 cannot be given reverse value True >>> l.setReverse(3,True) Traceback (most recent call last): MedRenException: the note at index 3 cannot be given reverse value True
- setStem(index, direction, orientation)¶
Takes three arguments: index, direction, orientation.
Index determines which note in the ligature the stem will be placed on. Direction determines which way the stem faces. Permitted directions are ‘up’,’down’, and ‘none’. Orientation determines on which side of the note the stem sits. Permitted orientations are ‘left’, ‘right’, and ‘none’. Setting the direction and orientation of a stem to ‘none’ removes the stem from the note.
Note that if the direction of a stem is ‘none’, then no stem is present on that note. So the orientation must also be ‘none’. Also note that an up-stem followed consecutively by a stemmed note is not permitted. An up-stem cannot be on the last note of a ligature. Stems may also not overlap. So two consecutive notes may note have stem orientations ‘right’ and ‘left’ respectively. Finally, a stem cannot be set on a note that is a maxima. An up-stem cannot be set on a note preceding a maxima.
>>> from music21 import * >>> l = medren.Ligature(['A4','C5','B4','A4','B4']) >>> l.setStem(0, 'none','left') Traceback (most recent call last): MedRenException: direction None and orientation left not supported for ligatures >>> l.setStem(1,'up', 'left') >>> l.getStem(1) ('up', 'left') >>> l.setStem(2, 'down', 'right') Traceback (most recent call last): MedRenException: a stem with direction down not permitted at index 2 >>> l.setMaxima(4, True) >>> l.setStem(4, 'up', 'left') Traceback (most recent call last): MedRenException: cannot place stem at index 4 >>> l.setStem(3, 'up','left') Traceback (most recent call last): MedRenException: a stem with direction up not permitted at index 3Methods inherited from Music21Object: searchActiveSiteByAttr(), getContextAttr(), setContextAttr(), addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSite(), hasSpannerSite(), hasVariantSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), purgeOrphans(), purgeUndeclaredIds(), removeLocationBySite(), removeLocationBySiteId(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()
Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()
Inherits from: GeneralMensuralNote, Note, NotRest, GeneralNote, Music21Object, JSONSerializer
An object representing a mensural note commonly found in medieval and renaissance music. Takes pitch and mensural type as arguments, but defaults to ‘C’ and ‘brevis’. Pitch and and mensural type can also be set using the properties music21.medren.MensuralNote.pitch and music21.medren.MensuralNote.mensuralType respectively. The utf-8 code for the Ciconia font character can be accessed via the property music21.medren.MensuralNote.fontString
The note stems can can be set using the method music21.medren.MensuralNote.setStem(). A note’s stems can be displayed using the method music21.medren.MensuralNote.getStems(). Stems may only be added to notes shorter than a brevis. For additional detail, see the documentation for music21.medren.MensuralNote.setStem().
The note flags can be set using the method music21.medren.MensuralNote.setFlag(). A note’s flags can be displayed using the method music21.medren.MensuralNote.getFlags(). Flags may only be added to stems that exist for the given note. For additional detail, see the documentation for music21.medren.MensuralNote.setFlag().
Two mensural notes are considered equal if they match in pitch, articulation, and are equal as general mensural notes.
Additional methods regarding color, duration, mensural type are inherited from music21.medren.GeneralMensuralNote.
MensuralNote attributes
Attributes without Documentation: stems, flags
Attributes inherited from Note: isNote, isRest, isUnpitched, pitch, beams
Attributes inherited from GeneralNote: isChord, lyrics, expressions, tie, articulations, editorial
Attributes inherited from Music21Object: classSortOrder, isSpanner, isStream, isVariant, id, groups, hideObjectOnPrint
MensuralNote properties
- color¶
The only valid colors for mensural notes are red and black
>>> from music21 import * >>> n = medren.MensuralNote('A', 'brevis') >>> n.color >>> >>> n.color = 'red' >>> n.color 'red' >>> n.color = 'green' Traceback (most recent call last): MedRenException: color green not supported for mensural notes
- fontString¶
- The utf-8 code corresponding to a mensural note in Ciconia font.
Note that semiminima with a left flag on the upper stem and any flag on the lower stem, semiminima with a right flag on the upperstem and on the lowerstem, and any red or unfilled notes with sidestems have no corresponding characters in the Cicionia font.
>>> from music21 import * >>> mn = medren.MensuralNote('A', 'M') >>> mn.setStem('down') >>> mn.fontString '0x44' >>> mn.setFlag('down', 'right') >>> mn.fontString '0x47' >>> mn.setFlag('down', None) >>> mn.setStem(None) >>> mn.fontString '0x4d' >>> mn.color = 'red' >>> mn.fontString '0x6d'
- fullName¶
No documentation.
Properties inherited from GeneralMensuralNote: mensuralType
Properties inherited from Note: nameWithOctave, pitchClass, accidental, diatonicNoteNum, freq440, frequency, microtone, midi, midiEvents, midiFile, mx, name, octave, pitchClassString, pitchNames, pitches, ps, step
Properties inherited from NotRest: notehead, noteheadFill, noteheadParen, stemDirection, volume
Properties inherited from GeneralNote: quarterLength, lyric, musicxml
Properties inherited from Music21Object: duration, activeSite, beat, beatDuration, beatStr, beatStrength, classes, derivationHierarchy, isGrace, measureNumber, offset, priority, seconds
Properties inherited from JSONSerializer: json
MensuralNote methods
- getFlags()¶
Returns a dictionary of each stem with its corresponding flag.
- getNumDots()¶
Used for French notation. Not yet implemented
- getStems()¶
Returns a list of stem directions. If the note has no stem, returns an empty list
- setFlag(stemDirection, orientation)¶
Takes two arguments: stemDirection and orientation.
stemDirection may be ‘up’ or ‘down’ (sidestems cannot have flags), and orientation may be ‘left’ or ‘right’. If the note has a stem with direction stemDirection, a flag with the specified orientation is added. Any stem may only have up to one flag, so setting a flag overrides whatever flag was previously present. Setting the orientation of a flag to None returns that stem to its default flag setting (‘right’ for semiminima, None otherwise).
A minima may not have a flag on its upstem, while a semiminima always has a flag on its upstem. The flag orientation for a semiminima is ‘right’ by default, but may be set to ‘left’. Any note with a downstem may also have a flag on that stem.
>>> from music21 import * >>> r_1 = medren.MensuralNote('A', 'minima') >>> r_1.setFlag('up', 'right') Traceback (most recent call last): MedRenException: a flag may not be added to an upstem of note type minima >>> r_1.setStem('down') >>> r_1.setFlag('down', 'left') >>> r_1.getFlags() {'down': 'left', 'up': None} >>> r_2 = medren.MensuralNote('A', 'semiminima') >>> r_2.getFlags() {'up': 'right'} >>> r_2.setFlag('up', 'left') >>> r_2.getFlags() {'up': 'left'} >>> r_3 = medren.MensuralNote('A','semibrevis') >>> r_3.setStem('side') >>> r_3.setFlag('side','left') Traceback (most recent call last): MedRenException: a flag cannot be added to a stem with direction side
- setStem(direction)¶
Takes one argument: direction.
Adds a stem to a note. Any note with length less than or equal to a minima gets an upstem by default. Any note can have at most two stems. Valid stem directions are “down” and “side”. Downstems can be applied to any note with length less than or equal to a brevis. Side stems in Trecento notation are the equivalent of dots, but may only be applied to notes of the type semibrevis and minima (hence, a dotted note may not have a side stem, and vice versa). Setting stem direction to None removes all but the default number of stems.
>>> from music21 import * >>> r_1 = medren.MensuralNote('A', 'brevis') >>> r_1.setStem('down') Traceback (most recent call last): MedRenException: A note of type brevis cannot be equipped with a stem >>> r_2 = medren.MensuralNote('A', 'semibrevis') >>> r_2.setStem('down') >>> r_2.setStem('side') >>> r_2.getStems() ['down', 'side'] >>> r_3 = medren.MensuralNote('A', 'minima') >>> r_3.setStem('side') >>> r_3.getStems() ['up', 'side'] >>> r_3.setStem('down') Traceback (most recent call last): MedRenException: This note already has the maximum number of stems >>> r_3.setStem(None) >>> r_3.getStems() ['up']Methods inherited from GeneralMensuralNote: updateDurationFromMensuration()
Methods inherited from Note: jsonAttributes(), setAccidental(), transpose()
Methods inherited from GeneralNote: addLyric(), augmentOrDiminish(), compactNoteInfo(), getGrace(), hasLyrics(), insertLyric()
Methods inherited from Music21Object: addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextAttr(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSite(), hasSpannerSite(), hasVariantSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), purgeOrphans(), purgeUndeclaredIds(), removeLocationBySite(), removeLocationBySiteId(), searchActiveSiteByAttr(), setContextAttr(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()
Methods inherited from JSONSerializer: jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()
Inherits from: GeneralMensuralNote, Rest, GeneralNote, Music21Object, JSONSerializer
An object representing a mensural rest. First argument is mensural type. The utf-8 code for the Ciconia font character can be accessed via the property music21.medren.MensuralNote.fontString
Additional methods regarding color, duration, equality, and mensural type are inherited from music21.medren.GeneralMensuralNote.
MensuralRest attributes
Attributes inherited from Rest: isNote, isRest, isUnpitched, name
Attributes inherited from GeneralNote: editorial, isChord, expressions, tie, lyrics, articulations
Attributes inherited from Music21Object: classSortOrder, isSpanner, isStream, isVariant, hideObjectOnPrint, groups, id
MensuralRest properties
- fontString¶
- The utf-8 code corresponding to the mensural rest in Ciconia font.
Note that there is no character for a semiminima rest yet.
>>> from music21 import * >>> mr = medren.MensuralRest('SB') >>> mr.fontString '0x32'
- fullName¶
No documentation.
Properties inherited from GeneralMensuralNote: mensuralType
Properties inherited from Rest: mx
Properties inherited from GeneralNote: quarterLength, color, lyric, musicxml
Properties inherited from Music21Object: duration, activeSite, beat, beatDuration, beatStr, beatStrength, classes, derivationHierarchy, isGrace, measureNumber, offset, priority, seconds
Properties inherited from JSONSerializer: json
MensuralRest methods
Methods inherited from GeneralMensuralNote: updateDurationFromMensuration()
Methods inherited from GeneralNote: addLyric(), augmentOrDiminish(), compactNoteInfo(), getGrace(), hasLyrics(), insertLyric(), jsonAttributes()
Methods inherited from Music21Object: addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextAttr(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSite(), hasSpannerSite(), hasVariantSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), purgeOrphans(), purgeUndeclaredIds(), removeLocationBySite(), removeLocationBySiteId(), searchActiveSiteByAttr(), setContextAttr(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()
Methods inherited from JSONSerializer: jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()
Inherits from: TimeSignature, Music21Object, JSONSerializer
An object representing a mensuration sign found in French notation. Takes four optional arguments: tempus, prolation, mode, and maximode. Defaults are ‘perfect’, ‘minor’, ‘perfect’, and None respectively.
Valid values for tempus and mode are ‘perfect’ and ‘imperfect’. Valid values for prolation and maximode are ‘major’ and ‘minor’.
>>> from music21 import *
>>> ODot = medren.Mensuration(tempus = 'perfect', prolation = 'major')
>>> ODot.standardSymbol
'O-dot'
>>> ODot.fontString
'0x50'
Mensuration attributes
Attributes without Documentation: standardSymbol, tempus, prolation, maximode, mode, timeString
Attributes inherited from TimeSignature: classSortOrder, inherited, beamSequence, symbolizeDenominator, symbol, beatSequence, summedNumerator, displaySequence, accentSequence
Attributes inherited from Music21Object: isSpanner, isStream, isVariant, id, groups, hideObjectOnPrint
Mensuration properties
- fontString¶
The utf-8 code corresponding to the mensuration character in Ciconia font
>>> from music21 import * >>> O = medren.Mensuration('imperfect', 'major') >>> O.fontString '0x4f'
- minimaPerBrevis¶
Used to get or set the number of minima in a ‘measure’ under the given divisione.
>>> from music21 import * >>> c = medren.Mensuration('imperfect', 'minor') >>> c.minimaPerBrevis 4 >>> c.minimaPerBrevis = 8 >>> c.minimaPerBrevis 8Properties inherited from TimeSignature: barDuration, beatCount, beatCountName, beatDivisionCount, beatDivisionCountName, beatDivisionDurations, beatDuration, beatLengthToQuarterLengthRatio, beatSubDivisionDurations, classification, denominator, musicxml, mx, numerator, quarterLengthToBeatLengthRatio, totalLength
Properties inherited from Music21Object: activeSite, beat, beatStr, beatStrength, classes, derivationHierarchy, duration, isGrace, measureNumber, offset, priority, seconds
Properties inherited from JSONSerializer: json
Mensuration methods
Methods inherited from TimeSignature: getAccent(), getAccentWeight(), getBeams(), getBeat(), getBeatDepth(), getBeatDuration(), getBeatOffsets(), getBeatProgress(), getBeatProportion(), getBeatProportionStr(), getOffsetFromBeat(), load(), loadRatio(), quarterPositionToBeat(), ratioEqual(), setAccentWeight(), setDisplay()
Methods inherited from Music21Object: searchActiveSiteByAttr(), getContextAttr(), setContextAttr(), addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSite(), hasSpannerSite(), hasVariantSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), purgeOrphans(), purgeUndeclaredIds(), removeLocationBySite(), removeLocationBySiteId(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()
Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()
Inherits from: Music21Object, JSONSerializer
An object representing a punctus, found in Trecento notation.
Punctus attributes
Attributes inherited from Music21Object: classSortOrder, isSpanner, isStream, isVariant, hideObjectOnPrint, groups, id
Punctus properties
- fontString¶
The utf-8 code corresponding the punctus in Cicionia font
Properties inherited from Music21Object: activeSite, beat, beatDuration, beatStr, beatStrength, classes, derivationHierarchy, duration, isGrace, measureNumber, offset, priority, seconds
Properties inherited from JSONSerializer: json
Punctus methods
Methods inherited from Music21Object: searchActiveSiteByAttr(), getContextAttr(), setContextAttr(), addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSite(), hasSpannerSite(), hasVariantSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), purgeOrphans(), purgeUndeclaredIds(), removeLocationBySite(), removeLocationBySiteId(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()
Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()