Inherits from: PolyphonicSnippet, Score, Stream, Music21Object, JSONSerializer
FrontPaddedSnippet attributes
Attributes without Documentation: snippetName
Attributes inherited from Stream: isMeasure, isStream, isFlat, autoSort, isSorted, flattenedRepresentationOf
Attributes inherited from Music21Object: classSortOrder, isSpanner, isVariant, id, groups, hideObjectOnPrint
FrontPaddedSnippet properties
Properties inherited from Score: parts
Properties inherited from Stream: notes, pitches, atSoundingPitch, beat, beatDuration, beatStr, beatStrength, derivationChain, derivationMethod, derivesFrom, duration, elements, finalBarline, flat, highestOffset, highestTime, isGapless, lowestOffset, metadata, midiFile, musicxml, mx, notesAndRests, offsetMap, rootDerivation, seconds, secondsMap, semiFlat, sorted, spannerBundle, spanners, variants, voices
Properties inherited from Music21Object: activeSite, classes, derivationHierarchy, isGrace, measureNumber, offset, priority
Properties inherited from JSONSerializer: json
FrontPaddedSnippet methods
- frontPadLine(thisStream)¶
Pads a line with a bunch of rests at the front to make it the same length as the longest line
>>> from music21 import * >>> ts = meter.TimeSignature('1/4') >>> s1 = stream.Part([ts]) >>> s1.repeatAppend(note.QuarterNote(), 4) >>> s2 = stream.Part([ts]) >>> s2.repeatAppend(note.QuarterNote(), 2) >>> s3 = stream.Part([ts]) >>> s3.repeatAppend(note.QuarterNote(), 1) >>> fiveExcelRows = [s1, s2, s3, '', '1/4'] >>> ps = trecento.polyphonicSnippet.FrontPaddedSnippet(fiveExcelRows) >>> ps.frontPadLine(s2) >>> s2.show('text') {0.0} <music21.stream.Measure 1 offset=0.0> {0.0} <music21.clef.TrebleClef> {0.0} <music21.meter.TimeSignature 1/4> {0.0} <music21.note.Rest rest> {1.0} <music21.stream.Measure 2 offset=1.0> {0.0} <music21.note.Rest rest> {2.0} <music21.stream.Measure 3 offset=2.0> {0.0} <music21.note.Note C> {3.0} <music21.stream.Measure 4 offset=3.0> {0.0} <music21.note.Note C> {1.0} <music21.bar.Barline style=final>Methods inherited from PolyphonicSnippet: findLongestCadence(), header(), measuresShort()
Methods inherited from Score: expandRepeats(), flattenParts(), implode(), makeNotation(), measure(), measureOffsetMap(), measures(), partsToVoices(), sliceByGreatestDivisor()
Methods inherited from Stream: append(), insert(), insertAndShift(), transpose(), augmentOrDiminish(), scaleOffsets(), scaleDurations(), activateVariants(), addGroupForElements(), allPlayingWhileSounding(), analyze(), attachIntervalsBetweenStreams(), attachMelodicIntervals(), attributeCount(), bestClef(), chordify(), explode(), extendDuration(), extendDurationAndGetBoundaries(), extendTies(), extractContext(), findConsecutiveNotes(), findGaps(), flattenUnnecessaryVoices(), getClefs(), getElementAfterElement(), getElementAfterOffset(), getElementAtOrAfter(), getElementAtOrBefore(), getElementBeforeElement(), getElementBeforeOffset(), getElementById(), getElementByObjectId(), getElementsByClass(), getElementsByGroup(), getElementsByOffset(), getElementsNotOfClass(), getInstrument(), getInstruments(), getKeySignatures(), getOffsetByElement(), getOverlaps(), getSimultaneous(), getTimeSignatures(), groupCount(), groupElementsByOffset(), hasElement(), hasElementByObjectId(), hasElementOfClass(), hasMeasures(), hasPartLikeStreams(), hasVoices(), haveAccidentalsBeenMade(), haveBeamsBeenMade(), index(), insertAtNativeOffset(), insertIntoNoteOrChord(), internalize(), invertDiatonic(), isSequence(), isTwelveTone(), isWellFormedNotation(), makeAccidentals(), makeBeams(), makeChords(), makeImmutable(), makeMeasures(), makeMutable(), makeRests(), makeTies(), makeTupletBrackets(), makeVoices(), measureTemplate(), melodicIntervals(), mergeElements(), metronomeMarkBoundaries(), pitchAttributeCount(), playingWhenAttacked(), plot(), pop(), quantize(), realizeOrnaments(), recurse(), remove(), removeByClass(), removeByNotOfClass(), repeatAppend(), repeatInsert(), replace(), restoreActiveSites(), setDerivation(), setupSerializationScaffold(), shiftElements(), showVariantAsOssialikePart(), simultaneousAttacks(), sliceAtOffsets(), sliceByBeat(), sliceByQuarterLengths(), sort(), splitAtQuarterLength(), splitByClass(), storeAtEnd(), stripTies(), teardownSerializationScaffold(), toSoundingPitch(), toWrittenPitch(), transferOffsetToElements(), trimPlayingWhileSounding(), unwrapWeakref(), voicesToParts(), wrapWeakref()
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(), splitByQuarterLengths(), unfreezeIds(), write()
Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()
Inherits from: PolyphonicSnippet, Score, Stream, Music21Object, JSONSerializer
Incipit attributes
Attributes without Documentation: snippetName
Attributes inherited from Stream: isMeasure, isStream, isFlat, autoSort, isSorted, flattenedRepresentationOf
Attributes inherited from Music21Object: classSortOrder, isSpanner, isVariant, id, groups, hideObjectOnPrint
Incipit properties
Properties inherited from Score: parts
Properties inherited from Stream: notes, pitches, atSoundingPitch, beat, beatDuration, beatStr, beatStrength, derivationChain, derivationMethod, derivesFrom, duration, elements, finalBarline, flat, highestOffset, highestTime, isGapless, lowestOffset, metadata, midiFile, musicxml, mx, notesAndRests, offsetMap, rootDerivation, seconds, secondsMap, semiFlat, sorted, spannerBundle, spanners, variants, voices
Properties inherited from Music21Object: activeSite, classes, derivationHierarchy, isGrace, measureNumber, offset, priority
Properties inherited from JSONSerializer: json
Incipit methods
- backPadLine(thisStream)¶
Pads a Stream with a bunch of rests at the end to make it the same length as the longest line
>>> from music21 import * >>> ts = meter.TimeSignature('1/4') >>> s1 = stream.Part([ts]) >>> s1.repeatAppend(note.QuarterNote(), 4) >>> s2 = stream.Part([ts]) >>> s2.repeatAppend(note.QuarterNote(), 2) >>> s3 = stream.Part([ts]) >>> s3.repeatAppend(note.QuarterNote(), 1) >>> fiveExcelRows = [s1, s2, s3, '', '1/4'] >>> ps = trecento.polyphonicSnippet.Incipit(fiveExcelRows) >>> ps.backPadLine(s2) >>> s2.show('text') {0.0} <music21.stream.Measure 1 offset=0.0> {0.0} <music21.meter.TimeSignature 1/4> {0.0} <music21.clef.TrebleClef> {0.0} <music21.note.Note C> {1.0} <music21.stream.Measure 2 offset=1.0> {0.0} <music21.note.Note C> {2.0} <music21.stream.Measure 3 offset=2.0> {0.0} <music21.note.Rest rest> {3.0} <music21.stream.Measure 4 offset=3.0> {0.0} <music21.note.Rest rest> {1.0} <music21.bar.Barline style=final>Methods inherited from PolyphonicSnippet: findLongestCadence(), header(), measuresShort()
Methods inherited from Score: expandRepeats(), flattenParts(), implode(), makeNotation(), measure(), measureOffsetMap(), measures(), partsToVoices(), sliceByGreatestDivisor()
Methods inherited from Stream: append(), insert(), insertAndShift(), transpose(), augmentOrDiminish(), scaleOffsets(), scaleDurations(), activateVariants(), addGroupForElements(), allPlayingWhileSounding(), analyze(), attachIntervalsBetweenStreams(), attachMelodicIntervals(), attributeCount(), bestClef(), chordify(), explode(), extendDuration(), extendDurationAndGetBoundaries(), extendTies(), extractContext(), findConsecutiveNotes(), findGaps(), flattenUnnecessaryVoices(), getClefs(), getElementAfterElement(), getElementAfterOffset(), getElementAtOrAfter(), getElementAtOrBefore(), getElementBeforeElement(), getElementBeforeOffset(), getElementById(), getElementByObjectId(), getElementsByClass(), getElementsByGroup(), getElementsByOffset(), getElementsNotOfClass(), getInstrument(), getInstruments(), getKeySignatures(), getOffsetByElement(), getOverlaps(), getSimultaneous(), getTimeSignatures(), groupCount(), groupElementsByOffset(), hasElement(), hasElementByObjectId(), hasElementOfClass(), hasMeasures(), hasPartLikeStreams(), hasVoices(), haveAccidentalsBeenMade(), haveBeamsBeenMade(), index(), insertAtNativeOffset(), insertIntoNoteOrChord(), internalize(), invertDiatonic(), isSequence(), isTwelveTone(), isWellFormedNotation(), makeAccidentals(), makeBeams(), makeChords(), makeImmutable(), makeMeasures(), makeMutable(), makeRests(), makeTies(), makeTupletBrackets(), makeVoices(), measureTemplate(), melodicIntervals(), mergeElements(), metronomeMarkBoundaries(), pitchAttributeCount(), playingWhenAttacked(), plot(), pop(), quantize(), realizeOrnaments(), recurse(), remove(), removeByClass(), removeByNotOfClass(), repeatAppend(), repeatInsert(), replace(), restoreActiveSites(), setDerivation(), setupSerializationScaffold(), shiftElements(), showVariantAsOssialikePart(), simultaneousAttacks(), sliceAtOffsets(), sliceByBeat(), sliceByQuarterLengths(), sort(), splitAtQuarterLength(), splitByClass(), storeAtEnd(), stripTies(), teardownSerializationScaffold(), toSoundingPitch(), toWrittenPitch(), transferOffsetToElements(), trimPlayingWhileSounding(), unwrapWeakref(), voicesToParts(), wrapWeakref()
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(), splitByQuarterLengths(), unfreezeIds(), write()
Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()
Inherits from: Score, Stream, Music21Object, JSONSerializer
a polyphonic snippet is a little Score-ette that represents an incipit or a cadence or something of that sort of a piece
it is initialized with the contents of five excel cells – the first three represent the notation of the cantus, tenor, and contratenor, respectively. the fourth is the cadence type (optional), the fifth is the time signature if not the same as the time signature of the parentPiece.
>>> from music21 import *
>>> cantus = trecento.trecentoCadence.TrecentoCadenceStream("c'2. d'8 c'4 a8 f4 f8 a4 c'4 c'8", '6/8')
>>> tenor = trecento.trecentoCadence.TrecentoCadenceStream("F1. f2. e4. d", '6/8')
>>> ps = trecento.polyphonicSnippet.PolyphonicSnippet([cantus, tenor, None, "8-8", "6/8"], parentPiece = trecento.cadencebook.BallataSheet().makeWork(3))
>>> ps.elements
[<music21.metadata.Metadata object at 0x...>, <music21.stream.Part C>, <music21.stream.Part T>]
>>> ps.elements[1] is cantus
True
>>> ps.elements[1].classes
['Part', 'TrecentoCadenceStream', 'TinyNotationStream', 'Stream', 'Music21Object', 'JSONSerializer', 'object']
>>> ps.show()
PolyphonicSnippet attributes
Attributes without Documentation: snippetName
Attributes inherited from Stream: isMeasure, isStream, isFlat, autoSort, isSorted, flattenedRepresentationOf
Attributes inherited from Music21Object: classSortOrder, isSpanner, isVariant, id, groups, hideObjectOnPrint
PolyphonicSnippet properties
Properties inherited from Score: parts
Properties inherited from Stream: notes, pitches, atSoundingPitch, beat, beatDuration, beatStr, beatStrength, derivationChain, derivationMethod, derivesFrom, duration, elements, finalBarline, flat, highestOffset, highestTime, isGapless, lowestOffset, metadata, midiFile, musicxml, mx, notesAndRests, offsetMap, rootDerivation, seconds, secondsMap, semiFlat, sorted, spannerBundle, spanners, variants, voices
Properties inherited from Music21Object: activeSite, classes, derivationHierarchy, isGrace, measureNumber, offset, priority
Properties inherited from JSONSerializer: json
PolyphonicSnippet methods
- findLongestCadence()¶
returns the length. (in quarterLengths) for the longest line in the parts
>>> from music21 import * >>> s1 = stream.Part([note.WholeNote()]) >>> s2 = stream.Part([note.HalfNote()]) >>> s3 = stream.Part([note.QuarterNote()]) >>> fiveExcelRows = [s1, s2, s3, '', '2/2'] >>> ps = trecento.polyphonicSnippet.PolyphonicSnippet(fiveExcelRows) >>> ps.findLongestCadence() 4.0
- header()¶
returns a string that prints an appropriate header for this cadence
- measuresShort(thisStream)¶
returns the number of measures short that each stream is compared to the longest stream.
>>> from music21 import * >>> s1 = stream.Part([note.WholeNote()]) >>> s2 = stream.Part([note.HalfNote()]) >>> s3 = stream.Part([note.QuarterNote()]) >>> fiveExcelRows = [s1, s2, s3, '', '1/2'] >>> ps = trecento.polyphonicSnippet.PolyphonicSnippet(fiveExcelRows) >>> ps.findLongestCadence() 4.0 >>> ps.measuresShort(s2) 1.0 >>> ps.measuresShort(s3) 1.5 >>> ps.measuresShort(s1) 0.0Methods inherited from Score: expandRepeats(), flattenParts(), implode(), makeNotation(), measure(), measureOffsetMap(), measures(), partsToVoices(), sliceByGreatestDivisor()
Methods inherited from Stream: append(), insert(), insertAndShift(), transpose(), augmentOrDiminish(), scaleOffsets(), scaleDurations(), activateVariants(), addGroupForElements(), allPlayingWhileSounding(), analyze(), attachIntervalsBetweenStreams(), attachMelodicIntervals(), attributeCount(), bestClef(), chordify(), explode(), extendDuration(), extendDurationAndGetBoundaries(), extendTies(), extractContext(), findConsecutiveNotes(), findGaps(), flattenUnnecessaryVoices(), getClefs(), getElementAfterElement(), getElementAfterOffset(), getElementAtOrAfter(), getElementAtOrBefore(), getElementBeforeElement(), getElementBeforeOffset(), getElementById(), getElementByObjectId(), getElementsByClass(), getElementsByGroup(), getElementsByOffset(), getElementsNotOfClass(), getInstrument(), getInstruments(), getKeySignatures(), getOffsetByElement(), getOverlaps(), getSimultaneous(), getTimeSignatures(), groupCount(), groupElementsByOffset(), hasElement(), hasElementByObjectId(), hasElementOfClass(), hasMeasures(), hasPartLikeStreams(), hasVoices(), haveAccidentalsBeenMade(), haveBeamsBeenMade(), index(), insertAtNativeOffset(), insertIntoNoteOrChord(), internalize(), invertDiatonic(), isSequence(), isTwelveTone(), isWellFormedNotation(), makeAccidentals(), makeBeams(), makeChords(), makeImmutable(), makeMeasures(), makeMutable(), makeRests(), makeTies(), makeTupletBrackets(), makeVoices(), measureTemplate(), melodicIntervals(), mergeElements(), metronomeMarkBoundaries(), pitchAttributeCount(), playingWhenAttacked(), plot(), pop(), quantize(), realizeOrnaments(), recurse(), remove(), removeByClass(), removeByNotOfClass(), repeatAppend(), repeatInsert(), replace(), restoreActiveSites(), setDerivation(), setupSerializationScaffold(), shiftElements(), showVariantAsOssialikePart(), simultaneousAttacks(), sliceAtOffsets(), sliceByBeat(), sliceByQuarterLengths(), sort(), splitAtQuarterLength(), splitByClass(), storeAtEnd(), stripTies(), teardownSerializationScaffold(), toSoundingPitch(), toWrittenPitch(), transferOffsetToElements(), trimPlayingWhileSounding(), unwrapWeakref(), voicesToParts(), wrapWeakref()
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(), splitByQuarterLengths(), unfreezeIds(), write()
Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()