Play sound based on frequency

Hi,

I’ve programmed a simple game of life, and i’d like create “music” with it. I’d like to play the frequency i map to each cells. How could i do this ? I found a way to play sound files, but i want to use as few files as possible (i currently have 100 cells, but i may have more in the future).

Cheers,
Hippolyte.

You could use ofSoundStream, and then in the audioOut method adjust the sound depending on the cells. There is a nice introduction about sound here http://openframeworks.cc/ofBook/chapters/sound.html

Thanks to your answer i managed to get something working.
It’s not the most harmonic piece of music you’ll ever hear, but it’s a first step !

You can find it here : https://github.com/IgorDubois/SoundOfLife

Cheers,
Hippolyte.