silence_every

rhythmmakertools.silence_every(indices, period=None, inverted=None, use_multimeasure_rests=None)

Makes silence mask that matches indices at period.

Silences every second division:

>>> mask = rhythmmakertools.silence_every(indices=[1], period=2)
>>> f(mask)
rhythmmakertools.SilenceMask(
    pattern=patterntools.Pattern(
        indices=[1],
        period=2,
        ),
    )
>>> rhythm_maker = rhythmmakertools.NoteRhythmMaker(
...     division_masks=[mask],
...     )
>>> divisions = [(7, 16), (3, 8), (7, 16), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Silences every second and third division:

>>> mask = rhythmmakertools.silence_every(indices=[1, 2], period=3)
>>> f(mask)
rhythmmakertools.SilenceMask(
    pattern=patterntools.Pattern(
        indices=[1, 2],
        period=3,
        ),
    )
>>> rhythm_maker = rhythmmakertools.NoteRhythmMaker(
...     division_masks=[mask],
...     )
>>> divisions = [(7, 16), (3, 8), (7, 16), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Silences every division except the last:

>>> mask = rhythmmakertools.silence_every(indices=[-1], inverted=True)
>>> f(mask)
rhythmmakertools.SilenceMask(
    pattern=patterntools.Pattern(
        indices=[-1],
        inverted=True,
        ),
    )
>>> rhythm_maker = rhythmmakertools.NoteRhythmMaker(
...     division_masks=[mask],
...     )
>>> divisions = [(7, 16), (3, 8), (7, 16), (3, 8)]
>>> selections = rhythm_maker(divisions)
>>> lilypond_file = rhythmmakertools.make_lilypond_file(
...     selections,
...     divisions,
...     )
>>> show(lilypond_file) 

Returns silence mask.