FrontPaddedSnippet bases
FrontPaddedSnippet read-only properties
Read-only properties inherited from Score:
Read-only properties inherited from Stream:
Read-only properties inherited from Music21Object:
FrontPaddedSnippet read/write properties
Read/write properties inherited from Stream:
Read/write properties inherited from Music21Object:
FrontPaddedSnippet methods
Pads a line with a bunch of rests at the front to make it the same length as the longest line
>>> ts = meter.TimeSignature('1/4')
>>> s1 = stream.Part([ts])
>>> s1.repeatAppend(note.Note(type='quarter'), 4)
>>> s2 = stream.Part([ts])
>>> s2.repeatAppend(note.Note(type='quarter'), 2)
>>> s3 = stream.Part([ts])
>>> s3.repeatAppend(note.Note(type='quarter'), 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:
Methods inherited from Score:
Methods inherited from Stream:
Methods inherited from Music21Object:
FrontPaddedSnippet instance variables
Instance variables inherited from PolyphonicSnippet:
|
|
|
Instance variables inherited from Score:
|
|
|
Instance variables inherited from Stream:
Instance variables inherited from Music21Object:
Incipit bases
Incipit read-only properties
Read-only properties inherited from Score:
Read-only properties inherited from Stream:
Read-only properties inherited from Music21Object:
Incipit read/write properties
Read/write properties inherited from Stream:
Read/write properties inherited from Music21Object:
Incipit methods
Pads a Stream with a bunch of rests at the end to make it the same length as the longest line
>>> ts = meter.TimeSignature('1/4')
>>> s1 = stream.Part([ts])
>>> s1.repeatAppend(note.Note(type='quarter'), 4)
>>> s2 = stream.Part([ts])
>>> s2.repeatAppend(note.Note(type='quarter'), 2)
>>> s3 = stream.Part([ts])
>>> s3.repeatAppend(note.Note(type='quarter'), 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.clef.TrebleClef>
{0.0} <music21.meter.TimeSignature 1/4>
{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:
Methods inherited from Score:
Methods inherited from Stream:
Methods inherited from Music21Object:
Incipit instance variables
Instance variables inherited from PolyphonicSnippet:
|
|
|
Instance variables inherited from Score:
|
|
|
Instance variables inherited from Stream:
Instance variables inherited from Music21Object:
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.
>>> 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.parts[0] is cantus
True
>>> ps.parts[0].classes
['Part', 'TrecentoCadenceStream', 'TinyNotationStream', 'Stream', 'Music21Object', 'object']
>>> ps.show()
PolyphonicSnippet bases
PolyphonicSnippet read-only properties
Read-only properties inherited from Score:
Read-only properties inherited from Stream:
Read-only properties inherited from Music21Object:
PolyphonicSnippet read/write properties
Read/write properties inherited from Stream:
Read/write properties inherited from Music21Object:
PolyphonicSnippet methods
returns the length. (in quarterLengths) for the longest line in the parts
>>> s1 = stream.Part([note.Note(type='whole')])
>>> s2 = stream.Part([note.Note(type='half')])
>>> s3 = stream.Part([note.Note(type='quarter')])
>>> fiveExcelRows = [s1, s2, s3, '', '2/2']
>>> ps = trecento.polyphonicSnippet.PolyphonicSnippet(fiveExcelRows)
>>> ps.findLongestCadence()
4.0
returns a string that prints an appropriate header for this cadence
returns the number of measures short that each stream is compared to the longest stream.
>>> s1 = stream.Part([note.Note(type='whole')])
>>> s2 = stream.Part([note.Note(type='half')])
>>> s3 = stream.Part([note.Note(type='quarter')])
>>> 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.0
Methods inherited from Score:
Methods inherited from Stream:
Methods inherited from Music21Object:
PolyphonicSnippet instance variables
Instance variables inherited from Score:
|
|
|
Instance variables inherited from Stream:
Instance variables inherited from Music21Object: