make_leaves_from_talea

scoretools.make_leaves_from_talea(talea, talea_denominator, decrease_durations_monotonically=True, forbidden_written_duration=None, spell_metrically=None, use_messiaen_style_ties=False)

Makes leaves from talea.

Interprets positive elements in talea as notes numerators.

Interprets negative elements in talea as rests numerators.

Sets the pitch of all notes to middle C.

Example 1. Makes leaves from talea:

>>> leaves = scoretools.make_leaves_from_talea([3, -3, 5, -5], 16)
>>> staff = Staff(leaves)
>>> staff.context_name = 'RhythmicStaff'
>>> time_signature = TimeSignature((4, 4))
>>> attach(time_signature, staff)
>>> show(staff) 

Example 2. Increases durations monotonically:

>>> leaves = scoretools.make_leaves_from_talea(
...     [3, -3, 5, -5], 16,
...     decrease_durations_monotonically=False,
...     )
>>> staff = Staff(leaves)
>>> staff.context_name = 'RhythmicStaff'
>>> time_signature = TimeSignature((4, 4))
>>> attach(time_signature, staff)
>>> show(staff) 

Example 3. Forbids written durations greater than or equal to a half note:

>>> leaves = scoretools.make_leaves_from_talea(
...     [3, -3, 5, -5], 16,
...     forbidden_written_duration=Duration(1, 4),
...     )
>>> staff = Staff(leaves)
>>> staff.context_name = 'RhythmicStaff'
>>> time_signature = TimeSignature((4, 4))
>>> attach(time_signature, staff)
>>> show(staff) 

Example 4. Spells unassignable durations metrically:

>>> leaves = scoretools.make_leaves_from_talea(
...     [3, -3, 5, -5], 16,
...     spell_metrically='unassignable',
...     )
>>> staff = Staff(leaves)
>>> staff.context_name = 'RhythmicStaff'
>>> time_signature = TimeSignature((4, 4))
>>> attach(time_signature, staff)
>>> show(staff) 

Example 5. Uses Messiaen-style ties:

>>> leaves = scoretools.make_leaves_from_talea(
...     [5, 9], 8,
...     spell_metrically='unassignable',
...     use_messiaen_style_ties=True,
...     )
>>> staff = Staff(leaves)
>>> staff.context_name = 'RhythmicStaff'
>>> time_signature = TimeSignature((4, 4))
>>> attach(time_signature, staff)
>>> show(staff) 

Returns selection.