Skip to content

Commit

Permalink
(#842) Migrated rhythmmakertools.silence*(), sustain*() to static met…
Browse files Browse the repository at this point in the history
…hods.

This closes #842.
  • Loading branch information
trevorbaca committed Jul 31, 2017
1 parent 4dcdbf3 commit 40ae386
Show file tree
Hide file tree
Showing 23 changed files with 2,006 additions and 2,032 deletions.
24 changes: 13 additions & 11 deletions abjad/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,19 @@
from abjad.tools.timespantools import Timespan

# rhythm-maker functions (but not classes)
from abjad.tools.rhythmmakertools import silence
from abjad.tools.rhythmmakertools import silence_all
from abjad.tools.rhythmmakertools import silence_every
from abjad.tools.rhythmmakertools import silence_except
from abjad.tools.rhythmmakertools import silence_first
from abjad.tools.rhythmmakertools import silence_last
from abjad.tools.rhythmmakertools import sustain
from abjad.tools.rhythmmakertools import sustain_all
from abjad.tools.rhythmmakertools import sustain_every
from abjad.tools.rhythmmakertools import sustain_first
from abjad.tools.rhythmmakertools import sustain_last
from abjad.tools.rhythmmakertools import SilenceMask
from abjad.tools.rhythmmakertools import SustainMask
silence = SilenceMask.silence
silence_all = SilenceMask.silence_all
silence_except = SilenceMask.silence_except
silence_every = SilenceMask.silence_every
silence_first = SilenceMask.silence_first
silence_last = SilenceMask.silence_last
sustain = SustainMask.sustain
sustain_all = SustainMask.sustain_all
sustain_every = SustainMask.sustain_every
sustain_first = SustainMask.sustain_first
sustain_last = SustainMask.sustain_last

# import custom exceptions into the builtins module
import os
Expand Down
6 changes: 3 additions & 3 deletions abjad/tools/rhythmmakertools/AccelerandoRhythmMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2493,8 +2493,8 @@ def logical_tie_masks(self):
... use_feather_beams=True,
... ),
... logical_tie_masks=[
... rhythmmakertools.silence_first(),
... rhythmmakertools.silence_last(),
... abjad.silence_first(),
... abjad.silence_last(),
... ],
... interpolation_specifiers=[
... rhythmmakertools.InterpolationSpecifier(
Expand Down Expand Up @@ -2728,7 +2728,7 @@ def logical_tie_masks(self):
... use_feather_beams=True,
... ),
... logical_tie_masks=[
... rhythmmakertools.silence_every([2], period=3),
... abjad.silence_every([2], period=3),
... ],
... interpolation_specifiers=[
... rhythmmakertools.InterpolationSpecifier(
Expand Down
12 changes: 6 additions & 6 deletions abjad/tools/rhythmmakertools/EvenDivisionRhythmMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ def division_masks(self):
>>> rhythm_maker = rhythmmakertools.EvenDivisionRhythmMaker(
... division_masks=[
... rhythmmakertools.silence_every([0], period=2),
... abjad.silence_every([0], period=2),
... ],
... )
Expand Down Expand Up @@ -999,7 +999,7 @@ def division_masks(self):
>>> rhythm_maker = rhythmmakertools.EvenDivisionRhythmMaker(
... division_masks=[
... rhythmmakertools.sustain_every([0], period=2),
... abjad.sustain_every([0], period=2),
... ],
... )
Expand Down Expand Up @@ -1050,7 +1050,7 @@ def division_masks(self):
::
>>> rhythm_maker = rhythmmakertools.EvenDivisionRhythmMaker(
... division_masks=rhythmmakertools.silence_all(),
... division_masks=abjad.silence_all(),
... )
::
Expand Down Expand Up @@ -1837,7 +1837,7 @@ def logical_tie_masks(self):
>>> rhythm_maker = rhythmmakertools.EvenDivisionRhythmMaker(
... logical_tie_masks=[
... rhythmmakertools.silence_every([0], period=3),
... abjad.silence_every([0], period=3),
... ],
... )
Expand Down Expand Up @@ -1901,7 +1901,7 @@ def logical_tie_masks(self):
>>> pattern_2 = abjad.index_first(2)
>>> pattern_3 = abjad.index_last(2)
>>> pattern = pattern_1 ^ pattern_2 ^ pattern_3
>>> mask = rhythmmakertools.silence(pattern)
>>> mask = abjad.silence(pattern)
>>> rhythm_maker = rhythmmakertools.EvenDivisionRhythmMaker(
... logical_tie_masks=mask,
... )
Expand Down Expand Up @@ -2023,7 +2023,7 @@ def logical_tie_masks(self):
::
>>> rhythm_maker = rhythmmakertools.EvenDivisionRhythmMaker(
... logical_tie_masks=rhythmmakertools.silence_every(
... logical_tie_masks=abjad.silence_every(
... indices=[3],
... period=4,
... ),
Expand Down
2 changes: 1 addition & 1 deletion abjad/tools/rhythmmakertools/IncisedRhythmMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ def logical_tie_masks(self):
... talea_denominator=16,
... ),
... logical_tie_masks=[
... rhythmmakertools.silence_every([1], period=2),
... abjad.silence_every([1], period=2),
... ],
... )
Expand Down
6 changes: 3 additions & 3 deletions abjad/tools/rhythmmakertools/NoteRhythmMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def division_masks(self):
::
>>> rhythm_maker = rhythmmakertools.NoteRhythmMaker(
... division_masks=[rhythmmakertools.silence_all()],
... division_masks=[abjad.silence_all()],
... )
::
Expand Down Expand Up @@ -1134,7 +1134,7 @@ def logical_tie_masks(self):
::
>>> rhythm_maker = rhythmmakertools.NoteRhythmMaker(
... logical_tie_masks=rhythmmakertools.silence_every([0], period=2)
... logical_tie_masks=abjad.silence_every([0], period=2)
... )
::
Expand Down Expand Up @@ -1176,7 +1176,7 @@ def logical_tie_masks(self):
::
>>> rhythm_maker = rhythmmakertools.NoteRhythmMaker(
... logical_tie_masks=rhythmmakertools.silence_all(),
... logical_tie_masks=abjad.silence_all(),
... )
::
Expand Down
Loading

0 comments on commit 40ae386

Please sign in to comment.