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 anafter_*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
Nonefor 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/MetricPhaseTargetto align the whole call at its end, or a per-segment list ofNone/targets where each non-Noneentry closes and aligns the run since the previous alignment. Seeset_beat_length_targets().
This is one-shot. To loop a tempo shape, build a
TempoEnvelopeand pass it toapply_tempo_envelope()withloop=True.