#!/usr/bin/env python # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy3 Experiment Builder (v2023.2.3), on julio 11, 2024, at 15:14 If you publish work using this script the most relevant publication is: Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) PsychoPy2: Experiments in behavior made easy Behav Res 51: 195. https://doi.org/10.3758/s13428-018-01193-y """ # --- Import packages --- from psychopy import locale_setup from psychopy import prefs from psychopy import plugins plugins.activatePlugins() prefs.hardware['audioLib'] = 'ptb' prefs.hardware['audioLatencyMode'] = '3' from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout from psychopy.tools import environmenttools from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, STOPPED, FINISHED, PRESSED, RELEASED, FOREVER, priority) import numpy as np # whole numpy lib is available, prepend 'np.' from numpy import (sin, cos, tan, log, log10, pi, average, sqrt, std, deg2rad, rad2deg, linspace, asarray) from numpy.random import random, randint, normal, shuffle, choice as randchoice import os # handy system and path functions import sys # to get file system encoding import psychopy.iohub as io from psychopy.hardware import keyboard # Run 'Before Experiment' code from code_2 #### Estas especificaciones las metemos desde el principio. Según inciemos el #### experimento se cargan las siguientes caracterísiticas. from pylsl import StreamInfo, StreamOutlet import random from datetime import date,datetime import configparser from enum import Enum, auto import serial import pandas as pd import multiprocessing import threading import subprocess ### Este apartado añade el hecho de que la tecla escape sirve para interrumpir el programa. ### Por otro lado la tecla (t) envia un error de que ha habido un problema def send_error_(outlet): while True: if kb.is_pressed('t'): while True: if not kb.is_pressed('t'): outlet.push_sample(['Error Marker']) print(f"{datetime.now()}: Marker sent") break if kb.is_pressed('escape'): print('log info: Error control disabled') break def send_error(outlet,e_keyb): while True: if e_keyb.getKeys(keyList=["t"]): while True: if not e_keyb.getKeys(keyList=["t"]): outlet.push_sample(['Error Marker']) print(f"{datetime.now()}: Marker sent") break if e_keyb.getKeys(keyList=["escape"]): print('log info: Error control disabled') break ### Para registrar la palabra que se está presentando # Marcadores: Asignación de identificadores numéricos --> Siendo la asignación aleatoria class Markers(Enum): EXPERIMENT_INICIO = auto() EXPERIMENT_FINAL = auto() REALSYLLABLES_EXPERIMENT_START_FIXATION = auto() REALSYLLABLES_EXPERIMENT_END_FIXATION = auto() REALSYLLABLES_EXPERIMENT_START_STIMULUS = auto() REALSYLLABLES_EXPERIMENT_END_STIMULUS = auto() REALSYLLABLES_EXPERIMENT_START_ISI = auto() REALSYLLABLES_EXPERIMENT_END_ISI = auto() REALSYLLABLES_EXPERIMENT_START_SPEECH = auto() REALSYLLABLES_EXPERIMENT_END_SPEECH = auto() REALSYLLABLES_EXPERIMENT_START_ITI = auto() REALSYLLABLES_EXPERIMENT_END_ITI = auto() SILENTSYLLABLES_EXPERIMENT_START_FIXATION = auto() SILENTSYLLABLES_EXPERIMENT_END_FIXATION = auto() SILENTSYLLABLES_EXPERIMENT_START_STIMULUS = auto() SILENTSYLLABLES_EXPERIMENT_END_STIMULUS = auto() SILENTSYLLABLES_EXPERIMENT_START_ISI = auto() SILENTSYLLABLES_EXPERIMENT_END_ISI = auto() SILENTSYLLABLES_EXPERIMENT_START_SPEECH = auto() SILENTSYLLABLES_EXPERIMENT_END_SPEECH = auto() SILENTSYLLABLES_EXPERIMENT_START_ITI = auto() SILENTSYLLABLES_EXPERIMENT_END_ITI = auto() REALWORDS_EXPERIMENT_START_FIXATION = auto() REALWORDS_EXPERIMENT_END_FIXATION = auto() REALWORDS_EXPERIMENT_START_STIMULUS = auto() REALWORDS_EXPERIMENT_END_STIMULUS = auto() REALWORDS_EXPERIMENT_START_ISI = auto() REALWORDS_EXPERIMENT_END_ISI = auto() REALWORDS_EXPERIMENT_START_SPEECH = auto() REALWORDS_EXPERIMENT_END_SPEECH = auto() REALWORDS_EXPERIMENT_START_ITI = auto() REALWORDS_EXPERIMENT_END_ITI = auto() SILENTWORDS_EXPERIMENT_START_FIXATION = auto() SILENTWORDS_EXPERIMENT_END_FIXATION = auto() SILENTWORDS_EXPERIMENT_START_STIMULUS = auto() SILENTWORDS_EXPERIMENT_END_STIMULUS = auto() SILENTWORDS_EXPERIMENT_START_ISI = auto() SILENTWORDS_EXPERIMENT_END_ISI = auto() SILENTWORDS_EXPERIMENT_START_SPEECH = auto() SILENTWORDS_EXPERIMENT_END_SPEECH = auto() SILENTWORDS_EXPERIMENT_START_ITI = auto() SILENTWORDS_EXPERIMENT_END_ITI = auto() REALSYLLABLES_PRACTICE_START_FIXATION = auto() REALSYLLABLES_PRACTICE_END_FIXATION = auto() REALSYLLABLES_PRACTICE_START_STIMULUS = auto() REALSYLLABLES_PRACTICE_END_STIMULUS = auto() REALSYLLABLES_PRACTICE_START_ISI = auto() REALSYLLABLES_PRACTICE_END_ISI = auto() REALSYLLABLES_PRACTICE_START_SPEECH = auto() REALSYLLABLES_PRACTICE_END_SPEECH = auto() REALSYLLABLES_PRACTICE_START_ITI = auto() REALSYLLABLES_PRACTICE_END_ITI = auto() SILENTSYLLABLES_PRACTICE_START_FIXATION = auto() SILENTSYLLABLES_PRACTICE_END_FIXATION = auto() SILENTSYLLABLES_PRACTICE_START_STIMULUS = auto() SILENTSYLLABLES_PRACTICE_END_STIMULUS = auto() SILENTSYLLABLES_PRACTICE_START_ISI = auto() SILENTSYLLABLES_PRACTICE_END_ISI = auto() SILENTSYLLABLES_PRACTICE_START_SPEECH = auto() SILENTSYLLABLES_PRACTICE_END_SPEECH = auto() SILENTSYLLABLES_PRACTICE_START_ITI = auto() SILENTSYLLABLES_PRACTICE_END_ITI = auto() REALWORDS_PRACTICE_START_FIXATION = auto() REALWORDS_PRACTICE_END_FIXATION = auto() REALWORDS_PRACTICE_START_STIMULUS = auto() REALWORDS_PRACTICE_END_STIMULUS = auto() REALWORDS_PRACTICE_START_ISI = auto() REALWORDS_PRACTICE_END_ISI = auto() REALWORDS_PRACTICE_START_SPEECH = auto() REALWORDS_PRACTICE_END_SPEECH = auto() REALWORDS_PRACTICE_START_ITI = auto() REALWORDS_PRACTICE_END_ITI = auto() SILENTWORDS_PRACTICE_START_FIXATION = auto() SILENTWORDS_PRACTICE_END_FIXATION = auto() SILENTWORDS_PRACTICE_START_STIMULUS = auto() SILENTWORDS_PRACTICE_END_STIMULUS = auto() SILENTWORDS_PRACTICE_START_ISI = auto() SILENTWORDS_PRACTICE_END_ISI = auto() SILENTWORDS_PRACTICE_START_SPEECH = auto() SILENTWORDS_PRACTICE_END_SPEECH = auto() SILENTWORDS_PRACTICE_START_ITI = auto() SILENTWORDS_PRACTICE_END_ITI = auto() # Definición de Palabras que Apareceran en los marcadores ### Marcar el puerto CONFIG_FILE = 'CV_task.conf' random.seed() config = configparser.ConfigParser() config.read(CONFIG_FILE) # Instanciación del puerto serie (envío de triggers hardware) if 'port' in config['TRIGGER']: trigger_port = config['TRIGGER']['port'] serial_port = serial.Serial(trigger_port, baudrate=128000, timeout=0.01) else: trigger_port = None serial_port = None # Outlet LSL (envío de triggers LSL) info = StreamInfo('SingleWordsMarkerStream', 'Markers', 1, 0, 'string', 'emuidw22') outlet = StreamOutlet(info) # --- Setup global variables (available in all functions) --- # Ensure that relative paths start from the same directory as this script _thisDir = os.path.dirname(os.path.abspath(__file__)) # Store info about the experiment session psychopyVersion = '2023.2.3' expName = 'EEG2SpeechLast' # from the Builder filename that created this script expInfo = { 'participant': f"{randint(0, 999999):06.0f}", 'session': '001', 'date': data.getDateStr(), # add a simple timestamp 'expName': expName, 'psychopyVersion': psychopyVersion, } def showExpInfoDlg(expInfo): """ Show participant info dialog. Parameters ========== expInfo : dict Information about this experiment, created by the `setupExpInfo` function. Returns ========== dict Information about this experiment. """ # temporarily remove keys which the dialog doesn't need to show poppedKeys = { 'date': expInfo.pop('date', data.getDateStr()), 'expName': expInfo.pop('expName', expName), 'psychopyVersion': expInfo.pop('psychopyVersion', psychopyVersion), } # show participant info dialog dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName) if dlg.OK == False: core.quit() # user pressed cancel # restore hidden keys expInfo.update(poppedKeys) # return expInfo return expInfo def setupData(expInfo, dataDir=None): """ Make an ExperimentHandler to handle trials and saving. Parameters ========== expInfo : dict Information about this experiment, created by the `setupExpInfo` function. dataDir : Path, str or None Folder to save the data to, leave as None to create a folder in the current directory. Returns ========== psychopy.data.ExperimentHandler Handler object for this experiment, contains the data to save and information about where to save it to. """ # data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc if dataDir is None: dataDir = _thisDir filename = u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date']) # make sure filename is relative to dataDir if os.path.isabs(filename): dataDir = os.path.commonprefix([dataDir, filename]) filename = os.path.relpath(filename, dataDir) # an ExperimentHandler isn't essential but helps with data saving thisExp = data.ExperimentHandler( name=expName, version='', extraInfo=expInfo, runtimeInfo=None, originPath='D:\\Salvar\\EEG2Speech_1\\AAA1_EEG2SpeechELBUENOLastPRUEBArun_lastrun.py', savePickle=True, saveWideText=True, dataFileName=dataDir + os.sep + filename, sortColumns='time' ) thisExp.setPriority('thisRow.t', priority.CRITICAL) thisExp.setPriority('expName', priority.LOW) # return experiment handler return thisExp def setupLogging(filename): """ Setup a log file and tell it what level to log at. Parameters ========== filename : str or pathlib.Path Filename to save log file and data files as, doesn't need an extension. Returns ========== psychopy.logging.LogFile Text stream to receive inputs from the logging system. """ # this outputs to the screen, not a file logging.console.setLevel(logging.WARNING) # save a log file for detail verbose info logFile = logging.LogFile(filename+'.log', level=logging.WARNING) return logFile def setupWindow(expInfo=None, win=None): """ Setup the Window Parameters ========== expInfo : dict Information about this experiment, created by the `setupExpInfo` function. win : psychopy.visual.Window Window to setup - leave as None to create a new window. Returns ========== psychopy.visual.Window Window in which to run this experiment. """ if win is None: # if not given a window to setup, make one win = visual.Window( size=[1440, 900], fullscr=True, screen=0, winType='pyglet', allowStencil=False, monitor='testMonitor', color=[-1.0000, -1.0000, -1.0000], colorSpace='rgb', backgroundImage='', backgroundFit='none', blendMode='avg', useFBO=True, units='height' ) if expInfo is not None: # store frame rate of monitor if we can measure it expInfo['frameRate'] = win.getActualFrameRate() else: # if we have a window, just set the attributes which are safe to set win.color = [-1.0000, -1.0000, -1.0000] win.colorSpace = 'rgb' win.backgroundImage = '' win.backgroundFit = 'none' win.units = 'height' win.mouseVisible = False win.hideMessage() return win def setupInputs(expInfo, thisExp, win): """ Setup whatever inputs are available (mouse, keyboard, eyetracker, etc.) Parameters ========== expInfo : dict Information about this experiment, created by the `setupExpInfo` function. thisExp : psychopy.data.ExperimentHandler Handler object for this experiment, contains the data to save and information about where to save it to. win : psychopy.visual.Window Window in which to run this experiment. Returns ========== dict Dictionary of input devices by name. """ # --- Setup input devices --- inputs = {} ioConfig = {} # Setup iohub keyboard ioConfig['Keyboard'] = dict(use_keymap='psychopy') ioSession = '1' if 'session' in expInfo: ioSession = str(expInfo['session']) ioServer = io.launchHubServer(window=win, **ioConfig) eyetracker = None # create a default keyboard (e.g. to check for escape) defaultKeyboard = keyboard.Keyboard(backend='iohub') # return inputs dict return { 'ioServer': ioServer, 'defaultKeyboard': defaultKeyboard, 'eyetracker': eyetracker, } def pauseExperiment(thisExp, inputs=None, win=None, timers=[], playbackComponents=[]): """ Pause this experiment, preventing the flow from advancing to the next routine until resumed. Parameters ========== thisExp : psychopy.data.ExperimentHandler Handler object for this experiment, contains the data to save and information about where to save it to. inputs : dict Dictionary of input devices by name. win : psychopy.visual.Window Window for this experiment. timers : list, tuple List of timers to reset once pausing is finished. playbackComponents : list, tuple List of any components with a `pause` method which need to be paused. """ # if we are not paused, do nothing if thisExp.status != PAUSED: return # pause any playback components for comp in playbackComponents: comp.pause() # prevent components from auto-drawing win.stashAutoDraw() # run a while loop while we wait to unpause while thisExp.status == PAUSED: # make sure we have a keyboard if inputs is None: inputs = { 'defaultKeyboard': keyboard.Keyboard(backend='ioHub') } # check for quit (typically the Esc key) if inputs['defaultKeyboard'].getKeys(keyList=['escape']): endExperiment(thisExp, win=win, inputs=inputs) # flip the screen win.flip() # if stop was requested while paused, quit if thisExp.status == FINISHED: endExperiment(thisExp, inputs=inputs, win=win) # resume any playback components for comp in playbackComponents: comp.play() # restore auto-drawn components win.retrieveAutoDraw() # reset any timers for timer in timers: timer.reset() def run(expInfo, thisExp, win, inputs, globalClock=None, thisSession=None): """ Run the experiment flow. Parameters ========== expInfo : dict Information about this experiment, created by the `setupExpInfo` function. thisExp : psychopy.data.ExperimentHandler Handler object for this experiment, contains the data to save and information about where to save it to. psychopy.visual.Window Window in which to run this experiment. inputs : dict Dictionary of input devices by name. globalClock : psychopy.core.clock.Clock or None Clock to get global time from - supply None to make a new one. thisSession : psychopy.session.Session or None Handle of the Session object this experiment is being run from, if any. """ # mark experiment as started thisExp.status = STARTED # make sure variables created by exec are available globally exec = environmenttools.setExecEnvironment(globals()) # get device handles from dict of input devices ioServer = inputs['ioServer'] defaultKeyboard = inputs['defaultKeyboard'] eyetracker = inputs['eyetracker'] # make sure we're running in the directory for this experiment os.chdir(_thisDir) # get filename from ExperimentHandler for convenience filename = thisExp.dataFileName frameTolerance = 0.001 # how close to onset before 'same' frame endExpNow = False # flag for 'escape' or other condition => quit the exp # get frame duration from frame rate in expInfo if 'frameRate' in expInfo and expInfo['frameRate'] is not None: frameDur = 1.0 / round(expInfo['frameRate']) else: frameDur = 1.0 / 60.0 # could not measure, so guess # Start Code - component code to be run after the window creation # --- Initialize components for Routine "PresentationList" --- # Run 'Begin Experiment' code from code_2 Presentation_List = expInfo['participant'] + "_" + expInfo['session'] +".xlsx" import pandas as pd # Envío de marcadores def send_markers(marker): if marker is Markers.EXPERIMENT_INICIO: if serial_port: serial_port.write(b"WRITE 1 50000 0\n") elif marker is Markers.EXPERIMENT_FINAL: if serial_port: serial_port.write(b"WRITE 2 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_START_FIXATION: if serial_port: serial_port.write(b"WRITE 3 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_END_FIXATION: if serial_port: serial_port.write(b"WRITE 4 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_START_STIMULUS: if serial_port: serial_port.write(b"WRITE 5 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_END_STIMULUS: if serial_port: serial_port.write(b"WRITE 6 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_START_ISI: if serial_port: serial_port.write(b"WRITE 7 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_END_ISI: if serial_port: serial_port.write(b"WRITE 8 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_START_SPEECH: if serial_port: serial_port.write(b"WRITE 9 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_END_SPEECH: if serial_port: serial_port.write(b"WRITE 10 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_START_ITI: if serial_port: serial_port.write(b"WRITE 11 50000 0\n") elif marker is Markers.REALSYLLABLES_EXPERIMENT_END_ITI: if serial_port: serial_port.write(b"WRITE 12 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_START_FIXATION: if serial_port: serial_port.write(b"WRITE 3 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_END_FIXATION: if serial_port: serial_port.write(b"WRITE 4 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_START_STIMULUS: if serial_port: serial_port.write(b"WRITE 5 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_END_STIMULUS: if serial_port: serial_port.write(b"WRITE 6 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_START_ISI: if serial_port: serial_port.write(b"WRITE 7 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_END_ISI: if serial_port: serial_port.write(b"WRITE 8 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_START_SPEECH: if serial_port: serial_port.write(b"WRITE 9 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_END_SPEECH: if serial_port: serial_port.write(b"WRITE 10 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_START_ITI: if serial_port: serial_port.write(b"WRITE 11 50000 0\n") elif marker is Markers.SILENTSYLLABLES_EXPERIMENT_END_ITI: if serial_port: serial_port.write(b"WRITE 12 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_START_FIXATION: if serial_port: serial_port.write(b"WRITE 3 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_END_FIXATION: if serial_port: serial_port.write(b"WRITE 4 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_START_STIMULUS: if serial_port: serial_port.write(b"WRITE 5 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_END_STIMULUS: if serial_port: serial_port.write(b"WRITE 6 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_START_ISI: if serial_port: serial_port.write(b"WRITE 7 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_END_ISI: if serial_port: serial_port.write(b"WRITE 8 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_START_SPEECH: if serial_port: serial_port.write(b"WRITE 9 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_END_SPEECH: if serial_port: serial_port.write(b"WRITE 10 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_START_ITI: if serial_port: serial_port.write(b"WRITE 11 50000 0\n") elif marker is Markers.REALWORDS_EXPERIMENT_END_ITI: if serial_port: serial_port.write(b"WRITE 12 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_START_FIXATION: if serial_port: serial_port.write(b"WRITE 3 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_END_FIXATION: if serial_port: serial_port.write(b"WRITE 4 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_START_STIMULUS: if serial_port: serial_port.write(b"WRITE 5 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_END_STIMULUS: if serial_port: serial_port.write(b"WRITE 6 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_START_ISI: if serial_port: serial_port.write(b"WRITE 7 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_END_ISI: if serial_port: serial_port.write(b"WRITE 8 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_START_SPEECH: if serial_port: serial_port.write(b"WRITE 9 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_END_SPEECH: if serial_port: serial_port.write(b"WRITE 10 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_START_ITI: if serial_port: serial_port.write(b"WRITE 11 50000 0\n") elif marker is Markers.SILENTWORDS_EXPERIMENT_END_ITI: if serial_port: serial_port.write(b"WRITE 12 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_START_FIXATION: if serial_port: serial_port.write(b"WRITE 3 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_END_FIXATION: if serial_port: serial_port.write(b"WRITE 4 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_START_STIMULUS: if serial_port: serial_port.write(b"WRITE 5 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_END_STIMULUS: if serial_port: serial_port.write(b"WRITE 6 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_START_ISI: if serial_port: serial_port.write(b"WRITE 7 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_END_ISI: if serial_port: serial_port.write(b"WRITE 8 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_START_SPEECH: if serial_port: serial_port.write(b"WRITE 9 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_END_SPEECH: if serial_port: serial_port.write(b"WRITE 10 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_START_ITI: if serial_port: serial_port.write(b"WRITE 11 50000 0\n") elif marker is Markers.SILENTSYLLABLES_PRACTICE_END_ITI: if serial_port: serial_port.write(b"WRITE 12 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_START_FIXATION: if serial_port: serial_port.write(b"WRITE 3 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_END_FIXATION: if serial_port: serial_port.write(b"WRITE 4 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_START_STIMULUS: if serial_port: serial_port.write(b"WRITE 5 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_END_STIMULUS: if serial_port: serial_port.write(b"WRITE 6 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_START_ISI: if serial_port: serial_port.write(b"WRITE 7 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_END_ISI: if serial_port: serial_port.write(b"WRITE 8 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_START_SPEECH: if serial_port: serial_port.write(b"WRITE 9 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_END_SPEECH: if serial_port: serial_port.write(b"WRITE 10 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_START_ITI: if serial_port: serial_port.write(b"WRITE 11 50000 0\n") elif marker is Markers.REALSYLLABLES_PRACTICE_END_ITI: if serial_port: serial_port.write(b"WRITE 12 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_START_FIXATION: if serial_port: serial_port.write(b"WRITE 3 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_END_FIXATION: if serial_port: serial_port.write(b"WRITE 4 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_START_STIMULUS: if serial_port: serial_port.write(b"WRITE 5 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_END_STIMULUS: if serial_port: serial_port.write(b"WRITE 6 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_START_ISI: if serial_port: serial_port.write(b"WRITE 7 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_END_ISI: if serial_port: serial_port.write(b"WRITE 8 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_START_SPEECH: if serial_port: serial_port.write(b"WRITE 9 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_END_SPEECH: if serial_port: serial_port.write(b"WRITE 10 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_START_ITI: if serial_port: serial_port.write(b"WRITE 11 50000 0\n") elif marker is Markers.REALWORDS_PRACTICE_END_ITI: if serial_port: serial_port.write(b"WRITE 12 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_START_FIXATION: if serial_port: serial_port.write(b"WRITE 3 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_END_FIXATION: if serial_port: serial_port.write(b"WRITE 4 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_START_STIMULUS: if serial_port: serial_port.write(b"WRITE 5 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_END_STIMULUS: if serial_port: serial_port.write(b"WRITE 6 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_START_ISI: if serial_port: serial_port.write(b"WRITE 7 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_END_ISI: if serial_port: serial_port.write(b"WRITE 8 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_START_SPEECH: if serial_port: serial_port.write(b"WRITE 9 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_END_SPEECH: if serial_port: serial_port.write(b"WRITE 10 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_START_ITI: if serial_port: serial_port.write(b"WRITE 11 50000 0\n") elif marker is Markers.SILENTWORDS_PRACTICE_END_ITI: if serial_port: serial_port.write(b"WRITE 12 50000 0\n") else: raise Exception("Undefined marker: {}".format(marker)) # --- Initialize components for Routine "InstInicio" --- text_16 = visual.TextStim(win=win, name='text_16', text='En este experimento, tu tarea consistirá en "DECIR EN VOZ ALTA" o "IMAGINAR" que dices las sílabas o palabras que se te irán presentando. En la condición de habla imaginada, será muy importante intentar imaginar que estás diciendo la sílaba o la palabra, pero sin activar ningún músculo.\n\nTendrás que producir el habla (imaginado o real), solamente una vez cuando aparezca la señal:\n\n[ *** ]\n\nLa presentación de las sílabas o palabras podrá ser de forma escrita, hablada o con imágenes (solamente para las palabras).\n\nA parte de los músculos necesarios para el habla en los bloques de habla real, tendrás que intentar, tanto como sea posible, no activar los otros músculos durante los ensayos (p.ej., con el parpadeo, moviendo la cabeza, bostezando...). Podrás descansar y realizar estos movimientos durante las pausas (cada 20 ensayos).\n\n\nPulsar la barra espaciadorra para comenzar.', font='Arial', pos=(0, 0), height=0.03, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_12 = keyboard.Keyboard() # --- Initialize components for Routine "InstPracCV" --- text_12 = visual.TextStim(win=win, name='text_12', text='Ahora, vamos a realizar unos ensayos de práctica.\n\nPara estos ensayos, tu tarea consistirá en IMAGINAR que dices las sílabas que se te irán presentando (escritas o habladas), pero sin activar ningún músculo, cuando aparezca la señal:\n\n\n[ *** ]\n\n\n\n\nPulsar la barra espaciadorra para comenzar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_9 = keyboard.Keyboard() # --- Initialize components for Routine "FixCVImaPrac" --- # Run 'Begin Experiment' code from code_FIXCV_3 FixCVprac1 = 0 maxDur = 1.5 minDur = 1 Fix_for_CV_3 = visual.TextStim(win=win, name='Fix_for_CV_3', text='+', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "TargetCVImaPrac" --- Target_SoundCV_3 = sound.Sound('A', secs=0.75, stereo=True, hamming=True, name='Target_SoundCV_3') Target_SoundCV_3.setVolume(1.0) Target_textCV_3 = visual.TextStim(win=win, name='Target_textCV_3', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); bracketsTarget_3 = visual.TextStim(win=win, name='bracketsTarget_3', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); # --- Initialize components for Routine "ISICVImaPrac" --- # Run 'Begin Experiment' code from code_ISICV_3 ISICVPrac1 = 0 maxDur = 1.5 minDur = 1 ISI_for_CV_3 = visual.TextStim(win=win, name='ISI_for_CV_3', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); bracketsISI_3 = visual.TextStim(win=win, name='bracketsISI_3', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); # --- Initialize components for Routine "SpeechCVImaPrac" --- SignOnsetSpeech_3 = visual.TextStim(win=win, name='SignOnsetSpeech_3', text='***', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); SpeechBrackets_3 = visual.TextStim(win=win, name='SpeechBrackets_3', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "ITICVImaPra" --- text_11 = visual.TextStim(win=win, name='text_11', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); # --- Initialize components for Routine "InstPracCVAloud" --- text_14 = visual.TextStim(win=win, name='text_14', text='Seguimos con los ensayos de práctica.\n\nSin embargo, para estos ensayos, tu tarea consistirá en DECIR EN VOZ ALTA las sílabas que se te irán presentando (escritas o habladas) cuando aparezca la señal:\n\n\n[ *** ]\n\n\n\n\nPulsar la barra espaciadorra para comenzar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_10 = keyboard.Keyboard() # --- Initialize components for Routine "FixCVAloudPrac" --- # Run 'Begin Experiment' code from code_FIXCV_4 FixCVprac2 = 0 maxDur = 1.5 minDur = 1 Fix_for_CV_4 = visual.TextStim(win=win, name='Fix_for_CV_4', text='+', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "TargetCVAloudPrac" --- Target_SoundCV_4 = sound.Sound('A', secs=0.75, stereo=True, hamming=True, name='Target_SoundCV_4') Target_SoundCV_4.setVolume(1.0) Target_textCV_4 = visual.TextStim(win=win, name='Target_textCV_4', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); bracketsTarget_4 = visual.TextStim(win=win, name='bracketsTarget_4', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); # --- Initialize components for Routine "ISICVAloudPrac" --- # Run 'Begin Experiment' code from code_ISICV_4 ISICVPrac2 = 0 maxDur = 1.5 minDur = 1 ISI_for_CV_4 = visual.TextStim(win=win, name='ISI_for_CV_4', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); bracketsISI_4 = visual.TextStim(win=win, name='bracketsISI_4', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); # --- Initialize components for Routine "SpeechCVAloudPrac" --- SignOnsetSpeech_4 = visual.TextStim(win=win, name='SignOnsetSpeech_4', text='***', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); SpeechBrackets_4 = visual.TextStim(win=win, name='SpeechBrackets_4', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "ITICVAloudPra" --- text_13 = visual.TextStim(win=win, name='text_13', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); # --- Initialize components for Routine "EXPInicio" --- text_15 = visual.TextStim(win=win, name='text_15', text='Ahora empiezan los ensayos experimentales.\n\n\nAntes de cada bloque, unas instracciones te indicarán como realizar la tarea.\n\n\n\n\n\nPulsar la barra espaciadorra para comenzar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_11 = keyboard.Keyboard() # --- Initialize components for Routine "ImaginedSpeechCV_Instruc" --- InstrucSilentCV = visual.TextStim(win=win, name='InstrucSilentCV', text='En este bloque, tu tarea consistirá en IMAGINAR que dices las sílabas que se te irán presentando (escritas o habladas), pero sin activar ningún músculo, cuando aparezca la señal:\n\n\n[ *** ]\n\n\n\n\nPulsar la barra espaciadorra para comenzar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_5 = keyboard.Keyboard() # --- Initialize components for Routine "Fixation_CV_Ima" --- # Run 'Begin Experiment' code from code_FIXCV FixCVima = 0 maxDur = 1.5 minDur = 1 Fix_for_CV = visual.TextStim(win=win, name='Fix_for_CV', text='+', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "Target_CV_Ima_2" --- Target_SoundCV = sound.Sound('A', secs=0.75, stereo=True, hamming=True, name='Target_SoundCV') Target_SoundCV.setVolume(1.0) Target_textCV = visual.TextStim(win=win, name='Target_textCV', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); bracketsTarget = visual.TextStim(win=win, name='bracketsTarget', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); # --- Initialize components for Routine "ISI_CV_Ima" --- # Run 'Begin Experiment' code from code_ISICV ISICVima = 0 maxDur = 1.5 minDur = 1 ISI_for_CV = visual.TextStim(win=win, name='ISI_for_CV', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); bracketsISI = visual.TextStim(win=win, name='bracketsISI', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); # --- Initialize components for Routine "SpeechCV_Ima" --- SignOnsetSpeech = visual.TextStim(win=win, name='SignOnsetSpeech', text='***', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); SpeechBrackets = visual.TextStim(win=win, name='SpeechBrackets', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "ITICV_IMA" --- text_5 = visual.TextStim(win=win, name='text_5', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); # --- Initialize components for Routine "SpeakAloudCV_Instruc" --- InstructAloudCV = visual.TextStim(win=win, name='InstructAloudCV', text='Ahora puedes descansar.\n\nEn este bloque, tu tarea consistirá en DECIR EN VOZ ALTA las sílabas que se te irán presentando (escritas o habladas) cuando aparezca la señal:\n\n\n[ *** ]\n\n\n\n\n\nPulsar la barra espaciadorra para empezar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_2 = keyboard.Keyboard() # --- Initialize components for Routine "Fixation_CV_Aloud" --- # Run 'Begin Experiment' code from code_FIXCV_2 FixCValoud = 0 maxDur = 1.5 minDur = 1 Fix_for_CV_2 = visual.TextStim(win=win, name='Fix_for_CV_2', text='+', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "Target_CV_Aloud" --- Target_textCV_2 = visual.TextStim(win=win, name='Target_textCV_2', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); Target_SoundCV_2 = sound.Sound('A', secs=0.75, stereo=True, hamming=True, name='Target_SoundCV_2') Target_SoundCV_2.setVolume(1.0) bracketsTarget_2 = visual.TextStim(win=win, name='bracketsTarget_2', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); # --- Initialize components for Routine "ISI_CV_Aloud" --- # Run 'Begin Experiment' code from code_ISICV_2 ISICValoud = 0 maxDur = 1.5 minDur = 1 ISI_for_CV_2 = visual.TextStim(win=win, name='ISI_for_CV_2', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); bracketsISI_2 = visual.TextStim(win=win, name='bracketsISI_2', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); # --- Initialize components for Routine "SpeechCV_Aloud" --- SignOnsetSpeech_2 = visual.TextStim(win=win, name='SignOnsetSpeech_2', text='***', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); SpeechBrackets_2 = visual.TextStim(win=win, name='SpeechBrackets_2', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "ITICV_Aloud" --- text_8 = visual.TextStim(win=win, name='text_8', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); # --- Initialize components for Routine "InstPracWord" --- text_17 = visual.TextStim(win=win, name='text_17', text='Ahora, vamos a realizar unos ensayos de PRÁCTICA.\n\nPara estos ensayos, tu tarea consistirá en IMAGINAR que dices las palabras que se te irán presentando (escritas, habladas o con imágenes), pero sin activar ningún músculo, cuando aparezca la señal:\n\n\n[ *** ]\n\n\nPD: Unas palabras son inventadas. Aun así, tendrás que intentar producirlas.\n\n\nPulsar la barra espaciadorra para comenzar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_13 = keyboard.Keyboard() # --- Initialize components for Routine "FixWordImaPrac" --- # Run 'Begin Experiment' code from code_8 FixWordPrac1 = 0 maxDur = 1.5 minDur = 1 Fix_for_Word_2 = visual.TextStim(win=win, name='Fix_for_Word_2', text='+', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "TargetWordImaPrac" --- bracketsTarget_WordSilent_2 = visual.TextStim(win=win, name='bracketsTarget_WordSilent_2', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); Target_Pic_WordSilent_2 = visual.ImageStim( win=win, name='Target_Pic_WordSilent_2', image='default.png', mask=None, anchor='center', ori=0.0, pos=(0, 0), size=(0.5, 0.5), color=[1,1,1], colorSpace='rgb', opacity=1.0, flipHoriz=False, flipVert=False, texRes=128.0, interpolate=True, depth=-1.0) TargetText_WordSilent_2 = visual.TextStim(win=win, name='TargetText_WordSilent_2', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); Target_Sound_WordSilent_2 = sound.Sound('A', secs=1, stereo=True, hamming=True, name='Target_Sound_WordSilent_2') Target_Sound_WordSilent_2.setVolume(1.0) # --- Initialize components for Routine "ISIWordImaPrac" --- # Run 'Begin Experiment' code from code_9 ISIWordPrac1 = 0 maxDur = 1.5 minDur = 1 ISI_Word1_2 = visual.TextStim(win=win, name='ISI_Word1_2', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "SpeechWordImaPrac" --- SignOnsetSpeech_Word1_2 = visual.TextStim(win=win, name='SignOnsetSpeech_Word1_2', text='***', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); Brackets_SignOnset_Word1_2 = visual.TextStim(win=win, name='Brackets_SignOnset_Word1_2', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "ITIWordImaPrac" --- ITI_Word1_2 = visual.TextStim(win=win, name='ITI_Word1_2', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); # --- Initialize components for Routine "InstPracWordAloud" --- text_20 = visual.TextStim(win=win, name='text_20', text='Seguimos con los ensayos de PRÁCTICA.\n\nPara estos ensayos, tu tarea consistirá en DECIR EN VOZ ALTA las palabras que se te irán presentando (escritas, habladas o con imágenes) cuando aparezca la señal:\n\n\n[ *** ]\n\n\nPD: Unas palabras son inventadas. Aun así, tendrás que intentar producirlas.\n\n\nPulsar la barra espaciadorra para comenzar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_14 = keyboard.Keyboard() # --- Initialize components for Routine "FixWordAloudPrac" --- # Run 'Begin Experiment' code from code_10 FixWordPrac2 = 0 maxDur = 1.5 minDur = 1 Fix_for_Word_3 = visual.TextStim(win=win, name='Fix_for_Word_3', text='+', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "TargetWordAloudPrac" --- BracketsTargetWordAloud_3 = visual.TextStim(win=win, name='BracketsTargetWordAloud_3', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); TargetPicWordAloud_3 = visual.ImageStim( win=win, name='TargetPicWordAloud_3', image='default.png', mask=None, anchor='center', ori=0.0, pos=(0, 0), size=(0.5, 0.5), color=[1,1,1], colorSpace='rgb', opacity=1.0, flipHoriz=False, flipVert=False, texRes=128.0, interpolate=True, depth=-1.0) TargetTextAloud_3 = visual.TextStim(win=win, name='TargetTextAloud_3', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); TargetAudioWordAloud_3 = sound.Sound('A', secs=1, stereo=True, hamming=True, name='TargetAudioWordAloud_3') TargetAudioWordAloud_3.setVolume(1.0) # --- Initialize components for Routine "ISIWordAloudPrac" --- # Run 'Begin Experiment' code from code_11 ISIWordPrac2 = 0 maxDur = 1.5 minDur = 1 ISI_Word2_2 = visual.TextStim(win=win, name='ISI_Word2_2', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "SpeechWordAloudPrac" --- BracketsSingOnsetAloud_2 = visual.TextStim(win=win, name='BracketsSingOnsetAloud_2', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); text_18 = visual.TextStim(win=win, name='text_18', text='***', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "ITIWordAloudPrac" --- text_19 = visual.TextStim(win=win, name='text_19', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); # --- Initialize components for Routine "EXPInicio" --- text_15 = visual.TextStim(win=win, name='text_15', text='Ahora empiezan los ensayos experimentales.\n\n\nAntes de cada bloque, unas instracciones te indicarán como realizar la tarea.\n\n\n\n\n\nPulsar la barra espaciadorra para comenzar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_11 = keyboard.Keyboard() # --- Initialize components for Routine "SilentSpeechWord_Instruc" --- InstrucSilent_Word = visual.TextStim(win=win, name='InstrucSilent_Word', text='En este bloque, tu tarea consistirá en IMAGINAR que dices las palabras que se te irán presentando (escritas, habladas o con dibujos), pero sin activar ningún músculo, cuando aparezca la señal:\n\n\n[ *** ]\n\n\n\n\n\nPulsar la barra espaciadorra para empezar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); SilentWOrdInst = keyboard.Keyboard() # --- Initialize components for Routine "Fix_Word_Ima" --- # Run 'Begin Experiment' code from code_3 FixWordima = 0 maxDur = 1.5 minDur = 1 Fix_for_Word = visual.TextStim(win=win, name='Fix_for_Word', text='+', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "Target_Word_Ima" --- bracketsTarget_WordSilent = visual.TextStim(win=win, name='bracketsTarget_WordSilent', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); Target_Pic_WordSilent = visual.ImageStim( win=win, name='Target_Pic_WordSilent', image='default.png', mask=None, anchor='center', ori=0.0, pos=(0, 0), size=(0.5, 0.5), color=[1,1,1], colorSpace='rgb', opacity=1.0, flipHoriz=False, flipVert=False, texRes=128.0, interpolate=True, depth=-1.0) TargetText_WordSilent = visual.TextStim(win=win, name='TargetText_WordSilent', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); Target_Sound_WordSilent = sound.Sound('A', secs=1, stereo=True, hamming=True, name='Target_Sound_WordSilent') Target_Sound_WordSilent.setVolume(1.0) # --- Initialize components for Routine "ISI_Word_Ima" --- # Run 'Begin Experiment' code from code_4 ISIWordima = 0 maxDur = 1.5 minDur = 1 ISI_Word1 = visual.TextStim(win=win, name='ISI_Word1', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "Speech_Word_Ima" --- SignOnsetSpeech_Word1 = visual.TextStim(win=win, name='SignOnsetSpeech_Word1', text='***', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); Brackets_SignOnset_Word1 = visual.TextStim(win=win, name='Brackets_SignOnset_Word1', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "ITI_Word_Ima" --- ITI_Word1 = visual.TextStim(win=win, name='ITI_Word1', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); # --- Initialize components for Routine "AloudSpeech_Word_Instruc" --- InstrucAloud_Word = visual.TextStim(win=win, name='InstrucAloud_Word', text='En este bloque, tu tarea consistirá en DECIR EN VOZ ALTA las palabras que se te irán presentando (escritas, habladas o con dibujos) cuando aparezca la señal:\n\n\n[ *** ]\n\n\n\n\n\nPulsar la barra espaciadorra para empezar.', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_7 = keyboard.Keyboard() # --- Initialize components for Routine "Fix_Word_Aloud" --- # Run 'Begin Experiment' code from code_6 FixWordaloud = 0 maxDur = 1.5 minDur = 1 text_2 = visual.TextStim(win=win, name='text_2', text='+', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "Target_Word_Aloud" --- BracketsTargetWordAloud_2 = visual.TextStim(win=win, name='BracketsTargetWordAloud_2', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); TargetPicWordAloud_2 = visual.ImageStim( win=win, name='TargetPicWordAloud_2', image='default.png', mask=None, anchor='center', ori=0.0, pos=(0, 0), size=(0.5, 0.5), color=[1,1,1], colorSpace='rgb', opacity=1.0, flipHoriz=False, flipVert=False, texRes=128.0, interpolate=True, depth=-1.0) TargetTextAloud_2 = visual.TextStim(win=win, name='TargetTextAloud_2', text='', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-2.0); TargetAudioWordAloud_2 = sound.Sound('A', secs=1, stereo=True, hamming=True, name='TargetAudioWordAloud_2') TargetAudioWordAloud_2.setVolume(1.0) # --- Initialize components for Routine "ISI_Word_Aloud" --- # Run 'Begin Experiment' code from code_7 ISIWordaloud = 0 maxDur = 1.5 minDur = 1 ISI_Word2 = visual.TextStim(win=win, name='ISI_Word2', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "Speech_Word_Aloud" --- BracketsSingOnsetAloud = visual.TextStim(win=win, name='BracketsSingOnsetAloud', text='[ ]', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); text_9 = visual.TextStim(win=win, name='text_9', text='***', font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=-1.0); # --- Initialize components for Routine "ITI_Word_Aloud" --- text_10 = visual.TextStim(win=win, name='text_10', text=None, font='Arial', pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); # --- Initialize components for Routine "Thank_you" --- Gracias = visual.TextStim(win=win, name='Gracias', text='¡Fin de la primera parte!', font='Arial', pos=(0, 0), height=0.1, wrapWidth=None, ori=0.0, color='white', colorSpace='rgb', opacity=None, languageStyle='LTR', depth=0.0); key_resp_8 = keyboard.Keyboard() # create some handy timers if globalClock is None: globalClock = core.Clock() # to track the time since experiment started if ioServer is not None: ioServer.syncClock(globalClock) logging.setDefaultClock(globalClock) routineTimer = core.Clock() # to track time remaining of each (possibly non-slip) routine win.flip() # flip window to reset last flip timer # store the exact time the global clock started expInfo['expStart'] = data.getDateStr(format='%Y-%m-%d %Hh%M.%S.%f %z', fractionalSecondDigits=6) # --- Prepare to start Routine "PresentationList" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('PresentationList.started', globalClock.getTime()) # keep track of which components have finished PresentationListComponents = [] for thisComponent in PresentationListComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "PresentationList" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in PresentationListComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "PresentationList" --- for thisComponent in PresentationListComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('PresentationList.stopped', globalClock.getTime()) # the Routine "PresentationList" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "InstInicio" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('InstInicio.started', globalClock.getTime()) key_resp_12.keys = [] key_resp_12.rt = [] _key_resp_12_allKeys = [] # Run 'Begin Routine' code from code_25 send_markers(Markers.EXPERIMENT_INICIO) # keep track of which components have finished InstInicioComponents = [text_16, key_resp_12] for thisComponent in InstInicioComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "InstInicio" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_16* updates # if text_16 is starting this frame... if text_16.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_16.frameNStart = frameN # exact frame index text_16.tStart = t # local t and not account for scr refresh text_16.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_16, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_16.started') # update status text_16.status = STARTED text_16.setAutoDraw(True) # if text_16 is active this frame... if text_16.status == STARTED: # update params pass # *key_resp_12* updates waitOnFlip = False # if key_resp_12 is starting this frame... if key_resp_12.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_12.frameNStart = frameN # exact frame index key_resp_12.tStart = t # local t and not account for scr refresh key_resp_12.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_12, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_12.started') # update status key_resp_12.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_12.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_12.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_12.status == STARTED and not waitOnFlip: theseKeys = key_resp_12.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_12_allKeys.extend(theseKeys) if len(_key_resp_12_allKeys): key_resp_12.keys = _key_resp_12_allKeys[-1].name # just the last key pressed key_resp_12.rt = _key_resp_12_allKeys[-1].rt key_resp_12.duration = _key_resp_12_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in InstInicioComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "InstInicio" --- for thisComponent in InstInicioComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('InstInicio.stopped', globalClock.getTime()) # check responses if key_resp_12.keys in ['', [], None]: # No response was made key_resp_12.keys = None thisExp.addData('key_resp_12.keys',key_resp_12.keys) if key_resp_12.keys != None: # we had a response thisExp.addData('key_resp_12.rt', key_resp_12.rt) thisExp.addData('key_resp_12.duration', key_resp_12.duration) thisExp.nextEntry() # the Routine "InstInicio" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "InstPracCV" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('InstPracCV.started', globalClock.getTime()) key_resp_9.keys = [] key_resp_9.rt = [] _key_resp_9_allKeys = [] # keep track of which components have finished InstPracCVComponents = [text_12, key_resp_9] for thisComponent in InstPracCVComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "InstPracCV" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_12* updates # if text_12 is starting this frame... if text_12.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_12.frameNStart = frameN # exact frame index text_12.tStart = t # local t and not account for scr refresh text_12.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_12, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_12.started') # update status text_12.status = STARTED text_12.setAutoDraw(True) # if text_12 is active this frame... if text_12.status == STARTED: # update params pass # *key_resp_9* updates waitOnFlip = False # if key_resp_9 is starting this frame... if key_resp_9.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_9.frameNStart = frameN # exact frame index key_resp_9.tStart = t # local t and not account for scr refresh key_resp_9.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_9, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_9.started') # update status key_resp_9.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_9.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_9.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_9.status == STARTED and not waitOnFlip: theseKeys = key_resp_9.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_9_allKeys.extend(theseKeys) if len(_key_resp_9_allKeys): key_resp_9.keys = _key_resp_9_allKeys[-1].name # just the last key pressed key_resp_9.rt = _key_resp_9_allKeys[-1].rt key_resp_9.duration = _key_resp_9_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in InstPracCVComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "InstPracCV" --- for thisComponent in InstPracCVComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('InstPracCV.stopped', globalClock.getTime()) # check responses if key_resp_9.keys in ['', [], None]: # No response was made key_resp_9.keys = None thisExp.addData('key_resp_9.keys',key_resp_9.keys) if key_resp_9.keys != None: # we had a response thisExp.addData('key_resp_9.rt', key_resp_9.rt) thisExp.addData('key_resp_9.duration', key_resp_9.duration) thisExp.nextEntry() # the Routine "InstPracCV" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc trialCVSilentPrac = data.TrialHandler(nReps=1.0, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions(Presentation_List, selection='0:5'), seed=None, name='trialCVSilentPrac') thisExp.addLoop(trialCVSilentPrac) # add the loop to the experiment thisTrialCVSilentPrac = trialCVSilentPrac.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrialCVSilentPrac.rgb) if thisTrialCVSilentPrac != None: for paramName in thisTrialCVSilentPrac: globals()[paramName] = thisTrialCVSilentPrac[paramName] for thisTrialCVSilentPrac in trialCVSilentPrac: currentLoop = trialCVSilentPrac thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrialCVSilentPrac.rgb) if thisTrialCVSilentPrac != None: for paramName in thisTrialCVSilentPrac: globals()[paramName] = thisTrialCVSilentPrac[paramName] # --- Prepare to start Routine "FixCVImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('FixCVImaPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_FIXCV_3 FixCVprac1 = minDur + (maxDur - minDur) * random.random() send_markers(Markers.SILENTSYLLABLES_PRACTICE_START_FIXATION) outlet.push_sample(['SilentSyllablesPracticeStartFixation:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # keep track of which components have finished FixCVImaPracComponents = [Fix_for_CV_3] for thisComponent in FixCVImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "FixCVImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Fix_for_CV_3* updates # if Fix_for_CV_3 is starting this frame... if Fix_for_CV_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Fix_for_CV_3.frameNStart = frameN # exact frame index Fix_for_CV_3.tStart = t # local t and not account for scr refresh Fix_for_CV_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Fix_for_CV_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_CV_3.started') # update status Fix_for_CV_3.status = STARTED Fix_for_CV_3.setAutoDraw(True) # if Fix_for_CV_3 is active this frame... if Fix_for_CV_3.status == STARTED: # update params pass # if Fix_for_CV_3 is stopping this frame... if Fix_for_CV_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Fix_for_CV_3.tStartRefresh + FixCVprac1-frameTolerance: # keep track of stop time/frame for later Fix_for_CV_3.tStop = t # not accounting for scr refresh Fix_for_CV_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_CV_3.stopped') # update status Fix_for_CV_3.status = FINISHED Fix_for_CV_3.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in FixCVImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "FixCVImaPrac" --- for thisComponent in FixCVImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('FixCVImaPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_FIXCV_3 send_markers(Markers.SILENTSYLLABLES_PRACTICE_END_FIXATION) outlet.push_sample(['SilentSyllablesPracticeEndFixation:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # the Routine "FixCVImaPrac" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "TargetCVImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('TargetCVImaPrac.started', globalClock.getTime()) Target_SoundCV_3.setSound(SyllableSoundSilentPrac, secs=0.75, hamming=True) Target_SoundCV_3.setVolume(1.0, log=False) Target_SoundCV_3.seek(0) Target_textCV_3.setText(SyllableLowSilentPrac) # Run 'Begin Routine' code from code_26 send_markers(Markers.SILENTSYLLABLES_PRACTICE_START_STIMULUS) outlet.push_sample(['SilentSyllablesPracticeStartStimulus:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # keep track of which components have finished TargetCVImaPracComponents = [Target_SoundCV_3, Target_textCV_3, bracketsTarget_3] for thisComponent in TargetCVImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "TargetCVImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.75: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # if Target_SoundCV_3 is starting this frame... if Target_SoundCV_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_SoundCV_3.frameNStart = frameN # exact frame index Target_SoundCV_3.tStart = t # local t and not account for scr refresh Target_SoundCV_3.tStartRefresh = tThisFlipGlobal # on global time # add timestamp to datafile thisExp.addData('Target_SoundCV_3.started', tThisFlipGlobal) # update status Target_SoundCV_3.status = STARTED Target_SoundCV_3.play(when=win) # sync with win flip # if Target_SoundCV_3 is stopping this frame... if Target_SoundCV_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_SoundCV_3.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later Target_SoundCV_3.tStop = t # not accounting for scr refresh Target_SoundCV_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_SoundCV_3.stopped') # update status Target_SoundCV_3.status = FINISHED Target_SoundCV_3.stop() # update Target_SoundCV_3 status according to whether it's playing if Target_SoundCV_3.isPlaying: Target_SoundCV_3.status = STARTED elif Target_SoundCV_3.isFinished: Target_SoundCV_3.status = FINISHED # *Target_textCV_3* updates # if Target_textCV_3 is starting this frame... if Target_textCV_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_textCV_3.frameNStart = frameN # exact frame index Target_textCV_3.tStart = t # local t and not account for scr refresh Target_textCV_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Target_textCV_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_textCV_3.started') # update status Target_textCV_3.status = STARTED Target_textCV_3.setAutoDraw(True) # if Target_textCV_3 is active this frame... if Target_textCV_3.status == STARTED: # update params pass # if Target_textCV_3 is stopping this frame... if Target_textCV_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_textCV_3.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later Target_textCV_3.tStop = t # not accounting for scr refresh Target_textCV_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_textCV_3.stopped') # update status Target_textCV_3.status = FINISHED Target_textCV_3.setAutoDraw(False) # *bracketsTarget_3* updates # if bracketsTarget_3 is starting this frame... if bracketsTarget_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsTarget_3.frameNStart = frameN # exact frame index bracketsTarget_3.tStart = t # local t and not account for scr refresh bracketsTarget_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsTarget_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_3.started') # update status bracketsTarget_3.status = STARTED bracketsTarget_3.setAutoDraw(True) # if bracketsTarget_3 is active this frame... if bracketsTarget_3.status == STARTED: # update params pass # if bracketsTarget_3 is stopping this frame... if bracketsTarget_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsTarget_3.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later bracketsTarget_3.tStop = t # not accounting for scr refresh bracketsTarget_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_3.stopped') # update status bracketsTarget_3.status = FINISHED bracketsTarget_3.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in TargetCVImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "TargetCVImaPrac" --- for thisComponent in TargetCVImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('TargetCVImaPrac.stopped', globalClock.getTime()) Target_SoundCV_3.pause() # ensure sound has stopped at end of Routine # Run 'End Routine' code from code_26 send_markers(Markers.SILENTSYLLABLES_PRACTICE_END_STIMULUS) outlet.push_sample(['SilentSyllablesPracticeEndStimulus:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.750000) # --- Prepare to start Routine "ISICVImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ISICVImaPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_ISICV_3 ISICVPrac1 = minDur + (maxDur - minDur) * random.random() send_markers(Markers.SILENTSYLLABLES_PRACTICE_START_ISI) outlet.push_sample(['SilentSyllablesPracticeStartISI:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # keep track of which components have finished ISICVImaPracComponents = [ISI_for_CV_3, bracketsISI_3] for thisComponent in ISICVImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ISICVImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ISI_for_CV_3* updates # if ISI_for_CV_3 is starting this frame... if ISI_for_CV_3.status == NOT_STARTED and tThisFlip >= 0-frameTolerance: # keep track of start time/frame for later ISI_for_CV_3.frameNStart = frameN # exact frame index ISI_for_CV_3.tStart = t # local t and not account for scr refresh ISI_for_CV_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ISI_for_CV_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_for_CV_3.started') # update status ISI_for_CV_3.status = STARTED ISI_for_CV_3.setAutoDraw(True) # if ISI_for_CV_3 is active this frame... if ISI_for_CV_3.status == STARTED: # update params pass # if ISI_for_CV_3 is stopping this frame... if ISI_for_CV_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ISI_for_CV_3.tStartRefresh + ISICVPrac1-frameTolerance: # keep track of stop time/frame for later ISI_for_CV_3.tStop = t # not accounting for scr refresh ISI_for_CV_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_for_CV_3.stopped') # update status ISI_for_CV_3.status = FINISHED ISI_for_CV_3.setAutoDraw(False) # *bracketsISI_3* updates # if bracketsISI_3 is starting this frame... if bracketsISI_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsISI_3.frameNStart = frameN # exact frame index bracketsISI_3.tStart = t # local t and not account for scr refresh bracketsISI_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsISI_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsISI_3.started') # update status bracketsISI_3.status = STARTED bracketsISI_3.setAutoDraw(True) # if bracketsISI_3 is active this frame... if bracketsISI_3.status == STARTED: # update params pass # if bracketsISI_3 is stopping this frame... if bracketsISI_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsISI_3.tStartRefresh + ISICVPrac1-frameTolerance: # keep track of stop time/frame for later bracketsISI_3.tStop = t # not accounting for scr refresh bracketsISI_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsISI_3.stopped') # update status bracketsISI_3.status = FINISHED bracketsISI_3.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ISICVImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ISICVImaPrac" --- for thisComponent in ISICVImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ISICVImaPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_ISICV_3 send_markers(Markers.SILENTSYLLABLES_PRACTICE_END_ISI) outlet.push_sample(['SilentSyllablesPracticeEndISI:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # the Routine "ISICVImaPrac" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "SpeechCVImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('SpeechCVImaPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_27 send_markers(Markers.SILENTSYLLABLES_PRACTICE_START_SPEECH) outlet.push_sample(['SilentSyllablesPracticeStartSpeech:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # keep track of which components have finished SpeechCVImaPracComponents = [SignOnsetSpeech_3, SpeechBrackets_3] for thisComponent in SpeechCVImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "SpeechCVImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 1.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *SignOnsetSpeech_3* updates # if SignOnsetSpeech_3 is starting this frame... if SignOnsetSpeech_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SignOnsetSpeech_3.frameNStart = frameN # exact frame index SignOnsetSpeech_3.tStart = t # local t and not account for scr refresh SignOnsetSpeech_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SignOnsetSpeech_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_3.started') # update status SignOnsetSpeech_3.status = STARTED SignOnsetSpeech_3.setAutoDraw(True) # if SignOnsetSpeech_3 is active this frame... if SignOnsetSpeech_3.status == STARTED: # update params pass # if SignOnsetSpeech_3 is stopping this frame... if SignOnsetSpeech_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SignOnsetSpeech_3.tStartRefresh + 1.5-frameTolerance: # keep track of stop time/frame for later SignOnsetSpeech_3.tStop = t # not accounting for scr refresh SignOnsetSpeech_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_3.stopped') # update status SignOnsetSpeech_3.status = FINISHED SignOnsetSpeech_3.setAutoDraw(False) # *SpeechBrackets_3* updates # if SpeechBrackets_3 is starting this frame... if SpeechBrackets_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SpeechBrackets_3.frameNStart = frameN # exact frame index SpeechBrackets_3.tStart = t # local t and not account for scr refresh SpeechBrackets_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SpeechBrackets_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SpeechBrackets_3.started') # update status SpeechBrackets_3.status = STARTED SpeechBrackets_3.setAutoDraw(True) # if SpeechBrackets_3 is active this frame... if SpeechBrackets_3.status == STARTED: # update params pass # if SpeechBrackets_3 is stopping this frame... if SpeechBrackets_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SpeechBrackets_3.tStartRefresh + 1.5-frameTolerance: # keep track of stop time/frame for later SpeechBrackets_3.tStop = t # not accounting for scr refresh SpeechBrackets_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SpeechBrackets_3.stopped') # update status SpeechBrackets_3.status = FINISHED SpeechBrackets_3.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in SpeechCVImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "SpeechCVImaPrac" --- for thisComponent in SpeechCVImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('SpeechCVImaPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_27 send_markers(Markers.SILENTSYLLABLES_PRACTICE_END_SPEECH) outlet.push_sample(['SilentSyllablesPracticeEndSpeech:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-1.500000) # --- Prepare to start Routine "ITICVImaPra" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ITICVImaPra.started', globalClock.getTime()) # Run 'Begin Routine' code from code_28 send_markers(Markers.SILENTSYLLABLES_PRACTICE_START_ITI) outlet.push_sample(['SilentSyllablesPracticeStartITI:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # keep track of which components have finished ITICVImaPraComponents = [text_11] for thisComponent in ITICVImaPraComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ITICVImaPra" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_11* updates # if text_11 is starting this frame... if text_11.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_11.frameNStart = frameN # exact frame index text_11.tStart = t # local t and not account for scr refresh text_11.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_11, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_11.started') # update status text_11.status = STARTED text_11.setAutoDraw(True) # if text_11 is active this frame... if text_11.status == STARTED: # update params pass # if text_11 is stopping this frame... if text_11.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_11.tStartRefresh + 0.5-frameTolerance: # keep track of stop time/frame for later text_11.tStop = t # not accounting for scr refresh text_11.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_11.stopped') # update status text_11.status = FINISHED text_11.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ITICVImaPraComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ITICVImaPra" --- for thisComponent in ITICVImaPraComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ITICVImaPra.stopped', globalClock.getTime()) # Run 'End Routine' code from code_28 send_markers(Markers.SILENTSYLLABLES_PRACTICE_END_ITI) outlet.push_sample(['SilentSyllablesPracticeEndITI:' + PresentionSyllableSilentPrac + "_" + SyllableUpSilentPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.500000) thisExp.nextEntry() if thisSession is not None: # if running in a Session with a Liaison client, send data up to now thisSession.sendExperimentData() # completed 1.0 repeats of 'trialCVSilentPrac' # --- Prepare to start Routine "InstPracCVAloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('InstPracCVAloud.started', globalClock.getTime()) key_resp_10.keys = [] key_resp_10.rt = [] _key_resp_10_allKeys = [] # keep track of which components have finished InstPracCVAloudComponents = [text_14, key_resp_10] for thisComponent in InstPracCVAloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "InstPracCVAloud" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_14* updates # if text_14 is starting this frame... if text_14.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_14.frameNStart = frameN # exact frame index text_14.tStart = t # local t and not account for scr refresh text_14.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_14, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_14.started') # update status text_14.status = STARTED text_14.setAutoDraw(True) # if text_14 is active this frame... if text_14.status == STARTED: # update params pass # *key_resp_10* updates waitOnFlip = False # if key_resp_10 is starting this frame... if key_resp_10.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_10.frameNStart = frameN # exact frame index key_resp_10.tStart = t # local t and not account for scr refresh key_resp_10.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_10, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_10.started') # update status key_resp_10.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_10.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_10.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_10.status == STARTED and not waitOnFlip: theseKeys = key_resp_10.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_10_allKeys.extend(theseKeys) if len(_key_resp_10_allKeys): key_resp_10.keys = _key_resp_10_allKeys[-1].name # just the last key pressed key_resp_10.rt = _key_resp_10_allKeys[-1].rt key_resp_10.duration = _key_resp_10_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in InstPracCVAloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "InstPracCVAloud" --- for thisComponent in InstPracCVAloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('InstPracCVAloud.stopped', globalClock.getTime()) # check responses if key_resp_10.keys in ['', [], None]: # No response was made key_resp_10.keys = None thisExp.addData('key_resp_10.keys',key_resp_10.keys) if key_resp_10.keys != None: # we had a response thisExp.addData('key_resp_10.rt', key_resp_10.rt) thisExp.addData('key_resp_10.duration', key_resp_10.duration) thisExp.nextEntry() # the Routine "InstPracCVAloud" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc trialCVAloudPrac = data.TrialHandler(nReps=1.0, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions(Presentation_List, selection='0:5'), seed=None, name='trialCVAloudPrac') thisExp.addLoop(trialCVAloudPrac) # add the loop to the experiment thisTrialCVAloudPrac = trialCVAloudPrac.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrialCVAloudPrac.rgb) if thisTrialCVAloudPrac != None: for paramName in thisTrialCVAloudPrac: globals()[paramName] = thisTrialCVAloudPrac[paramName] for thisTrialCVAloudPrac in trialCVAloudPrac: currentLoop = trialCVAloudPrac thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrialCVAloudPrac.rgb) if thisTrialCVAloudPrac != None: for paramName in thisTrialCVAloudPrac: globals()[paramName] = thisTrialCVAloudPrac[paramName] # --- Prepare to start Routine "FixCVAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('FixCVAloudPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_FIXCV_4 FixCVprac2 = minDur + (maxDur - minDur) * random.random() send_markers(Markers.REALSYLLABLES_PRACTICE_START_FIXATION) outlet.push_sample(['RealSyllablesPracticeStartFixation:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # keep track of which components have finished FixCVAloudPracComponents = [Fix_for_CV_4] for thisComponent in FixCVAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "FixCVAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Fix_for_CV_4* updates # if Fix_for_CV_4 is starting this frame... if Fix_for_CV_4.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Fix_for_CV_4.frameNStart = frameN # exact frame index Fix_for_CV_4.tStart = t # local t and not account for scr refresh Fix_for_CV_4.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Fix_for_CV_4, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_CV_4.started') # update status Fix_for_CV_4.status = STARTED Fix_for_CV_4.setAutoDraw(True) # if Fix_for_CV_4 is active this frame... if Fix_for_CV_4.status == STARTED: # update params pass # if Fix_for_CV_4 is stopping this frame... if Fix_for_CV_4.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Fix_for_CV_4.tStartRefresh + FixCVprac2-frameTolerance: # keep track of stop time/frame for later Fix_for_CV_4.tStop = t # not accounting for scr refresh Fix_for_CV_4.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_CV_4.stopped') # update status Fix_for_CV_4.status = FINISHED Fix_for_CV_4.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in FixCVAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "FixCVAloudPrac" --- for thisComponent in FixCVAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('FixCVAloudPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_FIXCV_4 send_markers(Markers.REALSYLLABLES_PRACTICE_END_FIXATION) outlet.push_sample(['RealSyllablesPracticeEndFixation:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # the Routine "FixCVAloudPrac" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "TargetCVAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('TargetCVAloudPrac.started', globalClock.getTime()) Target_SoundCV_4.setSound(SyllableSoundAloudPrac, secs=0.75, hamming=True) Target_SoundCV_4.setVolume(1.0, log=False) Target_SoundCV_4.seek(0) Target_textCV_4.setText(SyllableLowAloudPrac) # Run 'Begin Routine' code from code_29 send_markers(Markers.REALSYLLABLES_PRACTICE_START_STIMULUS) outlet.push_sample(['RealSyllablesPracticeStartStimulus:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # keep track of which components have finished TargetCVAloudPracComponents = [Target_SoundCV_4, Target_textCV_4, bracketsTarget_4] for thisComponent in TargetCVAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "TargetCVAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.75: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # if Target_SoundCV_4 is starting this frame... if Target_SoundCV_4.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_SoundCV_4.frameNStart = frameN # exact frame index Target_SoundCV_4.tStart = t # local t and not account for scr refresh Target_SoundCV_4.tStartRefresh = tThisFlipGlobal # on global time # add timestamp to datafile thisExp.addData('Target_SoundCV_4.started', tThisFlipGlobal) # update status Target_SoundCV_4.status = STARTED Target_SoundCV_4.play(when=win) # sync with win flip # if Target_SoundCV_4 is stopping this frame... if Target_SoundCV_4.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_SoundCV_4.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later Target_SoundCV_4.tStop = t # not accounting for scr refresh Target_SoundCV_4.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_SoundCV_4.stopped') # update status Target_SoundCV_4.status = FINISHED Target_SoundCV_4.stop() # update Target_SoundCV_4 status according to whether it's playing if Target_SoundCV_4.isPlaying: Target_SoundCV_4.status = STARTED elif Target_SoundCV_4.isFinished: Target_SoundCV_4.status = FINISHED # *Target_textCV_4* updates # if Target_textCV_4 is starting this frame... if Target_textCV_4.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_textCV_4.frameNStart = frameN # exact frame index Target_textCV_4.tStart = t # local t and not account for scr refresh Target_textCV_4.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Target_textCV_4, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_textCV_4.started') # update status Target_textCV_4.status = STARTED Target_textCV_4.setAutoDraw(True) # if Target_textCV_4 is active this frame... if Target_textCV_4.status == STARTED: # update params pass # if Target_textCV_4 is stopping this frame... if Target_textCV_4.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_textCV_4.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later Target_textCV_4.tStop = t # not accounting for scr refresh Target_textCV_4.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_textCV_4.stopped') # update status Target_textCV_4.status = FINISHED Target_textCV_4.setAutoDraw(False) # *bracketsTarget_4* updates # if bracketsTarget_4 is starting this frame... if bracketsTarget_4.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsTarget_4.frameNStart = frameN # exact frame index bracketsTarget_4.tStart = t # local t and not account for scr refresh bracketsTarget_4.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsTarget_4, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_4.started') # update status bracketsTarget_4.status = STARTED bracketsTarget_4.setAutoDraw(True) # if bracketsTarget_4 is active this frame... if bracketsTarget_4.status == STARTED: # update params pass # if bracketsTarget_4 is stopping this frame... if bracketsTarget_4.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsTarget_4.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later bracketsTarget_4.tStop = t # not accounting for scr refresh bracketsTarget_4.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_4.stopped') # update status bracketsTarget_4.status = FINISHED bracketsTarget_4.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in TargetCVAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "TargetCVAloudPrac" --- for thisComponent in TargetCVAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('TargetCVAloudPrac.stopped', globalClock.getTime()) Target_SoundCV_4.pause() # ensure sound has stopped at end of Routine # Run 'End Routine' code from code_29 send_markers(Markers.REALSYLLABLES_PRACTICE_END_STIMULUS) outlet.push_sample(['RealSyllablesPracticeEndStimulus:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.750000) # --- Prepare to start Routine "ISICVAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ISICVAloudPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_ISICV_4 ISICVPrac2 = minDur + (maxDur - minDur) * random.random() send_markers(Markers.REALSYLLABLES_PRACTICE_START_ISI) outlet.push_sample(['RealSyllablesPracticeStartISI:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # keep track of which components have finished ISICVAloudPracComponents = [ISI_for_CV_4, bracketsISI_4] for thisComponent in ISICVAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ISICVAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ISI_for_CV_4* updates # if ISI_for_CV_4 is starting this frame... if ISI_for_CV_4.status == NOT_STARTED and tThisFlip >= 0-frameTolerance: # keep track of start time/frame for later ISI_for_CV_4.frameNStart = frameN # exact frame index ISI_for_CV_4.tStart = t # local t and not account for scr refresh ISI_for_CV_4.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ISI_for_CV_4, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_for_CV_4.started') # update status ISI_for_CV_4.status = STARTED ISI_for_CV_4.setAutoDraw(True) # if ISI_for_CV_4 is active this frame... if ISI_for_CV_4.status == STARTED: # update params pass # if ISI_for_CV_4 is stopping this frame... if ISI_for_CV_4.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ISI_for_CV_4.tStartRefresh + ISICVPrac2-frameTolerance: # keep track of stop time/frame for later ISI_for_CV_4.tStop = t # not accounting for scr refresh ISI_for_CV_4.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_for_CV_4.stopped') # update status ISI_for_CV_4.status = FINISHED ISI_for_CV_4.setAutoDraw(False) # *bracketsISI_4* updates # if bracketsISI_4 is starting this frame... if bracketsISI_4.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsISI_4.frameNStart = frameN # exact frame index bracketsISI_4.tStart = t # local t and not account for scr refresh bracketsISI_4.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsISI_4, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsISI_4.started') # update status bracketsISI_4.status = STARTED bracketsISI_4.setAutoDraw(True) # if bracketsISI_4 is active this frame... if bracketsISI_4.status == STARTED: # update params pass # if bracketsISI_4 is stopping this frame... if bracketsISI_4.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsISI_4.tStartRefresh + ISICVPrac2-frameTolerance: # keep track of stop time/frame for later bracketsISI_4.tStop = t # not accounting for scr refresh bracketsISI_4.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsISI_4.stopped') # update status bracketsISI_4.status = FINISHED bracketsISI_4.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ISICVAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ISICVAloudPrac" --- for thisComponent in ISICVAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ISICVAloudPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_ISICV_4 send_markers(Markers.REALSYLLABLES_PRACTICE_END_ISI) outlet.push_sample(['RealSyllablesPracticeEndISI:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # the Routine "ISICVAloudPrac" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "SpeechCVAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('SpeechCVAloudPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_30 send_markers(Markers.REALSYLLABLES_PRACTICE_START_SPEECH) outlet.push_sample(['RealSyllablesPracticeStartSpeech:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # keep track of which components have finished SpeechCVAloudPracComponents = [SignOnsetSpeech_4, SpeechBrackets_4] for thisComponent in SpeechCVAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "SpeechCVAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 1.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *SignOnsetSpeech_4* updates # if SignOnsetSpeech_4 is starting this frame... if SignOnsetSpeech_4.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SignOnsetSpeech_4.frameNStart = frameN # exact frame index SignOnsetSpeech_4.tStart = t # local t and not account for scr refresh SignOnsetSpeech_4.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SignOnsetSpeech_4, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_4.started') # update status SignOnsetSpeech_4.status = STARTED SignOnsetSpeech_4.setAutoDraw(True) # if SignOnsetSpeech_4 is active this frame... if SignOnsetSpeech_4.status == STARTED: # update params pass # if SignOnsetSpeech_4 is stopping this frame... if SignOnsetSpeech_4.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SignOnsetSpeech_4.tStartRefresh + 1.5-frameTolerance: # keep track of stop time/frame for later SignOnsetSpeech_4.tStop = t # not accounting for scr refresh SignOnsetSpeech_4.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_4.stopped') # update status SignOnsetSpeech_4.status = FINISHED SignOnsetSpeech_4.setAutoDraw(False) # *SpeechBrackets_4* updates # if SpeechBrackets_4 is starting this frame... if SpeechBrackets_4.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SpeechBrackets_4.frameNStart = frameN # exact frame index SpeechBrackets_4.tStart = t # local t and not account for scr refresh SpeechBrackets_4.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SpeechBrackets_4, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SpeechBrackets_4.started') # update status SpeechBrackets_4.status = STARTED SpeechBrackets_4.setAutoDraw(True) # if SpeechBrackets_4 is active this frame... if SpeechBrackets_4.status == STARTED: # update params pass # if SpeechBrackets_4 is stopping this frame... if SpeechBrackets_4.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SpeechBrackets_4.tStartRefresh + 1.5-frameTolerance: # keep track of stop time/frame for later SpeechBrackets_4.tStop = t # not accounting for scr refresh SpeechBrackets_4.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SpeechBrackets_4.stopped') # update status SpeechBrackets_4.status = FINISHED SpeechBrackets_4.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in SpeechCVAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "SpeechCVAloudPrac" --- for thisComponent in SpeechCVAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('SpeechCVAloudPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_30 send_markers(Markers.REALSYLLABLES_PRACTICE_END_SPEECH) outlet.push_sample(['RealSyllablesPracticeEndSpeech:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-1.500000) # --- Prepare to start Routine "ITICVAloudPra" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ITICVAloudPra.started', globalClock.getTime()) # Run 'Begin Routine' code from code_31 send_markers(Markers.REALSYLLABLES_PRACTICE_START_ITI) outlet.push_sample(['RealSyllablesPracticeStartITI:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # keep track of which components have finished ITICVAloudPraComponents = [text_13] for thisComponent in ITICVAloudPraComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ITICVAloudPra" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_13* updates # if text_13 is starting this frame... if text_13.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_13.frameNStart = frameN # exact frame index text_13.tStart = t # local t and not account for scr refresh text_13.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_13, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_13.started') # update status text_13.status = STARTED text_13.setAutoDraw(True) # if text_13 is active this frame... if text_13.status == STARTED: # update params pass # if text_13 is stopping this frame... if text_13.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_13.tStartRefresh + 0.5-frameTolerance: # keep track of stop time/frame for later text_13.tStop = t # not accounting for scr refresh text_13.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_13.stopped') # update status text_13.status = FINISHED text_13.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ITICVAloudPraComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ITICVAloudPra" --- for thisComponent in ITICVAloudPraComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ITICVAloudPra.stopped', globalClock.getTime()) # Run 'End Routine' code from code_31 send_markers(Markers.REALSYLLABLES_PRACTICE_END_ITI) outlet.push_sample(['RealSyllablesPracticeEndITI:' + PresentionSyllableAloudPrac + "_" + SyllableUpAloudPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.500000) thisExp.nextEntry() if thisSession is not None: # if running in a Session with a Liaison client, send data up to now thisSession.sendExperimentData() # completed 1.0 repeats of 'trialCVAloudPrac' # --- Prepare to start Routine "EXPInicio" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('EXPInicio.started', globalClock.getTime()) key_resp_11.keys = [] key_resp_11.rt = [] _key_resp_11_allKeys = [] # keep track of which components have finished EXPInicioComponents = [text_15, key_resp_11] for thisComponent in EXPInicioComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "EXPInicio" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_15* updates # if text_15 is starting this frame... if text_15.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_15.frameNStart = frameN # exact frame index text_15.tStart = t # local t and not account for scr refresh text_15.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_15, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_15.started') # update status text_15.status = STARTED text_15.setAutoDraw(True) # if text_15 is active this frame... if text_15.status == STARTED: # update params pass # *key_resp_11* updates waitOnFlip = False # if key_resp_11 is starting this frame... if key_resp_11.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_11.frameNStart = frameN # exact frame index key_resp_11.tStart = t # local t and not account for scr refresh key_resp_11.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_11, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_11.started') # update status key_resp_11.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_11.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_11.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_11.status == STARTED and not waitOnFlip: theseKeys = key_resp_11.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_11_allKeys.extend(theseKeys) if len(_key_resp_11_allKeys): key_resp_11.keys = _key_resp_11_allKeys[-1].name # just the last key pressed key_resp_11.rt = _key_resp_11_allKeys[-1].rt key_resp_11.duration = _key_resp_11_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in EXPInicioComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "EXPInicio" --- for thisComponent in EXPInicioComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('EXPInicio.stopped', globalClock.getTime()) # check responses if key_resp_11.keys in ['', [], None]: # No response was made key_resp_11.keys = None thisExp.addData('key_resp_11.keys',key_resp_11.keys) if key_resp_11.keys != None: # we had a response thisExp.addData('key_resp_11.rt', key_resp_11.rt) thisExp.addData('key_resp_11.duration', key_resp_11.duration) thisExp.nextEntry() # the Routine "EXPInicio" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc trials_CV = data.TrialHandler(nReps=10.0, method='random', extraInfo=expInfo, originPath=-1, trialList=[None], seed=None, name='trials_CV') thisExp.addLoop(trials_CV) # add the loop to the experiment thisTrials_CV = trials_CV.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrials_CV.rgb) if thisTrials_CV != None: for paramName in thisTrials_CV: globals()[paramName] = thisTrials_CV[paramName] for thisTrials_CV in trials_CV: currentLoop = trials_CV thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrials_CV.rgb) if thisTrials_CV != None: for paramName in thisTrials_CV: globals()[paramName] = thisTrials_CV[paramName] # --- Prepare to start Routine "ImaginedSpeechCV_Instruc" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ImaginedSpeechCV_Instruc.started', globalClock.getTime()) key_resp_5.keys = [] key_resp_5.rt = [] _key_resp_5_allKeys = [] # Run 'Begin Routine' code from RowSelecCV if (trials_CV.thisN ==0): use_rows = str('0:20') if (trials_CV.thisN ==1): use_rows = str('20:40') if (trials_CV.thisN ==2): use_rows = str('40:60') if (trials_CV.thisN ==3): use_rows = str('60:80') if (trials_CV.thisN ==4): use_rows = str('80:100') if (trials_CV.thisN ==5): use_rows = str('100:120') if (trials_CV.thisN ==6): use_rows = str('120:140') if (trials_CV.thisN ==7): use_rows = str('140:160') if (trials_CV.thisN ==8): use_rows = str('160:180') if (trials_CV.thisN ==9): use_rows = str('180:200') # keep track of which components have finished ImaginedSpeechCV_InstrucComponents = [InstrucSilentCV, key_resp_5] for thisComponent in ImaginedSpeechCV_InstrucComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ImaginedSpeechCV_Instruc" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *InstrucSilentCV* updates # if InstrucSilentCV is starting this frame... if InstrucSilentCV.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later InstrucSilentCV.frameNStart = frameN # exact frame index InstrucSilentCV.tStart = t # local t and not account for scr refresh InstrucSilentCV.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(InstrucSilentCV, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'InstrucSilentCV.started') # update status InstrucSilentCV.status = STARTED InstrucSilentCV.setAutoDraw(True) # if InstrucSilentCV is active this frame... if InstrucSilentCV.status == STARTED: # update params pass # *key_resp_5* updates waitOnFlip = False # if key_resp_5 is starting this frame... if key_resp_5.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_5.frameNStart = frameN # exact frame index key_resp_5.tStart = t # local t and not account for scr refresh key_resp_5.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_5, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_5.started') # update status key_resp_5.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_5.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_5.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_5.status == STARTED and not waitOnFlip: theseKeys = key_resp_5.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_5_allKeys.extend(theseKeys) if len(_key_resp_5_allKeys): key_resp_5.keys = _key_resp_5_allKeys[-1].name # just the last key pressed key_resp_5.rt = _key_resp_5_allKeys[-1].rt key_resp_5.duration = _key_resp_5_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ImaginedSpeechCV_InstrucComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ImaginedSpeechCV_Instruc" --- for thisComponent in ImaginedSpeechCV_InstrucComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ImaginedSpeechCV_Instruc.stopped', globalClock.getTime()) # check responses if key_resp_5.keys in ['', [], None]: # No response was made key_resp_5.keys = None trials_CV.addData('key_resp_5.keys',key_resp_5.keys) if key_resp_5.keys != None: # we had a response trials_CV.addData('key_resp_5.rt', key_resp_5.rt) trials_CV.addData('key_resp_5.duration', key_resp_5.duration) # the Routine "ImaginedSpeechCV_Instruc" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc TrialCVSilent = data.TrialHandler(nReps=1.0, method='sequential', extraInfo=expInfo, originPath=-1, trialList=data.importConditions(Presentation_List, selection=use_rows), seed=None, name='TrialCVSilent') thisExp.addLoop(TrialCVSilent) # add the loop to the experiment thisTrialCVSilent = TrialCVSilent.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrialCVSilent.rgb) if thisTrialCVSilent != None: for paramName in thisTrialCVSilent: globals()[paramName] = thisTrialCVSilent[paramName] for thisTrialCVSilent in TrialCVSilent: currentLoop = TrialCVSilent thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrialCVSilent.rgb) if thisTrialCVSilent != None: for paramName in thisTrialCVSilent: globals()[paramName] = thisTrialCVSilent[paramName] # --- Prepare to start Routine "Fixation_CV_Ima" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Fixation_CV_Ima.started', globalClock.getTime()) # Run 'Begin Routine' code from code_FIXCV FixCVima = minDur + (maxDur - minDur) * random.random() send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_START_FIXATION) outlet.push_sample(['SilentSyllablesExperimentStartFixation:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # keep track of which components have finished Fixation_CV_ImaComponents = [Fix_for_CV] for thisComponent in Fixation_CV_ImaComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Fixation_CV_Ima" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Fix_for_CV* updates # if Fix_for_CV is starting this frame... if Fix_for_CV.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Fix_for_CV.frameNStart = frameN # exact frame index Fix_for_CV.tStart = t # local t and not account for scr refresh Fix_for_CV.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Fix_for_CV, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_CV.started') # update status Fix_for_CV.status = STARTED Fix_for_CV.setAutoDraw(True) # if Fix_for_CV is active this frame... if Fix_for_CV.status == STARTED: # update params pass # if Fix_for_CV is stopping this frame... if Fix_for_CV.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Fix_for_CV.tStartRefresh + FixCVima-frameTolerance: # keep track of stop time/frame for later Fix_for_CV.tStop = t # not accounting for scr refresh Fix_for_CV.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_CV.stopped') # update status Fix_for_CV.status = FINISHED Fix_for_CV.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Fixation_CV_ImaComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Fixation_CV_Ima" --- for thisComponent in Fixation_CV_ImaComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Fixation_CV_Ima.stopped', globalClock.getTime()) # Run 'End Routine' code from code_FIXCV send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_END_FIXATION) outlet.push_sample(['SilentSyllablesExperimentEndFixation:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # the Routine "Fixation_CV_Ima" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "Target_CV_Ima_2" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Target_CV_Ima_2.started', globalClock.getTime()) Target_SoundCV.setSound(SyllableSoundSilent, secs=0.75, hamming=True) Target_SoundCV.setVolume(1.0, log=False) Target_SoundCV.seek(0) Target_textCV.setText(SyllableLowSilent) # Run 'Begin Routine' code from code_12 send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_START_STIMULUS) outlet.push_sample(['SilentSyllablesExperimentStartStimulus:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # keep track of which components have finished Target_CV_Ima_2Components = [Target_SoundCV, Target_textCV, bracketsTarget] for thisComponent in Target_CV_Ima_2Components: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Target_CV_Ima_2" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.75: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # if Target_SoundCV is starting this frame... if Target_SoundCV.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_SoundCV.frameNStart = frameN # exact frame index Target_SoundCV.tStart = t # local t and not account for scr refresh Target_SoundCV.tStartRefresh = tThisFlipGlobal # on global time # add timestamp to datafile thisExp.addData('Target_SoundCV.started', tThisFlipGlobal) # update status Target_SoundCV.status = STARTED Target_SoundCV.play(when=win) # sync with win flip # if Target_SoundCV is stopping this frame... if Target_SoundCV.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_SoundCV.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later Target_SoundCV.tStop = t # not accounting for scr refresh Target_SoundCV.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_SoundCV.stopped') # update status Target_SoundCV.status = FINISHED Target_SoundCV.stop() # update Target_SoundCV status according to whether it's playing if Target_SoundCV.isPlaying: Target_SoundCV.status = STARTED elif Target_SoundCV.isFinished: Target_SoundCV.status = FINISHED # *Target_textCV* updates # if Target_textCV is starting this frame... if Target_textCV.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_textCV.frameNStart = frameN # exact frame index Target_textCV.tStart = t # local t and not account for scr refresh Target_textCV.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Target_textCV, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_textCV.started') # update status Target_textCV.status = STARTED Target_textCV.setAutoDraw(True) # if Target_textCV is active this frame... if Target_textCV.status == STARTED: # update params pass # if Target_textCV is stopping this frame... if Target_textCV.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_textCV.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later Target_textCV.tStop = t # not accounting for scr refresh Target_textCV.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_textCV.stopped') # update status Target_textCV.status = FINISHED Target_textCV.setAutoDraw(False) # *bracketsTarget* updates # if bracketsTarget is starting this frame... if bracketsTarget.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsTarget.frameNStart = frameN # exact frame index bracketsTarget.tStart = t # local t and not account for scr refresh bracketsTarget.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsTarget, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget.started') # update status bracketsTarget.status = STARTED bracketsTarget.setAutoDraw(True) # if bracketsTarget is active this frame... if bracketsTarget.status == STARTED: # update params pass # if bracketsTarget is stopping this frame... if bracketsTarget.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsTarget.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later bracketsTarget.tStop = t # not accounting for scr refresh bracketsTarget.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget.stopped') # update status bracketsTarget.status = FINISHED bracketsTarget.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Target_CV_Ima_2Components: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Target_CV_Ima_2" --- for thisComponent in Target_CV_Ima_2Components: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Target_CV_Ima_2.stopped', globalClock.getTime()) Target_SoundCV.pause() # ensure sound has stopped at end of Routine # Run 'End Routine' code from code_12 send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_END_STIMULUS) outlet.push_sample(['SilentSyllablesExperimentEndStimulus:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.750000) # --- Prepare to start Routine "ISI_CV_Ima" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ISI_CV_Ima.started', globalClock.getTime()) # Run 'Begin Routine' code from code_ISICV ISICVima = minDur + (maxDur - minDur) * random.random() send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_START_ISI) outlet.push_sample(['SilentSyllablesExperimentStartISI:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # keep track of which components have finished ISI_CV_ImaComponents = [ISI_for_CV, bracketsISI] for thisComponent in ISI_CV_ImaComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ISI_CV_Ima" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ISI_for_CV* updates # if ISI_for_CV is starting this frame... if ISI_for_CV.status == NOT_STARTED and tThisFlip >= 0-frameTolerance: # keep track of start time/frame for later ISI_for_CV.frameNStart = frameN # exact frame index ISI_for_CV.tStart = t # local t and not account for scr refresh ISI_for_CV.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ISI_for_CV, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_for_CV.started') # update status ISI_for_CV.status = STARTED ISI_for_CV.setAutoDraw(True) # if ISI_for_CV is active this frame... if ISI_for_CV.status == STARTED: # update params pass # if ISI_for_CV is stopping this frame... if ISI_for_CV.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ISI_for_CV.tStartRefresh + ISICVima-frameTolerance: # keep track of stop time/frame for later ISI_for_CV.tStop = t # not accounting for scr refresh ISI_for_CV.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_for_CV.stopped') # update status ISI_for_CV.status = FINISHED ISI_for_CV.setAutoDraw(False) # *bracketsISI* updates # if bracketsISI is starting this frame... if bracketsISI.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsISI.frameNStart = frameN # exact frame index bracketsISI.tStart = t # local t and not account for scr refresh bracketsISI.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsISI, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsISI.started') # update status bracketsISI.status = STARTED bracketsISI.setAutoDraw(True) # if bracketsISI is active this frame... if bracketsISI.status == STARTED: # update params pass # if bracketsISI is stopping this frame... if bracketsISI.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsISI.tStartRefresh + ISICVima-frameTolerance: # keep track of stop time/frame for later bracketsISI.tStop = t # not accounting for scr refresh bracketsISI.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsISI.stopped') # update status bracketsISI.status = FINISHED bracketsISI.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ISI_CV_ImaComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ISI_CV_Ima" --- for thisComponent in ISI_CV_ImaComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ISI_CV_Ima.stopped', globalClock.getTime()) # Run 'End Routine' code from code_ISICV send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_END_ISI) outlet.push_sample(['SilentSyllablesExperimentEndISI:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # the Routine "ISI_CV_Ima" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "SpeechCV_Ima" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('SpeechCV_Ima.started', globalClock.getTime()) # Run 'Begin Routine' code from code_13 send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_START_SPEECH) outlet.push_sample(['SilentSyllablesExperimentStartSpeech:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # keep track of which components have finished SpeechCV_ImaComponents = [SignOnsetSpeech, SpeechBrackets] for thisComponent in SpeechCV_ImaComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "SpeechCV_Ima" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 1.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *SignOnsetSpeech* updates # if SignOnsetSpeech is starting this frame... if SignOnsetSpeech.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SignOnsetSpeech.frameNStart = frameN # exact frame index SignOnsetSpeech.tStart = t # local t and not account for scr refresh SignOnsetSpeech.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SignOnsetSpeech, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech.started') # update status SignOnsetSpeech.status = STARTED SignOnsetSpeech.setAutoDraw(True) # if SignOnsetSpeech is active this frame... if SignOnsetSpeech.status == STARTED: # update params pass # if SignOnsetSpeech is stopping this frame... if SignOnsetSpeech.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SignOnsetSpeech.tStartRefresh + 1.5-frameTolerance: # keep track of stop time/frame for later SignOnsetSpeech.tStop = t # not accounting for scr refresh SignOnsetSpeech.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech.stopped') # update status SignOnsetSpeech.status = FINISHED SignOnsetSpeech.setAutoDraw(False) # *SpeechBrackets* updates # if SpeechBrackets is starting this frame... if SpeechBrackets.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SpeechBrackets.frameNStart = frameN # exact frame index SpeechBrackets.tStart = t # local t and not account for scr refresh SpeechBrackets.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SpeechBrackets, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SpeechBrackets.started') # update status SpeechBrackets.status = STARTED SpeechBrackets.setAutoDraw(True) # if SpeechBrackets is active this frame... if SpeechBrackets.status == STARTED: # update params pass # if SpeechBrackets is stopping this frame... if SpeechBrackets.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SpeechBrackets.tStartRefresh + 1.5-frameTolerance: # keep track of stop time/frame for later SpeechBrackets.tStop = t # not accounting for scr refresh SpeechBrackets.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SpeechBrackets.stopped') # update status SpeechBrackets.status = FINISHED SpeechBrackets.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in SpeechCV_ImaComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "SpeechCV_Ima" --- for thisComponent in SpeechCV_ImaComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('SpeechCV_Ima.stopped', globalClock.getTime()) # Run 'End Routine' code from code_13 send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_END_SPEECH) outlet.push_sample(['SilentSyllablesExperimentEndSpeech:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-1.500000) # --- Prepare to start Routine "ITICV_IMA" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ITICV_IMA.started', globalClock.getTime()) # Run 'Begin Routine' code from code_14 send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_START_ITI) outlet.push_sample(['SilentSyllablesExperimentStartITI:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # keep track of which components have finished ITICV_IMAComponents = [text_5] for thisComponent in ITICV_IMAComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ITICV_IMA" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_5* updates # if text_5 is starting this frame... if text_5.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_5.frameNStart = frameN # exact frame index text_5.tStart = t # local t and not account for scr refresh text_5.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_5, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_5.started') # update status text_5.status = STARTED text_5.setAutoDraw(True) # if text_5 is active this frame... if text_5.status == STARTED: # update params pass # if text_5 is stopping this frame... if text_5.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_5.tStartRefresh + 0.5-frameTolerance: # keep track of stop time/frame for later text_5.tStop = t # not accounting for scr refresh text_5.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_5.stopped') # update status text_5.status = FINISHED text_5.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ITICV_IMAComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ITICV_IMA" --- for thisComponent in ITICV_IMAComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ITICV_IMA.stopped', globalClock.getTime()) # Run 'End Routine' code from code_14 send_markers(Markers.SILENTSYLLABLES_EXPERIMENT_END_ITI) outlet.push_sample(['SilentSyllablesExperimentEndITI:' + PresentionSyllableSilent + "_" + SyllableUpSilent]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.500000) thisExp.nextEntry() if thisSession is not None: # if running in a Session with a Liaison client, send data up to now thisSession.sendExperimentData() # completed 1.0 repeats of 'TrialCVSilent' # --- Prepare to start Routine "SpeakAloudCV_Instruc" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('SpeakAloudCV_Instruc.started', globalClock.getTime()) key_resp_2.keys = [] key_resp_2.rt = [] _key_resp_2_allKeys = [] # keep track of which components have finished SpeakAloudCV_InstrucComponents = [InstructAloudCV, key_resp_2] for thisComponent in SpeakAloudCV_InstrucComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "SpeakAloudCV_Instruc" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *InstructAloudCV* updates # if InstructAloudCV is starting this frame... if InstructAloudCV.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later InstructAloudCV.frameNStart = frameN # exact frame index InstructAloudCV.tStart = t # local t and not account for scr refresh InstructAloudCV.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(InstructAloudCV, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'InstructAloudCV.started') # update status InstructAloudCV.status = STARTED InstructAloudCV.setAutoDraw(True) # if InstructAloudCV is active this frame... if InstructAloudCV.status == STARTED: # update params pass # *key_resp_2* updates waitOnFlip = False # if key_resp_2 is starting this frame... if key_resp_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_2.frameNStart = frameN # exact frame index key_resp_2.tStart = t # local t and not account for scr refresh key_resp_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_2.started') # update status key_resp_2.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_2.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_2.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_2.status == STARTED and not waitOnFlip: theseKeys = key_resp_2.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_2_allKeys.extend(theseKeys) if len(_key_resp_2_allKeys): key_resp_2.keys = _key_resp_2_allKeys[-1].name # just the last key pressed key_resp_2.rt = _key_resp_2_allKeys[-1].rt key_resp_2.duration = _key_resp_2_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in SpeakAloudCV_InstrucComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "SpeakAloudCV_Instruc" --- for thisComponent in SpeakAloudCV_InstrucComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('SpeakAloudCV_Instruc.stopped', globalClock.getTime()) # check responses if key_resp_2.keys in ['', [], None]: # No response was made key_resp_2.keys = None trials_CV.addData('key_resp_2.keys',key_resp_2.keys) if key_resp_2.keys != None: # we had a response trials_CV.addData('key_resp_2.rt', key_resp_2.rt) trials_CV.addData('key_resp_2.duration', key_resp_2.duration) # the Routine "SpeakAloudCV_Instruc" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc TrialCVAloud = data.TrialHandler(nReps=1.0, method='sequential', extraInfo=expInfo, originPath=-1, trialList=data.importConditions(Presentation_List, selection=use_rows), seed=None, name='TrialCVAloud') thisExp.addLoop(TrialCVAloud) # add the loop to the experiment thisTrialCVAloud = TrialCVAloud.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrialCVAloud.rgb) if thisTrialCVAloud != None: for paramName in thisTrialCVAloud: globals()[paramName] = thisTrialCVAloud[paramName] for thisTrialCVAloud in TrialCVAloud: currentLoop = TrialCVAloud thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrialCVAloud.rgb) if thisTrialCVAloud != None: for paramName in thisTrialCVAloud: globals()[paramName] = thisTrialCVAloud[paramName] # --- Prepare to start Routine "Fixation_CV_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Fixation_CV_Aloud.started', globalClock.getTime()) # Run 'Begin Routine' code from code_FIXCV_2 FixCValoud = minDur + (maxDur - minDur) * random.random() send_markers(Markers.REALSYLLABLES_EXPERIMENT_START_FIXATION) outlet.push_sample(['RealSyllablesExperimentStartFixation:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # keep track of which components have finished Fixation_CV_AloudComponents = [Fix_for_CV_2] for thisComponent in Fixation_CV_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Fixation_CV_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Fix_for_CV_2* updates # if Fix_for_CV_2 is starting this frame... if Fix_for_CV_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Fix_for_CV_2.frameNStart = frameN # exact frame index Fix_for_CV_2.tStart = t # local t and not account for scr refresh Fix_for_CV_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Fix_for_CV_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_CV_2.started') # update status Fix_for_CV_2.status = STARTED Fix_for_CV_2.setAutoDraw(True) # if Fix_for_CV_2 is active this frame... if Fix_for_CV_2.status == STARTED: # update params pass # if Fix_for_CV_2 is stopping this frame... if Fix_for_CV_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Fix_for_CV_2.tStartRefresh + FixCValoud-frameTolerance: # keep track of stop time/frame for later Fix_for_CV_2.tStop = t # not accounting for scr refresh Fix_for_CV_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_CV_2.stopped') # update status Fix_for_CV_2.status = FINISHED Fix_for_CV_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Fixation_CV_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Fixation_CV_Aloud" --- for thisComponent in Fixation_CV_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Fixation_CV_Aloud.stopped', globalClock.getTime()) # Run 'End Routine' code from code_FIXCV_2 send_markers(Markers.REALSYLLABLES_EXPERIMENT_END_FIXATION) outlet.push_sample(['RealSyllablesExperimentEndFixation:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # the Routine "Fixation_CV_Aloud" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "Target_CV_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Target_CV_Aloud.started', globalClock.getTime()) Target_SoundCV_2.setSound(SyllableSoundAloud, secs=0.75, hamming=True) Target_SoundCV_2.setVolume(1.0, log=False) Target_SoundCV_2.seek(0) # Run 'Begin Routine' code from code_15 send_markers(Markers.REALSYLLABLES_EXPERIMENT_START_STIMULUS) outlet.push_sample(['RealSyllablesExperimentStartStimulus:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # keep track of which components have finished Target_CV_AloudComponents = [Target_textCV_2, Target_SoundCV_2, bracketsTarget_2] for thisComponent in Target_CV_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Target_CV_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.75: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Target_textCV_2* updates # if Target_textCV_2 is starting this frame... if Target_textCV_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_textCV_2.frameNStart = frameN # exact frame index Target_textCV_2.tStart = t # local t and not account for scr refresh Target_textCV_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Target_textCV_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_textCV_2.started') # update status Target_textCV_2.status = STARTED Target_textCV_2.setAutoDraw(True) # if Target_textCV_2 is active this frame... if Target_textCV_2.status == STARTED: # update params Target_textCV_2.setText(SyllableLowAloud, log=False) # if Target_textCV_2 is stopping this frame... if Target_textCV_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_textCV_2.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later Target_textCV_2.tStop = t # not accounting for scr refresh Target_textCV_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_textCV_2.stopped') # update status Target_textCV_2.status = FINISHED Target_textCV_2.setAutoDraw(False) # if Target_SoundCV_2 is starting this frame... if Target_SoundCV_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_SoundCV_2.frameNStart = frameN # exact frame index Target_SoundCV_2.tStart = t # local t and not account for scr refresh Target_SoundCV_2.tStartRefresh = tThisFlipGlobal # on global time # add timestamp to datafile thisExp.addData('Target_SoundCV_2.started', tThisFlipGlobal) # update status Target_SoundCV_2.status = STARTED Target_SoundCV_2.play(when=win) # sync with win flip # if Target_SoundCV_2 is stopping this frame... if Target_SoundCV_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_SoundCV_2.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later Target_SoundCV_2.tStop = t # not accounting for scr refresh Target_SoundCV_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_SoundCV_2.stopped') # update status Target_SoundCV_2.status = FINISHED Target_SoundCV_2.stop() # update Target_SoundCV_2 status according to whether it's playing if Target_SoundCV_2.isPlaying: Target_SoundCV_2.status = STARTED elif Target_SoundCV_2.isFinished: Target_SoundCV_2.status = FINISHED # *bracketsTarget_2* updates # if bracketsTarget_2 is starting this frame... if bracketsTarget_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsTarget_2.frameNStart = frameN # exact frame index bracketsTarget_2.tStart = t # local t and not account for scr refresh bracketsTarget_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsTarget_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_2.started') # update status bracketsTarget_2.status = STARTED bracketsTarget_2.setAutoDraw(True) # if bracketsTarget_2 is active this frame... if bracketsTarget_2.status == STARTED: # update params pass # if bracketsTarget_2 is stopping this frame... if bracketsTarget_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsTarget_2.tStartRefresh + 0.75-frameTolerance: # keep track of stop time/frame for later bracketsTarget_2.tStop = t # not accounting for scr refresh bracketsTarget_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_2.stopped') # update status bracketsTarget_2.status = FINISHED bracketsTarget_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Target_CV_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Target_CV_Aloud" --- for thisComponent in Target_CV_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Target_CV_Aloud.stopped', globalClock.getTime()) Target_SoundCV_2.pause() # ensure sound has stopped at end of Routine # Run 'End Routine' code from code_15 send_markers(Markers.REALSYLLABLES_EXPERIMENT_END_STIMULUS) outlet.push_sample(['RealSyllablesExperimentEndStimulus:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.750000) # --- Prepare to start Routine "ISI_CV_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ISI_CV_Aloud.started', globalClock.getTime()) # Run 'Begin Routine' code from code_ISICV_2 ISICValoud = minDur + (maxDur - minDur) * random.random() send_markers(Markers.REALSYLLABLES_EXPERIMENT_START_ISI) outlet.push_sample(['RealSyllablesExperimentStartISI:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # keep track of which components have finished ISI_CV_AloudComponents = [ISI_for_CV_2, bracketsISI_2] for thisComponent in ISI_CV_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ISI_CV_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ISI_for_CV_2* updates # if ISI_for_CV_2 is starting this frame... if ISI_for_CV_2.status == NOT_STARTED and tThisFlip >= 0-frameTolerance: # keep track of start time/frame for later ISI_for_CV_2.frameNStart = frameN # exact frame index ISI_for_CV_2.tStart = t # local t and not account for scr refresh ISI_for_CV_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ISI_for_CV_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_for_CV_2.started') # update status ISI_for_CV_2.status = STARTED ISI_for_CV_2.setAutoDraw(True) # if ISI_for_CV_2 is active this frame... if ISI_for_CV_2.status == STARTED: # update params pass # if ISI_for_CV_2 is stopping this frame... if ISI_for_CV_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ISI_for_CV_2.tStartRefresh + ISICValoud-frameTolerance: # keep track of stop time/frame for later ISI_for_CV_2.tStop = t # not accounting for scr refresh ISI_for_CV_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_for_CV_2.stopped') # update status ISI_for_CV_2.status = FINISHED ISI_for_CV_2.setAutoDraw(False) # *bracketsISI_2* updates # if bracketsISI_2 is starting this frame... if bracketsISI_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsISI_2.frameNStart = frameN # exact frame index bracketsISI_2.tStart = t # local t and not account for scr refresh bracketsISI_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsISI_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsISI_2.started') # update status bracketsISI_2.status = STARTED bracketsISI_2.setAutoDraw(True) # if bracketsISI_2 is active this frame... if bracketsISI_2.status == STARTED: # update params pass # if bracketsISI_2 is stopping this frame... if bracketsISI_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsISI_2.tStartRefresh + ISICValoud-frameTolerance: # keep track of stop time/frame for later bracketsISI_2.tStop = t # not accounting for scr refresh bracketsISI_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsISI_2.stopped') # update status bracketsISI_2.status = FINISHED bracketsISI_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ISI_CV_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ISI_CV_Aloud" --- for thisComponent in ISI_CV_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ISI_CV_Aloud.stopped', globalClock.getTime()) # Run 'End Routine' code from code_ISICV_2 send_markers(Markers.REALSYLLABLES_EXPERIMENT_END_ISI) outlet.push_sample(['RealSyllablesExperimentEndISI:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # the Routine "ISI_CV_Aloud" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "SpeechCV_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('SpeechCV_Aloud.started', globalClock.getTime()) # Run 'Begin Routine' code from code_16 send_markers(Markers.REALSYLLABLES_EXPERIMENT_START_SPEECH) outlet.push_sample(['RealSyllablesExperimentStartSpeech:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # keep track of which components have finished SpeechCV_AloudComponents = [SignOnsetSpeech_2, SpeechBrackets_2] for thisComponent in SpeechCV_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "SpeechCV_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 1.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *SignOnsetSpeech_2* updates # if SignOnsetSpeech_2 is starting this frame... if SignOnsetSpeech_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SignOnsetSpeech_2.frameNStart = frameN # exact frame index SignOnsetSpeech_2.tStart = t # local t and not account for scr refresh SignOnsetSpeech_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SignOnsetSpeech_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_2.started') # update status SignOnsetSpeech_2.status = STARTED SignOnsetSpeech_2.setAutoDraw(True) # if SignOnsetSpeech_2 is active this frame... if SignOnsetSpeech_2.status == STARTED: # update params pass # if SignOnsetSpeech_2 is stopping this frame... if SignOnsetSpeech_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SignOnsetSpeech_2.tStartRefresh + 1.5-frameTolerance: # keep track of stop time/frame for later SignOnsetSpeech_2.tStop = t # not accounting for scr refresh SignOnsetSpeech_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_2.stopped') # update status SignOnsetSpeech_2.status = FINISHED SignOnsetSpeech_2.setAutoDraw(False) # *SpeechBrackets_2* updates # if SpeechBrackets_2 is starting this frame... if SpeechBrackets_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SpeechBrackets_2.frameNStart = frameN # exact frame index SpeechBrackets_2.tStart = t # local t and not account for scr refresh SpeechBrackets_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SpeechBrackets_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SpeechBrackets_2.started') # update status SpeechBrackets_2.status = STARTED SpeechBrackets_2.setAutoDraw(True) # if SpeechBrackets_2 is active this frame... if SpeechBrackets_2.status == STARTED: # update params pass # if SpeechBrackets_2 is stopping this frame... if SpeechBrackets_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SpeechBrackets_2.tStartRefresh + 1.5-frameTolerance: # keep track of stop time/frame for later SpeechBrackets_2.tStop = t # not accounting for scr refresh SpeechBrackets_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SpeechBrackets_2.stopped') # update status SpeechBrackets_2.status = FINISHED SpeechBrackets_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in SpeechCV_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "SpeechCV_Aloud" --- for thisComponent in SpeechCV_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('SpeechCV_Aloud.stopped', globalClock.getTime()) # Run 'End Routine' code from code_16 send_markers(Markers.REALSYLLABLES_EXPERIMENT_END_SPEECH) outlet.push_sample(['RealSyllablesExperimentEndSpeech:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-1.500000) # --- Prepare to start Routine "ITICV_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ITICV_Aloud.started', globalClock.getTime()) # Run 'Begin Routine' code from code_17 send_markers(Markers.REALSYLLABLES_EXPERIMENT_START_ITI) outlet.push_sample(['RealSyllablesExperimentStartITI:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # keep track of which components have finished ITICV_AloudComponents = [text_8] for thisComponent in ITICV_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ITICV_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_8* updates # if text_8 is starting this frame... if text_8.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_8.frameNStart = frameN # exact frame index text_8.tStart = t # local t and not account for scr refresh text_8.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_8, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_8.started') # update status text_8.status = STARTED text_8.setAutoDraw(True) # if text_8 is active this frame... if text_8.status == STARTED: # update params pass # if text_8 is stopping this frame... if text_8.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_8.tStartRefresh + 0.5-frameTolerance: # keep track of stop time/frame for later text_8.tStop = t # not accounting for scr refresh text_8.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_8.stopped') # update status text_8.status = FINISHED text_8.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ITICV_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ITICV_Aloud" --- for thisComponent in ITICV_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ITICV_Aloud.stopped', globalClock.getTime()) # Run 'End Routine' code from code_17 send_markers(Markers.REALSYLLABLES_EXPERIMENT_END_ITI) outlet.push_sample(['RealSyllablesExperimentEndITI:' + PresentionSyllableAloud + "_" + SyllableUpAloud]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.500000) thisExp.nextEntry() if thisSession is not None: # if running in a Session with a Liaison client, send data up to now thisSession.sendExperimentData() # completed 1.0 repeats of 'TrialCVAloud' # completed 10.0 repeats of 'trials_CV' # --- Prepare to start Routine "InstPracWord" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('InstPracWord.started', globalClock.getTime()) key_resp_13.keys = [] key_resp_13.rt = [] _key_resp_13_allKeys = [] # keep track of which components have finished InstPracWordComponents = [text_17, key_resp_13] for thisComponent in InstPracWordComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "InstPracWord" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_17* updates # if text_17 is starting this frame... if text_17.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_17.frameNStart = frameN # exact frame index text_17.tStart = t # local t and not account for scr refresh text_17.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_17, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_17.started') # update status text_17.status = STARTED text_17.setAutoDraw(True) # if text_17 is active this frame... if text_17.status == STARTED: # update params pass # *key_resp_13* updates waitOnFlip = False # if key_resp_13 is starting this frame... if key_resp_13.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_13.frameNStart = frameN # exact frame index key_resp_13.tStart = t # local t and not account for scr refresh key_resp_13.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_13, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_13.started') # update status key_resp_13.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_13.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_13.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_13.status == STARTED and not waitOnFlip: theseKeys = key_resp_13.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_13_allKeys.extend(theseKeys) if len(_key_resp_13_allKeys): key_resp_13.keys = _key_resp_13_allKeys[-1].name # just the last key pressed key_resp_13.rt = _key_resp_13_allKeys[-1].rt key_resp_13.duration = _key_resp_13_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in InstPracWordComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "InstPracWord" --- for thisComponent in InstPracWordComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('InstPracWord.stopped', globalClock.getTime()) # check responses if key_resp_13.keys in ['', [], None]: # No response was made key_resp_13.keys = None thisExp.addData('key_resp_13.keys',key_resp_13.keys) if key_resp_13.keys != None: # we had a response thisExp.addData('key_resp_13.rt', key_resp_13.rt) thisExp.addData('key_resp_13.duration', key_resp_13.duration) thisExp.nextEntry() # the Routine "InstPracWord" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc trialWordsSilentPrac = data.TrialHandler(nReps=1.0, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions(Presentation_List, selection='0:10'), seed=None, name='trialWordsSilentPrac') thisExp.addLoop(trialWordsSilentPrac) # add the loop to the experiment thisTrialWordsSilentPrac = trialWordsSilentPrac.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrialWordsSilentPrac.rgb) if thisTrialWordsSilentPrac != None: for paramName in thisTrialWordsSilentPrac: globals()[paramName] = thisTrialWordsSilentPrac[paramName] for thisTrialWordsSilentPrac in trialWordsSilentPrac: currentLoop = trialWordsSilentPrac thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrialWordsSilentPrac.rgb) if thisTrialWordsSilentPrac != None: for paramName in thisTrialWordsSilentPrac: globals()[paramName] = thisTrialWordsSilentPrac[paramName] # --- Prepare to start Routine "FixWordImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('FixWordImaPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_8 FixWordPrac1 = minDur + (maxDur - minDur) * random.random() send_markers(Markers.SILENTWORDS_PRACTICE_START_FIXATION) outlet.push_sample(['SilentWordsPracticeStartFixation:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # keep track of which components have finished FixWordImaPracComponents = [Fix_for_Word_2] for thisComponent in FixWordImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "FixWordImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Fix_for_Word_2* updates # if Fix_for_Word_2 is starting this frame... if Fix_for_Word_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Fix_for_Word_2.frameNStart = frameN # exact frame index Fix_for_Word_2.tStart = t # local t and not account for scr refresh Fix_for_Word_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Fix_for_Word_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_Word_2.started') # update status Fix_for_Word_2.status = STARTED Fix_for_Word_2.setAutoDraw(True) # if Fix_for_Word_2 is active this frame... if Fix_for_Word_2.status == STARTED: # update params pass # if Fix_for_Word_2 is stopping this frame... if Fix_for_Word_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Fix_for_Word_2.tStartRefresh + FixWordPrac1-frameTolerance: # keep track of stop time/frame for later Fix_for_Word_2.tStop = t # not accounting for scr refresh Fix_for_Word_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_Word_2.stopped') # update status Fix_for_Word_2.status = FINISHED Fix_for_Word_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in FixWordImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "FixWordImaPrac" --- for thisComponent in FixWordImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('FixWordImaPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_8 send_markers(Markers.SILENTWORDS_PRACTICE_END_FIXATION) outlet.push_sample(['SilentWordsPracticeEndFixation:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # the Routine "FixWordImaPrac" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "TargetWordImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('TargetWordImaPrac.started', globalClock.getTime()) bracketsTarget_WordSilent_2.setText(BracketsWordsSilentL + " " + BracketsWordsSilentR) Target_Pic_WordSilent_2.setImage(WordPicSilentPrac) TargetText_WordSilent_2.setText(WordLowSilentPrac) Target_Sound_WordSilent_2.setSound(WordAudioSilentPrac, secs=1, hamming=True) Target_Sound_WordSilent_2.setVolume(1.0, log=False) Target_Sound_WordSilent_2.seek(0) # Run 'Begin Routine' code from code_32 send_markers(Markers.SILENTWORDS_PRACTICE_START_STIMULUS) outlet.push_sample(['SilentWordsPracticeStartStimulus:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # keep track of which components have finished TargetWordImaPracComponents = [bracketsTarget_WordSilent_2, Target_Pic_WordSilent_2, TargetText_WordSilent_2, Target_Sound_WordSilent_2] for thisComponent in TargetWordImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "TargetWordImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 1.0: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *bracketsTarget_WordSilent_2* updates # if bracketsTarget_WordSilent_2 is starting this frame... if bracketsTarget_WordSilent_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsTarget_WordSilent_2.frameNStart = frameN # exact frame index bracketsTarget_WordSilent_2.tStart = t # local t and not account for scr refresh bracketsTarget_WordSilent_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsTarget_WordSilent_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_WordSilent_2.started') # update status bracketsTarget_WordSilent_2.status = STARTED bracketsTarget_WordSilent_2.setAutoDraw(True) # if bracketsTarget_WordSilent_2 is active this frame... if bracketsTarget_WordSilent_2.status == STARTED: # update params pass # if bracketsTarget_WordSilent_2 is stopping this frame... if bracketsTarget_WordSilent_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsTarget_WordSilent_2.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later bracketsTarget_WordSilent_2.tStop = t # not accounting for scr refresh bracketsTarget_WordSilent_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_WordSilent_2.stopped') # update status bracketsTarget_WordSilent_2.status = FINISHED bracketsTarget_WordSilent_2.setAutoDraw(False) # *Target_Pic_WordSilent_2* updates # if Target_Pic_WordSilent_2 is starting this frame... if Target_Pic_WordSilent_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_Pic_WordSilent_2.frameNStart = frameN # exact frame index Target_Pic_WordSilent_2.tStart = t # local t and not account for scr refresh Target_Pic_WordSilent_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Target_Pic_WordSilent_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_Pic_WordSilent_2.started') # update status Target_Pic_WordSilent_2.status = STARTED Target_Pic_WordSilent_2.setAutoDraw(True) # if Target_Pic_WordSilent_2 is active this frame... if Target_Pic_WordSilent_2.status == STARTED: # update params pass # if Target_Pic_WordSilent_2 is stopping this frame... if Target_Pic_WordSilent_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_Pic_WordSilent_2.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later Target_Pic_WordSilent_2.tStop = t # not accounting for scr refresh Target_Pic_WordSilent_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_Pic_WordSilent_2.stopped') # update status Target_Pic_WordSilent_2.status = FINISHED Target_Pic_WordSilent_2.setAutoDraw(False) # *TargetText_WordSilent_2* updates # if TargetText_WordSilent_2 is starting this frame... if TargetText_WordSilent_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later TargetText_WordSilent_2.frameNStart = frameN # exact frame index TargetText_WordSilent_2.tStart = t # local t and not account for scr refresh TargetText_WordSilent_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(TargetText_WordSilent_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetText_WordSilent_2.started') # update status TargetText_WordSilent_2.status = STARTED TargetText_WordSilent_2.setAutoDraw(True) # if TargetText_WordSilent_2 is active this frame... if TargetText_WordSilent_2.status == STARTED: # update params pass # if TargetText_WordSilent_2 is stopping this frame... if TargetText_WordSilent_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > TargetText_WordSilent_2.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later TargetText_WordSilent_2.tStop = t # not accounting for scr refresh TargetText_WordSilent_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetText_WordSilent_2.stopped') # update status TargetText_WordSilent_2.status = FINISHED TargetText_WordSilent_2.setAutoDraw(False) # if Target_Sound_WordSilent_2 is starting this frame... if Target_Sound_WordSilent_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_Sound_WordSilent_2.frameNStart = frameN # exact frame index Target_Sound_WordSilent_2.tStart = t # local t and not account for scr refresh Target_Sound_WordSilent_2.tStartRefresh = tThisFlipGlobal # on global time # add timestamp to datafile thisExp.addData('Target_Sound_WordSilent_2.started', tThisFlipGlobal) # update status Target_Sound_WordSilent_2.status = STARTED Target_Sound_WordSilent_2.play(when=win) # sync with win flip # if Target_Sound_WordSilent_2 is stopping this frame... if Target_Sound_WordSilent_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_Sound_WordSilent_2.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later Target_Sound_WordSilent_2.tStop = t # not accounting for scr refresh Target_Sound_WordSilent_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_Sound_WordSilent_2.stopped') # update status Target_Sound_WordSilent_2.status = FINISHED Target_Sound_WordSilent_2.stop() # update Target_Sound_WordSilent_2 status according to whether it's playing if Target_Sound_WordSilent_2.isPlaying: Target_Sound_WordSilent_2.status = STARTED elif Target_Sound_WordSilent_2.isFinished: Target_Sound_WordSilent_2.status = FINISHED # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in TargetWordImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "TargetWordImaPrac" --- for thisComponent in TargetWordImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('TargetWordImaPrac.stopped', globalClock.getTime()) Target_Sound_WordSilent_2.pause() # ensure sound has stopped at end of Routine # Run 'End Routine' code from code_32 send_markers(Markers.SILENTWORDS_PRACTICE_END_STIMULUS) outlet.push_sample(['SilentWordsPracticeEndStimulus:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-1.000000) # --- Prepare to start Routine "ISIWordImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ISIWordImaPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_9 ISIWordPrac1 = minDur + (maxDur - minDur) * random.random() send_markers(Markers.SILENTWORDS_PRACTICE_START_ISI) outlet.push_sample(['SilentWordsPracticeStartISI:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # keep track of which components have finished ISIWordImaPracComponents = [ISI_Word1_2] for thisComponent in ISIWordImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ISIWordImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ISI_Word1_2* updates # if ISI_Word1_2 is starting this frame... if ISI_Word1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later ISI_Word1_2.frameNStart = frameN # exact frame index ISI_Word1_2.tStart = t # local t and not account for scr refresh ISI_Word1_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ISI_Word1_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_Word1_2.started') # update status ISI_Word1_2.status = STARTED ISI_Word1_2.setAutoDraw(True) # if ISI_Word1_2 is active this frame... if ISI_Word1_2.status == STARTED: # update params pass # if ISI_Word1_2 is stopping this frame... if ISI_Word1_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ISI_Word1_2.tStartRefresh + ISIWordPrac1-frameTolerance: # keep track of stop time/frame for later ISI_Word1_2.tStop = t # not accounting for scr refresh ISI_Word1_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_Word1_2.stopped') # update status ISI_Word1_2.status = FINISHED ISI_Word1_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ISIWordImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ISIWordImaPrac" --- for thisComponent in ISIWordImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ISIWordImaPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_9 send_markers(Markers.SILENTWORDS_PRACTICE_END_ISI) outlet.push_sample(['SilentWordsPracticeEndISI:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # the Routine "ISIWordImaPrac" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "SpeechWordImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('SpeechWordImaPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_33 send_markers(Markers.SILENTWORDS_PRACTICE_START_SPEECH) outlet.push_sample(['SilentWordsPracticeStartSpeech:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # keep track of which components have finished SpeechWordImaPracComponents = [SignOnsetSpeech_Word1_2, Brackets_SignOnset_Word1_2] for thisComponent in SpeechWordImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "SpeechWordImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 2.0: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *SignOnsetSpeech_Word1_2* updates # if SignOnsetSpeech_Word1_2 is starting this frame... if SignOnsetSpeech_Word1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SignOnsetSpeech_Word1_2.frameNStart = frameN # exact frame index SignOnsetSpeech_Word1_2.tStart = t # local t and not account for scr refresh SignOnsetSpeech_Word1_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SignOnsetSpeech_Word1_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_Word1_2.started') # update status SignOnsetSpeech_Word1_2.status = STARTED SignOnsetSpeech_Word1_2.setAutoDraw(True) # if SignOnsetSpeech_Word1_2 is active this frame... if SignOnsetSpeech_Word1_2.status == STARTED: # update params pass # if SignOnsetSpeech_Word1_2 is stopping this frame... if SignOnsetSpeech_Word1_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SignOnsetSpeech_Word1_2.tStartRefresh + 2-frameTolerance: # keep track of stop time/frame for later SignOnsetSpeech_Word1_2.tStop = t # not accounting for scr refresh SignOnsetSpeech_Word1_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_Word1_2.stopped') # update status SignOnsetSpeech_Word1_2.status = FINISHED SignOnsetSpeech_Word1_2.setAutoDraw(False) # *Brackets_SignOnset_Word1_2* updates # if Brackets_SignOnset_Word1_2 is starting this frame... if Brackets_SignOnset_Word1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Brackets_SignOnset_Word1_2.frameNStart = frameN # exact frame index Brackets_SignOnset_Word1_2.tStart = t # local t and not account for scr refresh Brackets_SignOnset_Word1_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Brackets_SignOnset_Word1_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Brackets_SignOnset_Word1_2.started') # update status Brackets_SignOnset_Word1_2.status = STARTED Brackets_SignOnset_Word1_2.setAutoDraw(True) # if Brackets_SignOnset_Word1_2 is active this frame... if Brackets_SignOnset_Word1_2.status == STARTED: # update params pass # if Brackets_SignOnset_Word1_2 is stopping this frame... if Brackets_SignOnset_Word1_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Brackets_SignOnset_Word1_2.tStartRefresh + 2-frameTolerance: # keep track of stop time/frame for later Brackets_SignOnset_Word1_2.tStop = t # not accounting for scr refresh Brackets_SignOnset_Word1_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Brackets_SignOnset_Word1_2.stopped') # update status Brackets_SignOnset_Word1_2.status = FINISHED Brackets_SignOnset_Word1_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in SpeechWordImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "SpeechWordImaPrac" --- for thisComponent in SpeechWordImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('SpeechWordImaPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_33 send_markers(Markers.SILENTWORDS_PRACTICE_END_SPEECH) outlet.push_sample(['SilentWordsPracticeEndSpeech:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-2.000000) # --- Prepare to start Routine "ITIWordImaPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ITIWordImaPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_34 send_markers(Markers.SILENTWORDS_PRACTICE_START_ITI) outlet.push_sample(['SilentWordsPracticeStartITI:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # keep track of which components have finished ITIWordImaPracComponents = [ITI_Word1_2] for thisComponent in ITIWordImaPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ITIWordImaPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ITI_Word1_2* updates # if ITI_Word1_2 is starting this frame... if ITI_Word1_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later ITI_Word1_2.frameNStart = frameN # exact frame index ITI_Word1_2.tStart = t # local t and not account for scr refresh ITI_Word1_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ITI_Word1_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ITI_Word1_2.started') # update status ITI_Word1_2.status = STARTED ITI_Word1_2.setAutoDraw(True) # if ITI_Word1_2 is active this frame... if ITI_Word1_2.status == STARTED: # update params pass # if ITI_Word1_2 is stopping this frame... if ITI_Word1_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ITI_Word1_2.tStartRefresh + 0.5-frameTolerance: # keep track of stop time/frame for later ITI_Word1_2.tStop = t # not accounting for scr refresh ITI_Word1_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ITI_Word1_2.stopped') # update status ITI_Word1_2.status = FINISHED ITI_Word1_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ITIWordImaPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ITIWordImaPrac" --- for thisComponent in ITIWordImaPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ITIWordImaPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_34 send_markers(Markers.SILENTWORDS_PRACTICE_END_ITI) outlet.push_sample(['SilentWordsPracticeEndITI:' + PresentationWordSilentPrac + "_" + WordSilentPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.500000) thisExp.nextEntry() if thisSession is not None: # if running in a Session with a Liaison client, send data up to now thisSession.sendExperimentData() # completed 1.0 repeats of 'trialWordsSilentPrac' # --- Prepare to start Routine "InstPracWordAloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('InstPracWordAloud.started', globalClock.getTime()) key_resp_14.keys = [] key_resp_14.rt = [] _key_resp_14_allKeys = [] # keep track of which components have finished InstPracWordAloudComponents = [text_20, key_resp_14] for thisComponent in InstPracWordAloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "InstPracWordAloud" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_20* updates # if text_20 is starting this frame... if text_20.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_20.frameNStart = frameN # exact frame index text_20.tStart = t # local t and not account for scr refresh text_20.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_20, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_20.started') # update status text_20.status = STARTED text_20.setAutoDraw(True) # if text_20 is active this frame... if text_20.status == STARTED: # update params pass # *key_resp_14* updates waitOnFlip = False # if key_resp_14 is starting this frame... if key_resp_14.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_14.frameNStart = frameN # exact frame index key_resp_14.tStart = t # local t and not account for scr refresh key_resp_14.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_14, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_14.started') # update status key_resp_14.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_14.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_14.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_14.status == STARTED and not waitOnFlip: theseKeys = key_resp_14.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_14_allKeys.extend(theseKeys) if len(_key_resp_14_allKeys): key_resp_14.keys = _key_resp_14_allKeys[-1].name # just the last key pressed key_resp_14.rt = _key_resp_14_allKeys[-1].rt key_resp_14.duration = _key_resp_14_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in InstPracWordAloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "InstPracWordAloud" --- for thisComponent in InstPracWordAloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('InstPracWordAloud.stopped', globalClock.getTime()) # check responses if key_resp_14.keys in ['', [], None]: # No response was made key_resp_14.keys = None thisExp.addData('key_resp_14.keys',key_resp_14.keys) if key_resp_14.keys != None: # we had a response thisExp.addData('key_resp_14.rt', key_resp_14.rt) thisExp.addData('key_resp_14.duration', key_resp_14.duration) thisExp.nextEntry() # the Routine "InstPracWordAloud" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc trialWordsAloudPrac = data.TrialHandler(nReps=1.0, method='random', extraInfo=expInfo, originPath=-1, trialList=data.importConditions(Presentation_List, selection='0:10'), seed=None, name='trialWordsAloudPrac') thisExp.addLoop(trialWordsAloudPrac) # add the loop to the experiment thisTrialWordsAloudPrac = trialWordsAloudPrac.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrialWordsAloudPrac.rgb) if thisTrialWordsAloudPrac != None: for paramName in thisTrialWordsAloudPrac: globals()[paramName] = thisTrialWordsAloudPrac[paramName] for thisTrialWordsAloudPrac in trialWordsAloudPrac: currentLoop = trialWordsAloudPrac thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrialWordsAloudPrac.rgb) if thisTrialWordsAloudPrac != None: for paramName in thisTrialWordsAloudPrac: globals()[paramName] = thisTrialWordsAloudPrac[paramName] # --- Prepare to start Routine "FixWordAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('FixWordAloudPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_10 FixWordPrac2 = minDur + (maxDur - minDur) * random.random() send_markers(Markers.REALWORDS_PRACTICE_START_FIXATION) outlet.push_sample(['RealWordsPracticeStartFixation:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # keep track of which components have finished FixWordAloudPracComponents = [Fix_for_Word_3] for thisComponent in FixWordAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "FixWordAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Fix_for_Word_3* updates # if Fix_for_Word_3 is starting this frame... if Fix_for_Word_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Fix_for_Word_3.frameNStart = frameN # exact frame index Fix_for_Word_3.tStart = t # local t and not account for scr refresh Fix_for_Word_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Fix_for_Word_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_Word_3.started') # update status Fix_for_Word_3.status = STARTED Fix_for_Word_3.setAutoDraw(True) # if Fix_for_Word_3 is active this frame... if Fix_for_Word_3.status == STARTED: # update params pass # if Fix_for_Word_3 is stopping this frame... if Fix_for_Word_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Fix_for_Word_3.tStartRefresh + FixWordPrac2-frameTolerance: # keep track of stop time/frame for later Fix_for_Word_3.tStop = t # not accounting for scr refresh Fix_for_Word_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_Word_3.stopped') # update status Fix_for_Word_3.status = FINISHED Fix_for_Word_3.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in FixWordAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "FixWordAloudPrac" --- for thisComponent in FixWordAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('FixWordAloudPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_10 send_markers(Markers.REALWORDS_PRACTICE_END_FIXATION) outlet.push_sample(['RealWordsPracticeEndFixation:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # the Routine "FixWordAloudPrac" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "TargetWordAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('TargetWordAloudPrac.started', globalClock.getTime()) BracketsTargetWordAloud_3.setText(BracketsWordsAloudL + " " + BracketsWordsAloudR) TargetPicWordAloud_3.setImage(WordPicAloudPrac) TargetTextAloud_3.setText(WordLowAloudPrac) TargetAudioWordAloud_3.setSound(WordAudioAloudPrac, secs=1, hamming=True) TargetAudioWordAloud_3.setVolume(1.0, log=False) TargetAudioWordAloud_3.seek(0) # Run 'Begin Routine' code from code_35 send_markers(Markers.REALWORDS_PRACTICE_START_STIMULUS) outlet.push_sample(['RealWordsPracticeStartStimulus:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # keep track of which components have finished TargetWordAloudPracComponents = [BracketsTargetWordAloud_3, TargetPicWordAloud_3, TargetTextAloud_3, TargetAudioWordAloud_3] for thisComponent in TargetWordAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "TargetWordAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 1.0: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *BracketsTargetWordAloud_3* updates # if BracketsTargetWordAloud_3 is starting this frame... if BracketsTargetWordAloud_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later BracketsTargetWordAloud_3.frameNStart = frameN # exact frame index BracketsTargetWordAloud_3.tStart = t # local t and not account for scr refresh BracketsTargetWordAloud_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(BracketsTargetWordAloud_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'BracketsTargetWordAloud_3.started') # update status BracketsTargetWordAloud_3.status = STARTED BracketsTargetWordAloud_3.setAutoDraw(True) # if BracketsTargetWordAloud_3 is active this frame... if BracketsTargetWordAloud_3.status == STARTED: # update params pass # if BracketsTargetWordAloud_3 is stopping this frame... if BracketsTargetWordAloud_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > BracketsTargetWordAloud_3.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later BracketsTargetWordAloud_3.tStop = t # not accounting for scr refresh BracketsTargetWordAloud_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'BracketsTargetWordAloud_3.stopped') # update status BracketsTargetWordAloud_3.status = FINISHED BracketsTargetWordAloud_3.setAutoDraw(False) # *TargetPicWordAloud_3* updates # if TargetPicWordAloud_3 is starting this frame... if TargetPicWordAloud_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later TargetPicWordAloud_3.frameNStart = frameN # exact frame index TargetPicWordAloud_3.tStart = t # local t and not account for scr refresh TargetPicWordAloud_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(TargetPicWordAloud_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetPicWordAloud_3.started') # update status TargetPicWordAloud_3.status = STARTED TargetPicWordAloud_3.setAutoDraw(True) # if TargetPicWordAloud_3 is active this frame... if TargetPicWordAloud_3.status == STARTED: # update params pass # if TargetPicWordAloud_3 is stopping this frame... if TargetPicWordAloud_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > TargetPicWordAloud_3.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later TargetPicWordAloud_3.tStop = t # not accounting for scr refresh TargetPicWordAloud_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetPicWordAloud_3.stopped') # update status TargetPicWordAloud_3.status = FINISHED TargetPicWordAloud_3.setAutoDraw(False) # *TargetTextAloud_3* updates # if TargetTextAloud_3 is starting this frame... if TargetTextAloud_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later TargetTextAloud_3.frameNStart = frameN # exact frame index TargetTextAloud_3.tStart = t # local t and not account for scr refresh TargetTextAloud_3.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(TargetTextAloud_3, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetTextAloud_3.started') # update status TargetTextAloud_3.status = STARTED TargetTextAloud_3.setAutoDraw(True) # if TargetTextAloud_3 is active this frame... if TargetTextAloud_3.status == STARTED: # update params pass # if TargetTextAloud_3 is stopping this frame... if TargetTextAloud_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > TargetTextAloud_3.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later TargetTextAloud_3.tStop = t # not accounting for scr refresh TargetTextAloud_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetTextAloud_3.stopped') # update status TargetTextAloud_3.status = FINISHED TargetTextAloud_3.setAutoDraw(False) # if TargetAudioWordAloud_3 is starting this frame... if TargetAudioWordAloud_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later TargetAudioWordAloud_3.frameNStart = frameN # exact frame index TargetAudioWordAloud_3.tStart = t # local t and not account for scr refresh TargetAudioWordAloud_3.tStartRefresh = tThisFlipGlobal # on global time # add timestamp to datafile thisExp.addData('TargetAudioWordAloud_3.started', tThisFlipGlobal) # update status TargetAudioWordAloud_3.status = STARTED TargetAudioWordAloud_3.play(when=win) # sync with win flip # if TargetAudioWordAloud_3 is stopping this frame... if TargetAudioWordAloud_3.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > TargetAudioWordAloud_3.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later TargetAudioWordAloud_3.tStop = t # not accounting for scr refresh TargetAudioWordAloud_3.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetAudioWordAloud_3.stopped') # update status TargetAudioWordAloud_3.status = FINISHED TargetAudioWordAloud_3.stop() # update TargetAudioWordAloud_3 status according to whether it's playing if TargetAudioWordAloud_3.isPlaying: TargetAudioWordAloud_3.status = STARTED elif TargetAudioWordAloud_3.isFinished: TargetAudioWordAloud_3.status = FINISHED # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in TargetWordAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "TargetWordAloudPrac" --- for thisComponent in TargetWordAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('TargetWordAloudPrac.stopped', globalClock.getTime()) TargetAudioWordAloud_3.pause() # ensure sound has stopped at end of Routine # Run 'End Routine' code from code_35 send_markers(Markers.REALWORDS_PRACTICE_END_STIMULUS) outlet.push_sample(['RealWordsPracticeEndStimulus:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-1.000000) # --- Prepare to start Routine "ISIWordAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ISIWordAloudPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_11 ISIWordPrac2 = minDur + (maxDur - minDur) * random.random() send_markers(Markers.REALWORDS_PRACTICE_START_ISI) outlet.push_sample(['RealWordsPracticeStartISI:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # keep track of which components have finished ISIWordAloudPracComponents = [ISI_Word2_2] for thisComponent in ISIWordAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ISIWordAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ISI_Word2_2* updates # if ISI_Word2_2 is starting this frame... if ISI_Word2_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later ISI_Word2_2.frameNStart = frameN # exact frame index ISI_Word2_2.tStart = t # local t and not account for scr refresh ISI_Word2_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ISI_Word2_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_Word2_2.started') # update status ISI_Word2_2.status = STARTED ISI_Word2_2.setAutoDraw(True) # if ISI_Word2_2 is active this frame... if ISI_Word2_2.status == STARTED: # update params pass # if ISI_Word2_2 is stopping this frame... if ISI_Word2_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ISI_Word2_2.tStartRefresh + ISIWordPrac2-frameTolerance: # keep track of stop time/frame for later ISI_Word2_2.tStop = t # not accounting for scr refresh ISI_Word2_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_Word2_2.stopped') # update status ISI_Word2_2.status = FINISHED ISI_Word2_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ISIWordAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ISIWordAloudPrac" --- for thisComponent in ISIWordAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ISIWordAloudPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_11 send_markers(Markers.REALWORDS_PRACTICE_END_ISI) outlet.push_sample(['RealWordsPracticeEndISI:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # the Routine "ISIWordAloudPrac" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "SpeechWordAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('SpeechWordAloudPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_36 send_markers(Markers.REALWORDS_PRACTICE_START_SPEECH) outlet.push_sample(['RealWordsPracticeStartSpeech:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # keep track of which components have finished SpeechWordAloudPracComponents = [BracketsSingOnsetAloud_2, text_18] for thisComponent in SpeechWordAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "SpeechWordAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 2.0: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *BracketsSingOnsetAloud_2* updates # if BracketsSingOnsetAloud_2 is starting this frame... if BracketsSingOnsetAloud_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later BracketsSingOnsetAloud_2.frameNStart = frameN # exact frame index BracketsSingOnsetAloud_2.tStart = t # local t and not account for scr refresh BracketsSingOnsetAloud_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(BracketsSingOnsetAloud_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'BracketsSingOnsetAloud_2.started') # update status BracketsSingOnsetAloud_2.status = STARTED BracketsSingOnsetAloud_2.setAutoDraw(True) # if BracketsSingOnsetAloud_2 is active this frame... if BracketsSingOnsetAloud_2.status == STARTED: # update params pass # if BracketsSingOnsetAloud_2 is stopping this frame... if BracketsSingOnsetAloud_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > BracketsSingOnsetAloud_2.tStartRefresh + 2-frameTolerance: # keep track of stop time/frame for later BracketsSingOnsetAloud_2.tStop = t # not accounting for scr refresh BracketsSingOnsetAloud_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'BracketsSingOnsetAloud_2.stopped') # update status BracketsSingOnsetAloud_2.status = FINISHED BracketsSingOnsetAloud_2.setAutoDraw(False) # *text_18* updates # if text_18 is starting this frame... if text_18.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_18.frameNStart = frameN # exact frame index text_18.tStart = t # local t and not account for scr refresh text_18.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_18, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_18.started') # update status text_18.status = STARTED text_18.setAutoDraw(True) # if text_18 is active this frame... if text_18.status == STARTED: # update params pass # if text_18 is stopping this frame... if text_18.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_18.tStartRefresh + 2-frameTolerance: # keep track of stop time/frame for later text_18.tStop = t # not accounting for scr refresh text_18.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_18.stopped') # update status text_18.status = FINISHED text_18.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in SpeechWordAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "SpeechWordAloudPrac" --- for thisComponent in SpeechWordAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('SpeechWordAloudPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_36 send_markers(Markers.REALWORDS_PRACTICE_END_SPEECH) outlet.push_sample(['RealWordsPracticeEndSpeech:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-2.000000) # --- Prepare to start Routine "ITIWordAloudPrac" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ITIWordAloudPrac.started', globalClock.getTime()) # Run 'Begin Routine' code from code_37 send_markers(Markers.REALWORDS_PRACTICE_START_ITI) outlet.push_sample(['RealWordsPracticeStartITI:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # keep track of which components have finished ITIWordAloudPracComponents = [text_19] for thisComponent in ITIWordAloudPracComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ITIWordAloudPrac" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_19* updates # if text_19 is starting this frame... if text_19.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_19.frameNStart = frameN # exact frame index text_19.tStart = t # local t and not account for scr refresh text_19.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_19, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_19.started') # update status text_19.status = STARTED text_19.setAutoDraw(True) # if text_19 is active this frame... if text_19.status == STARTED: # update params pass # if text_19 is stopping this frame... if text_19.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_19.tStartRefresh + 0.5-frameTolerance: # keep track of stop time/frame for later text_19.tStop = t # not accounting for scr refresh text_19.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_19.stopped') # update status text_19.status = FINISHED text_19.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ITIWordAloudPracComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ITIWordAloudPrac" --- for thisComponent in ITIWordAloudPracComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ITIWordAloudPrac.stopped', globalClock.getTime()) # Run 'End Routine' code from code_37 send_markers(Markers.REALWORDS_PRACTICE_END_ITI) outlet.push_sample(['RealWordsPracticeEndITI:' + PresentationWordAloudPrac + "_" + WordAloudPrac]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.500000) thisExp.nextEntry() if thisSession is not None: # if running in a Session with a Liaison client, send data up to now thisSession.sendExperimentData() # completed 1.0 repeats of 'trialWordsAloudPrac' # --- Prepare to start Routine "EXPInicio" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('EXPInicio.started', globalClock.getTime()) key_resp_11.keys = [] key_resp_11.rt = [] _key_resp_11_allKeys = [] # keep track of which components have finished EXPInicioComponents = [text_15, key_resp_11] for thisComponent in EXPInicioComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "EXPInicio" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_15* updates # if text_15 is starting this frame... if text_15.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_15.frameNStart = frameN # exact frame index text_15.tStart = t # local t and not account for scr refresh text_15.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_15, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_15.started') # update status text_15.status = STARTED text_15.setAutoDraw(True) # if text_15 is active this frame... if text_15.status == STARTED: # update params pass # *key_resp_11* updates waitOnFlip = False # if key_resp_11 is starting this frame... if key_resp_11.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_11.frameNStart = frameN # exact frame index key_resp_11.tStart = t # local t and not account for scr refresh key_resp_11.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_11, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_11.started') # update status key_resp_11.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_11.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_11.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_11.status == STARTED and not waitOnFlip: theseKeys = key_resp_11.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_11_allKeys.extend(theseKeys) if len(_key_resp_11_allKeys): key_resp_11.keys = _key_resp_11_allKeys[-1].name # just the last key pressed key_resp_11.rt = _key_resp_11_allKeys[-1].rt key_resp_11.duration = _key_resp_11_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in EXPInicioComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "EXPInicio" --- for thisComponent in EXPInicioComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('EXPInicio.stopped', globalClock.getTime()) # check responses if key_resp_11.keys in ['', [], None]: # No response was made key_resp_11.keys = None thisExp.addData('key_resp_11.keys',key_resp_11.keys) if key_resp_11.keys != None: # we had a response thisExp.addData('key_resp_11.rt', key_resp_11.rt) thisExp.addData('key_resp_11.duration', key_resp_11.duration) thisExp.nextEntry() # the Routine "EXPInicio" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc trials_Words = data.TrialHandler(nReps=13.0, method='random', extraInfo=expInfo, originPath=-1, trialList=[None], seed=None, name='trials_Words') thisExp.addLoop(trials_Words) # add the loop to the experiment thisTrials_Word = trials_Words.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrials_Word.rgb) if thisTrials_Word != None: for paramName in thisTrials_Word: globals()[paramName] = thisTrials_Word[paramName] for thisTrials_Word in trials_Words: currentLoop = trials_Words thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrials_Word.rgb) if thisTrials_Word != None: for paramName in thisTrials_Word: globals()[paramName] = thisTrials_Word[paramName] # --- Prepare to start Routine "SilentSpeechWord_Instruc" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('SilentSpeechWord_Instruc.started', globalClock.getTime()) SilentWOrdInst.keys = [] SilentWOrdInst.rt = [] _SilentWOrdInst_allKeys = [] # Run 'Begin Routine' code from RowSelecWord if (trials_Words.thisN ==0): use_rows2 = str('0:20') if (trials_Words.thisN ==1): use_rows2 = str('20:40') if (trials_Words.thisN ==2): use_rows2 = str('40:60') if (trials_Words.thisN ==3): use_rows2 = str('60:80') if (trials_Words.thisN ==4): use_rows2 = str('80:100') if (trials_Words.thisN ==5): use_rows2 = str('100:120') if (trials_Words.thisN ==6): use_rows2 = str('120:140') if (trials_Words.thisN ==7): use_rows2 = str('140:160') if (trials_Words.thisN ==8): use_rows2 = str('160:180') if (trials_Words.thisN ==9): use_rows2 = str('180:200') if (trials_Words.thisN ==10): use_rows2 = str('200:220') if (trials_Words.thisN ==11): use_rows2 = str('220:240') if (trials_Words.thisN ==12): use_rows2 = str('240:255') # keep track of which components have finished SilentSpeechWord_InstrucComponents = [InstrucSilent_Word, SilentWOrdInst] for thisComponent in SilentSpeechWord_InstrucComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "SilentSpeechWord_Instruc" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *InstrucSilent_Word* updates # if InstrucSilent_Word is starting this frame... if InstrucSilent_Word.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later InstrucSilent_Word.frameNStart = frameN # exact frame index InstrucSilent_Word.tStart = t # local t and not account for scr refresh InstrucSilent_Word.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(InstrucSilent_Word, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'InstrucSilent_Word.started') # update status InstrucSilent_Word.status = STARTED InstrucSilent_Word.setAutoDraw(True) # if InstrucSilent_Word is active this frame... if InstrucSilent_Word.status == STARTED: # update params pass # *SilentWOrdInst* updates waitOnFlip = False # if SilentWOrdInst is starting this frame... if SilentWOrdInst.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SilentWOrdInst.frameNStart = frameN # exact frame index SilentWOrdInst.tStart = t # local t and not account for scr refresh SilentWOrdInst.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SilentWOrdInst, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SilentWOrdInst.started') # update status SilentWOrdInst.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(SilentWOrdInst.clock.reset) # t=0 on next screen flip win.callOnFlip(SilentWOrdInst.clearEvents, eventType='keyboard') # clear events on next screen flip if SilentWOrdInst.status == STARTED and not waitOnFlip: theseKeys = SilentWOrdInst.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _SilentWOrdInst_allKeys.extend(theseKeys) if len(_SilentWOrdInst_allKeys): SilentWOrdInst.keys = _SilentWOrdInst_allKeys[-1].name # just the last key pressed SilentWOrdInst.rt = _SilentWOrdInst_allKeys[-1].rt SilentWOrdInst.duration = _SilentWOrdInst_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in SilentSpeechWord_InstrucComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "SilentSpeechWord_Instruc" --- for thisComponent in SilentSpeechWord_InstrucComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('SilentSpeechWord_Instruc.stopped', globalClock.getTime()) # check responses if SilentWOrdInst.keys in ['', [], None]: # No response was made SilentWOrdInst.keys = None trials_Words.addData('SilentWOrdInst.keys',SilentWOrdInst.keys) if SilentWOrdInst.keys != None: # we had a response trials_Words.addData('SilentWOrdInst.rt', SilentWOrdInst.rt) trials_Words.addData('SilentWOrdInst.duration', SilentWOrdInst.duration) # the Routine "SilentSpeechWord_Instruc" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc TrialWordSilent = data.TrialHandler(nReps=1.0, method='sequential', extraInfo=expInfo, originPath=-1, trialList=data.importConditions(Presentation_List, selection=use_rows2), seed=None, name='TrialWordSilent') thisExp.addLoop(TrialWordSilent) # add the loop to the experiment thisTrialWordSilent = TrialWordSilent.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrialWordSilent.rgb) if thisTrialWordSilent != None: for paramName in thisTrialWordSilent: globals()[paramName] = thisTrialWordSilent[paramName] for thisTrialWordSilent in TrialWordSilent: currentLoop = TrialWordSilent thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrialWordSilent.rgb) if thisTrialWordSilent != None: for paramName in thisTrialWordSilent: globals()[paramName] = thisTrialWordSilent[paramName] # --- Prepare to start Routine "Fix_Word_Ima" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Fix_Word_Ima.started', globalClock.getTime()) # Run 'Begin Routine' code from code_3 FixWordima = minDur + (maxDur - minDur) * random.random() send_markers(Markers.SILENTWORDS_EXPERIMENT_START_FIXATION) outlet.push_sample(['SilentWordsExperimentStartFixation:' + PresentationWordSilent + "_" + WordSilent]) # keep track of which components have finished Fix_Word_ImaComponents = [Fix_for_Word] for thisComponent in Fix_Word_ImaComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Fix_Word_Ima" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Fix_for_Word* updates # if Fix_for_Word is starting this frame... if Fix_for_Word.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Fix_for_Word.frameNStart = frameN # exact frame index Fix_for_Word.tStart = t # local t and not account for scr refresh Fix_for_Word.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Fix_for_Word, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_Word.started') # update status Fix_for_Word.status = STARTED Fix_for_Word.setAutoDraw(True) # if Fix_for_Word is active this frame... if Fix_for_Word.status == STARTED: # update params pass # if Fix_for_Word is stopping this frame... if Fix_for_Word.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Fix_for_Word.tStartRefresh + FixWordima-frameTolerance: # keep track of stop time/frame for later Fix_for_Word.tStop = t # not accounting for scr refresh Fix_for_Word.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Fix_for_Word.stopped') # update status Fix_for_Word.status = FINISHED Fix_for_Word.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Fix_Word_ImaComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Fix_Word_Ima" --- for thisComponent in Fix_Word_ImaComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Fix_Word_Ima.stopped', globalClock.getTime()) # Run 'End Routine' code from code_3 send_markers(Markers.SILENTWORDS_EXPERIMENT_END_FIXATION) outlet.push_sample(['SilentWordsExperimentEndFixation:' + PresentationWordSilent + "_" + WordSilent]) # the Routine "Fix_Word_Ima" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "Target_Word_Ima" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Target_Word_Ima.started', globalClock.getTime()) bracketsTarget_WordSilent.setText(BracketsWordsSilentL + " " + BracketsWordsSilentR) Target_Pic_WordSilent.setImage(WordPicSilent) TargetText_WordSilent.setText(WordLowSilent) Target_Sound_WordSilent.setSound(WordAudioSilent, secs=1, hamming=True) Target_Sound_WordSilent.setVolume(1.0, log=False) Target_Sound_WordSilent.seek(0) # Run 'Begin Routine' code from code_18 send_markers(Markers.SILENTWORDS_EXPERIMENT_START_STIMULUS) outlet.push_sample(['SilentWordsExperimentStartStimulus:' + PresentationWordSilent + "_" + WordSilent]) # keep track of which components have finished Target_Word_ImaComponents = [bracketsTarget_WordSilent, Target_Pic_WordSilent, TargetText_WordSilent, Target_Sound_WordSilent] for thisComponent in Target_Word_ImaComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Target_Word_Ima" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 1.0: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *bracketsTarget_WordSilent* updates # if bracketsTarget_WordSilent is starting this frame... if bracketsTarget_WordSilent.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later bracketsTarget_WordSilent.frameNStart = frameN # exact frame index bracketsTarget_WordSilent.tStart = t # local t and not account for scr refresh bracketsTarget_WordSilent.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(bracketsTarget_WordSilent, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_WordSilent.started') # update status bracketsTarget_WordSilent.status = STARTED bracketsTarget_WordSilent.setAutoDraw(True) # if bracketsTarget_WordSilent is active this frame... if bracketsTarget_WordSilent.status == STARTED: # update params pass # if bracketsTarget_WordSilent is stopping this frame... if bracketsTarget_WordSilent.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > bracketsTarget_WordSilent.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later bracketsTarget_WordSilent.tStop = t # not accounting for scr refresh bracketsTarget_WordSilent.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'bracketsTarget_WordSilent.stopped') # update status bracketsTarget_WordSilent.status = FINISHED bracketsTarget_WordSilent.setAutoDraw(False) # *Target_Pic_WordSilent* updates # if Target_Pic_WordSilent is starting this frame... if Target_Pic_WordSilent.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_Pic_WordSilent.frameNStart = frameN # exact frame index Target_Pic_WordSilent.tStart = t # local t and not account for scr refresh Target_Pic_WordSilent.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Target_Pic_WordSilent, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_Pic_WordSilent.started') # update status Target_Pic_WordSilent.status = STARTED Target_Pic_WordSilent.setAutoDraw(True) # if Target_Pic_WordSilent is active this frame... if Target_Pic_WordSilent.status == STARTED: # update params pass # if Target_Pic_WordSilent is stopping this frame... if Target_Pic_WordSilent.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_Pic_WordSilent.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later Target_Pic_WordSilent.tStop = t # not accounting for scr refresh Target_Pic_WordSilent.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_Pic_WordSilent.stopped') # update status Target_Pic_WordSilent.status = FINISHED Target_Pic_WordSilent.setAutoDraw(False) # *TargetText_WordSilent* updates # if TargetText_WordSilent is starting this frame... if TargetText_WordSilent.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later TargetText_WordSilent.frameNStart = frameN # exact frame index TargetText_WordSilent.tStart = t # local t and not account for scr refresh TargetText_WordSilent.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(TargetText_WordSilent, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetText_WordSilent.started') # update status TargetText_WordSilent.status = STARTED TargetText_WordSilent.setAutoDraw(True) # if TargetText_WordSilent is active this frame... if TargetText_WordSilent.status == STARTED: # update params pass # if TargetText_WordSilent is stopping this frame... if TargetText_WordSilent.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > TargetText_WordSilent.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later TargetText_WordSilent.tStop = t # not accounting for scr refresh TargetText_WordSilent.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetText_WordSilent.stopped') # update status TargetText_WordSilent.status = FINISHED TargetText_WordSilent.setAutoDraw(False) # if Target_Sound_WordSilent is starting this frame... if Target_Sound_WordSilent.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Target_Sound_WordSilent.frameNStart = frameN # exact frame index Target_Sound_WordSilent.tStart = t # local t and not account for scr refresh Target_Sound_WordSilent.tStartRefresh = tThisFlipGlobal # on global time # add timestamp to datafile thisExp.addData('Target_Sound_WordSilent.started', tThisFlipGlobal) # update status Target_Sound_WordSilent.status = STARTED Target_Sound_WordSilent.play(when=win) # sync with win flip # if Target_Sound_WordSilent is stopping this frame... if Target_Sound_WordSilent.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Target_Sound_WordSilent.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later Target_Sound_WordSilent.tStop = t # not accounting for scr refresh Target_Sound_WordSilent.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Target_Sound_WordSilent.stopped') # update status Target_Sound_WordSilent.status = FINISHED Target_Sound_WordSilent.stop() # update Target_Sound_WordSilent status according to whether it's playing if Target_Sound_WordSilent.isPlaying: Target_Sound_WordSilent.status = STARTED elif Target_Sound_WordSilent.isFinished: Target_Sound_WordSilent.status = FINISHED # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Target_Word_ImaComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Target_Word_Ima" --- for thisComponent in Target_Word_ImaComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Target_Word_Ima.stopped', globalClock.getTime()) Target_Sound_WordSilent.pause() # ensure sound has stopped at end of Routine # Run 'End Routine' code from code_18 send_markers(Markers.SILENTWORDS_EXPERIMENT_END_STIMULUS) outlet.push_sample(['SilentWordsExperimentEndStimulus:' + PresentationWordSilent + "_" + WordSilent]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-1.000000) # --- Prepare to start Routine "ISI_Word_Ima" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ISI_Word_Ima.started', globalClock.getTime()) # Run 'Begin Routine' code from code_4 ISIWordima = minDur + (maxDur - minDur) * random.random() send_markers(Markers.SILENTWORDS_EXPERIMENT_START_ISI) outlet.push_sample(['SilentWordsExperimentStartISI:' + PresentationWordSilent + "_" + WordSilent]) # keep track of which components have finished ISI_Word_ImaComponents = [ISI_Word1] for thisComponent in ISI_Word_ImaComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ISI_Word_Ima" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ISI_Word1* updates # if ISI_Word1 is starting this frame... if ISI_Word1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later ISI_Word1.frameNStart = frameN # exact frame index ISI_Word1.tStart = t # local t and not account for scr refresh ISI_Word1.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ISI_Word1, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_Word1.started') # update status ISI_Word1.status = STARTED ISI_Word1.setAutoDraw(True) # if ISI_Word1 is active this frame... if ISI_Word1.status == STARTED: # update params pass # if ISI_Word1 is stopping this frame... if ISI_Word1.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ISI_Word1.tStartRefresh + ISIWordima-frameTolerance: # keep track of stop time/frame for later ISI_Word1.tStop = t # not accounting for scr refresh ISI_Word1.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_Word1.stopped') # update status ISI_Word1.status = FINISHED ISI_Word1.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ISI_Word_ImaComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ISI_Word_Ima" --- for thisComponent in ISI_Word_ImaComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ISI_Word_Ima.stopped', globalClock.getTime()) # Run 'End Routine' code from code_4 send_markers(Markers.SILENTWORDS_EXPERIMENT_END_ISI) outlet.push_sample(['SilentWordsExperimentEndISI:' + PresentationWordSilent + "_" + WordSilent]) # the Routine "ISI_Word_Ima" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "Speech_Word_Ima" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Speech_Word_Ima.started', globalClock.getTime()) # Run 'Begin Routine' code from code_19 send_markers(Markers.SILENTWORDS_EXPERIMENT_START_SPEECH) outlet.push_sample(['SilentWordsExperimentStartSpeech:' + PresentationWordSilent + "_" + WordSilent]) # keep track of which components have finished Speech_Word_ImaComponents = [SignOnsetSpeech_Word1, Brackets_SignOnset_Word1] for thisComponent in Speech_Word_ImaComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Speech_Word_Ima" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 2.0: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *SignOnsetSpeech_Word1* updates # if SignOnsetSpeech_Word1 is starting this frame... if SignOnsetSpeech_Word1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later SignOnsetSpeech_Word1.frameNStart = frameN # exact frame index SignOnsetSpeech_Word1.tStart = t # local t and not account for scr refresh SignOnsetSpeech_Word1.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(SignOnsetSpeech_Word1, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_Word1.started') # update status SignOnsetSpeech_Word1.status = STARTED SignOnsetSpeech_Word1.setAutoDraw(True) # if SignOnsetSpeech_Word1 is active this frame... if SignOnsetSpeech_Word1.status == STARTED: # update params pass # if SignOnsetSpeech_Word1 is stopping this frame... if SignOnsetSpeech_Word1.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > SignOnsetSpeech_Word1.tStartRefresh + 2-frameTolerance: # keep track of stop time/frame for later SignOnsetSpeech_Word1.tStop = t # not accounting for scr refresh SignOnsetSpeech_Word1.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'SignOnsetSpeech_Word1.stopped') # update status SignOnsetSpeech_Word1.status = FINISHED SignOnsetSpeech_Word1.setAutoDraw(False) # *Brackets_SignOnset_Word1* updates # if Brackets_SignOnset_Word1 is starting this frame... if Brackets_SignOnset_Word1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Brackets_SignOnset_Word1.frameNStart = frameN # exact frame index Brackets_SignOnset_Word1.tStart = t # local t and not account for scr refresh Brackets_SignOnset_Word1.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Brackets_SignOnset_Word1, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Brackets_SignOnset_Word1.started') # update status Brackets_SignOnset_Word1.status = STARTED Brackets_SignOnset_Word1.setAutoDraw(True) # if Brackets_SignOnset_Word1 is active this frame... if Brackets_SignOnset_Word1.status == STARTED: # update params pass # if Brackets_SignOnset_Word1 is stopping this frame... if Brackets_SignOnset_Word1.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > Brackets_SignOnset_Word1.tStartRefresh + 2-frameTolerance: # keep track of stop time/frame for later Brackets_SignOnset_Word1.tStop = t # not accounting for scr refresh Brackets_SignOnset_Word1.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'Brackets_SignOnset_Word1.stopped') # update status Brackets_SignOnset_Word1.status = FINISHED Brackets_SignOnset_Word1.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Speech_Word_ImaComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Speech_Word_Ima" --- for thisComponent in Speech_Word_ImaComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Speech_Word_Ima.stopped', globalClock.getTime()) # Run 'End Routine' code from code_19 send_markers(Markers.SILENTWORDS_EXPERIMENT_END_SPEECH) outlet.push_sample(['SilentWordsExperimentEndSpeech:' + PresentationWordSilent + "_" + WordSilent]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-2.000000) # --- Prepare to start Routine "ITI_Word_Ima" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ITI_Word_Ima.started', globalClock.getTime()) # Run 'Begin Routine' code from code_20 send_markers(Markers.SILENTWORDS_EXPERIMENT_START_ITI) outlet.push_sample(['SilentWordsExperimentStartITI:' + PresentationWordSilent + "_" + WordSilent]) # keep track of which components have finished ITI_Word_ImaComponents = [ITI_Word1] for thisComponent in ITI_Word_ImaComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ITI_Word_Ima" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ITI_Word1* updates # if ITI_Word1 is starting this frame... if ITI_Word1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later ITI_Word1.frameNStart = frameN # exact frame index ITI_Word1.tStart = t # local t and not account for scr refresh ITI_Word1.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ITI_Word1, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ITI_Word1.started') # update status ITI_Word1.status = STARTED ITI_Word1.setAutoDraw(True) # if ITI_Word1 is active this frame... if ITI_Word1.status == STARTED: # update params pass # if ITI_Word1 is stopping this frame... if ITI_Word1.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ITI_Word1.tStartRefresh + 0.5-frameTolerance: # keep track of stop time/frame for later ITI_Word1.tStop = t # not accounting for scr refresh ITI_Word1.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ITI_Word1.stopped') # update status ITI_Word1.status = FINISHED ITI_Word1.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ITI_Word_ImaComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ITI_Word_Ima" --- for thisComponent in ITI_Word_ImaComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ITI_Word_Ima.stopped', globalClock.getTime()) # Run 'End Routine' code from code_20 send_markers(Markers.SILENTWORDS_EXPERIMENT_END_ITI) outlet.push_sample(['SilentWordsExperimentEndITI:' + PresentationWordSilent + "_" + WordSilent]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.500000) thisExp.nextEntry() if thisSession is not None: # if running in a Session with a Liaison client, send data up to now thisSession.sendExperimentData() # completed 1.0 repeats of 'TrialWordSilent' # --- Prepare to start Routine "AloudSpeech_Word_Instruc" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('AloudSpeech_Word_Instruc.started', globalClock.getTime()) key_resp_7.keys = [] key_resp_7.rt = [] _key_resp_7_allKeys = [] # keep track of which components have finished AloudSpeech_Word_InstrucComponents = [InstrucAloud_Word, key_resp_7] for thisComponent in AloudSpeech_Word_InstrucComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "AloudSpeech_Word_Instruc" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *InstrucAloud_Word* updates # if InstrucAloud_Word is starting this frame... if InstrucAloud_Word.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later InstrucAloud_Word.frameNStart = frameN # exact frame index InstrucAloud_Word.tStart = t # local t and not account for scr refresh InstrucAloud_Word.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(InstrucAloud_Word, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'InstrucAloud_Word.started') # update status InstrucAloud_Word.status = STARTED InstrucAloud_Word.setAutoDraw(True) # if InstrucAloud_Word is active this frame... if InstrucAloud_Word.status == STARTED: # update params pass # *key_resp_7* updates waitOnFlip = False # if key_resp_7 is starting this frame... if key_resp_7.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_7.frameNStart = frameN # exact frame index key_resp_7.tStart = t # local t and not account for scr refresh key_resp_7.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_7, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_7.started') # update status key_resp_7.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_7.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_7.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_7.status == STARTED and not waitOnFlip: theseKeys = key_resp_7.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_7_allKeys.extend(theseKeys) if len(_key_resp_7_allKeys): key_resp_7.keys = _key_resp_7_allKeys[-1].name # just the last key pressed key_resp_7.rt = _key_resp_7_allKeys[-1].rt key_resp_7.duration = _key_resp_7_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in AloudSpeech_Word_InstrucComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "AloudSpeech_Word_Instruc" --- for thisComponent in AloudSpeech_Word_InstrucComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('AloudSpeech_Word_Instruc.stopped', globalClock.getTime()) # check responses if key_resp_7.keys in ['', [], None]: # No response was made key_resp_7.keys = None trials_Words.addData('key_resp_7.keys',key_resp_7.keys) if key_resp_7.keys != None: # we had a response trials_Words.addData('key_resp_7.rt', key_resp_7.rt) trials_Words.addData('key_resp_7.duration', key_resp_7.duration) # the Routine "AloudSpeech_Word_Instruc" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # set up handler to look after randomisation of conditions etc TrialWordAloud = data.TrialHandler(nReps=1.0, method='sequential', extraInfo=expInfo, originPath=-1, trialList=data.importConditions(Presentation_List, selection=use_rows2), seed=None, name='TrialWordAloud') thisExp.addLoop(TrialWordAloud) # add the loop to the experiment thisTrialWordAloud = TrialWordAloud.trialList[0] # so we can initialise stimuli with some values # abbreviate parameter names if possible (e.g. rgb = thisTrialWordAloud.rgb) if thisTrialWordAloud != None: for paramName in thisTrialWordAloud: globals()[paramName] = thisTrialWordAloud[paramName] for thisTrialWordAloud in TrialWordAloud: currentLoop = TrialWordAloud thisExp.timestampOnFlip(win, 'thisRow.t') # pause experiment here if requested if thisExp.status == PAUSED: pauseExperiment( thisExp=thisExp, inputs=inputs, win=win, timers=[routineTimer], playbackComponents=[] ) # abbreviate parameter names if possible (e.g. rgb = thisTrialWordAloud.rgb) if thisTrialWordAloud != None: for paramName in thisTrialWordAloud: globals()[paramName] = thisTrialWordAloud[paramName] # --- Prepare to start Routine "Fix_Word_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Fix_Word_Aloud.started', globalClock.getTime()) # Run 'Begin Routine' code from code_6 FixWordaloud = minDur + (maxDur - minDur) * random.random() send_markers(Markers.REALWORDS_EXPERIMENT_START_FIXATION) outlet.push_sample(['RealWordsExperimentStartFixation:' + PresentationWordAloud + "_" + WordAloud]) # keep track of which components have finished Fix_Word_AloudComponents = [text_2] for thisComponent in Fix_Word_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Fix_Word_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_2* updates # if text_2 is starting this frame... if text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_2.frameNStart = frameN # exact frame index text_2.tStart = t # local t and not account for scr refresh text_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_2.started') # update status text_2.status = STARTED text_2.setAutoDraw(True) # if text_2 is active this frame... if text_2.status == STARTED: # update params pass # if text_2 is stopping this frame... if text_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_2.tStartRefresh + FixWordaloud-frameTolerance: # keep track of stop time/frame for later text_2.tStop = t # not accounting for scr refresh text_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_2.stopped') # update status text_2.status = FINISHED text_2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Fix_Word_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Fix_Word_Aloud" --- for thisComponent in Fix_Word_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Fix_Word_Aloud.stopped', globalClock.getTime()) # Run 'End Routine' code from code_6 send_markers(Markers.REALWORDS_EXPERIMENT_END_FIXATION) outlet.push_sample(['RealWordsExperimentEndFixation:' + PresentationWordAloud + "_" + WordAloud]) # the Routine "Fix_Word_Aloud" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "Target_Word_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Target_Word_Aloud.started', globalClock.getTime()) BracketsTargetWordAloud_2.setText(BracketsWordsAloudL + " " + BracketsWordsAloudR) TargetPicWordAloud_2.setImage(WordPicAloud) TargetTextAloud_2.setText(WordLowAloud) TargetAudioWordAloud_2.setSound(WordAudioAloud, secs=1, hamming=True) TargetAudioWordAloud_2.setVolume(1.0, log=False) TargetAudioWordAloud_2.seek(0) # Run 'Begin Routine' code from code_21 send_markers(Markers.REALWORDS_EXPERIMENT_START_STIMULUS) outlet.push_sample(['RealWordsExperimentStartStimulus:' + PresentationWordAloud + "_" + WordAloud]) # keep track of which components have finished Target_Word_AloudComponents = [BracketsTargetWordAloud_2, TargetPicWordAloud_2, TargetTextAloud_2, TargetAudioWordAloud_2] for thisComponent in Target_Word_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Target_Word_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 1.0: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *BracketsTargetWordAloud_2* updates # if BracketsTargetWordAloud_2 is starting this frame... if BracketsTargetWordAloud_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later BracketsTargetWordAloud_2.frameNStart = frameN # exact frame index BracketsTargetWordAloud_2.tStart = t # local t and not account for scr refresh BracketsTargetWordAloud_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(BracketsTargetWordAloud_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'BracketsTargetWordAloud_2.started') # update status BracketsTargetWordAloud_2.status = STARTED BracketsTargetWordAloud_2.setAutoDraw(True) # if BracketsTargetWordAloud_2 is active this frame... if BracketsTargetWordAloud_2.status == STARTED: # update params pass # if BracketsTargetWordAloud_2 is stopping this frame... if BracketsTargetWordAloud_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > BracketsTargetWordAloud_2.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later BracketsTargetWordAloud_2.tStop = t # not accounting for scr refresh BracketsTargetWordAloud_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'BracketsTargetWordAloud_2.stopped') # update status BracketsTargetWordAloud_2.status = FINISHED BracketsTargetWordAloud_2.setAutoDraw(False) # *TargetPicWordAloud_2* updates # if TargetPicWordAloud_2 is starting this frame... if TargetPicWordAloud_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later TargetPicWordAloud_2.frameNStart = frameN # exact frame index TargetPicWordAloud_2.tStart = t # local t and not account for scr refresh TargetPicWordAloud_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(TargetPicWordAloud_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetPicWordAloud_2.started') # update status TargetPicWordAloud_2.status = STARTED TargetPicWordAloud_2.setAutoDraw(True) # if TargetPicWordAloud_2 is active this frame... if TargetPicWordAloud_2.status == STARTED: # update params pass # if TargetPicWordAloud_2 is stopping this frame... if TargetPicWordAloud_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > TargetPicWordAloud_2.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later TargetPicWordAloud_2.tStop = t # not accounting for scr refresh TargetPicWordAloud_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetPicWordAloud_2.stopped') # update status TargetPicWordAloud_2.status = FINISHED TargetPicWordAloud_2.setAutoDraw(False) # *TargetTextAloud_2* updates # if TargetTextAloud_2 is starting this frame... if TargetTextAloud_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later TargetTextAloud_2.frameNStart = frameN # exact frame index TargetTextAloud_2.tStart = t # local t and not account for scr refresh TargetTextAloud_2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(TargetTextAloud_2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetTextAloud_2.started') # update status TargetTextAloud_2.status = STARTED TargetTextAloud_2.setAutoDraw(True) # if TargetTextAloud_2 is active this frame... if TargetTextAloud_2.status == STARTED: # update params pass # if TargetTextAloud_2 is stopping this frame... if TargetTextAloud_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > TargetTextAloud_2.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later TargetTextAloud_2.tStop = t # not accounting for scr refresh TargetTextAloud_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetTextAloud_2.stopped') # update status TargetTextAloud_2.status = FINISHED TargetTextAloud_2.setAutoDraw(False) # if TargetAudioWordAloud_2 is starting this frame... if TargetAudioWordAloud_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later TargetAudioWordAloud_2.frameNStart = frameN # exact frame index TargetAudioWordAloud_2.tStart = t # local t and not account for scr refresh TargetAudioWordAloud_2.tStartRefresh = tThisFlipGlobal # on global time # add timestamp to datafile thisExp.addData('TargetAudioWordAloud_2.started', tThisFlipGlobal) # update status TargetAudioWordAloud_2.status = STARTED TargetAudioWordAloud_2.play(when=win) # sync with win flip # if TargetAudioWordAloud_2 is stopping this frame... if TargetAudioWordAloud_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > TargetAudioWordAloud_2.tStartRefresh + 1-frameTolerance: # keep track of stop time/frame for later TargetAudioWordAloud_2.tStop = t # not accounting for scr refresh TargetAudioWordAloud_2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'TargetAudioWordAloud_2.stopped') # update status TargetAudioWordAloud_2.status = FINISHED TargetAudioWordAloud_2.stop() # update TargetAudioWordAloud_2 status according to whether it's playing if TargetAudioWordAloud_2.isPlaying: TargetAudioWordAloud_2.status = STARTED elif TargetAudioWordAloud_2.isFinished: TargetAudioWordAloud_2.status = FINISHED # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Target_Word_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Target_Word_Aloud" --- for thisComponent in Target_Word_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Target_Word_Aloud.stopped', globalClock.getTime()) TargetAudioWordAloud_2.pause() # ensure sound has stopped at end of Routine # Run 'End Routine' code from code_21 send_markers(Markers.REALWORDS_EXPERIMENT_END_STIMULUS) outlet.push_sample(['RealWordsExperimentEndStimulus:' + PresentationWordAloud + "_" + WordAloud]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-1.000000) # --- Prepare to start Routine "ISI_Word_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ISI_Word_Aloud.started', globalClock.getTime()) # Run 'Begin Routine' code from code_7 ISIWordaloud = minDur + (maxDur - minDur) * random.random() send_markers(Markers.REALWORDS_EXPERIMENT_START_ISI) outlet.push_sample(['RealWordsExperimentStartISI:' + PresentationWordAloud + "_" + WordAloud]) # keep track of which components have finished ISI_Word_AloudComponents = [ISI_Word2] for thisComponent in ISI_Word_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ISI_Word_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *ISI_Word2* updates # if ISI_Word2 is starting this frame... if ISI_Word2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later ISI_Word2.frameNStart = frameN # exact frame index ISI_Word2.tStart = t # local t and not account for scr refresh ISI_Word2.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(ISI_Word2, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_Word2.started') # update status ISI_Word2.status = STARTED ISI_Word2.setAutoDraw(True) # if ISI_Word2 is active this frame... if ISI_Word2.status == STARTED: # update params pass # if ISI_Word2 is stopping this frame... if ISI_Word2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > ISI_Word2.tStartRefresh + ISIWordaloud-frameTolerance: # keep track of stop time/frame for later ISI_Word2.tStop = t # not accounting for scr refresh ISI_Word2.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'ISI_Word2.stopped') # update status ISI_Word2.status = FINISHED ISI_Word2.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ISI_Word_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ISI_Word_Aloud" --- for thisComponent in ISI_Word_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ISI_Word_Aloud.stopped', globalClock.getTime()) # Run 'End Routine' code from code_7 send_markers(Markers.REALWORDS_EXPERIMENT_END_ISI) outlet.push_sample(['RealWordsExperimentEndISI:' + PresentationWordAloud + "_" + WordAloud]) # the Routine "ISI_Word_Aloud" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # --- Prepare to start Routine "Speech_Word_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Speech_Word_Aloud.started', globalClock.getTime()) # Run 'Begin Routine' code from code_22 send_markers(Markers.REALWORDS_EXPERIMENT_START_SPEECH) outlet.push_sample(['RealWordsExperimentStartSpeech:' + PresentationWordAloud + "_" + WordAloud]) # keep track of which components have finished Speech_Word_AloudComponents = [BracketsSingOnsetAloud, text_9] for thisComponent in Speech_Word_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Speech_Word_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 2.0: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *BracketsSingOnsetAloud* updates # if BracketsSingOnsetAloud is starting this frame... if BracketsSingOnsetAloud.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later BracketsSingOnsetAloud.frameNStart = frameN # exact frame index BracketsSingOnsetAloud.tStart = t # local t and not account for scr refresh BracketsSingOnsetAloud.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(BracketsSingOnsetAloud, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'BracketsSingOnsetAloud.started') # update status BracketsSingOnsetAloud.status = STARTED BracketsSingOnsetAloud.setAutoDraw(True) # if BracketsSingOnsetAloud is active this frame... if BracketsSingOnsetAloud.status == STARTED: # update params pass # if BracketsSingOnsetAloud is stopping this frame... if BracketsSingOnsetAloud.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > BracketsSingOnsetAloud.tStartRefresh + 2-frameTolerance: # keep track of stop time/frame for later BracketsSingOnsetAloud.tStop = t # not accounting for scr refresh BracketsSingOnsetAloud.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'BracketsSingOnsetAloud.stopped') # update status BracketsSingOnsetAloud.status = FINISHED BracketsSingOnsetAloud.setAutoDraw(False) # *text_9* updates # if text_9 is starting this frame... if text_9.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_9.frameNStart = frameN # exact frame index text_9.tStart = t # local t and not account for scr refresh text_9.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_9, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_9.started') # update status text_9.status = STARTED text_9.setAutoDraw(True) # if text_9 is active this frame... if text_9.status == STARTED: # update params pass # if text_9 is stopping this frame... if text_9.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_9.tStartRefresh + 2-frameTolerance: # keep track of stop time/frame for later text_9.tStop = t # not accounting for scr refresh text_9.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_9.stopped') # update status text_9.status = FINISHED text_9.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Speech_Word_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Speech_Word_Aloud" --- for thisComponent in Speech_Word_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Speech_Word_Aloud.stopped', globalClock.getTime()) # Run 'End Routine' code from code_22 send_markers(Markers.REALWORDS_EXPERIMENT_END_SPEECH) outlet.push_sample(['RealWordsExperimentEndSpeech:' + PresentationWordAloud + "_" + WordAloud]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-2.000000) # --- Prepare to start Routine "ITI_Word_Aloud" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('ITI_Word_Aloud.started', globalClock.getTime()) # Run 'Begin Routine' code from code_23 send_markers(Markers.REALWORDS_EXPERIMENT_START_ITI) outlet.push_sample(['RealWordsExperimentStartITI:' + PresentationWordAloud + "_" + WordAloud]) # keep track of which components have finished ITI_Word_AloudComponents = [text_10] for thisComponent in ITI_Word_AloudComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "ITI_Word_Aloud" --- routineForceEnded = not continueRoutine while continueRoutine and routineTimer.getTime() < 0.5: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *text_10* updates # if text_10 is starting this frame... if text_10.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later text_10.frameNStart = frameN # exact frame index text_10.tStart = t # local t and not account for scr refresh text_10.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(text_10, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_10.started') # update status text_10.status = STARTED text_10.setAutoDraw(True) # if text_10 is active this frame... if text_10.status == STARTED: # update params pass # if text_10 is stopping this frame... if text_10.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > text_10.tStartRefresh + 0.5-frameTolerance: # keep track of stop time/frame for later text_10.tStop = t # not accounting for scr refresh text_10.frameNStop = frameN # exact frame index # add timestamp to datafile thisExp.timestampOnFlip(win, 'text_10.stopped') # update status text_10.status = FINISHED text_10.setAutoDraw(False) # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in ITI_Word_AloudComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "ITI_Word_Aloud" --- for thisComponent in ITI_Word_AloudComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('ITI_Word_Aloud.stopped', globalClock.getTime()) # Run 'End Routine' code from code_23 send_markers(Markers.REALWORDS_EXPERIMENT_END_ITI) outlet.push_sample(['RealWordsExperimentEndITI:' + PresentationWordAloud + "_" + WordAloud]) # using non-slip timing so subtract the expected duration of this Routine (unless ended on request) if routineForceEnded: routineTimer.reset() else: routineTimer.addTime(-0.500000) thisExp.nextEntry() if thisSession is not None: # if running in a Session with a Liaison client, send data up to now thisSession.sendExperimentData() # completed 1.0 repeats of 'TrialWordAloud' # completed 13.0 repeats of 'trials_Words' # --- Prepare to start Routine "Thank_you" --- continueRoutine = True # update component parameters for each repeat thisExp.addData('Thank_you.started', globalClock.getTime()) key_resp_8.keys = [] key_resp_8.rt = [] _key_resp_8_allKeys = [] # keep track of which components have finished Thank_youComponents = [Gracias, key_resp_8] for thisComponent in Thank_youComponents: thisComponent.tStart = None thisComponent.tStop = None thisComponent.tStartRefresh = None thisComponent.tStopRefresh = None if hasattr(thisComponent, 'status'): thisComponent.status = NOT_STARTED # reset timers t = 0 _timeToFirstFrame = win.getFutureFlipTime(clock="now") frameN = -1 # --- Run Routine "Thank_you" --- routineForceEnded = not continueRoutine while continueRoutine: # get current time t = routineTimer.getTime() tThisFlip = win.getFutureFlipTime(clock=routineTimer) tThisFlipGlobal = win.getFutureFlipTime(clock=None) frameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update/draw components on each frame # *Gracias* updates # if Gracias is starting this frame... if Gracias.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later Gracias.frameNStart = frameN # exact frame index Gracias.tStart = t # local t and not account for scr refresh Gracias.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(Gracias, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'Gracias.started') # update status Gracias.status = STARTED Gracias.setAutoDraw(True) # if Gracias is active this frame... if Gracias.status == STARTED: # update params pass # *key_resp_8* updates waitOnFlip = False # if key_resp_8 is starting this frame... if key_resp_8.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance: # keep track of start time/frame for later key_resp_8.frameNStart = frameN # exact frame index key_resp_8.tStart = t # local t and not account for scr refresh key_resp_8.tStartRefresh = tThisFlipGlobal # on global time win.timeOnFlip(key_resp_8, 'tStartRefresh') # time at next scr refresh # add timestamp to datafile thisExp.timestampOnFlip(win, 'key_resp_8.started') # update status key_resp_8.status = STARTED # keyboard checking is just starting waitOnFlip = True win.callOnFlip(key_resp_8.clock.reset) # t=0 on next screen flip win.callOnFlip(key_resp_8.clearEvents, eventType='keyboard') # clear events on next screen flip if key_resp_8.status == STARTED and not waitOnFlip: theseKeys = key_resp_8.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False) _key_resp_8_allKeys.extend(theseKeys) if len(_key_resp_8_allKeys): key_resp_8.keys = _key_resp_8_allKeys[-1].name # just the last key pressed key_resp_8.rt = _key_resp_8_allKeys[-1].rt key_resp_8.duration = _key_resp_8_allKeys[-1].duration # a response ends the routine continueRoutine = False # check for quit (typically the Esc key) if defaultKeyboard.getKeys(keyList=["escape"]): thisExp.status = FINISHED if thisExp.status == FINISHED or endExpNow: endExperiment(thisExp, inputs=inputs, win=win) return # check if all components have finished if not continueRoutine: # a component has requested a forced-end of Routine routineForceEnded = True break continueRoutine = False # will revert to True if at least one component still running for thisComponent in Thank_youComponents: if hasattr(thisComponent, "status") and thisComponent.status != FINISHED: continueRoutine = True break # at least one component has not yet finished # refresh the screen if continueRoutine: # don't flip if this routine is over or we'll get a blank screen win.flip() # --- Ending Routine "Thank_you" --- for thisComponent in Thank_youComponents: if hasattr(thisComponent, "setAutoDraw"): thisComponent.setAutoDraw(False) thisExp.addData('Thank_you.stopped', globalClock.getTime()) # check responses if key_resp_8.keys in ['', [], None]: # No response was made key_resp_8.keys = None thisExp.addData('key_resp_8.keys',key_resp_8.keys) if key_resp_8.keys != None: # we had a response thisExp.addData('key_resp_8.rt', key_resp_8.rt) thisExp.addData('key_resp_8.duration', key_resp_8.duration) thisExp.nextEntry() # Run 'End Routine' code from code_24 send_markers(Markers.EXPERIMENT_FINAL) # the Routine "Thank_you" was not non-slip safe, so reset the non-slip timer routineTimer.reset() # mark experiment as finished endExperiment(thisExp, win=win, inputs=inputs) def saveData(thisExp): """ Save data from this experiment Parameters ========== thisExp : psychopy.data.ExperimentHandler Handler object for this experiment, contains the data to save and information about where to save it to. """ filename = thisExp.dataFileName # these shouldn't be strictly necessary (should auto-save) thisExp.saveAsWideText(filename + '.csv', delim='auto') thisExp.saveAsPickle(filename) def endExperiment(thisExp, inputs=None, win=None): """ End this experiment, performing final shut down operations. This function does NOT close the window or end the Python process - use `quit` for this. Parameters ========== thisExp : psychopy.data.ExperimentHandler Handler object for this experiment, contains the data to save and information about where to save it to. inputs : dict Dictionary of input devices by name. win : psychopy.visual.Window Window for this experiment. """ if win is not None: # remove autodraw from all current components win.clearAutoDraw() # Flip one final time so any remaining win.callOnFlip() # and win.timeOnFlip() tasks get executed win.flip() # mark experiment handler as finished thisExp.status = FINISHED # shut down eyetracker, if there is one if inputs is not None: if 'eyetracker' in inputs and inputs['eyetracker'] is not None: inputs['eyetracker'].setConnectionState(False) logging.flush() def quit(thisExp, win=None, inputs=None, thisSession=None): """ Fully quit, closing the window and ending the Python process. Parameters ========== win : psychopy.visual.Window Window to close. inputs : dict Dictionary of input devices by name. thisSession : psychopy.session.Session or None Handle of the Session object this experiment is being run from, if any. """ thisExp.abort() # or data files will save again on exit # make sure everything is closed down if win is not None: # Flip one final time so any remaining win.callOnFlip() # and win.timeOnFlip() tasks get executed before quitting win.flip() win.close() if inputs is not None: if 'eyetracker' in inputs and inputs['eyetracker'] is not None: inputs['eyetracker'].setConnectionState(False) logging.flush() if thisSession is not None: thisSession.stop() # terminate Python process core.quit() # if running this experiment as a script... if __name__ == '__main__': # call all functions in order expInfo = showExpInfoDlg(expInfo=expInfo) thisExp = setupData(expInfo=expInfo) logFile = setupLogging(filename=thisExp.dataFileName) win = setupWindow(expInfo=expInfo) inputs = setupInputs(expInfo=expInfo, thisExp=thisExp, win=win) run( expInfo=expInfo, thisExp=thisExp, win=win, inputs=inputs ) saveData(thisExp=thisExp) quit(thisExp=thisExp, win=win, inputs=inputs)