Exemplo n.º 1
0
def test_rhythmmakertools_TieSpecifier_01():

    divisions = [(3, 8), (5, 16), (1, 4), (5, 16)]
    rhythm_maker = rhythmmakertools.TaleaRhythmMaker(
        burnish_specifier=rhythmmakertools.BurnishSpecifier(
            left_classes=[abjad.Rest, abjad.Note],
            left_counts=[1],
        ),
        extra_counts_per_division=[0, 1, 1],
        talea=rhythmmakertools.Talea(
            counts=[1, 2, 3],
            denominator=16,
        ),
        tie_specifier=rhythmmakertools.TieSpecifier(
            tie_across_divisions=True, ),
    )
    selections = rhythm_maker(divisions)
    staff = abjad.Staff(selections)

    assert format(staff) == abjad.String.normalize(r'''
        \new Staff
        {
            \tweak text #tuplet-number::calc-fraction-text
            \times 1/1 {
                r16
                c'8
                [
                c'8.
                ~
                ]
            }
            \tweak text #tuplet-number::calc-fraction-text
            \times 5/6 {
                c'16
                [
                c'8
                c'8.
                ]
            }
            \times 4/5 {
                r16
                c'8
                [
                c'8
                ~
                ]
            }
            \tweak text #tuplet-number::calc-fraction-text
            \times 1/1 {
                c'16
                [
                c'16
                c'8
                c'16
                ]
            }
        }
        ''')
Exemplo n.º 2
0
        dynamic_expressions=consort.DynamicExpression(
            division_period=2,
            dynamic_tokens='pp mf p p mf mf pp',
            start_dynamic_tokens='fp niente',
            stop_dynamic_tokens='niente f',
        ),
        stem_tremolo_spanner=consort.AttachmentExpression(
            attachments=spannertools.StemTremoloSpanner(),
            selector=selectortools.select_pitched_runs(),
        ),
    ),
    color='red',
    pitch_handler=consort.AbsolutePitchHandler(
        logical_tie_expressions=[
            consort.ChordExpression(chord_expr=_, )
            for _ in abbreviations.guitar_chords
        ],
        pitch_specifier=consort.PitchSpecifier(
            pitch_segments=(
                'D3',
                'F3',
                'G2',
            ),
            ratio=(1, 1, 1),
        ),
    ),
    rhythm_maker=rhythmmakertools.NoteRhythmMaker(
        tie_specifier=rhythmmakertools.TieSpecifier(
            tie_across_divisions=True, ), ),
)
Exemplo n.º 3
0
 def _get_tie_specifier(self):
     from abjad.tools import rhythmmakertools
     if self.tie_specifier is not None:
         return self.tie_specifier
     return rhythmmakertools.TieSpecifier()
Exemplo n.º 4
0
 def _tie_across_divisions(self, selections):
     from abjad.tools import rhythmmakertools
     tie_specifier = self.tie_specifier
     if tie_specifier is None:
         tie_specifier = rhythmmakertools.TieSpecifier()
     tie_specifier._make_ties_across_divisions(selections)
Exemplo n.º 5
0
 pitch_handler=consort.AbsolutePitchHandler(
     forbid_repetitions=True,
     pitch_specifier="f c' g' c' f g' c' f c' g' f",
     ),
 rhythm_maker=consort.CompositeRhythmMaker(
     last=rhythmmakertools.IncisedRhythmMaker(
         incise_specifier=rhythmmakertools.InciseSpecifier(
             prefix_counts=[0],
             suffix_talea=[1],
             suffix_counts=[1],
             talea_denominator=16,
             ),
         duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
             forbidden_written_duration=(1, 4),
             forbid_meter_rewriting=True,
             spell_metrically='unassignable',
             ),
         tie_specifier=rhythmmakertools.TieSpecifier(
             strip_ties=True,
             ),
         ),
     default=rhythmmakertools.EvenDivisionRhythmMaker(
         denominators=(4,),
         duration_spelling_specifier=rhythmmakertools.DurationSpellingSpecifier(
             forbidden_written_duration=(1, 4),
             forbid_meter_rewriting=True,
             spell_metrically='unassignable',
             ),
         ),
     ),
 )