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 at when. Forwards to set_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 a MetricPhaseTarget.

  • curve_shape – the bend of the transition: 0 is linear, > 0 changes late, < 0 early.

  • 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 when did not pin) on a phase or coordinate — e.g. accelerate over a fixed time, landing on a downbeat. See set_tempo_target().