Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Control timing within a sketchpad

edited December 2016 in OpenSesame

Hi Sebastian,
I was wondering if there was any way to control timing within a sketchpad from its script. For example, if i want the same sketchpad to show a green and a red circle but with each circle having a duration of 300 ms can I manipulate the sketchpad's script to do this or do i have to create a separate script (and if yes how exactly?)? I really need one sketchpad for this so please let me know of any such solution.
Thanks!

Comments

  • Hi,

    If I understand correctly, you first want to show a circle in one color, and then in the other color? You'll need to use two sketchpads for this. Out of curiosity, why would it be problematic to use two sketchpads?

    Cheers,

    Josh

  • Hi It is part of a rhythmic sequence with limitations of which pattern to present and having 2 sketchpads just makes things harder....except if i make a loop for these 2 sketchpads and work this way?

  • You will need a loop either way. If your trial consists of e.g. a circle in a certain color, then another circle in a certain color, and then a response, you'll need two sketchpads and a response item in a sequence item. That sequence item can be placed in a loop item, and in the loop you define your conditions (e.g. what color your first and second circle should be).
    When you draw a circle in the sketchpad, you can click the middle icon of those three icons in the upper right corner to reveal a script. In this script, you see a parameter named color. Here, you could add something like color = [first_circle] for the first sketchpad, and color = [second_circle] for the second sketchpad. In the loop item you'll have two condition variables named first_circle and second_circle, that can have multiple values as specified in the cells of each column (e.g. red, blue, green).

    It may be worthwhile for you to do a tutorial and learn about building a trial. Displaying ten sketchpad really isn't more difficult than displaying one sketchpad! http://osdoc.cogsci.nl/2.9/tutorials/step-by-step-tutorial/

    Cheers

    Josh

  • Thanks. However, I plan to show, for example, a red circle of 600 ms, a green circle of 600 ms, a red that goes to green circle each 300 ms for a total of 600 ms, and a green that goes to red each 300 ms for total of 600 ms. This sequence of 4 elements have to be presented with some limitations for instance the red-600ms cannot be followed or preceded by a red circle and the same goes for the green 600ms circle. So just making a simple loop is easy but the difficulty for us is to create the pattern i just described. Any ideas?

  • Hi Argiro,

    Basically, the issue here is not the sketchpad but the definition of the trial sequence, right? The presentation of the stimulus is rather straightforward. Just like Josh described you need for each stimulus one sketchpad, in which you define the color and the duration generically (as variables).
    Earlier in the script, you need to define these variables. I think the easiest would be doing it in an inline_script, but maybe there are also other ways. Here, one suggestion:

    import random
    
    # possible trial combos (example)
    colors = [['red','green','red_green','green_red'],['green','red','red_green','green_red'],['red','green','green_red','red_green']]
    
    no_trials = 30
    no_circles_per_trial = 4
    trials = []
    
    while len(trials)< no_trials:
         trial_colors = random.choice(colors) # choose a trial randomly
         trials.append(trial_colors) # attach to trial_list
    
    

    This is just one example of how you could do it in general. I'm quite sure it won't do for you the way it is, but maybe you can figure it out by yourself based on this code. If you like you can share all the requirements and details of your paradigm with us, then we can help you better creating a procedure to make your sequences.

    Does this help/

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.