Help with /ontrialbegin function to add fixation cross to start of trial


Help with /ontrialbegin function to add fixation cross to start of...

Author
Message
Greeny
Greeny
Associate Member
Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)

Group: Forum Members
Posts: 11, Visits: 39
Hi Dave,

I want to add a 500ms fixation cross to the start of every trial for this script: 

<trial UU_prac_green>
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]
/ ontrialbegin = [
values.primeitemnumber = list.UU_prac_primes.nextvalue;
values.targetitemnumber = list.UU_prac_targets.nextvalue;
]
/ ontrialbegin = [trial.UU_prac_green.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UU_prac_green.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UU_prac_green.resetstimulusframes()]
/ stimulustimes = [0 = CSNegPrimes_green]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_prac_green.response==values.responsekeyUnpleasant || trial.UU_prac_green.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_prac_green.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = picture.CSNegPrimes_green.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

How do I do this? I created a text element then tried to insert it before the / ontrialbegin = [trial.UU_prac_green.insertstimulustime(shape.eraser, (values.primeduration))] line but the closest I could get was showing a fixation cross, followed by the target stimulus without the prime showing in between.

Thanks,
Luke
Dave
Dave
Supreme Being
Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)

Group: Administrators
Posts: 8.6K, Visits: 36K
Greeny - Wednesday, November 8, 2017
Hi Dave,

I want to add a 500ms fixation cross to the start of every trial for this script: 

<trial UU_prac_green>
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]
/ ontrialbegin = [
values.primeitemnumber = list.UU_prac_primes.nextvalue;
values.targetitemnumber = list.UU_prac_targets.nextvalue;
]
/ ontrialbegin = [trial.UU_prac_green.insertstimulustime(shape.eraser, (values.primeduration))]
/ ontrialbegin = [trial.UU_prac_green.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi))]
/ ontrialend = [trial.UU_prac_green.resetstimulusframes()]
/ stimulustimes = [0 = CSNegPrimes_green]
/ beginresponsetime = values.primeduration + values.pt_isi
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_prac_green.response==values.responsekeyUnpleasant || trial.UU_prac_green.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_prac_green.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = picture.CSNegPrimes_green.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>

How do I do this? I created a text element then tried to insert it before the / ontrialbegin = [trial.UU_prac_green.insertstimulustime(shape.eraser, (values.primeduration))] line but the closest I could get was showing a fixation cross, followed by the target stimulus without the prime showing in between.

Thanks,
Luke

If you want it in every trial, you need not use /ontrialbegin. Simply add the thing to the <trial>'s /stimulustimes:

/ stimulustimes = [0 = fixation; 500=CSNegPrimes_green]

with

<text fixation>
/ items = ("+")
...
</text>

and make sure you adjust the remaining timings accordingly. I.e., you'll want to shift any inserted stimuli by 500ms

<trial UU_prac_green>
/ ontrialbegin = [values.primecategory="Unpleasant"; values.targetcategory="Unpleasant"]
/ ontrialbegin = [
values.primeitemnumber = list.UU_prac_primes.nextvalue;
values.targetitemnumber = list.UU_prac_targets.nextvalue;
]
/ ontrialbegin = [trial.UU_prac_green.insertstimulustime(shape.eraser, (values.primeduration + 500))]
/ ontrialbegin = [trial.UU_prac_green.insertstimulustime(text.UnpleasantTarget, (values.primeduration + values.pt_isi + 500))]
/ ontrialend = [trial.UU_prac_green.resetstimulusframes()]
/ stimulustimes = [0 = fixation; 500=CSNegPrimes_green]
/ beginresponsetime = values.primeduration + values.pt_isi + 500
/ responseinterrupt = immediate
/ monkeyresponse = (18, 23)
/ isvalidresponse = [trial.UU_prac_green.response==values.responsekeyUnpleasant || trial.UU_prac_green.response == values.responsekeyPleasant]
/ iscorrectresponse = [trial.UU_prac_green.response == values.responsekeyUnpleasant]

/ ontrialend = [values.prime = picture.CSNegPrimes_green.currentitem; values.target = text.UnpleasantTarget.currentitem]

/ posttrialpause = values.iti
/ errormessage = true(errorfeedback, 500)
</trial>
Greeny
Greeny
Associate Member
Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)Associate Member (121 reputation)

Group: Forum Members
Posts: 11, Visits: 39
Thanks Dave


ilanagratch
ilanagratch
New Member
New Member (48 reputation)New Member (48 reputation)New Member (48 reputation)New Member (48 reputation)New Member (48 reputation)New Member (48 reputation)New Member (48 reputation)New Member (48 reputation)New Member (48 reputation)

Group: Forum Members
Posts: 6, Visits: 11

Hi Dave - is there a way to add a pause after a fixation point and before the stimuli?
Dave
Dave
Supreme Being
Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)

Group: Administrators
Posts: 8.6K, Visits: 36K
ilanagratch - Monday, November 27, 2017

Hi Dave - is there a way to add a pause after a fixation point and before the stimuli?

Sure -- just time the stimuli in the /stimulustimes attribute accordingly. E.g. suppose you want to show a fixation cross for 2000ms, then make it disappear for 1000ms (the "pause"), and then start displaying other stimuli:

/stimulustimes = [0=fixationcross; 2000=erasefixationcross; 2500=somestimulus, ...]

with

<text fixationcross>
/ items = ("+")
</text>

<shape erasefixationcross>
/ shape = rectangle
/ color = white
/ size = (30%,30%)
/ erase = false
</shape>

<text somestimulus>
...
</text>

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search