I’m interested in brainwave entrainment, so for my ICM homework this week, I created a sketch that plays two sine wave tones of the user’s choice. If the frequencies come within a 40hz range of each other, they combine to form the illusion of a third tone, aka a binaural beat. This third tone’s frequency is the difference of the two.
The p5.sound library has a great class called FFT, which enables you to visualize the frequency of any sound playing in your sketch. I wanted to visualize how the sound waves would interact as the user changes their frequencies; especially interesting are the shapes that emerge with binaural beats. To make it clear when you’ve reached such a threshold, the visualization turns from blue to red:
To properly induce binaural beats, each tone must be heard by one ear exclusively, but simultaneously. Luckily, there’s the
.pan() function for that. The first tone will play in the left earbud; the second, in the right.
Try it here: