Stimuli Not Showing for the Times Specified


Author
Message
ewa2702
ewa2702
Partner Member (784 reputation)Partner Member (784 reputation)Partner Member (784 reputation)Partner Member (784 reputation)Partner Member (784 reputation)Partner Member (784 reputation)Partner Member (784 reputation)Partner Member (784 reputation)Partner Member (784 reputation)
Group: Forum Members
Posts: 8, Visits: 37
Hi guys,

I have a problem and I am very stumped. I am trying to present an array of images for randomized durations of either 400, 600, 800, 1000, 1200, 400 or 1600 ms. Each picture is preceded by a fixation cross and is followed by a mask. Participants then make an alternative forced choice judgment about the length of each stimulus duration (by pressing either the left or right arrow key). There are 50 trials (i.e. 50 pictures shown) in each block. My code, however, does not appear to show the images for the time it says it does (note: when I create a data file for values.fixduration it lies and tells me it is showing the pictures for the correct amount of time). 

Here are the relevant bits of the code:

<item trial_items1>
/1 = "1616.jpg"
/2 = "2220.jpg"
/3 = "2385.jpg"
/4 = "2487.jpg"
/5 = "2514.jpg"
/6 = "5532.jpg"
/7 = "6150.jpg"
/8 = "7170.jpg"
/9 = "7182.jpg"
/10 = "7207.jpg"
/11 = "3000.jpg"
/12 = "3102.jpg"
/13 = "3110.jpg"
/14 = "3140.jpg"
/15 = "3150.jpg"
/16 = "3266.jpg"
/17 = "3500.jpg"
/18 = "6230.jpg"
/19 = "6300.jpg"
/20 = "6370.jpg"
</item>

<picture neuneg_picture1>
/items = trial_items1
/select = noreplace
/position = (50,50)
</picture>

<trial neuneg_trial1>
/ontrialbegin = [values.fixduration = replace(400, 600, 800, 1000, 1200, 1400, 1600)]
/ontrialbegin = [trial.neuneg_trial1.insertstimulustime(picture.mask, 200+values.fixduration);]
/stimulustimes = [1=fixation_cross_text; 200=neuneg_picture1]
/validresponse = (203, 205)
/ontrialend = [values.presponse = trial.neuneg_trial1.response]
/ontrialend = [if(values.fixduration <= 850) values.correctresponse = "203"]
/ontrialend = [if(values.fixduration >=851) values.correctresponse = "205"]
/ontrialend=[if(values.correctresponse == values.presponse) values.trialoutcome = 1]
/ontrialend=[if(values.correctresponse != values.presponse) values.trialoutcome = 0]
/pretrialpause = (400)
/recorddata= true
/inputdevice= keyboard
</trial>

<block neuneg_block1>
/trials = [1-49=noreplace(neuneg_trial1)]
</block>

<expt expt_b>
/blocks = [1=practise_block; 2=trial_instructions_survey; 3=noreplacenorepeat(neuneg_block1)
</expt>


I am not sure what is wrong. Especially because the first picture appears to show for the correct time, and then the others do not. 

Thanks a bunch in advance!!!!!!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
When you insert a stimulus at a specified time as in

/ontrialbegin = [trial.neuneg_trial1.insertstimulustime(picture.mask, 200+values.fixduration);]

the inserted stimulus *persists* across trials -- i.e., the changes are *cumulative* -- *unless* you explicitly reset the stimulus presentation sequence.

Suppose you insert the mask picture at 600ms in the *first* instance of <trial neuneg_trial1>. That instance of the trial will display the mask picture at that time.

Further suppose you insert the mask picture at 1400ms in the *second* instance of <trial neuneg_trial1>. That instance will now display the mask picture at *both* 600ms (where it was inserted in the 1st instance) AND 1400ms (where it was inserted in the 2nd instance).

The above is how it's intended to work, i.e., it is not a bug.

The solution is to do

<trial neuneg_trial1>
/ontrialbegin = [values.fixduration = replace(400, 600, 800, 1000, 1200, 1400, 1600)]
/ontrialbegin = [trial.neuneg_trial1.insertstimulustime(picture.mask, 200+values.fixduration);]
/stimulustimes = [1=fixation_cross_text; 200=neuneg_picture1]
/validresponse = (203, 205)
/ontrialend = [values.presponse = trial.neuneg_trial1.response]
/ontrialend = [if(values.fixduration <= 850) values.correctresponse = "203"]
/ontrialend = [if(values.fixduration >=851) values.correctresponse = "205"]
/ontrialend=[if(values.correctresponse == values.presponse) values.trialoutcome = 1]
/ontrialend=[if(values.correctresponse != values.presponse) values.trialoutcome = 0]
/ontrialend = [trial.neuneg_trial1.resetstimulusframes(); ]
/pretrialpause = (400)
/recorddata= true
/inputdevice= keyboard
</trial>

as previously noted here https://www.millisecond.com/forums/FindPost19218.aspx under #1.

Hope this helps.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search