Howdy, Stranger!

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

Supported by

[solved] Unique Randomization

edited October 2014 in OpenSesame

Hi,

I need to present a series of facial stimuli where both what face is shown and whether that face is shown once or three times (in a row). So; random face 'x', shown three times. Next, random face 'y', shown once.
It would be easy enough to randomize if face 'x' gets shown three times for each participant, but I'd like not only the face itself, but the number of times it's shown for every participant.

So far I am able to successfully randomize the presentation of the visual stimuli. My problem is (a) getting Open Sesame to decide to either show it once or three times and (b) getting it to show the visual stimulus again after say like a 500ms delay while still operating within the same loop sequence.

Any suggestions on how to accomplish this would be amazing!

Comments

  • edited October 2014

    Hi,

    Here is a working script example. The script (including some example pictures from Wikipedia) can be downloaded here.

    # Generated by OpenSesame 2.8.3 (Gutsy Gibson)
    # Wed Oct 01 21:35:32 2014 (nt)
    # <http://www.cogsci.nl/opensesame>
    
    set mouse_backend "legacy"
    set subject_parity "even"
    set height "768"
    set font_italic "no"
    set canvas_backend "legacy"
    set synth_backend "legacy"
    set start "experiment"
    set title "New experiment"
    set coordinates "relative"
    set width "1024"
    set sampler_backend "legacy"
    set transparent_variables "no"
    set foreground "white"
    set font_bold "no"
    set description "Default description"
    set background "black"
    set font_size "18"
    set keyboard_backend "legacy"
    set font_family "mono"
    set compensation "0"
    set bidi "no"
    set subject_nr "0"
    
    define sketchpad blank
        set duration "1000"
        set description "Displays stimuli"
    
    define sequence experiment
        run reset_counting_variable "always"
        run welcome "always"
        run face_loop "always"
    
    define loop face_loop
        set repeat "1"
        set description "Repeatedly runs another item"
        set item "face_sequence"
        set break_if "never"
        set column_order "imgname"
        set cycles "3"
        set order "random"
        setcycle 0 imgname "bunny.png"
        setcycle 1 imgname "carrot.png"
        setcycle 2 imgname "potato.png"
        run face_sequence
    
    define sequence face_sequence
        set flush_keyboard "yes"
        set description "Runs a number of items in sequence"
        run repeat_loop "always"
    
    define sketchpad image
        set duration "2000"
        set description "Displays stimuli"
        draw image 0 0 "[imgname]" scale=1 center=1 show_if="always"
    
    define loop repeat_loop
        set repeat "0.5"
        set description "Repeatedly runs another item"
        set item "showing_sequence"
        set break_if "never"
        set column_order "showtime"
        set cycles "2"
        set order "random"
        setcycle 0 showtime "1"
        setcycle 1 showtime "3"
        run repeat_sequence
    
    define sequence repeat_sequence
        set flush_keyboard "yes"
        set description "Runs a number of items in sequence"
        run show_loop "always"
        run reset_counting_variable "always"
    
    define inline_script reset_counting_variable
        ___run__
        exp.set("count_image", 0)
        __end__
        set _prepare ""
        set description "Executes Python code"
    
    define loop show_loop
        set repeat "3"
        set description "Repeatedly runs another item"
        set item "show_sequence"
        set break_if "[count_image] = [showtime]"
        set column_order ""
        set cycles "1"
        set order "random"
        run show_sequence
    
    define sequence show_sequence
        set flush_keyboard "yes"
        set description "Runs a number of items in sequence"
        run image "always"
        run blank "always"
    
    define sketchpad welcome
        set duration "keypress"
        set start_response_interval "no"
        set description "Displays stimuli"
        draw textline 0 0 "OpenSesame 2.8.0 <i>Gutsy Gibson</i>" center=1 color=white font_family="serif" font_size=32 font_italic=no font_bold=no show_if="always" html="yes"
    
  • edited 6:49PM

    Thanks, Edwin.

    This helped!

Sign In or Register to comment.