Thanks. Yea, I have no clue where the 4/3 came from. I'd run across nTake but was put off by the statefulness of it. Yes, I'm treating a pattern as a list but how is that really different from
d1 $ sound "{bd hh sn cp, arpy bass2 drum}"
where the second pattern repeats (plays faster) to align with the first pattern?
Anyway, this is the first working version of a function that does what I want. I still need to make it more like the applyPatTo* functions and use the real arc.
let l ## r = l # fast ( lengthL / lengthR ) r
where lengthL = patLen l
lengthR = patLen r
patLen p = fromIntegral $ (length ( queryArc p (Arc 0 1) ) )
It's not really a problem for what you're doing, but what I mean is that while some patterns can be though of as list-like, in general they can do a lot of things beyond lists.
As an example, using your patLen function:
> patLen $ s "a ~"
1
> patLen $ s "[a,b]"
2
These particular examples maybe could be fixed, but in general there just isn't a universal notion of "length" of a pattern.
Sorry for leaping in here, but I'd like to ask what the % actually does in this example. I know what a modulo is, but I'm having a hard time wrapping my head around what it does when applying it to a pattern in TidalCycles and I can't find any explanation over at tidalcycles.org.
Thanks already in advance!
Oh yeah, I know. Any randomization like ? as well as using fast or slow to create interesting time signatures that cause alternation between patterns and hundreds of other ways to cause the patterns to change across cycles make it an impossible task.