I will need some assistance with this. I don’t know where in the JS code to add this since I don’t know JS or the specifics of psychopy. I tried a few things but it didn’t work. The relevant part of the script is:
// *flicker_left* updates
if (t >= 0.0 && flicker_left.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
flicker_left.tStart = t; // (not accounting for frame time here)
flicker_left.frameNStart = frameN; // exact frame index
flicker_left.setAutoDraw(true);
}
// *flicker_right* updates
if (t >= 0.0 && flicker_right.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
flicker_right.tStart = t; // (not accounting for frame time here)
flicker_right.frameNStart = frameN; // exact frame index
flicker_right.setAutoDraw(true);
}
// *crosshair* updates
if (t >= 0.0 && crosshair.status === PsychoJS.Status.NOT_STARTED) {
// keep track of start time/frame for later
crosshair.tStart = t; // (not accounting for frame time here)
crosshair.frameNStart = frameN; // exact frame index
crosshair.setAutoDraw(true);
}
seq = [10, 0, 10, 0, 0, 10, 0, 10, 10, 0, 10, 10, 10, 10, 0, 0, 10, 10, 10, 10, 10, 0, 0, 10, 10, 10, 10, 0, 0, 0, 10, 0, 0, 0, 0, 10, 0, 0, 0, 0];
n = 10;
seq2 = [0, 10, 0, 10, 10, 0, 10, 0, 0, 10, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 10, 10, 10, 0, 10, 10, 10, 10, 0, 10, 10, 10, 10];
if ((frameN > (seq.length - 1))) {
flicker_left.setOpacity(0);
} else {
flicker_left.setOpacity(seq[frameN]);
}
if ((frameN > (seq2.length - 1))) {
flicker_right.setOpacity(0);
} else {
flicker_right.setOpacity(seq2[frameN]);
}
If you happen to have an answer please let me know. Thanks.