I’d like to transfer an experiment with a variable Intertrial Interval (ITI) from Psychopy3 online to Pavlovia.
I’ve been able to get the variable ITI to work in multiple ways locally. These all involve putting on a stimulus for variable duration (or a variable startpoint), defining a parameter for ITI before or at the start of the routine (i.e. in code at the beginning of the experiment, or in a conditions file), then putting the parameter name in the ‘duration’ or ‘start time’ section of the stimulus in Builder.
However, when I try to put this on Pavlovia, the duration can’t be varied. I’ve realised this occurs because locally, the Python code imports numpy in order to put the variable duration, i.e.:
from numpy import (sin, cos, tan, log, log10, pi, average,
sqrt, std, deg2rad, rad2deg, linspace, asarray)
if tThisFlipGlobal > blank_between.tStartRefresh + asarray(ITI)-frameTolerance:
(here ITI is my variable name and asarray is imported from numpy).
This import does not convert to JS (as explained in @wakecarter 's Crib Sheet). Therefore, in the JS converted version for Pavlovia they just attempt to use the function ‘asarray’, which doesn’t work so it crashes.
Is there a way to implement a variable stimulus duration in an online experiment which doesn’t encounter this problem?
Thank you so much