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
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