I wanted to get stitch working in Strudel, and after some helpful pointers on the Discord channel, I got to a satisfactory first working version that takes an euclidean pattern and uses it to pick from two source patterns:
Pattern.prototype.stitchEuclid = function (pulses, steps, offset, p1, p2) {
return stack(
this.euclidRot(pulses, steps, offset).pick([p1, p2]),
this.euclidRot(-pulses, steps, offset).pick([p2, p1])
)
}
It only works with euclidean patterns because 1. it's my preferred use case for stitch
in Tidal, 2. it's easier than working with any type of pattern to obtain the "negative" version to use with pick
and 3. it's my first time getting this deep into the strudel workings and need to take a step at a time.
Now I wanted to make this a function that could be called outside a pattern -- right now i have to give it a "dummy" pattern and do something like .octave("0".stitchEuclid(3,8,0, 2,3))
instead of .octave(stitchEuclid(3,8,0, 2,3))
.
So I guess my question now is: what needs changing/adding for this to be a "global" function?