heuristics
Abstract Classes
Abstract heuristic. |
- abstract class abjadext.nauert.heuristics.Heuristic[source]
Abstract heuristic.
Heuristics rank Q-grids according to the criteria they encapsulate.
They provide the means by which the quantizer selects a single
QGrid
from all computedQGrids
for any givenQTargetBeat
to represent that beat.Attributes Summary
Calls heuristic.
Special methods
- overridden __call__(q_target_beats: tuple[QTargetBeat, ...]) tuple[QTargetBeat, ...] [source]
Calls heuristic.
Classes
Distance heuristic. |
- class abjadext.nauert.heuristics.DistanceHeuristic[source]
Distance heuristic.
Considers only the computed distance of each
QGrid
and the number of leaves of thatQGrid
when choosing the optimalQGrid
for a givenQTargetBeat
.The
QGrid
with the smallest distance and fewest number of leaves will be selected.>>> durations = [1000] * 8 >>> pitches = range(8) >>> q_event_sequence = nauert.QEventSequence.from_millisecond_pitch_pairs( ... tuple(zip(durations, pitches)) ... ) >>> heuristic = nauert.DistanceHeuristic() >>> result = nauert.quantize(q_event_sequence, heuristic=heuristic) >>> abjad.show(result)
Special methods
-
(
Heuristic
).__call__(q_target_beats: tuple[QTargetBeat, ...]) tuple[QTargetBeat, ...] Calls heuristic.
-
(