This is, of course, much more efficient than creating three different routines (or, equivalently, a single routine with three image components)! We will discuss loops in more detail in the next tutorial!Īlright, now you should know enough of the Builder functionality to start creating a new experiment, which we’ll do in the next tutorial.RatingScale ¶ class psychopy.visual. This functionality allows you to, well, add loops across routines! In the demo experiment, we use this to repeat our show_stimulus routine for the three different images. Then, to insert it in the experiment flow, click on Insert Routine, select your new routine, and click on the flow line in between wrap_up and the arrow head to insert it!Īnothing think you might encounter in the flow pane is “loops”, like the stimulus_loop in the demo experiment. For example, create a new routine called the_end (in the top menu: Experiment → New routine) with a single text component lasting 1 second. Try inserting a new routine at the end of the experiment flow (i.e., after the goodbye routine). For example, if you click on a text component, you can set the color, font, font size (“letter height”), position, and of course the text itself. For example, the mouse component allows you to record and use mouse movements and clicks and the rating scale component creates a rating scale which you can use to collect ratings on, for example, questionnaire items.īy clicking on a particular component, a pop-up appears in which you can set the properties of the component, such as the component name, onset and and duration, and several component-specific properties. The responses section contains several components that facilitate interaction with the participant. The stimuli section contains various different stimulus components you might want to use in your experiment, such as dot stimuli, gratings, and sounds. Some of the most used components are listed under favorites (such as text and image components). The components pane contains, as you might have guessed, the different components you can include in your routines. Considering the demo experiment, do you understand why? The components pane # In the intro routine, the wait_key and key_resp components seem to lack an explicit offset. It’s up to you how you how you structure your routines! Note that routines do not have to contain multiple components for example, the show_stimulus routine only contains a single component (i.e., stim). Moreover, the routine pane also shows you the onset and offsets of the different components. For example, if you click on the intro routine tab, the routine pane shows, across different “rows”, that this routine consists of three consecutive text components ( hello, welcome, and wait_key) and a “keyboard” component ( key_resp). Each routine may consist of multiple components (e.g., text, images, and sounds). In the demo experiment, for example, there are four routines: intro, show_stimulus, gabor, and wrap_up. The Routines pane consist of the different elements of your experiment, where each element gets its own tab. Apart from the list of icons on top of the Builder window, there are several subwindows (or panes): the Routines pane, the Components pane, and the Flow pane. Make sure you (still) have the demo experiment active in the Builder. Now, let’s take a look at the elements of the Builder interface. Take a look at the generated script do you see elements from the demo experiment (e.g., the text or images shown during the demo experiment)? Elements of the Builder interface # It may, however, give you some insight about what is going on “under the hood”. Most of the time, you can ignore the script associated with your Builder experiment. In fact, everytime your run a Builder experiment on your own computer, Psychopy first generates the corresponding Python script, which is then executed to start the experiment. The generated intropy_demo.py script contains the code necessary to run the experiment originally specified in the Builder interface (i.e., in the intropy_demo.psyexp file). This should open the Coder interface with the code equivalent of the demo Builder experiment! Then, click the Compile to script button (right of the Edit experiment settings button). If you haven’t loaded the demo Builder experiment ( intropy_demo.psyexp), do so now. Let’s see this Builder-to-Coder compilation in action.
0 Comments
Leave a Reply. |