Did you consider using an existing visualizer like ProjectM to generate the visuals and then record the output to a file? I have no idea if their license would allow you to monetize that though.
All the visuals are done by HTML/CSS and Web Audio API now.