I wrote something similar (but using Python), on how one can generate music using mathematical sequences such as Fibonacci's:
http://pedrokroger.net/pascals-triangle-sound/
I used to spend a lot of time on The On-Line Encyclopedia of Integer Sequences ;-)