 Hi, my name is Sebastia Mato, I'm the lead developer of OpenSesame and today we're going to walk through the step-by-step tutorial for OpenSesame 3.0. Now before we start with the tutorial, a little bit about OpenSesame. OpenSesame is a program mostly for researchers, psychologists, neuroscientists, experimental economists to create behavioral experiments. So it's a very user-friendly graphical interface for creating behavioral experiments. OpenSesame is cross-platform, so it runs on Windows, which is what we're going to use today. It runs on macOS, it runs on Linux, and a runtime-only version runs on Android, the mobile operating system. OpenSesame is open-source, which means that you can download and use the software for free with very few license restrictions, and also that you can download and modify the source code if you would be so inclined. Before we start with the tutorial again, let's take a look at the user interface. OpenSesame has a menu bar here at the top, which has standard functionality, like starting a new experiment, opening a file, saving a file, etc. Below the menu bar we have the main toolbar, which is a selection of the most relevant information from the menu bar, basically. It allows you to start a new experiment, open an existing experiment, save an experiment, various ways of running an experiment. It allows you to close tabs. So we have a tab area here, in which you can have multiple tabs open. If it gets a bit messy, you can click on this button to close all tabs, except the one that you're currently viewing. You can enable so-called one-tab mode, in which only one tab is visible at the time. And here you can hide or view various aspects of the OpenSesame user interface, which we will meet later on in this tutorial. And you can undo and redo actions once you get to work. Now, on the left side here we have the item toolbar. Items are the building blocks of experiments in OpenSesame, so an experiment is basically a collection, a structure of items. And you can add items to your experiment by dragging them from here, picking them up and dragging them up like that, into your experiment, which we will do later in this tutorial. Then here we have the overview area, which provides a graphical tree-like overview of your experiment structure, which is very useful. Then here we have the so-called tab area, which is kind of like a browser, which shows the graphical controls of your items, which shows messages, etc. You will do most of the work in OpenSesame here in this tab area, usually. Below we have the debug window, which is a Python interpreter. Python is a very high-level programming language, which is used a lot in science for scientific purposes, and you can also use it in OpenSesame. We are not going to use Python in our tutorial today, so this debug window is not very useful to us, so we hide it by clicking here on this ladybug icon, so we have a little bit more room on the screen. Okay, now let's take a look at the tutorial that we are going to do today. It is this tutorial, the so-called step-by-step tutorial, or the beginner tutorial, which you can find here on this address, on the OpenSesame documentation side. And this is a step-by-step tutorial. It consists of 13 steps, really from the start, from a completely blank experiment to a full-functioning gaze-queuing experiment. Now, the experiment that we are going to create is a gaze-queuing experiment, and it has the following structure. Every trial starts with a fixation dot, so a small dot in the center of the screen. This fixation dot is followed by a so-called neutral gaze-queue, so a smiley that looks straight at you from the center of the screen. This is followed by a gaze-queue, so it's a smiley that looks either to the left or the right side of the screen. And this is in turn followed by a target and a distractor, while the gaze-queue is still visible on the screen. So the distractor is always the letter X, which means nothing to the participant, and the target is the letter F or H, and the participant's task is to indicate whether they saw an F by pressing the Z key on the keyboard with their left hand, or the H by pressing the M key on the keyboard with their right hand. So it's basically an arbitrary response mapping. If the participant makes a mistake, so if the participant doesn't provide the response or provides the wrong response, we will play a sound to provide some feedback. Okay, now let's switch back to open sesame. Here we click on open sesame. When you start open sesame for the first time, you receive this kind of welcome message, which we get close for now, so I click on the close tab button. And then without further ado, we can start with step one of the experiment, in which we're going to define the main sequence of our experiment. Now, when you start open sesame, you see that it by default loads the so-called default template, which is a sequence called experiment, consisting of a notepad called getting started and a sketchpad called welcome. Now, a sequence is a special type of item in open sesame that runs other items sequentially, as the name suggests, of course. In this case, we don't need the two items that are already there, the getting started notepad and the welcome sketchpad, so you can say right click, delete, right click, delete. And now we have an empty sequence to start from. You will see that the actual items that we've deleted are still visible in the unused item bin, unused items bin, until we say permanently delete unused items. Yes. Switch back to the experiment sequence. Okay. Now, the main sequence of our experiment is basically the most high-level sequence, the most high-level structure of our experiment, which really defines that we start with this instruction screen, which is followed by several blocks of practice trials, which is followed by another screen that lets the participant know that the practice phase is finished, which is followed by several blocks of experimental trials, right, which is in the end finished by a message that lets the participant know that the experiment is finished. Now, if you have printed out a tutorial or if you're viewing it online, you will see the structure that we're going to create in Figure 5. So it's maybe convenient for reference to have that by hand. Okay. And we're going to start, as I said, with an instruction screen. And for that, we're going to use this item, the text form underscore text display item. So we're going to pick it up and drag it into our experiment. Okay. There we have it. We are not going to bother with adjusting the text now. We can do that later. We're just going to give it a good name. That's important because if you don't, if you just always stick with the default names, you get very confusing structures. So it's really important to give informative names to your items. So this one is called Instructions, okay? So you can rename items by either clicking here in the tab area or by right clicking on the item here in the tree in the overview area and selecting rename. It's the same thing. After the instructions, we have a loop. Okay. We add that into the experiment. And this loop, a loop is an item. Again, like the sequence, it's an item that adds structure to your experiment. And what the loop does is it runs another item repeatedly, right? So it has a single other item that it runs repeatedly. And in our case, this loop runs a block repeatedly. So our practice loop, we're going to rename it to practice loop, runs a practice block repeatedly. Then of course, we also need a practice block for this. We're going to use a sequence. We pick it up and we drag it onto our practice loop item, drop it. Then the obsessive me asks if we want to set the new item as the item to run for the practice loop. So basically, if we want to add the sequence into the practice loop or if we want to insert it after the practice loop. So we want to add it into, set it in the practice loop like this. Then we have a new sequence, which we're going to call block sequence. Now, working with loops and sequences and using those to add structure to your experiment is one of the key things that you need to know in order to work with obsessive me. It sounds a bit abstract in the beginning, but if you've seen it a few times, you will understand the general logic. So basically, the logic here is that this block sequence corresponds to one block of trials and the practice loop around it runs this one block of trials multiple times so that our practice phase can consist of multiple blocks. Okay. Now, after the practice phase, we need another text message. So we're going to use another form text display. We drag it to the end of our experiment sequence. Again, obsessive me asks us if we want to add a new item into the practice loop, which we don't want to do, right? We want to add it after the practice loop. So now we have our new form text display here and we're going to rename it into end of practice because it's the message that the participant will see when the practice phase is over. After this, we will have another loop, which we will call experimental loop. And this is the loop that's going to loop over blocks of trials during the experimental phase of our experiment, right? So after the training once participants are doing the real experiment. And again, we need another item to loop over and we're going to reuse this block sequence. So the idea here is that the idea is that the experiment, basically the blocks and the trials of our experiment are exactly the same during the practice phase and the experimental phase of our experiment. So we don't need to redefine everything twice. We can simply reuse this block sequence that we've already created. To do that, we don't drag a new item into it instead. We select an already existing item from this drop-down menu. Select block sequence. And now you will see that the same block sequence is part of both experimental loop and practice loop. And these are what we call linked copies. So everything you do to this block sequence will also apply to this block sequence and vice versa. It's really the same item that occurs in two different places of the experiment. That's quite convenient because it avoids you from having to do everything twice. And then at the end of the experiment, we again add a text display item. Well, as I said, you can add items by dragging them from the item toolbar. Another way to add items is to open the sequence by clicking on it and doing this, add a new item, select form text display. And then we add a text display item. Form text display. And then we say rename end of experiment. So using this plus button to add a new item is exactly the same thing as dragging a new item from the item toolbar into here or from the item toolbar into here. It all boils down to the same thing. Okay, well, that's the end of step one. So now we have the basic structure of our experiment laid out. And in step two, we're going to create the block sequence. So we're going to define one block of trials from the top down, not yet bothering with individual trials, but just the general block sequence. So I click on block sequence. Each block of trials starts by resetting the feedback variables. Open Sesame automatically maintains an average response time and an average accuracy. We're not an average accuracy, but an accuracy. And if we don't reset those, then they will just keep accumulating over during the entire experiment. But that's not usually what we want. Usually we want to give feedback just on a particular block of trials. And to do that, we need to reset the feedback variables at the beginning of the block. Click on plus a new item, and we're going to select reset feedback. See? Easy peasy. Right click, rename, and just say reset feedback. Okay, now after we've reset it, if you can say that feedback, we're going to loop across the actual trials. So for that we need another loop. We're going to drag that into the block sequence. And this loop will repeat one trial multiple times. So we can rename it to block loop. And one trial is a sequence that is part of this block loop. So we add it onto the block loop. Set this item to run for block loop. Get in space, rename, block sequence. Oh sorry, this is not correct actually. It is trial sequence. Yes. So we have one trial that is executed multiple times by a block loop, right? And then our block sequence is followed by a feedback item. Okay, which we rename to feedback. Now I've been on purpose using different ways of interacting with user interface, right? You can drag items from here into your experiment. You can use this plus button. You can drag items into the overview area or into the controls of the sequence. It all has more or less the same effect, right? It just does what you expect it to do, namely modify the structure of your experiment. Okay, so now we have gone deeper in specifying the basic structure of our experiment, right? So from the top down we have an experiment sequence which runs an instruction screen, which runs a practice loop. And the practice loop multiple times runs a block sequence which corresponds to one block of trials. In a block of trials we start by resetting feedback. Then we run the block loop which runs a trial sequence multiple times. Once that's finished we provide feedback at the end of the block, okay? Then we jump back up in the hierarchy. After the practice phase is finished we give a message that the practice phase is finished to the participant. Then we start with the experimental loop, so the experimental phase of the experiment, which again consists of multiple trials, each trial consisting corresponding to a block sequence. And of course it's the same block sequence, so we start by resetting feedback, looping over multiple trials, providing feedback. And then at the very end of the experiment we jump back up into the hierarchy and we provide an end-of-experiment message. So the general structure of the experiment it's quite hierarchical, but it's actually not terribly complicated. Okay, now we're going to define the independent variables in our experiment. So we are at the end of step 2 and we're going to start with step 3. And we're going to define our independent variables in the block loop. So click on the block loop to open it. You see that we have a lot of items open here. This can be a little bit confusing, so you can say, okay, I want to close all other items. Or you can say, okay, I want to enable one tab mode, in which case you can only have one tab open at a time. I personally kind of like one tab mode, so let's enable that. Okay, so here we have the block loop. In the block loop, you can define a table with your independent variables here, which is now completely empty. But if you have a full factorial design, and we do have a full factorial design in this tutorial, you can use the variable wizard just to save a little bit of time. We almost have a full factorial design anyway. So click on the variable wizard. Okay. And the variable wizard works as follows. On the first row, you type the names of all the independent variables that exist in your experiment. So we have, for example, the variable gaseq, which determines whether our smiley face is going to look to the left or the right. So below the name, we give the possible values of our variable. So that's left and right. We have a variable gaseq, which can be either left or right. Then our other variable is the position of the target. Target position. The target can also be presented on the left or the right side of the screen. Now, we could type left or right, but to make our life a little bit easier, what we're going to do is directly specify the position of the target in pixels relative to the center. So in open sesame, 0, 0 is always the center of the display. So if we use minus 300 for the x-coordinate of the target, this means it will be shown to the left, 300 pixels to the left of the center. And on other trials, we show it to the right of the center, so it's 300, right? So basically, this means the same thing as left and right, but it's a little bit, you will see that it's a little bit easier later on in the tutorial. Then we have the target letter, right? Which is an F or an H, okay? So what we have here is a 2 by 2 by 2 design, right? So we have three factors, all of which have three factors here, all of which have two levels. Click on OK. You will see that open sesame automatically generates a table where each column corresponds to a variable and each row corresponds to a cycle. And in our case, a cycle is a trial, right? So, for example, in cycle one, the target would be on the left, the gaze would also look to the left and the target would be an F. And all these different cycles are walked through in random order, right? So it's a randomized trial sequence, well, block, it's a randomized block, okay? Now, we're not completely done yet because obviously in addition to the target, we also have a distractor which also has a position. We can use some clever deduction, well, not even that clever, we can use some fairly basic deduction to just programmatically say that whenever the distractor is, whenever the target is on the left, the distractor is on the right. But for our purpose, what we're going to do is we're going to create a new variable called distPause for distractor position, okay? And whenever target position is 300, distractor position will be minus 300. So, select this, copy, paste, right? A little bit of copy-pasting will save us a bit of time. Copy, paste, right? So, basically the distractor is always on the opposite side from the target. We are also going to define the variable called correct response. And this variable is automatically recognized by OpenSesame and used to determine whether the participants give the correct response or not. So, it's quite convenient to define the correct response by to sort of keep track of accuracy across the blocks of trials. Now, our response rule was such that whenever the target was in F, the correct response was in Z. And whenever the target was in H, the correct response was in M, right? This is just completely arbitrary, but that's what we've chosen. So, paste, okay, up, paste, up, okay. Now, there we have a fully finished block loop in which we've defined all the independent variables of our experiment. Okay, so that brings us to the end of step 3. Now, we're moving on to step 4 in which we're going to add images and sound files to the OpenSesame file pool. Now, what is the file pool? The file pool, let's first make the file pool visible by clicking on this item here, this icon here, click, and there we have the file pool, which is now empty. The file pool is just a collection of files that are part of your experiment and that are also automatically saved along with your experiment. So, you never have to sort of walk around with the USB stick with your experiment file and all kinds of separate bitmaps and whatever, just put them in your file pool and they're automatically bundled with OpenSesame. Now, the files that we need for our experiment are available online, so we can switch back to the internet browser. And then we go down, up, okay, and in step 4, add images and sound files to the file pool, click on it, that's where we are now. And here you see that we have three bitmaps, gaze neutral, gaze left and gaze right and we have one sound file that we're going to play back when participants give the incorrect response, okay? So, okay, save as, just going to save it in the Downloads folder, save, save as, save as, save as. Okay. Now, we've downloaded the files. To add them to the OpenSesame file pool, you can just view the files in Explorer or whatever kind of file browser you use. You select them and you drag them up into OpenSesame, right? So, there we go. Now, we've added those four files to our file pool and we can use them in our experiment. Obviously, you can also use files in your experiment that are not part of the file pool. For example, if you're using very large video files, it's usually not convenient to add them to the file pool, but in most cases, it's adding your files to the file pool is the easiest way to use files in OpenSesame. Okay. Well, that brings us to the end of step 4. Now, we're going to move on to step 5, in which things get a little bit more interesting. We're going to define our trial sequence. So, we're going to add items to our trial sequence. Now, each trial starts with a fixation dot and a fixation dot is a sketchpad. Okay. A sketchpad is this item right here and a sketchpad is just the normal way to present visual stimuli in OpenSesame. There are multiple ways to present visual stimuli. For example, we've already seen the form text display to present text, but that's quite specific for if you want to have more or less questionnaire or form-based interaction with the user. If you just want to show things on the screen, then you want to use the sketchpad item. Okay. So, we're going to add that to our trial sequence and we're going to rename it to fixation dot. Right? So, we're always going to rename our items just so that we know what they mean. That makes our life a lot easier. Okay. After the fixation dot, we have the neutral gaze, right? Part of the experiment where the smiley looks at us. So, we drag a new sketchpad. We rename it to neutral gaze. And after the neutral gaze, we have the gaze cue. So, the part of the trial where the smiley looks to the left or the right. Gaze cue. And then after the gaze cue, we have the target, right? So, part of the trial where the gaze cue is still present, but there's also the distractor and the target letter. So, rename target. After we've shown the target, we want to collect a keyboard response. For that, we're going to use the keyboard response item right here. We're going to drag that into the experiment. Can rename it to keyboard response. After the keyboard response, we're going to play a sound if the response was incorrect. Now, to play sounds, we have two items. We have the sampler, like the wooden box here. The sampler plays sound files. And we have the synth, which plays synthesized sounds, right? So, it beeps, et cetera. It's a very basic sound synthesizer. We're going to use the sampler item, right? Because we have a sound file. So, we're going to pick that up, drag it into the experiment. Now, obviously, we don't always want to play a sound, right? We're going to rename this, by the way, to incorrect sound. Yes. We don't always want to play the sound. And to control that, we can use this run if column. So, here we have the item names, right? And we have all the run if statements. So, we always show fixation, not always neutral gaze, always the gaze cue, always the target, always the keyboard response, but not always the incorrect sound. So, edit the run if statement. And we're going to type the following. Correct is 1. Okay. So, what does this mean? Well, the square brackets around correct that correct is the name of a variable. And the equals 1 means that the incorrect sound the incorrect sound sampler is only played if the correct variable has the value 1. Which, come to think of it, is of course not correct. It should be correct is 0. So, basically, what this means is if the participant gives an incorrect response, if that happens, open sesame automatically sets the variable correct to 0. And in that case, we play the incorrect sound sampler. Okay. So, using these kind of run if statements, you can control the flow of your experiment quite easily in a quite flexible and powerful way. You can learn much more about using if statements online on the documentation side. Okay. Now, at the very end of the experiment, we're going to do something which we should never forget. We're going to log the data. So, open sesame doesn't automatically log the data. To log data, you need the logger item. So, we're going to pick up the logger item and drag it up here and going to rename it. We'll see that later in this tutorial. But for now, it's just important to note that if you want to log your data and that is in most cases what you definitely want to do, you need to add a logger item usually to the end of the trial sequence. Okay. Well, that brings us to the end of step 5. And now we're going to move on to step 6 in which we're going to draw these sketch paths that we've defined here. Okay. So, let's close the file pool because it takes up a little bit of space. Okay. Let's move to the fixation dot. So, if you open the fixation dot or any kind of sketch path, you will see that you really have a graphical representation of your visual stimuli. So, it's kind of like a paint-like functionality to really draw your visual stimuli. And this is one of the powerful features of open sesame, I think. By default, open sesame uses a dark background and a white foreground, which I think is fine because it avoids eye strain. But we are actually, if you're looking, if you switch to our gaze neutral thing, you see that they actually have a white background. So, that will look a bit weird on the black background. So, we're going to change this. To do that, we're going to make a slight detour. You open the general tab, which you can do by clicking on the top level item in the overview area, which is called New Experiment. And here you have a whole bunch of options that are kind of like general options of your experiment. You have a name, obviously. The default name is called New Experiment. So, let's call it Video Tutorial. Maybe a description. This is for example, doing experiments. Whatever. Okay. Then we have the back end. The back end is the low level layer that determines it specifies the way that visual stimuli are shown on the display. This is quite important, and I suggest, especially if you're interested in doing time critical experiments, that you read the back end section and the timing section on the documentation side. For our purpose, what we're going to do is we're just going to switch to the back end called Legacy. Not because it's a particularly good back end, but because it works better with the screen recording software that I'm using right now. Okay. Then we have the resolution 1024 by 768. So, just kind of standard resolution. The colors, foreground is white. We're going to change the foreground to black. And the background is black. We're going to change the background to white. We can use a lot of different ways to specify colors. We can say, for example, okay, instead of white, we can say ff, ff, ff, ff, which also means white, but then in hexadecimal notation, we can use RGB notation, say 100%, 100% red, 100% green, and 0%. Okay. Types accidentally pressed enter. RGB 100%, 0%. So that would mean 100% red, 0% green, 0% blue. So there are a few different ways in which you can specify colors. In most cases, words are just the most readable. So we're just going to say background white. Okay. Now, this is the end of our little detour. Let's switch back to our fixation dot. Click on it. And we're going to draw a fixation dot in the center of the screen. Because fixation dots are so common in psychology research, there is actually special fixation dot element here. We're going to select it. We also have text line, line, arrow, rectangle, circle, ellipse, images, keyboard patches, noise patches. But now we're going to use the fixation dot. The color is still set to white. We're going to change it to black. And we draw it in the center of the screen. Now, that is basically what we all we need to do for our fixation dot. But we also need to change the duration. You see that by default, the duration is set to key press. Which means that this fixation dot will stay on the screen until the user presses, the participant presses a key. That is not what we want, right? We want the trial sequence to automatically progress over time. So we're going to change this key press duration to 745. Now, what does this mean? 745 means basically that the fixation dot will be shown for 750 milliseconds. It is, the duration that we specified is a little bit less than 750 milliseconds, right? But because a stimuli has to be shown always for a multiple of frame durations, right? Each frame usually almost monitors less. 16.67 milliseconds. So a stimulus is always visible for a multiple of 16.67 milliseconds. And this value that we type right here is rounded up to the nearest multiple of 16.67 milliseconds, which is 750. This sounds kind of complicated. It's not really that complicated. What you need to keep in mind as a general rule is that you want to select a duration that is possible, right? So a duration that is actually a multiple of your frame duration. And then you subtract say 5 milliseconds from that duration. So we wanted to go for 750 which is possible because it's a multiple of 16.67 and then we subtracted 5 milliseconds. Again, this is quite important. So if you're into time critical experiment, I suggest that you read the timing section on the documentation website. Okay, so far for the fixation dot. Let's move on to the neutral gaze item, okay? The neutral gaze is this is an image, right? So we're going to select the image element here, this one. Going to click in the center of the screen. And we're going to select the gaze neutral bitmap and say select and there it is. Okay, now following the same logic as before we're going to change this to 745 if we want to change the duration to 745 if we want to show the gaze neutral gaze phase for 750 milliseconds. And that's it. Now we're going to move on to the gaze cue and this is where things get gradually get more interesting. Now the gaze cue is not always the same, right? On some trials the gaze looks to the left and on other trials the gaze looks to the right. So we cannot just draw a fixed image on the center of the screen. That won't work. However we can use a clever trick in open sesame which goes as follows. We start by defining what you might call a prototype display. A display that might occur on a particular trial. So select the image element, click on the center and select gaze left dot png, right? Because on some trials the gaze the smiley looks to the left. Then we're going to make use of the fact that everything that you do in a graphical user interface generates a script. A very simple script which is called open sesame script. This script is not generally visible but you can make it visible by clicking here on the view icon and you can choose what you want to see whether you want to see the controls or the graphical things that we usually see whether you want to see the script or whether you want to see both. So we say split view and then you see that in the script that has been generated there is this line in which we draw an image on the center of the screen and we draw it from the file gaze left dot png. Now what we're going to do is basically we're going to replace this part left by between square brackets gaze q. So what does this mean? Well, the square brackets indicate that gaze q is the name of a variable and when open sesame is going to run this experiment it will run it will show gaze left dot png whenever gaze q has the value left and gaze right dot png whenever gaze q has the value right so it basically it makes this static image that used to be static always to the left makes it variable and dependent on the variable gaze q so that's quite nice and convenient. So if we apply that you see that the smiley face changes into a question mark because open sesame now doesn't know how to how to how to give you a preview because it is variably defined but that's okay it will be actually shown during the experiment. Now, we also have to change the duration, right? So we can change the duration here in the duration field or we can change it here in the script let's do it in the script just to vary a little bit let's do 495 that means it's rounded up again to the nearest duration that is compatible with the frame duration which is 500 milliseconds so this means that the gaze q will be shown for 500 milliseconds applying close okay there we are now we're going to now we're going to go to the target item that's where things get even more interesting click on the target so the target is to begin with the same as the gaze q because it still has the gaze q in it okay so we start by drawing gaze left nope the mouse is a little bit funky in addition to the in addition to the gaze q there is the target and the distractor letter right so we're going to draw those with the with the text line element you see when I select the text line element you see a few things options popping up that are compatible with with with text right that are applicable to text by default we use a mono space font of 18 pixels I think 18 pixels is a bit small so let's put it to 32 pixels okay so if you click on the font you see a few different fonts mono space sans serif serif you also see a few fonts that are specific to non western languages Arabic, Chinese, Japanese, Korean, Hebrew and Hindi if you want to draw for example Arabic text you have to select the Arabic font because open sesame is not smart enough to to select the correct font itself right so for example if in Microsoft Word you type Arabic text even though you've selected a font that doesn't support Arabic text Microsoft Word will automatically select a font that does contain Arabic characters open sesame won't do that so if you add Arabic font to your display while having for example the mono space font selected you will just see empty boxes when running the experiment right so that's why if you if you want to use Arabic text select Arabic, CJK for Asian, Hebrew and Hindi etc okay now so as I said you can start we're going to start by drawing a prototype display as the display might look like on a given trial so for example on some trials the distractor which is an X might be on the left and then obviously the target will be on the right now instead of typing the target letter directly we're going to make use of the fact that we have a variable called target letter and we're going to put it between square brackets to indicate that target letter is the name of a variable and if we do that open sesame will not show while you're running the experiment will not show between square brackets target letter but it will show F when target letter is F and H when target letter is H right okay now and then we're going to use so now we have to find a static display the prototype display of what the target display might look like on a given trial and what we're going to do is we're going to view the script just like before and we're going to make it variable okay so just like with gaze queue with the gaze queue we're going to replace this gaze left by gaze underscore gazeq.png that basically assures that our gaze queue depends on the variable gaze queue here we have this line right here corresponds to our distractor right it has the text x in it and right now it's on the fixed location minus 320 so on the left what we're going to do is we're going to replace this fixed location by this pos between square brackets so that the x coordinate of the distractor depends on the variable this pos once we do that the open sesame will say that it doesn't no longer knows where to show this pos but that doesn't matter it will be shown during the experiment and we're going to do the same trick for target letter right we're going to replace the x the x coordinate by which used to be 320 we're going to replace it by between square bracket target pos okay and then we're going to say close okay now a last thing that we need to do when before we move on to the keyboard response is to specify the duration of the target now by default is the duration is key press which at first sight may make sense for the for the target right because we want the target to be visible until the participant presses a key but actually we're going to change it to zero which might not make sense because we don't want the target to be visible for zero milliseconds right but what this actually means if we set the duration to zero is that once the experiment once open sesame has shown the target it will not wait at all it will move on immediately to the next item which is the keyboard response and this will collect a keyboard response to the target right so basically this duration of zero milliseconds means that open sesame should not wait before moving on to the keyboard response to collect the keyboard response so that's the logic behind it okay now we're advancing nicely this was the end already of of step six now we're going to move on to step seven in which we're going to configure a keyboard response item we're going to click on the keyboard response item and this is actually quite simple so the keyboard response has a few options there's the correct response field which is empty and that's fine if we leave this correct response field empty open sesame will automatically use the variable that we've created which is called correct underscore response leaving it empty is the same as saying use correct underscore response then we have the allowed responses field which is a semicolon separated list of keys that should be allowed and we have the Z and the M right because the Z is for the F and the M is for the H in addition to the Z and M open sesame will also always respond to the key escape which will pause the experiment so that's always implied then we have a timeout value which specifies after how many milliseconds open sesame should move on to basically should consider that no response is going to come in and then it will set the response variable to non with the capital N so we set this to two thousand which means that the participants have to respond within two seconds which I think is plenty for this kind of simple task okay then we have this option here flush pending key presses basically if you have this enabled and usually you want to have this enabled it means that opens that all responses that were still pending right so if the participant had pressed some keys before this keyboard response item became activated are flushed and ignored and only new responses will be accepted so that's usually what you want only in very rare cases do you want to disable that option okay that brings us to the end of step seven now we're going to move on to step eight in which we're going to configure the incorrect sound item for the sampler right so we're going to click on it to open it and actually we don't hardly need to do anything here we just need to select the sound file click on browse okay select the incorrect ogg select and basically that's fine you can see we can take a look at a few of the options right this is the volume the panning so left or right the pitch so the speed of the sound stop after so that indicates for example if you put this at 100 it means that the sound is stopped after 100 milliseconds so it's truncated fade in means that the sound is fades in for x number of milliseconds and duration means the time that the sampler item pauses the experiment so if it's set to sound basically open sesame will not move on to the next item until the sound is finished playing if you would set the duration to 0 it wouldn't mean that the sound is played for only 0 milliseconds but that open sesame just moves on immediately to the next item while the sound is still playing in the background okay well that's the end of step 8 so let's move on to step 9 in which we're going to configure the logger which does the data logging so I'm going to click on the logger actually we don't really need to do anything in logger but because it's very important we're still going to take a look at it so you see that here the option log all variables is selected by default this means that open sesame will automatically check which experimental variables it knows about and log all of them that's a lot of variables so you will have a very big log file but I still think it's usually the safest option because it's better to have too much data than to have too little data also even if you have the log all variables option enabled you still need to double and triple check that all the data that you need for your analysis is actually actually present in your data files because you won't be the first researcher that runs 100 participants only to find out that the response was not logged for example of course open sesame does everything in its power to avoid that from happening but you want to err on the side of caution as they say now let's assume for a moment that you don't want to log all variables then you can disable this and then you can add a custom variable by saying click on add custom variable response another way to add variables is by activating the variable inspector and dragging variables from here into the experiment for example into the logger item for example drag the correct item up into here alright well so you can do that but it's not usually recommended unless you really know why and in this case we're just going to log all variables okay that is the end of step 9 now we're going to move on to step 10 in which we're going to define the per block feedback so we're going to click on the feedback item right here err and basically feedback is quite simple we just select text we click in the center of the screen and we say okay for example you can be a bit creative here but say end of block err your average response time was average RT your accuracy was % press any key to continue okay now what does this mean so okay it's a bit small I think so let's do for example so what does this mean well most of it is clear I guess but basically open sesame automatically keeps track of the average response time and your accuracy and these are stored in the variables average in the score RT and AC so what we're doing here by putting these between square brackets is basically telling open sesame to show the average response time here and then followed by milliseconds and accuracy here followed by % right so that's quite convenient the duration is key press which is fine because I guess it makes sense to have the participants to give the participants a break until they press a key to move on to the next next block right so that's the end of step 10 now we're going to move on to step 11 in which we're going to specify the length of our various of our various blocks and phases now let's start by clicking on the block loop so what you see here is that we have eight cycles so basically we have eight different kinds of trials right executed in random order and each of them is executed only once this means that basically this means that a block of trials is only eight trials which is not that much I think a more reasonable number of trials per block is for example 24 so if we change the repeat value to 3 you will see that the block loop will now call trial sequence 8 times 3 is 24 times in random order so we have a block of 24 trials if we move up in the hierarchy we go to practice loop click on it you see that practice loop calls block sequence only one time this means that the practice phase consists of only one block of trials say that we want to have two practice blocks we can change the repeat value to 2 like this and then we have 1 times 2 is 2 times is block sequence called during the practice loop okay so we have two practice blocks of 24 trials the same logic goes for the experimental loop now I think a reasonable number of trials for an experimental phase is 8 blocks for an experimental phase is 8 if we put this to 8 you see that during the experimental loop block sequence will be called 8 times that means that our experiment will consist of 8 blocks of 24 trials which is fine a nice trick I think for data analysis and that's actually what I usually do is that I add a variable to the experimental loop which is practice no so if you define a new variable you can say the name of the variable space and then the default value no practice no and in the practice loop we say practice yes this does nothing in our experiment but it makes it easier during data analysis because we can automatically filter out all trials where practice is yes so it always makes sense I think to think of your data analysis already while you're designing your experiment because it can save you a lot of headaches okay well that was the end of of step 11 now we're moving on to step 12 in which we're going to write the instructions the end of practice and the end of experiment messages let's just do that really quickly because just for the sake of time but obviously instructions are a very important aspect of your experiment so you should really think very carefully on how to frame your instructions so that the participant understands preferably using a bullet point kind of bullet point kind of structure and without having too much information on the screen at any one time those are I think the golden rules for having a clear instructions display or having multiple instructions if your instructions are kind of complicated so let's say instructions okay so let's just keep it really short say if you see an F press M if you see an H press slash slash right okay we're going to the end of practice message which is more or less the same end of practice you see by the way the title of the form has these weird things around it span size 24 these are so called HTML tags that allow you to kind of adjust the layout of your letters for example this means that all the text that is within this span has a size of 24 which is a little bit bigger than usual and this is a flexible way to add some text formatting to your experiment so you can take a look at the text page on the documentation side to find out how that works but basically it works like a sort of simplified HTML okay the practice phase is finished finished okay of course in real life you have to explain this a little bit so participants understand what the difference between the practice phase and experimental phase is end of experiment the experiment is finished is finished okay now there we are this is the end of step 12 and step 13 is running the experiment now before we're going to do that we're going to do something that is super important without saving our experiment click on the save button I've been working quite some time and without saving at all that is not not really good practice I think I would recommend saving your experiment quite often so that you don't lose anything if your computer crashes or whatever disaster catastrophe occurs well it automatically suggests a name video tutorial.osxp is the default file extension of open sesame as of open sesame 3.0 okay that's fine save okay now we're totally good to go now we can run our experiment we can do this in three ways we can click on the run full screen button which is basically what you would do if you would run the experiment in real life with real participants we can run it in a window or we can do a quick run a quick run is the same as running in a window the only difference is that it bypasses a few questions like asking for the subject number so it's quite convenient during debugging but here what we're going to do is run it in a window so you can see what that looks like what we're also going to do is we're going to show the variable inspector so kind of click on this because the variable inspector gives a live overview of the values that certain variables have so say for example here we have the correct variable which depends obviously on the response if we run the experiment you will see this correct variable switching from 0 to 1 etc depending on whether I give a correct response okay so that's very convenient during debugging for example allows you to see whether the conditions that you see defined here in your variable inspector match the behavior of your experiment okay so let's click on run in window enter subject number 0 that's fine select save the data file somewhere so open sesame uses comma separated values files which are spreadsheet text based spreadsheets that you can just open in excel or liberal office or whatever kind of spreadsheet software you use excel sometimes opens it in a little bit of a funny way but you can if you google a little bit you will find out how to open it okay save there we go we have our instruction screen right so move it a little bit to the left so we can see it so we can see the correct variable here okay and there we go okay we have the smiley face I see an F so Z is correct right so correct becomes 1 Z now I'm going to make a mistake Z again I hear a sound and correct becomes 0 if I don't respond it will time out after 2 seconds okay well that's it thank you very much for following this gays tutorial and bearing with me you can find out much more about open sesame on the documentation side including other tutorials more complicated tutorials that include python code etc so I would definitely recommend checking those out and if you have any questions don't hesitate to ask them on the support forum where you will be helped very quickly usually by one of the community members thank you very much