clockblocks.utilities.set_tempo_targets

clockblocks.utilities.set_tempo_targets(tempo_targets: Sequence[float], whens: Sequence[ResolvableMoment], curve_shapes: Sequence[float] = None, truncate: bool = True, align_to: ResolvableMoment | Sequence[ResolvableMoment | None] = None) → None[source]

Set several tempo targets at once, building a multi-segment tempo curve on the current clock. Forwards to set_tempo_targets(); acts on the currently active clock. Raises NoActiveClockError if there is no active clock.

Parameters:
  • tempo_targets – the tempo to arrive at for each segment, in beats per minute.

  • whens – the arrival moment for each target (same length as tempo_targets). Each is resolved against the clock’s current position (so an after_* moment counts from now, not from the previous segment’s end), beats and time may be mixed, and the moments must come out strictly increasing in clock-time.

  • curve_shapes – optional per-segment curve shapes (same length), or None for all-linear.

  • truncate – if True, discard any tempo curve already scheduled past the current beat first.

  • align_to – optional; bend whole runs of segments to land collectively on a phase/coordinate. Pass a single Moment/MetricPhaseTarget to align the whole call at its end, or a per-segment list of None/targets where each non-None entry closes and aligns the run since the previous alignment. See set_beat_length_targets().

This is one-shot. To loop a tempo shape, build a TempoEnvelope and pass it to apply_tempo_envelope() with loop=True.