choose :: [a] -> Pattern a
The choose function emits a stream of randomly choosen values from the given list, as a continuous pattern.
d1 $ sound "drum ~ drum drum" # n (choose [0,2,3])
As with all continuous patterns, you have to be careful to give them structure; in this case chooose gives you an infinitely detailed stream of random choices.
wchoose :: [(a, Double)] -> Pattern a
wchoose is similar to choose, but allows you to 'weight' the choices, so some are more likely to be chosen than others. The following is similar to the previous example, but the 2 is twice as likely to be chosen than the 0 or 3.
d1 $ sound "drum ~ drum drum" # n (wchoose [(0,0.25,(2,0.5),(3,0.25)])
Note: prior to version 1.0.0 of tidal, the weights had to add up to 1, but this is no longer the case.