Controlling Trial Duration


Author
Message
ChrisS
ChrisS
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 9, Visits: 27
Hi everyone,

My paradigm requires participant respond to particular visual targets in a block of trials. When they correctly buttonpress in response to the presentation of the target, a short 500ms sound will be played as feedback for correct response.

I want the trials to run its duration (1500ms) when participants button press in response to a stimuli.

However with the script I have so far..... as soon as the participant button presses in response to a stimuli, the stimuli disappears for the remainder of trial duration and is then followed by the short feedback sound.

I need the visual stimuli to stay on the screen for 1500ms when participant button presses. Does anyone know how to write a trial script for this?

Here is what I have so far. Thank you for taking the time to help me with this!

********************************************************************************
TRIALS
********************************************************************************

<trial green>
/ trialduration = 1500
/ stimulustimes = [0= green; 0 = greenmarker]
/ validresponse = (" ",noresponse,"p")
/ correctresponse = (" ")
/ responsetrial = (" ",correctfeedback1)
/ responsetrial = (noresponse,incorrectfeedback1)
/ responsetrial = ("p",pausetrial)
</trial>

<trial red>
/ trialduration = 1500
/ stimulustimes = [0= red; 0 = redmarker]
/ validresponse = (" ",noresponse,"p")
/ correctresponse = (noresponse)
/ responsetrial = (noresponse,correctfeedback2)
/ responsetrial = (" ",incorrectfeedback2)
/ responsetrial = ("p",pausetrial)
</trial>

<trial pausetrial>
/ stimulusframes = [1 = pausetext; 1 = pausemarker]
/ validresponse = ("p")
</trial>

<text pausetext>
/ items = ("Have a break!")
/ position = (50%, 50%)
/ valign = center
/ fontstyle = ("Arial", 6.00%, false, false, false, false, 5, 1)
/ txcolor = (255, 255, 255)
/ txbgcolor = (0,0,0)
</text>

<trial correctfeedback1>
/ stimulustimes = [0 = correctpicture; 0 = correctsound; 0 = correctfeedbackmarker1]
/ timeout = 500
/ validresponse = (noresponse)
</trial>

<trial incorrectfeedback1>
/ stimulustimes = [0 = incorrectpicture; 0 = incorrectfeedbackmaker1]
/ timeout = 500
/ validresponse = (noresponse)
</trial>

<trial correctfeedback2>
/ stimulustimes = [0 = correctpicture; 0 = correctfeedbackmarker2]
/ timeout = 500
/ validresponse = (noresponse)
</trial>

<trial incorrectfeedback2>
/ stimulustimes = [0 = incorrectpicture; 0 = incorrectfeedbackmarker2]
/ timeout = 500
/ validresponse = (noresponse)
</trial>

<text break>
/ items = break
/ position = (50%, 50%)
/ valign = center
/ fontstyle = ("Arial", 6.00%, false, false, false, false, 5, 1)
/ txcolor = (255, 255, 255)
/ txbgcolor = (0,0,0)
</text>

<item break>
/ 1 = "Have a break!"
</item>

<trial break>
/ stimulustimes = [0 = break; 0 = breakmarker]
/ validresponse = ("p")
</trial>



********************************************************************************
BLOCKS
********************************************************************************

<block one>
/ trials = [1-20=noreplace(green,green,green,green,green,green,green,green,green,green,red,red,red,red,red,red,red,red,red,red)]
</block>

<block two>
/ trials = [1=break;2-21=noreplace(green,green,green,green,green,green,green,green,green,green,red,red,red,red,red,red,red,red,red,red)]
</block>

<block three>
/ trials = [1=break;2-21=noreplace(green,green,green,green,green,green,green,green,green,green,red,red,red,red,red,red,red,red,red,red)]
</block>

<block four>
/ trials = [1=break;2-21=noreplace(green,green,green,green,green,green,green,green,green,green,red,red,red,red,red,red,red,red,red,red)]
</block>

<expt>
/ blocks = [1=one; 2=two; 3=three; 4=four]
</expt>

*********************************************************************************

<defaults>
/ screencolor = (0, 0, 0)
</defaults>




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: 109K
You'll want to set the respective stimululs elements' /erase attributes to false if you want them to remain visible. You may also want to adjust the <trial>s' /responseinterrupt behavior according to your preferences.

ChrisS
ChrisS
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 9, Visits: 27
Hi Dave,

Thanks for that! I just modified my <picture> /erase attribute to false and it worked :) the stimuli stayed on the screen even when a response is made. But I'm not exactly sure what the /responseinterrupt attribute is supposed to do?

Also, I was just wondering if there is anyway for me to write up a script command to send port codes to the EEG NeuroScan software when a participant button presses? I want to do this because I want to analyse EEG activity that occurs as a participant makes a response. So if a port code could show up on NeuroScan to indicate that the participant pressed the button, I would be able to analyse this EEG activity.

Any suggestions? 

Thanks for all of your help! You've been incredibly helpful!

Regards,
Chris
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: 109K
/responseinterrupt determines how a <trial> should behave once a response is registered. E.g. should it terminate immediately (that's the default)? Should first display any remaining stimuli in /stimulustimes or -frames etc.?

As for sending response-locked TTL signals (to an EEG or other external device), you'll want to set up <port> elements as needed and use /reponsemessage or the like to "display" them. See e.g. http://www.millisecond.com/forums/Topic1721.aspx

ChrisS
ChrisS
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 9, Visits: 27
Hi Dave,

I tried your suggestions regarding using the /responsemesssage attribute in the trial and adding an additional port code which I called pressmarker (see TRIAL section and MARKERS section below) but it didn't seem to work. Any ideas why?

******************************************************************************
STIMULI
******************************************************************************

<picture green>
/ items = green
/ size = (75%, 75%)
/ valign = center
/ position = (50%, 50%)
/ erase = false
</picture>

<item green>
/ 1 = "green.jpg"
</item>

<picture red>
/ items = red
/ size = (75%, 75%)
/ valign = center
/ position = (50%, 50%)
/ erase = false
</picture>

<item red>
/ 1 = "red.jpg"
</item>

<picture fixcross>
/ items = fixcross
/ size = (50%,50%)
/ valign = center
/ position = (50%,50%)
</picture>

<item fixcross>
/ 1 = "fixcross.png"
</item>

<sound correctsound>
/items = correctsound
</sound>

<item correctsound>
/ 1 = "trainwhistle.wav"
</item>

<picture correctpicture>
/ items = correctpicture
/ size = (100%, 100%)
/ valign = center
/ position = (50%, 50%)
</picture>

<item correctpicture>
/ 1 = "blacksq.png"
</item>

<picture incorrectpicture>
/ items = incorrectpicture
/ size = (100%, 100%)
/ valign = center
/ position = (50%, 50%)
</picture>

<item incorrectpicture>
/ 1 = "blacksq.png"
</item>


********************************************************************************
MARKERS
********************************************************************************

<port greenmarker>
/ port = lpt1
/ subport = data
/ items = ("00000001")
</port>

<port redmarker>
/ port = lpt1
/ subport = data
/ items = ("00000100")
</port>

<port correctfeedbackmarker1>
/ port = lpt1
/ subport = data
/ items = ("00000010")
</port>

<port incorrectfeedbackmarker1>
/ port = lpt1
/ subport = data
/ items = ("00000011")
</port>

<port correctfeedbackmarker2>
/ port = lpt1
/ subport = data
/ items = ("00000101")
</port>

<port incorrectfeedbackmarker2>
/ port = lpt1
/ subport = data
/ items = ("00000110")
</port>

<port breakmarker>
/ port = lpt1
/ subport = data
/ items = ("00000111")
</port>

<port pausemarker>
/ port = lpt1
/ subport = data
/ items = ("00001000")
</port>

<port pressmarker>
/ port = lpt1
/ subport = data
/ items = ("00001001")
/ erase = true ("00000000")
</port>

********************************************************************************
TRIALS
********************************************************************************

<trial green1>
/ trialduration = 1500
/ stimulustimes = [0= green; 0= greenmarker]
/ validresponse = (" ",noresponse,"p")
/ correctresponse = (" ")
/ responsemessage = (" ", pressmarker, 100)
/ responsetrial = (" ",correctfeedback1)
/ responsetrial = (noresponse,incorrectfeedback1)
/ responsetrial = ("p",pausetrial)
</trial>

<trial green2>
/ trialduration = 1500
/ stimulustimes = [0= green; 0= greenmarker]
/ validresponse = (" ",noresponse,"p")
/ correctresponse = (noresponse)
/ responsemessage = (" ", pressmarker, 100)
/ responsetrial = (noresponse,correctfeedback2)
/ responsetrial = (" ",incorrectfeedback2)
/ responsetrial = ("p",pausetrial)
</trial>

<trial red1>
/ trialduration = 1500
/ stimulustimes = [0= red; 0= redmarker]
/ validresponse = (" ",noresponse,"p")
/ correctresponse = (noresponse)
/ responsemessage = (" ", pressmarker, 100)
/ responsetrial = (noresponse,correctfeedback2)
/ responsetrial = (" ",incorrectfeedback2)
/ responsetrial = ("p",pausetrial)
</trial>

<trial red2>
/ trialduration = 1500
/ stimulustimes = [0= red; 0= redmarker]
/ validresponse = (" ",noresponse,"p")
/ correctresponse = (" ")
/ responsemessage = (" ", pressmarker, 100)
/ responsetrial = (" ",correctfeedback1)
/ responsetrial = (noresponse,incorrectfeedback1)
/ responsetrial = ("p",pausetrial)
</trial>

<trial pausetrial>
/ stimulusframes = [1 = break; 1 = pausemarker]
/ validresponse = ("p")
</trial>

<picture break>
/ items = break
/ size = (100%, 100%)
/ valign = center
/ position = (50%, 50%)
</picture>

<item break>
/ 1 = "break.jpg"
</item>

<trial correctfeedback1>
/ stimulustimes = [0 = correctpicture; 0 = correctsound; 0 = correctfeedbackmarker1]
/ trialduration = 500
/ validresponse = (noresponse)
</trial>

<trial incorrectfeedback1>
/ stimulustimes = [0 = incorrectpicture; 0 = incorrectfeedbackmarker1]
/ trialduration = 500
/ validresponse = (noresponse)
</trial>

<trial correctfeedback2>
/ stimulustimes = [0 = correctpicture; 0 = correctfeedbackmarker2]
/ trialduration = 500
/ validresponse = (noresponse)
</trial>

<trial incorrectfeedback2>
/ stimulustimes = [0 = incorrectpicture; 0 = incorrectfeedbackmarker2]
/ trialduration = 500
/ validresponse = (noresponse)
</trial>

<trial break>
/ stimulustimes = [0 = break; 0 = breakmarker]
/ validresponse = ("p")
</trial>


********************************************************************************
BLOCKS
********************************************************************************

<block one>
/ trials = [1-50=noreplace(green2,red2)]
</block>

<block two>
/ trials = [1=break;2-51=noreplace(green2,red2)]
</block>

<block three>
/ trials = [1=break;2-51=noreplace(green1,red1)]
</block>

<block four>
/ trials = [1=break;2-51=noreplace(green1,red1)]
</block>
 
<expt>
/ blocks = [1=one; 2=two; 3=three; 4=four]
</expt>

*********************************************************************************

<defaults>
/ screencolor = (0, 0, 0)
</defaults>



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: 109K
What exactly does "it didn't seem to work" mean? Please be as specific as possible. What is or is not happening exactly?

ChrisS
ChrisS
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 9, Visits: 27
Hi Dave,

Sorry. I meant the response port code  "00001001" which should come out as "9" in the EEG NeuroScan software, did not appear when a button is pressed.

<port pressmarker>
/ port = lpt1
/ subport = data 
/ items = ("00001001")
/ erase = true ("00000000")
</port>

Chris
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: 109K
Start small. Set up a simple test script that simply does:

<block myblock>
/ trials = [1-10=mytrial]
</block>

<trial mytrial>
/ validresponse = (" ")
/ responsemessage = (" ", pressmarker, 100)
</trial>

and check if the device registers the signal.


The one complication you'll have to deal with in your full script is that any other markers presented via /stimulustimes will remain raised for the duration of the trial and will be *erased* at the end. That may interfere in multiple ways with the marker sent via /responsemessage. You'll want to toy around with something along the lines of


<port greenmarker>
/ port = lpt1
/ subport = data
/ items = ("00000001")
/ erase = false
</port>

<port allbitstozero>
/ port = lpt1
/ subport = data
/ items = ("00000000")
/ erase = false
</port>

<trial green1>
...
/ stimulustimes = [0=green,greenmarker; 50=allbitstozero]
/ beginresponsetime = 0
...
</trial>

to avoid that.

ChrisS
ChrisS
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 9, Visits: 27
Thanks Dave I'll give that a go!

Much appreciated! :)

Chris
ChrisS
ChrisS
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 9, Visits: 27
IT WORKED!!! AWESOME!!! :)

THANKS HEAPS DAVE!

Chris

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search