Tidal icon indicating copy to clipboard operation
Tidal copied to clipboard

Pattern-local cps

Open yaxu opened this issue 2 years ago • 1 comments

It would be lovely to have per-pattern cps.

E.g. so these could be beat aligned:

d1 $ sound "bd bd cp"
  # localcps 1

d2 $ sound "bd bd bd cp"
  # localcps (4/3)

This is already possible with slow, the difference is where the cps changes, the pattern continues in a stateful way.

Some design thoughts:

  1. The localcps could be expressed as a multiplier of the 'global' cps.
  2. There would need to be a way to reset the localcps and cycle offset to the global one. E.g. setting it to -1, or simply not specifying it.
  3. To avoid unexpected phase shifts, it would generally be best to set it at the start of a cycle, e.g. like:
d2 $ stack [localcps(4/3), sound "~ bd bd cp"]
  1. It might even be better as a function that adds a localcps pattern to another one (like overlay):
d2 $ localcps (4/3) $ sound "~ bd bd cp"
  1. cps would need to be rational. Tricky when the link clock is floating point :/

yaxu avatar Mar 16 '23 16:03 yaxu

Tricky when the link clock is floating point :/

You could find the next rational for that float

telephon avatar Mar 18 '23 07:03 telephon