Change BPM to 70.
Extract drawCurve() and getTime() functions.
Sample NEW_SAMPLES times per frame.