How to choose random pattern

I'm trying to choose a random pattern

let pats =
[
("a", s "bd!4"
),
("b", s "sd!4"
)
]
in
d1 $ fast 4 $ ur 2 (choose ["a","b"]) pats

This doesn't return any error, but I don't get sound either.
Anyone know how to do this?

Does randcat do what you want? d1 $ randcat [ "bd", " cp*3"] (on my phone so syntax errors may be a problem)

You can also use mini-notation for that: d1 $ fast 2 $ s "[bd!4|sd!4]"

2 Likes

This works, but for long patterns it gets illegible pretty quickly.

That could work, thanks!
Line breaks make it a bit easier to read.

d1 $ randcat [
"bd*4",
"cp*4"
]