A program can generate music randomly by choosing between a few patterns.
p = new Piano
for [1..6]
p.play random [
"_B,/C/C_E2"
"_B,/C/CF_E"
"C/_E/Z/E/_B,2"
]
p.play random [
"F,Z/_E/A,C/D/"
"Z/A,/Z/A,/A,/A,/A,"
"Z/F,/F,/Z/A,/A,_B,/"
]
p.play "[C'C]/"