Adam: Sweet! Are there implementations in Haskell?
Francesco: here is the problem that spurred me to write this email:
Tidal uses a |+| operator to conjoin what it calls OscPatterns. For instance, you can write:
d1 $ sound "bd sn" |+| speed "3" |+| pan "1"
to tell the sampler named d1, "play the bd (bass drum) sample at phase 0 and the sn (snare drum) sample at pahse 1/2. Speed both up by a factor of 3, and pan both to the right speaker". (Phase takes values in the interval [0,1); upon reaching 1, a new cycle begins at 0.)
Tidal offers functions for changing patterns. For instance, to slow down by a factor of 2 the frequency at which samples are triggered (that's how often a sample is played, not its playback speed), you can write this:
d1 $ (slow 2 $ sound "bd sn") |+| speed "3" |+| pan "1"
Every instruction issued to d1 is a chain of |+|-separated OscPatterns. I often want to thread OscPatterns through functions before conjoining them. I therefore would like to be able to explain to Tidal that in whatever it finds to the right of a statement beginning with "d1 $", it should bind |+| after $. Then I would not need so many parentheses.