clockblocks.utilities.set_tempo_target
- clockblocks.utilities.set_tempo_target(tempo_target: float, when: ResolvableMoment, curve_shape: float = None, truncate: bool = True, align_to: ResolvableMoment = None) None[source]
Smoothly change the current clock’s tempo to
tempo_target(in beats per minute), arriving atwhen. Forwards toset_tempo_target()on the currently active clock. Raises NoActiveClockError if there is no active clock.- Parameters:
tempo_target – the tempo to arrive at, in beats per minute.
when – when the target is reached, as a
Moment(e.g.Moment.after_beats(4),Moment.at_time(10)) or aMetricPhaseTarget.curve_shape – the bend of the transition:
0is linear,> 0changes late,< 0early.truncate – if
True, discard any tempo curve already scheduled past the current beat first.align_to – optional; solve the curvature to land the free axis (the one
whendid not pin) on a phase or coordinate — e.g. accelerate over a fixed time, landing on a downbeat. Seeset_tempo_target().