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.
Not yet, seems like it's a lot harder than I do it right now. It might require coding a thing that screen captures the visualizer itself, which is really unstable.
All the visuals are done by HTML/CSS and Web Audio API now.