﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 4  » Reaction Time and Audio File Questions</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Fri, 22 May 2026 21:58:38 GMT</lastBuildDate><ttl>20</ttl><item><title>Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18524.aspx</link><description>I am writing a script where I would like to have a ball bouncing continuously on the screen for 2 minutes. For this block, the participant will be instructed to tap the space key when the ball hits the bottom of the screen. &lt;br/&gt;&lt;br/&gt;1. I would like to record reaction time data, but I am unsure of how to go about doing this.&lt;br/&gt;&lt;br/&gt;2. Is there any way that I can make a sound appear whenever the keyboard is tapped during this block?&lt;br/&gt;&lt;br/&gt;Thanks!</description><pubDate>Mon, 14 Mar 2016 11:38:23 GMT</pubDate><dc:creator>christinahaywood</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18601.aspx</link><description>One more thought what might be going on here. If you're running this on a Mac, it's possible that the OS's media display subsystem interprets mouse clicks as commands (and e.g. briefly pauses the video when the mouse button is pressed / until it's released).&lt;br/&gt;&lt;br/&gt;I'm not near a Mac right now, but perhaps one can work around this by overlaying some transparent stimulus and defining that as the valid response. I.e.&lt;br/&gt;&lt;br/&gt;&amp;lt;block recordingA&amp;gt;&lt;br/&gt;/ trials = [1=taprecordingA]&lt;br/&gt;/ bgstim = (ballbouncevideo_A)&lt;br/&gt;/ timeout = 60000&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial taprecordingA&amp;gt;&lt;br/&gt;/ stimulusframes = [1=click]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ isvalidresponse = [{values.rt_relative_to_blockstart = block.recordingA.elapsedtime; trial.taprecordingA.response == "click" }]&lt;br/&gt;/ branch = [trial.taprecordingA]&lt;br/&gt;/ responsemessage = ("click",bounce,200)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture click&amp;gt;&lt;br/&gt;/ items = ("transparent.png")&lt;br/&gt;/ size = (100%, 100%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ rt_relative_to_blockstart = -1&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;video ballbouncevideo_A&amp;gt;&lt;br/&gt;/ items = ("PatternAVideo.mp4")&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;/ size = (100%, 100%)&lt;br/&gt;&amp;lt;/video&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;video bounce&amp;gt;&lt;br/&gt;/ items = ("Jump_Sound.mp3")&lt;br/&gt;&amp;lt;/video&amp;gt;&lt;br/&gt;</description><pubDate>Mon, 14 Mar 2016 11:38:23 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18600.aspx</link><description>I don't have your video, so I had to plug in some other, arbitrary mp4 I had lying around. I am unable to reproduce this. The video plays uninterrupted upon mouse click for me. I'll point out though, that you should use a &amp;lt;video&amp;gt; element -- not &amp;lt;sound&amp;gt; -- to play back the mp3 "bounce" sound. Please check if this makes any difference.&lt;br/&gt;</description><pubDate>Mon, 14 Mar 2016 11:18:38 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18598.aspx</link><description>Hi,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I've changed my input device from keyboard to mouse using the code above, however, whenever I click the mouse it pauses my video of the ball bouncing. It does not do this when i set the input to keyboard. Why might this be, and how could I go about setting my input device to mousekey while making sure it does not pause my video?&lt;br/&gt;&lt;br/&gt;Here is the script:&lt;br/&gt;&lt;br/&gt;&amp;lt;block recordingA&amp;gt;&lt;br/&gt;/ trials = [1=taprecordingA]&lt;br/&gt;/ bgstim = (ballbouncevideo_A)&lt;br/&gt;/ timeout = 60000&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial taprecordingA&amp;gt;&lt;br/&gt;/ inputdevice = mousekey&lt;br/&gt;/ isvalidresponse = [{values.rt_relative_to_blockstart = block.recordingA.elapsedtime; trial.taprecordingA.response == "lbuttondown" }]&lt;br/&gt;/ branch = [trial.taprecordingA]&lt;br/&gt;/ responsemessage = (lbuttondown,bounce,200)&lt;br/&gt;&amp;lt;/trial&amp;gt; &lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ rt_relative_to_blockstart = -1&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;video ballbouncevideo_A&amp;gt;&lt;br/&gt;/ items = ("PatternAVideo.mp4")&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;/ size = (100%, 100%)&lt;br/&gt;&amp;lt;/video&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound bounce&amp;gt;&lt;br/&gt;/ items = ("Jump_Sound.mp3")&lt;br/&gt;/ resetinterval = 200&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thanks.</description><pubDate>Mon, 14 Mar 2016 11:00:35 GMT</pubDate><dc:creator>christinahaywood</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18554.aspx</link><description>You need to set the &amp;lt;trial&amp;gt;'s /inputdevice to either mouse or mousekey. &lt;br/&gt;&lt;br/&gt;You need to specify a valid mouse event as detailed in the documentation for the /validresponse attribute. By "simple click" you probably mean pressing the left mouse button. The event for that is "leftbuttondown".&lt;br/&gt;&lt;br/&gt;&amp;lt;trial taprecordingA&amp;gt;&lt;br/&gt;/ inputdevice = mousekey&lt;br/&gt;/ isvalidresponse = [{values.rt_relative_to_blockstart = block.recordingA.elapsedtime; trial.taprecordingA.response == "lbuttondown"}]&lt;br/&gt;/ branch = [trial.taprecordingA]&lt;br/&gt;/ responsemessage = (lbuttondown,bounce,200-250)</description><pubDate>Thu, 10 Mar 2016 13:29:32 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18553.aspx</link><description>Following the code you wrote above, I've created the manipulation. However, I would like to change the input from spacebar to a simple mouse click. How can I do this specifically for trial.trialname.response in the isvalidresponse attribute? When I type mouse it does not work.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial taprecordingA&amp;gt;&lt;br/&gt;/ isvalidresponse = [{values.rt_relative_to_blockstart = block.recordingA.elapsedtime; trial.taprecordingA.response == mouse}]&lt;br/&gt;/ branch = [trial.taprecordingA]&lt;br/&gt;/ responsemessage = (mouse,bounce,200-250)&lt;br/&gt; </description><pubDate>Thu, 10 Mar 2016 13:02:39 GMT</pubDate><dc:creator>christinahaywood</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18532.aspx</link><description>&amp;gt; [...]&amp;nbsp; is there any way to get two trials to play simultaneously?&lt;br/&gt;&lt;br/&gt;No.&lt;br/&gt;</description><pubDate>Wed, 09 Mar 2016 05:36:36 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18527.aspx</link><description>Ok so I figured out the sound issue, but is there any way to get two trials to play simultaneously?&lt;br/&gt;&lt;br/&gt;&amp;lt;block sync&amp;gt;&lt;br/&gt;/ preinstructions = (intro1sync)&lt;br/&gt;/ trials = [1-12=random(slow,fast); 1-12=taprecording]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;</description><pubDate>Tue, 08 Mar 2016 20:51:38 GMT</pubDate><dc:creator>christinahaywood</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18526.aspx</link><description>So far I've coded the ball bouncing using two trials (one where the ball bounces fast and the other where it bounces slow). I also have an mp3 sound file that I want to use for the response noise instead of systembeep. Here is what I've coded so far, but when I run the script I am unable to hear the sound when I press the space bar.&lt;br/&gt;&lt;br/&gt;Second question is - how can I change the input from spacebar to a mouse click?&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block sync&amp;gt;&lt;br/&gt;/ trials = [1-12 = random(slow,fast), taprecording]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial taprecording&amp;gt;&lt;br/&gt;/ isvalidresponse = [{values.rt_relative_to_blockstart = block.sync.elapsedtime; trial.taprecording.response == 57}]&lt;br/&gt;/ branch = [trial.taprecording]&lt;br/&gt;/ responsemessage = (57,Jump_Sound.mp3, 50)&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ rt_relative_to_blockstart = -1&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ columns = [date time subject group blocknum blockcode trialnum trialcode response latency values.rt_relative_to_blockstart]&lt;br/&gt;/ separatefiles = true&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial fast&amp;gt;&lt;br/&gt;/ pretrialpause = replace(0-850)&lt;br/&gt;/ stimulustimes = [&lt;br/&gt;&amp;nbsp;0=ball10, table;&lt;br/&gt;15=blank10, ball12.5;&lt;br/&gt;30=blank12.5, ball15;&lt;br/&gt;45=blank15, ball17.5;&lt;br/&gt;60=blank17.5, ball20;&lt;br/&gt;75=blank20, ball17.5;&lt;br/&gt;90=blank17.5, ball15;&lt;br/&gt;105=blank15, ball12.5;&lt;br/&gt;120=blank12.5, ball10;&lt;br/&gt;/ validresponse = (noresponse)&lt;br/&gt;/ timeout = 120&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial slow&amp;gt;&lt;br/&gt;/ pretrialpause = replace(0-1105)&lt;br/&gt;/ stimulustimes = [&lt;br/&gt;&amp;nbsp;0=ball10, table;&lt;br/&gt;20=blank10, ball12.5;&lt;br/&gt;40=blank12.5, ball15;&lt;br/&gt;60=blank15, ball17.5;&lt;br/&gt;80=blank17.5, ball20;&lt;br/&gt;100=blank20, ball17.5;&lt;br/&gt;120=blank17.5, ball15;&lt;br/&gt;140=blank15, ball12.5;&lt;br/&gt;160=blank12.5, ball10;&lt;br/&gt;/ validresponse = (noresponse)&lt;br/&gt;/ timeout = 160&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture ball20&amp;gt;&lt;br/&gt;/ items = ("ball.png")&lt;br/&gt;/ position = (70,20)&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape blank20&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ position = (70,20)&lt;br/&gt;/ color = black&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture ball17.5&amp;gt;&lt;br/&gt;/ items = ("ball.png")&lt;br/&gt;/ position = (70,17.5)&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape blank17.5&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ position = (70,17.5)&lt;br/&gt;/ color = black&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture ball15&amp;gt;&lt;br/&gt;/ items = ("ball.png")&lt;br/&gt;/ position = (70,15)&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape blank15&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ position = (70,15)&lt;br/&gt;/ color = black&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture ball12.5&amp;gt;&lt;br/&gt;/ items = ("ball.png")&lt;br/&gt;/ position = (70,12.5)&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape blank12.5&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ position = (70,12.5)&lt;br/&gt;/ color = black&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture ball10&amp;gt;&lt;br/&gt;/ items = ("ball.png")&lt;br/&gt;/ position = (70,10)&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape blank10&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ position = (70,10)&lt;br/&gt;/ color = black&lt;br/&gt;/ valign = top&lt;br/&gt;/ size = (12%,12%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture table&amp;gt;&lt;br/&gt;/ items = ("table1.png")&lt;br/&gt;/ position = (70,20)&lt;br/&gt;/ valign = top&lt;br/&gt;/ erase = false&lt;br/&gt;/ size = (20%, 20%)&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 08 Mar 2016 20:00:51 GMT</pubDate><dc:creator>christinahaywood</dc:creator></item><item><title>RE: Reaction Time and Audio File Questions</title><link>https://forums.millisecond.com/Topic18525.aspx</link><description>&amp;gt; I am writing a script where I would like to have a ball bouncing continuously on the screen for 2 minutes. For this block, the participant will &lt;br/&gt;&amp;gt; be instructed to tap the space key when the ball hits the bottom of the screen. &lt;br/&gt;&lt;br/&gt;You can have a &amp;lt;video&amp;gt; displaying the bouncing ball displayed during the entire &amp;lt;block&amp;gt; using its /bgstim attribute. You'll also want the &amp;lt;block&amp;gt;'s /timeout to 120000 (2 minutes).&lt;br/&gt;&lt;br/&gt;&amp;gt; 1. I would like to record reaction time data, but I am unsure of how to go about doing this.&lt;br/&gt;&lt;br/&gt;Have the &amp;lt;block&amp;gt; run a single &amp;lt;trial&amp;gt; that does not display any stimuli, but mere allows for pressing the space bar. If you want latencies relative to the start of the &amp;lt;block&amp;gt;, you can log the block's elapsedtime property to the data file.&lt;br/&gt;&lt;br/&gt;&amp;gt; 2. Is there any way that I can make a sound appear whenever the keyboard is tapped during this block?&lt;br/&gt;&lt;br/&gt;Yes. You can play back a sound via the &amp;lt;trial&amp;gt;'s /responsemessage attribute.&lt;br/&gt;&lt;br/&gt;In a nutshell:&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ bgstim = (bouncingballvideo)&lt;br/&gt;/ trials = [1=keypresstrial]&lt;br/&gt;/ timeout = 120000&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial keypresstrial&amp;gt;&lt;br/&gt;/ isvalidresponse = [{values.rt_relative_to_blockstart = block.myblock.elapsedtime; trial.keypresstrial.response == 57}]&lt;br/&gt;/ branch = [trial.keypresstrial]&lt;br/&gt;/ responsemessage = (57,systembeep, 50)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;video bouncingballvideo&amp;gt;&lt;br/&gt;/ items = ("bouncingball.mpg")&lt;br/&gt;/ playthrough = false&lt;br/&gt;/ loop = true&lt;br/&gt;/ erase = false&lt;br/&gt;/ size = (100%, 100%)&lt;br/&gt;&amp;lt;/video&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ rt_relative_to_blockstart = -1&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ columns = [date time subject group blocknum blockcode trialnum trialcode response latency values.rt_relative_to_blockstart]&lt;br/&gt;/ separatefiles = true&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;&lt;br/&gt;As for scripts in the library, the "Inattentional Blindness Task" is similar in nature and worth taking a look at:&lt;br/&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/download/library/InattentionalBlindness/"&gt;https://www.millisecond.com/download/library/InattentionalBlindness/&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 08 Mar 2016 19:08:23 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>