Millisecond Forums

How to record sound and button presses on the same trial?

https://forums.millisecond.com/Topic29393.aspx

By AbigailNovick - 7/14/2020

Hello,

I am trying to record audio and also record button presses on the same trial. I record sound using soundcapture, and record button presses using keyboard as the inputdevice. 

The problem is if I want to record what buttons subjects press by using validresponse, then the trial ends as soon as they press a keyboard button, thus truncating the recording. 

How do I continue recording even after a keyboard button has been pressed?

Thank you for your time,
Abby

current code below
<trial mytrial>
/ soundcapture = true
/ inputdevice = keyboard
/ stimulustimes = [0=target]
/ trialduration = 2000
/ validresponse =(23, 36, 37, 38)
</trial>
By Dave - 7/14/2020

AbigailNovick - 7/14/2020
Hello,

I am trying to record audio and also record button presses on the same trial. I record sound using soundcapture, and record button presses using keyboard as the inputdevice. 

The problem is if I want to record what buttons subjects press by using validresponse, then the trial ends as soon as they press a keyboard button, thus truncating the recording. 

How do I continue recording even after a keyboard button has been pressed?

Thank you for your time,
Abby

current code below
<trial mytrial>
/ soundcapture = true
/ inputdevice = keyboard
/ stimulustimes = [0=target]
/ trialduration = 2000
/ validresponse =(23, 36, 37, 38)
</trial>

You do something like

<trial mytrial>
/ soundcapture = true
/ inputdevice = keyboard
/ stimulustimes = [0=target; 2000=target]
/ responseinterrupt = frames
/ beginresponsetime = 0
/ trialduration = 2000
/ validresponse =(23, 36, 37, 38)
</trial>
By AbigailNovick - 7/14/2020

Dave - 7/14/2020
AbigailNovick - 7/14/2020
Hello,

I am trying to record audio and also record button presses on the same trial. I record sound using soundcapture, and record button presses using keyboard as the inputdevice. 

The problem is if I want to record what buttons subjects press by using validresponse, then the trial ends as soon as they press a keyboard button, thus truncating the recording. 

How do I continue recording even after a keyboard button has been pressed?

Thank you for your time,
Abby

current code below
<trial mytrial>
/ soundcapture = true
/ inputdevice = keyboard
/ stimulustimes = [0=target]
/ trialduration = 2000
/ validresponse =(23, 36, 37, 38)
</trial>

You do something like

<trial mytrial>
/ soundcapture = true
/ inputdevice = keyboard
/ stimulustimes = [0=target; 2000=target]
/ responseinterrupt = frames
/ beginresponsetime = 0
/ trialduration = 2000
/ validresponse =(23, 36, 37, 38)
</trial>

This is perfect!!!! Just tried it out.Thank you so much, Dave :)