TaleaTimespanMaker

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph cluster_builtins { graph [label=builtins]; node [color=1]; "builtins.object" [URL="https://docs.python.org/3.7/library/functions.html#object", label=object, target=_top]; } subgraph cluster_tsmakers { graph [label=tsmakers]; node [color=2]; "tsmakers.TaleaTimespanMaker.TaleaTimespanMaker" [URL="../api/tsmakers/TaleaTimespanMaker.html#tsmakers.TaleaTimespanMaker.TaleaTimespanMaker", color=black, fontcolor=white, label="Talea\nTimespan\nMaker", target=_top]; "tsmakers.TimespanMaker.TimespanMaker" [URL="../api/tsmakers/TimespanMaker.html#tsmakers.TimespanMaker.TimespanMaker", label="Timespan\nMaker", target=_top]; "tsmakers.TimespanMaker.TimespanMaker" -> "tsmakers.TaleaTimespanMaker.TaleaTimespanMaker"; } "builtins.object" -> "tsmakers.TimespanMaker.TimespanMaker"; }

class tsmakers.TaleaTimespanMaker.TaleaTimespanMaker(fuse_groups=None, initial_silence_talea=None, division_masks=None, padding=None, playing_talea=Talea([4], 16), playing_groupings=(1), reflect=None, repeat=True, seed=None, silence_talea=Talea([4], 16), step_anchor=Right, synchronize_groupings=False, synchronize_step=False, timespan_specifier=None)[source]

A talea timespan maker.

>>> timespan_maker = tsmakers.TaleaTimespanMaker(
...     initial_silence_talea=rmakers.Talea(
...         counts=(0, 4),
...         denominator=16,
...     )
... )
>>> print(abjad.storage(timespan_maker))
tsmakers.TaleaTimespanMaker(
    initial_silence_talea=rmakers.Talea(
        [0, 4],
        16
        ),
    playing_talea=rmakers.Talea(
        [4],
        16
        ),
    playing_groupings=(1,),
    repeat=True,
    silence_talea=rmakers.Talea(
        [4],
        16
        ),
    step_anchor=Right,
    synchronize_groupings=False,
    synchronize_step=False,
    )
>>> import collections
>>> music_specifiers = collections.OrderedDict(
...     [
...         ("A", None),
...         ("B", None),
...         ("C", None),
...         ("D", None),
...     ]
... )
>>> target_timespan = abjad.Timespan(0, 1)
>>> timespan_list = timespan_maker(
...     music_specifiers=music_specifiers,
...     target_timespan=target_timespan,
... )
>>> ts_list = abjad.TimespanList(
...     [
...         abjad.AnnotatedTimespan(
...             start_offset=_.start_offset,
...             stop_offset=_.stop_offset,
...             annotation=_.voice_name,
...         )
...         for _ in timespan_list
...     ]
... )
>>> abjad.show(ts_list, scale=0.5, key="annotation")  
>>> timespan_maker = abjad.new(
...     timespan_maker,
...     initial_silence_talea=None,
...     synchronize_step=True,
... )
>>> timespan_list = timespan_maker(
...     music_specifiers=music_specifiers,
...     target_timespan=target_timespan,
... )
>>> ts_list = abjad.TimespanList(
...     [
...         abjad.AnnotatedTimespan(
...             start_offset=_.start_offset,
...             stop_offset=_.stop_offset,
...             annotation=_.voice_name,
...         )
...         for _ in timespan_list
...     ]
... )
>>> abjad.show(ts_list, scale=0.5, key="annotation")  
>>> timespan_maker = abjad.new(
...     timespan_maker,
...     initial_silence_talea=rmakers.Talea(
...         counts=(0, 2),
...         denominator=16,
...     ),
... )
>>> timespan_list = timespan_maker(
...     music_specifiers=music_specifiers,
...     target_timespan=target_timespan,
... )
>>> ts_list = abjad.TimespanList(
...     [
...         abjad.AnnotatedTimespan(
...             start_offset=_.start_offset,
...             stop_offset=_.stop_offset,
...             annotation=_.voice_name,
...         )
...         for _ in timespan_list
...     ]
... )
>>> abjad.show(ts_list, scale=0.5, key="annotation")  
>>> music_specifiers = abjad.OrderedDict(
...     [(f"Voice {i+1}", None) for i in range(10)]
... )
>>> target_timespan = abjad.Timespan(0, 8)
>>> timespan_maker = tsmakers.TaleaTimespanMaker(
...     initial_silence_talea=rmakers.Talea(
...         counts=([0, 5, 3, 6, 2]), denominator=8
...     ),
...     playing_talea=rmakers.Talea(counts=([5, 3, 1, 2, 6]), denominator=4),
...     playing_groupings=([1, 2, 3, 2]),
...     silence_talea=rmakers.Talea(counts=([5, 3, 4, 3]), denominator=4),
... )
>>> temp_list = timespan_maker(
...     music_specifiers=music_specifiers, target_timespan=target_timespan
... )
>>> t_list = abjad.TimespanList()
>>> for span in temp_list:
...     new_span = abjad.AnnotatedTimespan(
...         span.start_offset,
...         span.stop_offset,
...         annotation=span.voice_name,
...     )
...     t_list.append(new_span)
... 
>>> def human_sorted_keys(pair):
...     key, timespan = pair
...     values = [to_digit(_) for _ in key.split()]
...     hashable_key = tuple(values)
...     return hashable_key
... 
>>> abjad.show(
...     t_list, scale=0.5, key="annotation", sort_callable=human_sorted_keys
... )  

Attributes Summary

fuse_groups

initial_silence_talea

playing_groupings

playing_talea

reflect

repeat

silence_talea

step_anchor

synchronize_groupings

synchronize_step


Special methods

(TimespanMaker).__call__(layer=None, music_specifiers=None, rotation=None, silenced_context_names=None, target_timespan=None, timespan_list=None)

Call self as a function.

(TimespanMaker).__format__(format_specification='')

Default object formatter.

(TimespanMaker).__illustrate__(scale=None, target_timespan=None, **kwargs)
(TimespanMaker).__repr__()

Return repr(self).

(TimespanMaker).__str__()

Return str(self).


Methods

(TimespanMaker).rotate(rotation)

Read-only properties

(TimespanMaker).division_masks
fuse_groups
initial_silence_talea
(TimespanMaker).is_dependent
(TimespanMaker).padding
playing_groupings
playing_talea
reflect
repeat
silence_talea
step_anchor
synchronize_groupings
synchronize_step
(TimespanMaker).timespan_specifier