def construct_paradigm(): # Initialize a paradigm par = Paradigm(window_dimensions=settings['window_dimensions'], escape_key='escape') # Create list of stimuli from variables in # experiment.py stimuli = [ (Text, (ex.instructions01, ex.duration01)), (Text, (ex.text02, ex.duration02)), (Text, ('+', 1.0)), # A fixation cross (Text, (ex.text03, ex.duration03)), # and so on... ] # Add the stimuli to the paradigm par.add_stimuli(stimuli) return par
def main(): # Initialize a paradigm par = Paradigm(window_dimensions=(720, 480)) # Create a list of stimuli in the order they will show up # Each stimuli is added as a tuple of the form (StimulusClass, (arguments)) stimuli = [ (Text, ('This text will disappear in 5 seconds. ' 'Then press the "c" key to continue ', 5.0)), (WaitForKey, (['c'], 'continue')), (Text, ("Here's some more text", )), # duration defaults to 2 sec # You can also specify keyword arguments in a dictionary (Text, { 'text': 'This text will display for 5 seconds', 'duration': 5.0 }), (Text, ('Nice! There will be a 2 second pause ' 'after this disappears, then an exit.', 4.0)), (Pause, (2, )) ] par.add_stimuli(stimuli) # Add the stimuli par.play_all() # Play all stimuli. Press escape to quit