picsvast.blogg.se

Psychopy get loop number
Psychopy get loop number









psychopy get loop number
  1. #PSYCHOPY GET LOOP NUMBER FULL#
  2. #PSYCHOPY GET LOOP NUMBER SOFTWARE#
  3. #PSYCHOPY GET LOOP NUMBER TRIAL#
  4. #PSYCHOPY GET LOOP NUMBER SERIES#

Peirce, JW (2007) PsychoPy - Psychophysics software in Python. If you publish work using this script please cite the relevant PsychoPy publications This experiment was created using PsychoPy2 Experiment Builder (v1.82.01), Thu Aug 27 10:56:53 2015

#PSYCHOPY GET LOOP NUMBER FULL#

Have I gone about this in the wrong way? The full code pasted below. I started to make the loop proceed through the conditions file randomly, but the result is that every triangle changes its orientation at every rep (rather than just one at a time). I am having a hard time figuring out what code to use to make this possible.

#PSYCHOPY GET LOOP NUMBER TRIAL#

However, my ultimate goal is to have a variable number of distractor shifts before the target shift in each trial, and for each trial to end with a fixation cross before moving onto the next trial. Right now I have this set as a sequential loop, with fixed numbers of distractor shifts, for the sake of simplicity. This is the "target shift." I have the orientations for all triangles specified in an Excel conditions file. When one of the triangle changes like this, it is called a "distractor shift."Īfter a number of these distractor shifts, one of the triangles shifts into the "target" position (either pointing left or right, 90 or 270 degrees), at which point the person is meant to respond with a keypress. So, if you can see in the snippet above, I created each row in the conditions file such that only one triangle changes its orientation every second. The orientation of each triangle is determined by the conditions file-triangle 1 orientation field is set to "angle_01," triangle 2 orientation is set to "angle_02" and so forth. Each triangle is set to have a 1 second duration. **The subject is then presented with an array of 4 triangles. The subject is instructed to press the corresponding left or right arrow keys when they spot either one of these targets.Ī sample of the Excel conditions file looks like this: angle_01 angle_02 angle_03 angle_04 corrAns Subject is first presented with two target triangles: one pointing to the left, one pointing to the right. I've run into a roadblock with a task and would appreciate any advice from the community! My knowledge of Python is still very limited. With open('Participant Scores.csv', 'a+') as file:įile.I am using PsychoPy version 1.82.01 in the Builder View. ("N:\Task Development\Stimuli/scream.wav").play() Scores = font_small.render(str(SCORE), True, BLACK)Ĭscores = font_small.render(str(COLLISION_SCORE2), True, BLACK)ĭISPLAYSURF.blit(cscores, (SCREEN_WIDTH-60, 10))ĭISPLAYSURF.blit(entity.image, entity.rect) #("D:\Pygame Project\Stimuli/spawn.wav").play() Self.image = ("N:\Task Development\Stimuli/greendot.png") (screen, RED, )įont = ("Verdana", 40)įont_small = ("Verdana", 20)īackground = ("N:\Task Development\Stimuli/trial.jpeg")ĭISPLAYSURF = _mode((SCREEN_WIDTH, SCREEN_HEIGHT), pygame.RESIZABLE) # Loop until the user clicks the close button. #CALIBRATION_SPEED = (input('Enter multiplier value')) SCREEN_WIDTH, SCREEN_HEIGHT = ().current_w, ().current_h Here is the entire, albeit lengthy, code: import pygame, sys If anyone could help me adjust the code so that it can be integrated into the loop 20 times in PsychoPy please, I would be most appreciative! Currently, after the 5 seconds, the screen remains blank white and won’t load into the next routine. I have attached an image of the desired routine/loop for reference.Ĭurrently, as it is, the task exits through pygame.quit() and win.flip(), but both of these exit the entire task, rather than exiting back to the loop. The same task would be repeated 20 times, forming one overall larger trial.

#PSYCHOPY GET LOOP NUMBER SERIES#

I’d like it to be as a five-second routine in builder and then repeat as a series of trials. I have my task coded in Python, which I’ve integrated into PsychoPy using builder.











Psychopy get loop number