From 0531369613a55395071a1b3afeac48720be4eb34 Mon Sep 17 00:00:00 2001 From: eefano <77832+eefano@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:09:36 +0100 Subject: [PATCH] Make cps patternable (#1001) Supports e.g. `note("c d e f g a").cps("<1 1.2 1.3 1.4 1.5 1.6>")` --- packages/core/cyclist.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/cyclist.mjs b/packages/core/cyclist.mjs index 472e83a8..bd2db122 100644 --- a/packages/core/cyclist.mjs +++ b/packages/core/cyclist.mjs @@ -68,6 +68,10 @@ export class Cyclist { // see https://github.com/tidalcycles/strudel/pull/1004 const deadline = targetTime - phase; onTrigger?.(hap, deadline, duration, this.cps, targetTime); + if (hap.value.cps !== undefined && this.cps != hap.value.cps) { + this.cps = hap.value.cps; + this.num_ticks_since_cps_change = 0; + } } }); } catch (e) {