URL of experiment: ToneTask [PsychoPy]
Gitlab: Fareeha Rana / ToneTask · GitLab
Description of the problem: I’m looking to record the duration of multiple presses of the same key during a given trial. The task premise is for participants to replicate a tone sequence using the spacebar. The experiment is running OK online, but the output file isn’t recording the durations properly–even though it is doing so offline.
I used this comment to add code snippets to record keypress durations {Measuring key lift time relative to stimulus onset - #4 by milsandhills} based off of the sample experiment here {Measuring key lift time relative to stimulus onset - #3 by Becca}. I have looked at other discussions posted on the forums that require something similar, but they haven’t been very helpful so far (or, possibly, I am not properly understanding the root of the issue).
More details:
In the output file, the first keypress duration seems to be recorded properly, but then the subsequent values iteratively go up by a small amount (e.g., 5.84, 5.99, 6.12 etc.). The output ‘durations’ per trial is far more than the number of keypresses, so I can only guess that it’s recording something in addition to the actual keypresses. That is, when I press (and release) the space bar three times, I still get a list of 20 or so values. Similarly, the variable that stores the keypresses (series of 'up’s and ‘downs’) is much longer than the keypresses within the trial. But the time is resetting for each trial, so I don’t think the experiment is recording all cumulative keypresses.
Any insight would be incredibly helpful (and if any more information would be helpful, I’d be happy to offer it). Thank you!