Rand function and midi data

i’ve been fiddling with the rand function and was wondering — is there a convenient way to translate rand’s output to midi data. this is how i ended up getting it in range of my daw’s drum machine:
d1 $ s “midi(9,16)” # n (range (0 -24) (0 -10) $ rand)

am i using the wrong tools for the job and/or am missing something obvious?

1 Like

ok, i`ve realised there’s midinote and you don’t need to use subtraction:
#midinote (range 36 51 $ rand)