I think it's just that the mininotation doesn't (yet) support patterns in the argument after !, just numbers. While I don't think it's exactly the same, you could get something similar to what you're trying to do with
setB "kick" $ fast (irand 16) "t"
d1 $ struct "^kick 1@3 1@2" $ s "bd"
Yeah, oops I mixed notation a bit there. Technically struct uses Pattern Bool, but you can represent booleans using "1 0 0 1" or "t f f t" and often Haskell will figure out that the first should be Bool rather than Int.
And as far as variables in the mininotation - I think it just comes down to that since a variable is a Pattern, you can use it anywhere in the mininotation that Patterns are accepted. So d1 $ s "bd(^foo, 8)" works (assuming "foo" has been set somewhere) because the Euclidean stuff accepts Patterns.
I think the places in mininotation that don't take patterns are after _, @, !, or ?
Thank you for the explanation @bgold and @Francesco_Corvi !
I asked because I sometimes inspect the pattern and if I write:
tidal> putStrLn . show $ fast 2 $ s "bd"
I know I will get:
(0>½)|s: "bd"
(½>1)|s: "bd"
and when I tried this:
tidal> putStrLn . show $ fast 2 "t"
I got an error:
<interactive>:2:26: error:
• No instance for (Enumerable ()) arising from the literal ‘"t"’
• In the second argument of ‘fast’, namely ‘"t"’
In the second argument of ‘($)’, namely ‘fast 2 "t"’
In the expression: putStrLn . show $ fast 2 "t"
but then I realised how stupid I am, because I have to explicitly set that "t" is Pattern Bool!
tidal> putStrLn . show $ fast 2 ("t" :: Pattern Bool)
(0>½)|True
(½>1)|True
and it works as expected
It seems very much the case here, as I am not able to figure out how to use it - using brackets does not solve the problem and I get a complaint from the compiler
Perhaps a future option @yaxu?
Yes, definitely worth creating an issue for these.. I'm not sure how tricky this would be to fix, one of those things that might take five minutes, or five days..