I played a lot with processing today and almost forgot about the homework.
Here comes the visualization for the famous pink song:
First I changed the audio source to line-in so that I could play live with whatever I want. And I do love to snap to my laptop and see it react. *snap* *snap*
Also it’s fun to whistle at the program to see what’s happening.
The primary factor for visualization in this piece is the shape of diamond. I do not really want to mess up with 3D transforming and matrix things…so to make life easier I came up with following specs:
* Frequency – mapped to color of the diamond. Firstly the full spectrum was mapped to full Hue scope in a linear manner. That is to map 0 – 22050Hz to 0-360. However for music and vocal the frequency gathers around below 2000Hz, so I trimmed the sample frequency range to 0 – 16000Hz. Not much difference in the result though because it’s not enough. But at least it’s more colorful than before the change, and actually I don’t really wish to lose the sampling of higher frequency.
* Amplitude – mapped to saturation and size of the diamond. A little randomness was also added.
* History – I would rather create an overall feeling of the piece of the sound than to analyze its features at any timeslot. So I made the previous visualization of the sound fade into the background. I’m thinking of a better solution though… maybe after I get comfortable with the 3D stuff.
* Keyboard Controls – several commands could be made through keyboard shortcuts:
1) l (as in Leopard) – toggle log/debug mode (which shows a waveform of spectrum)
2) c – clear screen
3) + – increase threshold for amplitude, which filters frequency with amplitude above threshold to sample
4) – - decrease threshold for amplitude
After getting tired of snapping, I used miniAudicle to generate sounds for testing, which looks pretty good from the result’s aspect.
Link for applet (using pink.mp3)
To play it with microphone you need to download Executable for Mac OSX