Generating Random Numbers (randint)

Handel provides expressions for generating random numbers.

To generate a random number, use the randint keyword, followed by a range start to end.

Randint expressions can be used anywhere digit types are expected in Handel.

Here is an example of the syntax:

start
save somerandomdigit = randint -2 to 2
save somerandomnote = C5
update somerandomnote rshift somerandomdigit
play somerandomnote for 3b
if somerandomdigit lessthan randint 4 to 8 then
play somerandomnote for 3b
endif
finish