classes¶
The rmakers classes.
Specifiers
Incise specifier. |
|
Interpolation specifier. |
|
Duration spelling specifier. |
|
Talea specifier. |
- class abjadext.rmakers.classes.Incise(body_ratio=(1,), fill_with_rests=False, outer_tuplets_only=False, prefix_counts=(), prefix_talea=(), suffix_counts=(), suffix_talea=(), talea_denominator=None)[source]¶
Incise specifier.
Attributes Summary
Implement delattr(self, name).
Return self==value.
Return self>=value.
Return self>value.
Return hash(self).
Return self<=value.
Return self<value.
Return repr(self).
Implement setattr(self, name, value).
Special methods
- overridden __delattr__(name)¶
Implement delattr(self, name).
- overridden __eq__(other)¶
Return self==value.
- overridden __ge__(other)¶
Return self>=value.
- overridden __gt__(other)¶
Return self>value.
- overridden __hash__()¶
Return hash(self).
- overridden __le__(other)¶
Return self<=value.
- overridden __lt__(other)¶
Return self<value.
- overridden __repr__()¶
Return repr(self).
- overridden __setattr__(name, value)¶
Implement setattr(self, name, value).
- class abjadext.rmakers.classes.Interpolation(start_duration=Duration(1, 8), stop_duration=Duration(1, 16), written_duration=Duration(1, 16))[source]¶
Interpolation specifier.
Attributes Summary
Implement delattr(self, name).
Return self==value.
Return self>=value.
Return self>value.
Return hash(self).
Return self<=value.
Return self<value.
- rtype:
Return repr(self).
Implement setattr(self, name, value).
Swaps start duration and stop duration of interpolation specifier.
Special methods
- overridden __delattr__(name)¶
Implement delattr(self, name).
- overridden __eq__(other)¶
Return self==value.
- overridden __ge__(other)¶
Return self>=value.
- overridden __gt__(other)¶
Return self>value.
- overridden __hash__()¶
Return hash(self).
- overridden __le__(other)¶
Return self<=value.
- overridden __lt__(other)¶
Return self<value.
- overridden __repr__()¶
Return repr(self).
- overridden __setattr__(name, value)¶
Implement setattr(self, name, value).
Methods
- reverse()[source]¶
Swaps start duration and stop duration of interpolation specifier.
Changes accelerando specifier to ritardando specifier:
>>> specifier = rmakers.Interpolation( ... start_duration=abjad.Duration(1, 4), ... stop_duration=abjad.Duration(1, 16), ... written_duration=abjad.Duration(1, 16), ... ) >>> specifier.reverse() Interpolation(start_duration=Duration(1, 16), stop_duration=Duration(1, 4), written_duration=Duration(1, 16))
Changes ritardando specifier to accelerando specifier:
>>> specifier = rmakers.Interpolation( ... start_duration=abjad.Duration(1, 16), ... stop_duration=abjad.Duration(1, 4), ... written_duration=abjad.Duration(1, 16), ... ) >>> specifier.reverse() Interpolation(start_duration=Duration(1, 4), stop_duration=Duration(1, 16), written_duration=Duration(1, 16))
- Return type:
- class abjadext.rmakers.classes.Spelling(forbidden_note_duration=None, forbidden_rest_duration=None, increase_monotonic=False)[source]¶
Duration spelling specifier.
Decreases monotically:
>>> def make_lilypond_file(pairs): ... time_signatures = rmakers.time_signatures(pairs) ... durations = [abjad.Duration(_) for _ in pairs] ... tuplets = rmakers.talea( ... durations, ... [5], ... 16, ... spelling=rmakers.Spelling(increase_monotonic=False), ... ) ... lilypond_file_ = rmakers.example(tuplets, time_signatures) ... voice = lilypond_file_["Voice"] ... rmakers.beam(voice) ... rmakers.extract_trivial(voice) ... return lilypond_file_ ...
>>> lilypond_file = make_lilypond_file([(3, 4), (3, 4)]) >>> abjad.show(lilypond_file)
Increases monotically:
>>> def make_lilypond_file(pairs): ... time_signatures = rmakers.time_signatures(pairs) ... durations = [abjad.Duration(_) for _ in time_signatures] ... tuplets = rmakers.talea( ... durations, ... [5], ... 16, ... spelling=rmakers.Spelling(increase_monotonic=True), ... ) ... lilypond_file_ = rmakers.example(tuplets, time_signatures) ... voice = lilypond_file_["Voice"] ... rmakers.beam(voice) ... rmakers.extract_trivial(voice) ... return lilypond_file_ ...
>>> pairs = [(3, 4), (3, 4)] >>> lilypond_file = make_lilypond_file(pairs) >>> abjad.show(lilypond_file)
Forbids note durations equal to
1/4
or greater:>>> def make_lilypond_file(pairs): ... time_signatures = rmakers.time_signatures(pairs) ... durations = [abjad.Duration(_) for _ in time_signatures] ... tuplets = rmakers.talea( ... durations, ... [1, 1, 1, 1, 4, -4], ... 16, ... spelling=rmakers.Spelling(forbidden_note_duration=abjad.Duration(1, 4)), ... ) ... lilypond_file_ = rmakers.example(tuplets, time_signatures) ... voice = lilypond_file_["Voice"] ... rmakers.beam(voice) ... rmakers.extract_trivial(voice) ... return lilypond_file_ ...
>>> pairs = [(3, 4), (3, 4)] >>> lilypond_file = make_lilypond_file(pairs) >>> abjad.show(lilypond_file)
Forbids rest durations equal to
1/4
or greater:>>> def make_lilypond_file(pairs): ... time_signatures = rmakers.time_signatures(pairs) ... durations = [abjad.Duration(_) for _ in time_signatures] ... tuplets = rmakers.talea( ... durations, ... [1, 1, 1, 1, 4, -4], ... 16, ... spelling=rmakers.Spelling(forbidden_rest_duration=abjad.Duration(1, 4)), ... ) ... lilypond_file_ = rmakers.example(tuplets, time_signatures) ... voice = lilypond_file_["Voice"] ... rmakers.beam(voice) ... rmakers.extract_trivial(voice) ... return lilypond_file_ ...
>>> pairs = [(3, 4), (3, 4)] >>> lilypond_file = make_lilypond_file(pairs) >>> abjad.show(lilypond_file)
Spells nonassignable durations with monontonically decreasing durations:
>>> def make_lilypond_file(pairs): ... time_signatures = rmakers.time_signatures(pairs) ... durations = [abjad.Duration(_) for _ in time_signatures] ... tuplets = rmakers.talea( ... durations, ... [5], ... 16, ... spelling=rmakers.Spelling(increase_monotonic=False), ... ) ... container = abjad.Container(tuplets) ... rmakers.beam(container) ... rmakers.extract_trivial(container) ... components = abjad.mutate.eject_contents(container) ... lilypond_file = rmakers.example(components, time_signatures) ... return lilypond_file ...
>>> pairs = [(5, 8), (5, 8), (5, 8)] >>> lilypond_file = make_lilypond_file(pairs) >>> abjad.show(lilypond_file)
Spells nonassignable durations with monontonically increasing durations:
>>> def make_lilypond_file(pairs): ... time_signatures = rmakers.time_signatures(pairs) ... durations = [abjad.Duration(_) for _ in time_signatures] ... tuplets = rmakers.talea( ... durations, ... [5], ... 16, ... spelling=rmakers.Spelling(increase_monotonic=True), ... ) ... container = abjad.Container(tuplets) ... rmakers.beam(container) ... rmakers.extract_trivial(container) ... components = abjad.mutate.eject_contents(container) ... lilypond_file = rmakers.example(components, time_signatures) ... return lilypond_file ...
>>> pairs = [(5, 8), (5, 8), (5, 8)] >>> lilypond_file = make_lilypond_file(pairs) >>> abjad.show(lilypond_file)
Forbids durations equal to
1/4
or greater:>>> def make_lilypond_file(pairs): ... time_signatures = rmakers.time_signatures(pairs) ... durations = [abjad.Duration(_) for _ in time_signatures] ... tuplets = rmakers.talea( ... durations, ... [1, 1, 1, 1, 4, 4], ... 16, ... spelling=rmakers.Spelling(forbidden_note_duration=abjad.Duration(1, 4)), ... ) ... lilypond_file = rmakers.example(tuplets, time_signatures) ... voice = lilypond_file["Voice"] ... rmakers.beam(voice) ... rmakers.extract_trivial(voice) ... return lilypond_file ...
>>> pairs = [(3, 4), (3, 4)] >>> lilypond_file = make_lilypond_file(pairs) >>> abjad.show(lilypond_file)
Rewrites forbidden durations with smaller durations tied together.
Attributes Summary
Implement delattr(self, name).
Return self==value.
Return self>=value.
Return self>value.
Return hash(self).
Return self<=value.
Return self<value.
Return repr(self).
Implement setattr(self, name, value).
Special methods
- overridden __delattr__(name)¶
Implement delattr(self, name).
- overridden __eq__(other)¶
Return self==value.
- overridden __ge__(other)¶
Return self>=value.
- overridden __gt__(other)¶
Return self>value.
- overridden __hash__()¶
Return hash(self).
- overridden __le__(other)¶
Return self<=value.
- overridden __lt__(other)¶
Return self<value.
- overridden __repr__()¶
Return repr(self).
- overridden __setattr__(name, value)¶
Implement setattr(self, name, value).
- class abjadext.rmakers.classes.Talea(counts, denominator, end_counts=(), preamble=())[source]¶
Talea specifier.
>>> talea = rmakers.Talea( ... [2, 1, 3, 2, 4, 1, 1], ... 16, ... preamble=[1, 1, 1, 1], ... )
Equal to weight of counts:
>>> rmakers.Talea([1, 2, 3, 4], 16).period 10
Rests make no difference:
>>> rmakers.Talea([1, 2, -3, 4], 16).period 10
Denominator makes no difference:
>>> rmakers.Talea([1, 2, -3, 4], 32).period 10
Preamble makes no difference:
>>> talea = rmakers.Talea( ... [1, 2, -3, 4], ... 32, ... preamble=[1, 1, 1], ... )
>>> talea.period 10
>>> talea = rmakers.Talea( ... [2, 1, 3, 2, 4, 1, 1], ... 16, ... preamble=[1, 1, 1, 1], ... )
>>> talea.preamble [1, 1, 1, 1]
>>> talea = rmakers.Talea( ... [16, -4, 16], ... 16, ... preamble=[1], ... )
>>> for i, duration in enumerate(talea): ... duration ... Duration(1, 16) Duration(1, 1) Duration(-1, 4) Duration(1, 1)
Attributes Summary
Is true when talea contains
argument
.Implement delattr(self, name).
Return self==value.
Return self>=value.
Gets item or slice identified by
argument
.Return self>value.
Return hash(self).
Iterates talea.
Return self<=value.
Gets length.
Return self<value.
Return repr(self).
Implement setattr(self, name, value).
Advances talea by
weight
.Gets period of talea.
Special methods
- __contains__(argument)[source]¶
Is true when talea contains
argument
.With preamble:
>>> talea = rmakers.Talea( ... [10], ... 16, ... preamble=[1, -1, 1], ... )
>>> for i in range(1, 23 + 1): ... i, i in talea ... (1, True) (2, True) (3, True) (4, False) (5, False) (6, False) (7, False) (8, False) (9, False) (10, False) (11, False) (12, False) (13, True) (14, False) (15, False) (16, False) (17, False) (18, False) (19, False) (20, False) (21, False) (22, False) (23, True)
- Return type:
- overridden __delattr__(name)¶
Implement delattr(self, name).
- overridden __eq__(other)¶
Return self==value.
- overridden __ge__(other)¶
Return self>=value.
- __getitem__(argument)[source]¶
Gets item or slice identified by
argument
.Gets item at index:
>>> talea = rmakers.Talea( ... [2, 1, 3, 2, 4, 1, 1], ... 16, ... preamble=[1, 1, 1, 1], ... )
>>> talea[0] (1, 16)
>>> talea[1] (1, 16)
Gets items in slice:
>>> for duration in talea[:6]: ... duration ... (1, 16) (1, 16) (1, 16) (1, 16) (2, 16) (1, 16)
>>> for duration in talea[2:8]: ... duration ... (1, 16) (1, 16) (2, 16) (1, 16) (3, 16) (2, 16)
- overridden __gt__(other)¶
Return self>value.
- overridden __hash__()¶
Return hash(self).
- __iter__()[source]¶
Iterates talea.
>>> talea = rmakers.Talea( ... [2, 1, 3, 2, 4, 1, 1], ... 16, ... preamble=[1, 1, 1, 1], ... )
>>> for duration in talea: ... duration ... Duration(1, 16) Duration(1, 16) Duration(1, 16) Duration(1, 16) Duration(1, 8) Duration(1, 16) Duration(3, 16) Duration(1, 8) Duration(1, 4) Duration(1, 16) Duration(1, 16)
- overridden __le__(other)¶
Return self<=value.
- __len__()[source]¶
Gets length.
>>> len(rmakers.Talea([2, 1, 3, 2, 4, 1, 1], 16)) 7
Defined equal to length of counts.
- Return type:
- overridden __lt__(other)¶
Return self<value.
- overridden __repr__()¶
Return repr(self).
- overridden __setattr__(name, value)¶
Implement setattr(self, name, value).
Methods
- advance(weight)[source]¶
Advances talea by
weight
.>>> talea = rmakers.Talea( ... [2, 1, 3, 2, 4, 1, 1], ... 16, ... preamble=[1, 1, 1, 1], ... )
>>> talea.advance(0) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=[1, 1, 1, 1])
>>> talea.advance(1) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=[1, 1, 1])
>>> talea.advance(2) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=[1, 1])
>>> talea.advance(3) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=[1])
>>> talea.advance(4) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=())
>>> talea.advance(5) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=[1, 1, 3, 2, 4, 1, 1])
>>> talea.advance(6) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=[1, 3, 2, 4, 1, 1])
>>> talea.advance(7) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=[3, 2, 4, 1, 1])
>>> talea.advance(8) Talea(counts=[2, 1, 3, 2, 4, 1, 1], denominator=16, end_counts=(), preamble=[2, 2, 4, 1, 1])
REGRESSION. Works when talea advances by period of talea:
>>> talea = rmakers.Talea([1, 2, 3, 4], 16) >>> talea Talea(counts=[1, 2, 3, 4], denominator=16, end_counts=(), preamble=())
>>> talea.advance(10) Talea(counts=[1, 2, 3, 4], denominator=16, end_counts=(), preamble=())
>>> talea.advance(20) Talea(counts=[1, 2, 3, 4], denominator=16, end_counts=(), preamble=())
- Return type:
Read-only properties
- period¶
Gets period of talea.
Equal to weight of counts:
>>> rmakers.Talea([1, 2, 3, 4], 16).period 10
Rests make no difference:
>>> rmakers.Talea([1, 2, -3, 4], 16).period 10
Denominator makes no difference:
>>> rmakers.Talea([1, 2, -3, 4], 32).period 10
Preamble makes no difference:
>>> talea = rmakers.Talea( ... [1, 2, -3, 4], ... 32, ... preamble=[1, 1, 1], ... )
>>> talea.period 10