Title: Music Visualizer
Engine: Unity 4
Platform: PC
A simple visualizer that analysis an audio file, such as a song, and scales 20 red pillars representing frequencies throughout the frequency range of the audio file. This gives a feeling for what frequencies the audio file consists of (lower frequencies to the left, higher to the right) but also produces an oddly satisfying visual representation of the sound.
The visualizer is made up of two scripts. One script that gets audio data from a specified audio source and scales a red "pillar" based on the strength of the audio. Another script that moves a grey "hat" based on it's corresponding pillar, pushing the hat up when the pillar reacts to stronger sounds. If the hat isn't continually pushed up by the pillar it will begin to fall.
The pillars each have a specified sample range. The script checks the strength of the audio within the range specified by these samples and scales the pillar according to the strongest sample. In order to account for the way the human ear registers sound the sample-strength is scaled logarithmically (just like human hearing). The scaling is based on the Mel Scale but has been slightly modified to give lower frequencies a bit more presence.
Each hat has a specific pillar that it belongs to. Each frame this script checks the corresponding pillar's scale and compares it to the hat's position plus the offset. The offset is used to create a slight space between the hat and the pillar. If the pillar's scale is greater than the hat's position plus offset the hat is moved up to the top of the pillar. If the top of the pillar is further down than the hat the hat falls down towards the bottom of the screen.
Stefan Alfredsson - Designer & Unity Developer - E-mail: stefan@jigoku.se - Mobile: +46 70 754 8228