clockblocks.utilities.set_beat_length_target

clockblocks.utilities.set_beat_length_target(beat_length_target: float, when: ResolvableMoment, curve_shape: float = None, truncate: bool = True, align_to: ResolvableMoment = None) → None[source]

Smoothly change the current clock’s beat length to beat_length_target (in seconds per beat), arriving at when. Forwards to set_beat_length_target() on the currently active clock. Raises NoActiveClockError if there is no active clock.

Parameters:
  • beat_length_target – the beat length to arrive at, in seconds per beat.

  • when – when the target is reached, as a Moment or 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 on a phase or coordinate. See set_beat_length_target().