Here is part 2 of my sound experimentation.
What I’m trying to do here is to analyse Fast Fourier Transform data from a sine wave, to determine what the initial pitch of the sound is.
First of all I’m generating a sine wave (see part 1). The pitch of this wave is relative to the mouse X position. This frequency is represented on the graph as a white line.
Then the sound data is put through the Fast Fourier Transform (FFT) using
SoundMixer.computeSpectrum(bytes, true, 2);
This data is plotted on the graph and the 5 highest peaks are marked with the red cross.
I want to determine the initial frequency of the sound that was put through FFT. This version calculates this by finding the middle point of the 3rd and 4th highest peaks, and then averaging this value with the weighted average height of the three highest peaks. The calculated frequency is represented on the graph by the red line.
In the bottom right-hand corner you can see the two pitches, and the difference between them.
Obviously this still has quite a way to go as the estimated frequency moves around quite a bit.
Flash player 10 has many cool features including sound generation. My goal is to learn about these in greater detail. I have a project in mind that I’m going to be working towards and this is the first step in that direction.
Move your mouse from left to right to control the wavelength/pitch.
You will need Flash Player 10 for this to work. Check (and update) your player version here.
The FLARToolKit is great and very easy to get up and running, thanks to the great demo from Saqoosha.
You can design your own image and generate a marker file here.
If you have a webcam you can download my marker image, then print it and have a go for yourself by visiting this page.
This is another Flash on the Beach AS3.0 experiment. There is a perlin noise field that controls the rotation of a series of circles that are slightly off centre. Looking at this one in action makes my eyes go funny. Click on the image below to see it animate.
Here is an experiment inspired by something I saw at Flash on the Beach. I can’t remember which speaker showed something like this but it was great. Just click on one of the circles to start the loop going and sit back and see what happens.
Recent Comments