Hi, I’m looking to build an RSVP stream with a set length of 9 items. However, I want to vary the target location within the stream, so that it may be presented as either item 5, 6, 7, or 8 in each trial. I am looking to also counterbalance the target position. What would be the best way of doing this using the coder?
Something like this code skeleton:
# assuming the number of trials is a multiple of 4,
# create a balanced list:
target_locations = [5, 6, 7, 8] * (number_of_trials/4)
# randomise its order:
numpy.random.shuffle(target_locations)
for trial_number, trial in enumerate(trials):
this_target_location = target.locations.pop()
for stimuli in range(9):
if trial_number + 1 == this_target_location: # NB 0 vs 1 based
# show the target
else:
# do whatever else
Thanks for this! Would you mind explaining how this works:
Can you be more specific? This is just an outline of the sort of structure your code would need, it won’t work by itself.
i.e. you need a loop for your trials (ideally a TrialHandler
psychopy.data - functions for storing/saving/analysing data — PsychoPy v2023.2.3), then within each trial, a loop for displaying the stimuli. But without seeing your own code, it is hard to be give more useful detail.