I recently made my audio components into a module; handles setting up audio, doing FFT, connecting to Ableton link, reading and playing midi. There's a video: github.com/rezonality/Zing