OR logic / choose for alterations?

I'm trying to figure out how get random effects/alterations to happen at the same place in time. Like OR logic or the way choose works for values. Here's what I imagine, something like

d1 $ every 2 (choose["fast 2", "speed 0.5", "stut 8 0.2 (1/16)"]) $ sound "bd"

Where a randomly-chosen alteration/effect would happen every 2 cycles.

I thought maybe randcat could do it:

p "s"
  $ every 2 (randcat ["fast 2", "speed 0.5", "stut 8 0.2 (1/32)"])
  $ stack [
  struct "t*4" $ sound "bd"
              ]

But I get an error ( Couldn't match expected type ā€˜Pattern ValueMap -> ControlPatternā€™)

Any ideas? Thanks in advance!

d1 $ squeezeJoin
   $ (segment 8 $ choose[fast 2, (speed 0.5 #), stut 8 0.2 (1/16)])
     <*> return ( sound "bd")

works, but I don't like the "return" here. there must be some better Haskell for join (foo <*> return bar)

2 Likes