def new(self, **kwargs): r'''Create new division-incised rest rhythm-maker with `kwargs`: :: >>> print maker.storage_format rhythmmakertools.DivisionIncisedRestRhythmMaker( prefix_talea=[1], prefix_lengths=[1, 2, 3, 4], suffix_talea=[1], suffix_lengths=[1], talea_denominator=32, prolation_addenda=[], secondary_divisions=[], decrease_durations_monotonically=True, tie_rests=False, beam_each_cell=False, beam_cells_together=False ) :: >>> new_maker = maker.new(suffix_lengths=[0]) :: >>> print new_maker.storage_format rhythmmakertools.DivisionIncisedRestRhythmMaker( prefix_talea=[1], prefix_lengths=[1, 2, 3, 4], suffix_talea=[1], suffix_lengths=[0], talea_denominator=32, prolation_addenda=[], secondary_divisions=[], decrease_durations_monotonically=True, tie_rests=False, beam_each_cell=False, beam_cells_together=False ) :: >>> divisions = [(5, 16), (5, 16), (5, 16), (5, 16)] >>> leaf_lists = new_maker(divisions) >>> leaves = sequencetools.flatten_sequence(leaf_lists) >>> measures = \ ... measuretools.make_measures_with_full_measure_spacer_skips( ... divisions) >>> staff = Staff(measures) >>> measures = measuretools.replace_contents_of_measures_in_expr( ... staff, leaves) :: >>> show(staff) # doctest: +SKIP Returns new division-incised rest rhythm-maker. ''' return DivisionIncisedRhythmMaker.new(self, **kwargs)
def reverse(self): r'''Reverse division-incised note rhythm-maker. Nonreversed output: >>> print maker.storage_format rhythmmakertools.DivisionIncisedNoteRhythmMaker( prefix_talea=[-1], prefix_lengths=[0, 1], suffix_talea=[-1], suffix_lengths=[1], talea_denominator=16, body_ratio=mathtools.Ratio(1, 1), prolation_addenda=[], secondary_divisions=[], decrease_durations_monotonically=True, tie_rests=False, beam_each_cell=False, beam_cells_together=False ) :: >>> divisions = [(5, 16), (5, 16), (5, 16), (5, 16)] >>> leaf_lists = maker(divisions) >>> leaves = sequencetools.flatten_sequence(leaf_lists) >>> measures = \ ... measuretools.make_measures_with_full_measure_spacer_skips( ... divisions) >>> staff = stafftools.RhythmicStaff(measures) >>> measures = measuretools.replace_contents_of_measures_in_expr( ... staff, leaves) :: >>> show(staff) # doctest: +SKIP Reversed output: :: >>> reversed_maker = maker.reverse() :: >>> print reversed_maker.storage_format rhythmmakertools.DivisionIncisedNoteRhythmMaker( prefix_talea=[-1], prefix_lengths=[1, 0], suffix_talea=[-1], suffix_lengths=[1], talea_denominator=16, body_ratio=mathtools.Ratio(1, 1), prolation_addenda=[], secondary_divisions=[], decrease_durations_monotonically=False, tie_rests=False, beam_each_cell=False, beam_cells_together=False ) :: >>> divisions = [(5, 16), (5, 16), (5, 16), (5, 16)] >>> leaf_lists = reversed_maker(divisions) >>> leaves = sequencetools.flatten_sequence(leaf_lists) >>> measures = \ ... measuretools.make_measures_with_full_measure_spacer_skips( ... divisions) >>> staff = stafftools.RhythmicStaff(measures) >>> measures = measuretools.replace_contents_of_measures_in_expr( ... staff, leaves) :: >>> show(staff) # doctest: +SKIP Returns division-incised note rhythm-maker. ''' return DivisionIncisedRhythmMaker.reverse(self)