Drawing waveform and responding to onsets