code to align psychopy and bdf events