I love music a lot, and so when we were told to do something involving data, I wanted to try and turn the data into music of some form. I thought it would be fun to have something that shows the change in data over time and relate that to pitches/music somehow. I also wanted to have some form of visualisation to go along with it.
I originally wanted to do this with the stock market data, but I couldn’t find a website that had clear enough data that would match what I wanted to do. So I ended up finding this website http://www.indexmundi.com/ which had statistics for things like birth rate, population, death rate, average life expectancy, etc. for many different countries, including the United States. So I took those statistics for United States and put them in my program.
I wanted a relatively simple output, so I took a bar graphic, had the category above it and the statistic below it. I then programmed the bar to move over the span of certain y pixels according to where the current value was in the range of the data for that value (i.e. if the data set had values from 0 to 10, a current value of 0 would put the bar at the bottom, 10 would put it at the top). Then I also created sineWave outputs through the library Minim that would choose a pitch from different pitch sets (each of the categories had a different set of pitches that were 8 different tones, all half steps spanning approximately a perfect 5th). Then I displayed the year at the top of the graphic and had the years span from 2000-2011, changing on a click of the mouse.
I also originally had a longer amplitude that made the sounds seem rather crazy. When I made the amplitude smaller, the sounds were much clearer.
The sound files weren’t what I was expecting and made the result sound rather horrifying and weird. Also there was a problem displaying the population – the numbers that the program are currently outputting need two more zeros between what’s displayed and the theoretical decimal point (e.g. “303″ should be “30300″). However I do think this provides an interesting and rather bizarre adaptation on a set of statistics. I am still not sure how I feel about this project.
The code can be downloaded Here.
With a bigger amplitude:
With a smaller amplitude: