if t > currTime + displaytime: currVisStim = 0 log_file.write("%d; %d; %5f; %d; %5f\n" %(keystroke_left, keystroke_right, t, currVisStim, currFreq)) keystroke_left = 0 keystroke_right = 0 #print '%5f; %d; %5f' %(t, currVisStim, currFreq) return 1 #Record key presses to text file, end stimulus with 'esc' def keydown(event): global keystroke_left, keystroke_right if event.key == pygame.locals.K_1 or event.key == pygame.locals.K_2: keystroke_left = 1 if event.key == pygame.locals.K_3 or event.key == pygame.locals.K_4: keystroke_right = 3 if event.key == pygame.locals.K_ESCAPE: p.parameters.go_duration = (0, 'frames') # Quit presentation 'p' with esc press def getcircleTexture(t): global circleTxtr return circleTxtr def getcircleAlpha(t): global currVisStim, alpha_min, alpha_max alpha = 0 if currVisStim == 0: alpha = alpha_min elif currVisStim == 1: alpha = alpha_max return alpha def myStimTextVis(t): global currTextVis return currTextVis def myStimTextAud(t):
if t > currTime + displaytime: currVisStim = 0 log_file.write("%d; %d; %5f; %d; %5f\n" %(keystroke_left, keystroke_right, t, currVisStim, currFreq)) keystroke_left = 0 keystroke_right = 0 #print '%5f; %d; %5f' %(t, currVisStim, currFreq) return 1 #Record key presses to text file, end stimulus with 'esc' def keydown(event): global keystroke_left, keystroke_right if event.key == pygame.locals.K_1 or event.key == pygame.locals.K_2: keystroke_left = 1 if event.key == pygame.locals.K_3 or event.key == pygame.locals.K_4: keystroke_right = 3 if event.key == pygame.locals.K_ESCAPE: p.parameters.go_duration = (0, 'frames') # Quit presentation 'p' with esc press def getcircleTexture(t): global circleTxtr return circleTxtr def getcircleAlpha(t): global currVisStim, alpha_min, alpha_max alpha = 0 if currVisStim == 0: alpha = alpha_min elif currVisStim == 1: alpha = alpha_max return alpha def myStimTextVis(t): global currTextVis return currTextVis def myStimTextAud(t):
NgFinal.docx