Split the spectrum analyzer, common main loop functionality, and sample generator out into separate modules, and added an 'analyzer.py' script to perform offline analysis of a song.