attackpointoptimizers¶
Abstract Classes
Abstract attack-point optimizer. |
- abstract class abjadext.nauert.attackpointoptimizers.AttackPointOptimizer[source]¶
Abstract attack-point optimizer.
Attack-point optimizers may alter the number, order, and individual durations of leaves in a logical tie, but may not alter the overall duration of that logical tie.
They effectively “clean up” notation, post-quantization.
Attributes Summary
Calls attack-point optimizer.
Special methods
Classes
Measurewise attack-point optimizer. |
|
Naive attack-point optimizer. |
|
Null attack-point optimizer. |
- class abjadext.nauert.attackpointoptimizers.MeasurewiseAttackPointOptimizer[source]¶
Measurewise attack-point optimizer.
Attempts to optimize attack points in an expression with regard to the effective time signature of that expression.
Only acts on measures.
>>> staff = abjad.Staff("c'8 d'8 e'8 f'8 g'8 a'8 b'8 c''8") >>> abjad.show(staff)
>>> source_tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60) >>> q_events = nauert.QEventSequence.from_tempo_scaled_leaves( ... staff[:], ... tempo=source_tempo, ... ) >>> target_tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 54) >>> q_schema = nauert.MeasurewiseQSchema( ... tempo=target_tempo, ... )
Without the measure-wise attack-point optimizer:
>>> result = nauert.quantize(q_events, q_schema=q_schema) >>> abjad.show(result)
With the measure-wise attack-point optimizer:
>>> optimizer = nauert.MeasurewiseAttackPointOptimizer() >>> result = nauert.quantize( ... q_events, ... attack_point_optimizer=optimizer, ... q_schema=q_schema, ... ) >>> abjad.show(result)
Attributes Summary
Calls measurewise attack-point optimizer.
Special methods
- class abjadext.nauert.attackpointoptimizers.NaiveAttackPointOptimizer[source]¶
Naive attack-point optimizer. (The default attack-point optimizer)
Optimizes attack points by fusing tie leaves within logical ties with leaf durations decreasing monotonically.
Logical ties will be partitioned into sub-logical-ties if leaves are found with metronome marks attached.
>>> staff = abjad.Staff("c'8 d'8 e'8 f'8 g'8 a'8 b'8 c''8") >>> abjad.show(staff)
>>> source_tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60) >>> q_events = nauert.QEventSequence.from_tempo_scaled_leaves( ... staff[:], ... tempo=source_tempo, ... ) >>> target_tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 54) >>> q_schema = nauert.MeasurewiseQSchema( ... tempo=target_tempo, ... )
>>> optimizer = nauert.NaiveAttackPointOptimizer() >>> result = nauert.quantize( ... q_events, ... attack_point_optimizer=optimizer, ... q_schema=q_schema, ... ) >>> abjad.show(result)
Attributes Summary
Calls naive attack-point optimizer.
Special methods
- class abjadext.nauert.attackpointoptimizers.NullAttackPointOptimizer[source]¶
Null attack-point optimizer.
Performs no attack point optimization.
>>> staff = abjad.Staff("c'8 d'8 e'8 f'8 g'8 a'8 b'8 c''8") >>> abjad.show(staff)
>>> source_tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60) >>> q_events = nauert.QEventSequence.from_tempo_scaled_leaves( ... staff[:], ... tempo=source_tempo, ... ) >>> target_tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 54) >>> q_schema = nauert.MeasurewiseQSchema( ... tempo=target_tempo, ... )
>>> optimizer = nauert.NullAttackPointOptimizer() >>> result = nauert.quantize( ... q_events, ... attack_point_optimizer=optimizer, ... q_schema=q_schema, ... ) >>> abjad.show(result)
Attributes Summary
Calls null attack-point optimizer.
Special methods