Binaural Beat Generation, Creating an Illusory Sound with Code

A little while ago I came across a phenomenon known as binaural beats. It's an auditory illusion that's created when two tones are presented to each ear separately, meaning one ear can't hear what the other ear is hearing.

I was curious in exploring this and wrote a brief piece of code using processing, which you can try out below if you download the processing environment.

What I also thought was interesting is the ability of a binaural beat to generate synchronous neuronal activity corresponding to the following mental states:
I tested this code on myself for about 10 minutes and was able to quickly enter a meditative state. Anyways, try it out for yourself and let me know what you think.