Wednesday, 13 February 2013

I got the equalizer!

This was an unexpected result! I was searching for a formula to calculate RPM using Unity pitch then I found out about Unity audio's GetSpectrumData and GetOutputData function. I didn't really understand what these functions are. From internet, I learnt that we can use the GetOutputData to get the audio volume in dB and use the GetSpectrumData to get the audio pitch which later using simple mathematics function can be converted into RPM. Oh, I also used this value to draw the equalized on our background.

Vinyl latest screenshot

Can you see the white line on the cyan background? That's the equalizer! That's not what we want, though. We have some idea how to draw the equalizer. One is to draw in on the pipe and the other one is to draw it in the background in bar not in line. Btw, this is the screenshot from last week progress.

Vinyl last week screenshot

There were indeed a lot of progress.
1. We added the colour in the ball static. Currently it is randomly generated and it will changed per half second.
2. We added laser beam to prevent player movement
3. We changed the cube into a green needle like object
And we added the laser beam on the far away distance on the pipe.

Now that we know the frequency of the audio, we can adjust everything based on the music: the static spawn time, the colour of the ball, the laser beam, ... Yeah, colour of the sound, too!!

No comments:

Post a Comment