Random list selection

choose  list (array)

Choose an element at random from a list (array).

Introduced in v2.0

Example

# Example 1

loop do
    play choose([60, 64, 67])
    sleep 1
    play chord(:c, :major).choose
    sleep 1
  end


 
#=> plays one of 60, 64 or 67 at random
 
#=> You can also call .choose on the list