psychopy.org | Reference | Downloads | Github

Non-slip timing - fMRI

I’m using PsychoPy in an fMRI experiment. The PsychoPy routine is a total length of 297 seconds (composed of 66 trials of 4.5 seconds each). I would like to use non-slip timing and have read about the clock feature that would allow for it at https://www.psychopy.org/general/timing/nonSlipTiming.html . I’d really appreciate it if someone could direct me to a publicly assessible experiment on Pavlovia that uses it, so that I can see how the code is written within PsychoPy (I don’t have a computing background), or would be willing to share it here. Thanks in advance.

If your trials have a fixed duration, then non-slip timing can likely be achieved easily within the Builder environment, without the need for coding at all. Perhaps you could just provide details of your implementation (is it currently in Builder, is it written from scotch in custom Python, or is it still at the planning stage?)

Thanks @Michael I didn’t realise that non-slip timing was automatically coded when the loop is shown as green (as my one is). I thought that this was something that still had to be coded in, but from what you are saying, this feature is automatically applied in the script (I attach it here)AudioWedsfMRI.psyexp (8.2 KB)

Yes, if the routines are coloured green, that indicates that Builder knows at compile time how long each routine is supposed to last, and so can apply the non-slip timing code. When the duration of a routine is contingent on something else (e.g. a keypress), and hence has indeterminate duration, non-slip timing can’t be used (which is indicated by the red colour).

It would be great if we could extend non-slip timing further (such as when the intended duration is known at the start of the routine but not necessarily at compile time), but that is still a work in progress (or more realistically, in contemplation):