Fader

class auxjad.Fader(contents: abjad.score.Container, *, mode: str = 'out', max_steps: int = 1, repetition_chance: float = 0.0, process_on_first_call: bool = False, disable_rewrite_meter: bool = False, omit_time_signatures: bool = False, use_multimeasure_rests: bool = True, mask: Optional[list] = None, boundary_depth: Optional[int] = None, maximum_dot_count: Optional[int] = None, rewrite_tuplets: bool = True, include_empty_measures: bool = True, prettify_rewrite_meter: bool = True, extract_trivial_tuplets: bool = True, fuse_across_groups_of_beats: bool = True, fuse_quadruple_meter: bool = True, fuse_triple_meter: bool = True)[source]

Takes an abjad.Container (or child class) as input and, using it as reference, gradually removes or adds notes one by one to an output abjad.Selection.

Basic usage:

Calling the object will return an abjad.Selection generated by the fading process. Each call of the object will apply the fading process to the previous result. By default, the container will be faded out (that is, its notes will be gradually removed one by one). Note that, by default, the first call in fade out mode outputs the initial container, with subsequent calls replacing leaves for rests.

>>> container = abjad.Container(r"c'4 ~ c'16 d'8. e'8 f'4.")
>>> abjad.show(container)
../_images/Fader-cQstYYC7CZ.png
>>> fader = auxjad.Fader(container)
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-pvlbt0azuqj.png
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-4bebflmnff9.png
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-64h0bb02goc.png

The property current_window can be used to access the current window without processing it.

>>> notes = fader.current_window()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-ruetb1tzhtn.png
process_on_first_call:

The very first call will output the input container without processing it. To disable this behaviour and apply the fading process on the very first call, initialise the class with the keyword argument process_on_first_call set to True.

>>> container = abjad.Container(r"c'4 d'4 e'4 f'4")
>>> fader = auxjad.Fader(container,
...                      process_on_first_call=True,
...                      )
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-rbnsf64kjoq.png
mode:

This class has two modes, set by the keyword argument mode. The default mode is 'out' (i.e. ‘fade out mode’), in which the fader will gradually remove notes one by one (see examples above). When set to 'in' (i.e. ‘fade in mode’), the fader will start with an empty container with the same length and time signature structure as the input music and will gradually add the original notes one by one.

>>> container = abjad.Container(r"c'4 ~ c'16 d'8. e'8 f'4.")
>>> fader = auxjad.Fader(container,
...                      mode='in',
...                      )
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-dzjqv7lsdis.png
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-f33perr6lfo.png
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-qxvj8lkfph.png
Changing mode after initialisation:

The property mode can also be changed after initialisation, as shown below.

>>> container = abjad.Container(r"c'4 d'4 e'4 f'4")
>>> fader = auxjad.Fader(container)
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-3ldjnprohuo.png
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-wzeaqjgouz8.png
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-aqq1docvezb.png
>>> fader.mode = 'in'
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-3jt6kto85h1.png
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-2i22so5t5pf.png
include_empty_measures:

When mode is set to 'out', the process will end on an empty measure and when it is set to 'in', it will start on an empty measure. Set include_empty_measures to False to exclude the empty measures (default is True). This can be used in conjunction with process_on_first_call.

>>> container = abjad.Container(r"c'4 d'4 e'2")
>>> fader = auxjad.Fader(container,
...                      mode='in',
...                      include_empty_measures=False,
...                      )
>>> staff = abjad.Staff(fader.output_all())
>>> abjad.show(staff)
../_images/Fader-pg0bejhb7ke.png
>>> container = abjad.Container(r"c'4 d'4 e'2")
>>> fader = auxjad.Fader(container,
...                      mode='out',
...                      include_empty_measures=False,
...                      )
>>> staff = abjad.Staff(fader.output_all())
>>> abjad.show(staff)
../_images/Fader-t1ir3ezcg6a.png
Using as iterator:

The instances of this class can also be used as an iterator, which can then be used in a for loop to run through the whole process. Note that unlike the methods output_n() and output_all(), time signatures are added to each window returned by the fader. Use the function auxjad.mutate.remove_repeated_time_signatures() to clean the output when using this class in this way.

>>> container = abjad.Container(r"c'4 d'4 e'4 f'4")
>>> fader = auxjad.Fader(container)
>>> staff = abjad.Staff()
>>> for window in fader:
...     staff.append(window)
>>> auxjad.mutate.remove_repeated_time_signatures(staff)
>>> abjad.show(staff)
../_images/Fader-qyve2exm08p.png
Arguments and properties:

This class can take many optional keyword arguments during its creation, besides mode. By default, calling the object in fade out mode will return the original container, and calling it in fade in mode will return a container filled with rests; set process_on_first_call to True and the fade process will be applied on the very first call. max_steps sets the maximum number of note that can be faded in/out at each iteration, ranging between 1 and the input value (default is also 1). repetition_chance sets the chance of a window repeating itself, from 0.0 to 1.0 (default is 0.0, i.e. no repetitions). disable_rewrite_meter disables the abjad.Meter.rewrite_meter() mutation which is applied to the container after every call, and omit_time_signatures will remove all time signatures from the output (both are False by default). Any measure filled with rests will be rewritten using a multi-measure rest; set the use_multimeasure_rests to False to disable this behaviour. It is possible to set an initial mask for the notes using mask, which should be a list of the same length as the number of notes in the input container. When mode is set to 'out', the mask is initialised with 1’s, and when it is set to 'in', it is initialised with 0’s. Change it to a mix of 1’s and 0’s to start the process with some specific notes already hidden or present. The properties boundary_depth, maximum_dot_count, and rewrite_tuplets are passed as arguments to abjad.Meter.rewrite_meter(), see its documentation for more information.

>>> container = abjad.Container(r"c'4 d'2 e'4 f'2 ~ f'8 g'4.")
>>> fader = auxjad.Fader(container,
...                      mode='in',
...                      max_steps=2,
...                      repetition_chance=0.7,
...                      disable_rewrite_meter=True,
...                      omit_time_signatures=True,
...                      use_multimeasure_rests=False,
...                      mask=[1, 0, 1, 1, 0],
...                      boundary_depth=0,
...                      maximum_dot_count=1,
...                      rewrite_tuplets=False,
...                      process_on_first_call=True,
...                      include_empty_measures=False,
...                      )
>>> fader.mode
'in'
>>> fader.max_steps
2
>>> fader.repetition_chance
0.7
>>> fader.disable_rewrite_meter
True
>>> fader.omit_time_signatures
True
>>> fader.use_multimeasure_rests
False
>>> fader.mask
[1, 0, 1, 1, 0]
>>> fader.boundary_depth
0
>>> fader.maximum_dot_count
1
>>> fader.rewrite_tuplets
False
>>> fader.process_on_first_call
True
>>> fader.include_empty_measures
False

Use the properties below to change these values after initialisation.

>>> fader.mode = 'out'
>>> fader.max_steps = 1
>>> fader.repetition_chance = 0.23
>>> fader.disable_rewrite_meter = False
>>> fader.omit_time_signatures = False
>>> fader.use_multimeasure_rests = True
>>> fader.mask = [0, 1, 1, 0, 1]
>>> fader.boundary_depth = 1
>>> fader.maximum_dot_count = 2
>>> fader.rewrite_tuplets = True
>>> fader.process_on_first_call = False
>>> fader.include_empty_measures = True
>>> fader.mode
'out'
>>> fader.max_steps
1
>>> fader.repetition_chance
0.23
>>> fader.disable_rewrite_meter
False
>>> fader.omit_time_signatures
False
>>> fader.use_multimeasure_rests
True
>>> fader.mask
[0, 1, 1, 0, 1]
>>> fader.boundary_depth
1
>>> fader.maximum_dot_count
2
>>> fader.rewrite_tuplets
True
>>> fader.process_on_first_call
False
>>> fader.include_empty_measures
True
contents:

Use the contents property to read as well as overwrite the contents of the fader. Notice that mask will also be reset at that point.

>>> container = abjad.Container(r"c'4 d'4 e'4 f'4")
>>> fader = auxjad.Fader(container)
>>> notes = fader()
>>> fader.mask
[1, 1, 1, 1]
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-nv5f76rv7f.png
>>> notes = fader()
>>> fader.mask
[0, 1, 1, 1]
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-6fr4wrb8god.png
>>> fader.contents = abjad.Container(r"c'16 d'16 e'16 f'16 g'2.")
>>> fader.mask
[1, 1, 1, 1, 1]
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-p8q5x8ti2d.png
>>> notes = fader()
>>> fader.mask
[1, 1, 1, 1, 1]
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-mky4pulzf4i.png
output_all():

To run through the whole process and output it as a single container, use the method output_all().

>>> container = abjad.Container(r"c'4. d'8 e'2")
>>> fader = auxjad.Fader(container)
>>> notes = fader.output_all()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-kiqwdhyx9vk.png
output_n():

To run through just part of the process and output it as a single container, use the method output_n() and pass the number of iterations as argument.

>>> container = abjad.Container(r"c'4. d'8 e'16 f'16 g'4.")
>>> fader = auxjad.Fader(container)
>>> notes = fader.output_n(3)
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-6mqxj9b5f13.png
Chords:

This class also support chords. Each of their individual notes are removed or added one by one.

>>> container = abjad.Container(
...     r"<c' e'>4 ~ <c' e'>16 d'8. <gs e'>8 <bf f' a'>8 ~ <bf f' a'>4"
... )
>>> fader = auxjad.Fader(container)
>>> staff = abjad.Staff(fader.output_all())
>>> abjad.show(staff)
../_images/Fader-wjphyrz750d.png
len():

The function len() returns the total number of notes in contents.

>>> container = abjad.Container(r"c'4 d'4 e'4 f'4")
>>> fader = auxjad.Fader(container)
>>> len(fader)
4
>>> container = abjad.Container(r"c'4 ~ c'8 d'8 e'4 ~ e'8 f'8")
>>> fader = auxjad.Fader(container)
>>> len(fader)
4
>>> container = abjad.Container(
...     r"c'4 ~ c'16 r16 d'8 e'4 ~ e'8 f'16 r16"
... )
>>> fader = auxjad.Fader(container)
>>> len(fader)
4

Note that each individual note in a chord will count as one note.

>>> container = abjad.Container(r"<c' e' g'>2 <d' f'>2")
>>> fader = auxjad.Fader(container)
>>> len(fader)
5
>>> container = abjad.Container(
...     r"<c' e' g'>4 ~ <c' e' g'>16 r8. <d' f'>2"
... )
>>> fader = auxjad.Fader(container)
>>> len(fader)
5
>>> container = abjad.Container(r"<c' e' g'>4 d'4 <e' g' b'>4 r4")
>>> fader = auxjad.Fader(container)
>>> len(fader)
7
max_steps:

Setting the keyword argument max_steps to a value larger than 1 will result in a random number of steps (between 1 and max_steps) being applied at each call.

>>> container = abjad.Container(r"c'8 d'8 e'8 f'8 g'8 a'8 b'8 c''8")
>>> fader = auxjad.Fader(container,
...                      max_steps=3,
...                      process_on_first_call=True,
...                      )
>>> notes = fader.output_n(3)
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-72wpb0iqtes.png
repetition_chance:

Use repetition_chance to set the chance of a measure repeating itself, ranging from 0.0 to 1.0 (default is 0.0, i.e. no repetitions).

>>> container = abjad.Container(r"c'4. d'8 e'4.. f'16")
>>> fader = auxjad.Fader(container,
...                      repetition_chance=0.5,
...                      )
>>> notes = fader.output_n(5)
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-1t2yh8imiu8.png
mask and reset_mask():

The property mask is used to represent whether each note is hidden or present. It is a list of the same length as the number of notes in the input container (use the len() function to read that value). When mode is set to 'out', the mask is initialised with 1’s, and when it is set to 'in', it is initialised with 0’s. Change it to a mix of 1’s and 0’s to start the process with some notes already hidden or present. Use the method reset_mask() to reset it back to its default value (depending on mode).

>>> container = abjad.Container(r"c'4 d'8 e'8 f'4 ~ f'8. g'16")
>>> fader = auxjad.Fader(container)
>>> fader.mask
[1, 1, 1, 1, 1]
>>> fader = auxjad.Fader(container,
...                      mode='in',
...                      )
>>> fader.mask
[0, 0, 0, 0, 0]
>>> for _ in range(3):
...     fader()
...     fader.mask
[0, 0, 0, 0, 0]
[0, 1, 0, 0, 0]
[0, 1, 1, 0, 0]
>>> staff = abjad.Staff(fader.current_window)
>>> abjad.show(staff)
../_images/Fader-52bwgmr7rks.png
>>> fader.mask = [1, 0, 1, 1, 0]
>>> fader.mask
[1, 0, 1, 1, 0]
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-fa199pggrp.png
>>> fader.reset_mask()
>>> fader.mask
[0, 0, 0, 0, 0]
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-xq3g5bd8djr.png

When a container has chords, each of their notes will be represented by an index in the mask, from the lowest pitched one to the highest pitched one. For instance, the container c'2 <d' e' f' g'>2 has five notes in total (a single note plus a 4-note chord), and applying the mask [1, 0, 1, 1, 0] to it will result in the first, third, and fourth notes to be shown, in this case c'2 <e' f'>2.

>>> container = abjad.Container(r"c'2 <d' e' f' g'>2")
>>> fader = auxjad.Fader(container, mask=[1, 0, 1, 1, 0])
>>> staff = abjad.Staff(fader())
>>> abjad.show(staff)
../_images/Fader-5n18nhr5qq2.png
random_mask():

The mask can also be randomised at any point using the method random_mask().

>>> container = abjad.Container(r"c'8 d'8 e'8 f'8 g'8 a'8 b'8 c''8")
>>> fader = auxjad.Fader(container)
>>> fader.random_mask()
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-r9z77w5l6vp.png
>>> fader.random_mask()
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-t7p8rjahkdh.png
shuffle_mask():

Use shuffle_mask() to shuffle the current mask. This method will shuffle the mask while keeping the total number of shown notes constant (that is, it will shuffle the contents of the mask while keeping the total number of 1’s and 0’s).

>>> container = abjad.Container(r"c'8 d'8 e'8 f'8 g'8 a'8 b'8 c''8")
>>> fader = auxjad.Fader(container,
...                      mask=[0, 0, 1, 1, 1, 1, 1, 1],
...                      )
>>> fader.shuffle_mask()
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-6bghb0g2wcx.png
>>> fader.shuffle_mask()
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-lvf1fqvizjn.png
use_multimeasure_rests and disable_rewrite_meter:

By default, all rests in a measure filled only with rests will be converted into a multi-measure rest. Set use_multimeasure_rests to False to disable this. Also, by default, all output is mutated through abjad.Meter.rewrite_meter(). To disable it, set disable_rewrite_meter to True.

>>> container = abjad.Container(r"c'8 d'8 e'2.")
>>> fader = auxjad.Fader(container,
...                      disable_rewrite_meter=True,
...                      use_multimeasure_rests=False,
...                      )
>>> notes = fader.output_all()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-lax06gkb3ap.png
omit_time_signatures:

To disable time signatures altogether, initialise this class with the keyword argument omit_time_signatures set to True (default is False), or use the omit_time_signatures property after initialisation.

>>> container = abjad.Container(r"c'4 d'2 e'4 f'2 ~ f'8 g'4.")
>>> fader = auxjad.Fader(container,
...                      omit_time_signatures=True,
...                      )
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-pcq5ecwz7ff.png

Tip

All methods that return an abjad.Selection will add an initial time signature to it. The output_n() and output_all() methods automatically remove repeated time signatures. When joining selections output by multiple method calls, use auxjad.mutate.remove_repeated_time_signatures() on the whole container after fusing the selections to remove any unecessary time signature changes.

Tweaking abjad.Meter.rewrite_meter():

This function uses the default logical tie splitting algorithm from abjad.Meter.rewrite_meter().

>>> container = abjad.Container(r"c'4. d'8 e'2")
>>> fader = auxjad.Fader(container)
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-93hcv2prkua.png

Set boundary_depth to a different number to change its behaviour.

>>> fader = auxjad.Fader(container,
...                      boundary_depth=1,
...                      )
>>> notes = fader()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-cq661zyctf.png

Other arguments available for tweaking the output of abjad.Meter.rewrite_meter() are maximum_dot_count and rewrite_tuplets, which work exactly as the identically named arguments of abjad.Meter.rewrite_meter().

This class also accepts the arguments fuse_across_groups_of_beats, fuse_quadruple_meter, fuse_triple_meter, and extract_trivial_tuplets, which are passed on to auxjad.mutate.prettify_rewrite_meter() (the latter can be disabled by setting prettify_rewrite_meter to False). See the documentation of this function for more details on these arguments.

Indicators:

This class can handle dynamics and articulations.

>>> container = abjad.Container(
...     r"\time 3/4 c'8->\f d'8\p ~ d'4 e'8..-- f'32-."
... )
>>> fader = auxjad.Fader(container)
>>> notes = fader.output_all()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-ox08wd3ljps.png
Slurs and hairpins:

Slurs and hairpins are also supported. Slurs are split when rests appear in the middle of a slurred phrase, while hairpins are shortened and adjusted as required.

>>> container = abjad.Container(
...     r"\times 2/3 {c'2(\p\< d'2 e'2\f} f'4\p\> g'2 a'4\pp)"
... )
>>> fader = auxjad.Fader(container)
>>> notes = fader.output_n(5)
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-jprjps4zxej.png

Tip

The functions auxjad.mutate.remove_repeated_dynamics() and auxjad.mutate.reposition_clefs() can be used to clean the output and remove repeated dynamics and unnecessary clef changes.

Warning

Do note that some elements that span multiple notes (such as ottava indicators, manual beams, etc.) can become problematic when notes containing them are split into two. As a rule of thumb, it is always better to attach those to the music after the fading process has ended.

Tuplets:

This class can handle tuplets.

>>> container = abjad.Container(r"\times 2/3 {c'8 d'8 e'8} d'2.")
>>> fader = auxjad.Fader(container)
>>> notes = fader.output_all()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-888tqk73kw3.png
Time signature changes:

This class can handle time signature changes.

>>> container = abjad.Container(r"\time 4/4 c'2( d'2 \time 3/4 e'2.)")
>>> fader = auxjad.Fader(container, mode='in')
>>> notes = fader.output_all()
>>> staff = abjad.Staff(notes)
>>> abjad.show(staff)
../_images/Fader-lkhKFVuUgx.png

Methods

__call__()

Calls the fading process for one iteration, returning an abjad.Selection.

__init__(contents, *[, mode, max_steps, …])

Initialises self.

__iter__()

Returns an iterator, allowing instances to be used as iterators.

__len__()

Returns the number of notes of contents.

__next__()

Calls the fading process for one iteration, returning an abjad.Selection.

__repr__()

Returns interpreter representation of contents.

output_all()

Goes through the whole fading process and outputs a single abjad.Selection.

output_n(n)

Goes through n iterations of the fading process and outputs a single abjad.Selection.

random_mask()

Creates a mask randomly filled with 1’s and 0’s.

reset_mask()

Creates a mask filled with a default value for the notes.

shuffle_mask()

Shuffles the current mask.

Attributes

boundary_depth

Sets the argument boundary_depth of abjad.Meter.rewrite_meter().

contents

The abjad.Container to be faded.

current_window

Read-only property, returns the previously output selection.

disable_rewrite_meter

When True, the durations of the notes in the output will not be rewritten by the abjad.Meter.rewrite_meter() mutation.

extract_trivial_tuplets

Sets the argument extract_trivial_tuplets of auxjad.mutate.prettify_rewrite_meter().

fuse_across_groups_of_beats

Sets the argument fuse_across_groups_of_beats of auxjad.mutate.prettify_rewrite_meter().

fuse_quadruple_meter

Sets the argument fuse_quadruple_meter of auxjad.mutate.prettify_rewrite_meter().

fuse_triple_meter

Sets the argument fuse_triple_meter of auxjad.mutate.prettify_rewrite_meter().

include_empty_measures

If True then an initial or final empty measures will be used, otherwise the process starts/ends with a single logical tie.

mask

Mask with 1’s and 0’s representing the notes of contents.

max_steps

The maximum number of steps per operation.

maximum_dot_count

Sets the argument maximum_dot_count of abjad.Meter.rewrite_meter().

mode

Mode of fading, must be either 'in' or 'out'.

omit_time_signatures

When True, all time signatures will be omitted from the output.

prettify_rewrite_meter

Used to enable or disable the mutation auxjad.mutate.prettify_rewrite_meter() (default True).

process_on_first_call

If True then contents will be processed in the very first call.

repetition_chance

The chance of not processing contents on a call, thus repeating the previous output.

rewrite_tuplets

Sets the argument rewrite_tuplets of abjad.Meter.rewrite_meter().

use_multimeasure_rests

When True, multi-measure rests will be used for silent measures.

__call__()abjad.select.Selection[source]

Calls the fading process for one iteration, returning an abjad.Selection.

__init__(contents: abjad.score.Container, *, mode: str = 'out', max_steps: int = 1, repetition_chance: float = 0.0, process_on_first_call: bool = False, disable_rewrite_meter: bool = False, omit_time_signatures: bool = False, use_multimeasure_rests: bool = True, mask: Optional[list] = None, boundary_depth: Optional[int] = None, maximum_dot_count: Optional[int] = None, rewrite_tuplets: bool = True, include_empty_measures: bool = True, prettify_rewrite_meter: bool = True, extract_trivial_tuplets: bool = True, fuse_across_groups_of_beats: bool = True, fuse_quadruple_meter: bool = True, fuse_triple_meter: bool = True)None[source]

Initialises self.

__iter__()None[source]

Returns an iterator, allowing instances to be used as iterators.

__len__()int[source]

Returns the number of notes of contents.

__next__()abjad.select.Selection[source]

Calls the fading process for one iteration, returning an abjad.Selection.

__repr__()str[source]

Returns interpreter representation of contents.

property boundary_depth: Optional[int]

Sets the argument boundary_depth of abjad.Meter.rewrite_meter().

property contents: abjad.score.Container

The abjad.Container to be faded.

property current_window: abjad.select.Selection

Read-only property, returns the previously output selection.

property disable_rewrite_meter: bool

When True, the durations of the notes in the output will not be rewritten by the abjad.Meter.rewrite_meter() mutation.

property extract_trivial_tuplets: bool

Sets the argument extract_trivial_tuplets of auxjad.mutate.prettify_rewrite_meter().

property fuse_across_groups_of_beats: bool

Sets the argument fuse_across_groups_of_beats of auxjad.mutate.prettify_rewrite_meter().

property fuse_quadruple_meter: bool

Sets the argument fuse_quadruple_meter of auxjad.mutate.prettify_rewrite_meter().

property fuse_triple_meter: bool

Sets the argument fuse_triple_meter of auxjad.mutate.prettify_rewrite_meter().

property include_empty_measures: bool

If True then an initial or final empty measures will be used, otherwise the process starts/ends with a single logical tie.

property mask: list

Mask with 1’s and 0’s representing the notes of contents.

property max_steps: int

The maximum number of steps per operation.

property maximum_dot_count: Optional[int]

Sets the argument maximum_dot_count of abjad.Meter.rewrite_meter().

property mode: str

Mode of fading, must be either 'in' or 'out'.

property omit_time_signatures: bool

When True, all time signatures will be omitted from the output.

output_all()abjad.select.Selection[source]

Goes through the whole fading process and outputs a single abjad.Selection.

output_n(n: int)abjad.select.Selection[source]

Goes through n iterations of the fading process and outputs a single abjad.Selection.

property prettify_rewrite_meter: bool

Used to enable or disable the mutation auxjad.mutate.prettify_rewrite_meter() (default True).

property process_on_first_call: bool

If True then contents will be processed in the very first call.

random_mask()None[source]

Creates a mask randomly filled with 1’s and 0’s.

property repetition_chance: float

The chance of not processing contents on a call, thus repeating the previous output.

reset_mask()None[source]

Creates a mask filled with a default value for the notes.

property rewrite_tuplets: bool

Sets the argument rewrite_tuplets of abjad.Meter.rewrite_meter().

shuffle_mask()None[source]

Shuffles the current mask.

property use_multimeasure_rests: bool

When True, multi-measure rests will be used for silent measures.