Cellular Automatas in C++ w/ OpenAL

    I made another program which uses OpenGL as well as OpenAL for playing sounds.  Its interface is the same, with one major addition:
a -- toggles the audio output of the program.

How I used OpenAL

    OpenAL is cross-platform open library for creating sounds.  One of the key features is its ability to generate 3-D spatialized sound.  I wasn't doing anything nearly that complicated -- I just used OpenAL to play WAV files.  The WAV files were pre-generated, and corresponded to each of different sounds that my Cellular Automata would make.  As in the other programs, the Cellular Automata was treated like the keys of a piano -- when a key was "pressed", the appropriate WAV file is played.

    For details on what I needed to get OpenAL working, see my OpenAL notes.

Why didn't I use CSOUND again?

    I did use CSOUND again.  The WAV files that are played have been generated from CSOUND.  The reason that CSOUND can be used directly is that the program needs to be written in C or C++.  Furthermore, the generation of the sounds in CSOUND can sometimes take quite a bit of time.
    The WAV files that are used in my example are all very simple.  However, there is no reason why CSOUND couldn't be used to generate very complicated sounds, which would then be played through OpenAL.

(Perceived) Limitations of OpenAL

    The problem with my use of OpenAL is that I can only play WAV files.  I cannot modify them at all before I play them.  This means that there must be a seperate WAV file for every single sound, no matter how similar they are.  In my most complicated experiments with Mathematica and CSOUND, I probably had over 200 sounds!  Though these sounds were mostly only differed by pitch, they would all require different WAV files.  200 WAV files is a little extreme, so I made very simple examples.

But its DYNAMIC!

    In almost every aspect, it seems like my Mathematica / CSOUND combination was better than the use of OpenAL.  However, there is one key aspect which makes the use of OpenAL much better.  The OpenAL program is dynamic -- it responds to user input.  While the Cellular Automata is running, if you decide to change the rule, the sound will change accordingly.  This is not possible in my Mathematica / CSOUND combination.  In that program, you only get to hear one rule at a time.


Converted by Mathematica      May 6, 2001