Jittering results in output file

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Windows 7
PsychoPy version (e.g. 1.84.x): 1.83.03
Standard Standalone? (y/n) If not then what?: Standalone

Hi everyone. I’m new to PsychoPy, I’m using the builder of the 1.83.03 version in Windows 7. I designed a paradigm that goes as follows:

  1. Fixation cross
  2. An utterance that is used as stimuli
  3. Fixation cross
  4. A question that has to do with the previously read utterance

I need to jitter the duration of the second fixation cross, between 6 and 10 seconds. To do this I first interted a new routine in the flow, Next I inserted a code component, in the section “Begin routine” I inserted the next line:

import random

Then, in the same routine, I inserted a text component, and in the section “stop”, I selected “duration(s)” and inserted the next line:


the jittering works fine and gives me the range of time I need. But I also need to see how long the fixation cross lasted in the screen. The output .csv file doesn’t give this information by default, and I don’t know how to tell PsychoPy to print it in the file. I appreciate you help, have a nice day!

Alan Carrillo


Add this in the code component:

thisExp.addData('fix_duration', Jitter)

thisExp.addData() can be used to add data manually to your .csv.

1 Like

Thank you very much, lindeloev! I followed your suggestion and it wroked just fine! Now I can have all the data I need. Have a nice day!

Alan Carrillo

Hello All,

I have done this before with seconds, but I am wondering if it is possible to jitter frames? I am looking to have an ITI that has a random duration 24-96 frames.

Thank you in advance for the help!

Please post this as a new question, perhaps linking to this one. The original question here was about how to put something in a log file. Your question is about timing.


1 Like