In progress: isolate relevant code from pitchdetect.js into custom2.js