CCRMA, Stanford University

MUSIC 256a Homework #3: Sonic Shape Sorter (SoShSo)

About

The 'Sonic Shape Sorter' (SoShSo) is a visualizer for sound from the system audio. It illustrates an fft waterfall of sorts, along with spectral chroma energy.


Demo


To Build


- To compile in the terminal with g++:

make

- To run:

Run ./SoShSo

- Key press options:

'c': view chroma via Cones (default view)

'h': view Chroma via 'Hedron

'+': scale up chroma brightness

'-': scale down chroma brightness

'w': toggle FFT windowing

't': view from top

'o': view from origin

'd': view from default view

's': toggle fullscreen

- To cleanup files:

make clean

Comments

There are 2 modes for visualization - the upstanding chroma cones with opposing FFT waterfall vortex, and the lazily rotating chroma 'hedron. The FFT waterfall code was largely borrowed from fft.cpp by Jorge Herrera. The algorithm for mapping FFT spectrum bins to chroma bins was hand converted to C++ from LabROSA's MATLAB code chromagram_E.m. Note that the brightness sensitivity of the chroma can be adjusted by the user (see key press options above), depending on the overall volume of the audio input.

Song Recommendation

To watch the chroma cones energize independently as the notes drop, I would suggest something melodic and moderately paced, like Beethoven's' Sonata Pathétique.

Screenshots

Chroma cone highlighting an A#/Bb being played currently
Chroma cones topple over to the beat
Top view into the FFT waterfall vortex
Shards of color seen from the origin as cones energize
Chroma 'hedron highlighting an A#/Bb being played currently
Chroma 'hedron is awash with a blend of colors
Inside the 'hedron
Again, looking from the origin

Issues

I changed the FFT size from the default of 512 to 8192 for better chroma (spectral) resolution with lower energy leakage. This makes the visualizer lag noticeably, so there is a tradeoff here.


Collaborators

I went pretty maverick on this one.


Source Files

Download