Libet Clock


Author
Message
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
FYI: I'll keep mulling this over for a little while longer. If I can come up with a way to make the transitions between trials smoother (i.e., further minimize or avoid delays introduced by stimulus preparation and/or hardware constraints), I will update this thread.

Psych_Josh
Psych_Josh
Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)
Group: Forum Members
Posts: 85, Visits: 397
Thanks Dave - Is there any way to preload the stimulus into the computer's RAM somehow? That's how matlab and eprime cope with such things, but they're unusable for online research.

Josh
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
Inquisit loads stimuli into RAM (as much as possible) when it initially parses the script; that does not, however, eliminate the audio hardware's inherent startup latency.

As I said, I'm toying around with a couple of ideas to make transitions smoother, but I frankly don't know if any of them is workable yet.

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
Okay, after thinking about this for a good long while as well as playing around with a couple of ideas, the best alternative implementation approach I can see is actually really unsophisticated: Use the <block> element's /bgstim attribute to have a video (20 frames per second) of the clock running constantly in the background. Then your <trial>s within that <block> are basically relieved of the burden to transition smoothly, i.e., without interrupting or briefly stalling the display of the moving clock. Example implementation (video included) is in the attached ZIP archive. Hope this helps.

Attachments
Libet_Alternative.zip (463 views, 962.00 KB)
Psych_Josh
Psych_Josh
Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)
Group: Forum Members
Posts: 85, Visits: 397
Hi Dave, thanks for your continued efforts - I tried running the study but encountered these errors:

Inquisit Media Error: Pins cannot connect because they don't support the same transport. line 74: file win\MediaPlayerControl.cpp
Unable to the load media file 'C:/Users/josha/Downloads/Libet_Alternative/libet.avi'. Verify the file is of a supported video format.

- is this specific to my computer? As this would be run online, would this mean there'd be a requirement of the participant's computer to run the study?

Thanks again,
Josh
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
This would indicate a codec issue, i.e., it *might* be particular to your system, but others may run into it as well. You can take the video and re-encode it to a different format using your transcoder of choice (MPEG-2 should be a suitable codec choice for maximum compatibility across systems).

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
By the way, if you want to toy around with this yourself: There are plenty tutorials available online (from basic to technically advanced) on how to generate videos from a set of still images. Search terms like "jpeg to mpeg" or "jpeg to avi" will bring up those articles and the tools you can use (see e.g. http://www.howtoanswer.com/create-avi-files-from-png-jpeg-and-bmp-images-format--155.html for a basic one and http://electron.mit.edu/~gsteele/ffmpeg/ for something on the technical side worth reading).

Psych_Josh
Psych_Josh
Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)
Group: Forum Members
Posts: 85, Visits: 397
Excellent, thanks Dave, you've been a great help. I'll try this method, and hopefully be able to figure this out myself.

Thanks again,
Josh
Psych_Josh
Psych_Josh
Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)Guru (11K reputation)
Group: Forum Members
Posts: 85, Visits: 397
Hi Dave,

I've played around with script, converted the video, and I think I mostly understand all of the technical aspects - however, given that this is a video, I can't see a way to report the current value (position) of the dot around the clock when the participant makes their response, which is crucial for the data columns so that I can compare their estimated time vs. the actual time (which we previously did via values.onset). Is there a way to still record this? I was thinking that if the video frames/time are/is specifically linked to a .jpeg, we could code for 24 values for each .jpeg, and use a counting measure for how long the video has played for. Is this viable?

Many thanks,
Josh
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
There isn't a way to record the exact frame. What you'd do instead is capture the <block>'s elapsedtime property at the relevant points of interest. I.e.,
- At what time has the response-gathering trial started in the block (-> values.responsetrial_starttime)? This indicates when the video has been successfully started / is running.
- At what time within the block have we observed the response (-> values.response_time)?
- At what time within the block has the audio-trial started and the sound been initiated (-> values.audiotrial_starttime & values.sound_starttime)?

This should give you the information you need.

<values>
/ delay = 0
/ keep_rotating_for = 0
/ intervalestimation = 0
</values>

<values>
/ response_time = 0
/ sound_starttime = 0
/ audiotrial_starttime = 0
/ responsetrial_starttime = 0
</values>

<data>
/ columns = [subject blockcode trialcode values.responsetrial_starttime values.response_time
    values.audiotrial_starttime values.sound_starttime values.delay values.intervalestimation]
/ separatefiles = true
</data>

<defaults>
/ screencolor = white
</defaults>

<expt>
/ blocks = [1-4 = fixate_p_block]
</expt>

<block fixate_p_block>
/ bgstim = (cross)
/ trials = [1=fixate_p]
/ branch = [block.rotate_p_block]
/ recorddata = false
</block>

<trial fixate_p>
/ontrialbegin = [values.keep_rotating_for = round(rand(2000,3500)); values.delay = 1500;
    values.audiotrial_starttime = -1; values.intervalestimation = -1;
    values.responsetrial_starttime = -1; values.response_time = -1;
    values.audiotrial_starttime = -1; values.sound_starttime = -1; ]
/ validresponse = (0)
/ trialduration = 1000
/ recorddata = false
</trial>

<text cross>
/ items = ("+")
/ color = (0,0,0)
/ erase = false
</text>

<block rotate_p_block>
/ bgstim = (clock)
/ trials = [1=response_p; 2=audio_p]
/ branch = [block.estimate_p_block]
</block>

<trial response_p>
/ ontrialbegin = [values.responsetrial_starttime = block.rotate_p_block.elapsedtime; ]
/ correctresponse = (57)
/ ontrialend = [values.response_time = block.rotate_p_block.elapsedtime; ]
</trial>

<trial audio_p>
/ ontrialbegin = [values.audiotrial_starttime = block.rotate_p_block.elapsedtime; ]
/ ontrialbegin = [trial.audio_p.insertstimulustime(sound.possounds, values.delay); ]
/ ontrialend = [values.sound_starttime = values.audiotrial_starttime + sound.possounds.stimulusonset; ]
/ ontrialend = [trial.audio_p.resetstimulusframes(); ]
/ validresponse = (0)
/ trialduration = values.delay + values.keep_rotating_for + 1000
</trial>

<sound possounds>
/ items = possounds
/ playthrough = false
/ select = noreplace
/ resetinterval = 0
</sound>

<item possounds>
/1 = "FemCheer.wav"
/2 = "FemLaugh.wav"
/3 = "MaleCheer.wav"
/4 = "MaleLaugh.wav"
</item>

<video clock>
/ items = ("libet.avi")
/ playthrough = false
/ loop = true
/ erase = false
/ size = (100%, 100%)
</video>

<block estimate_p_block>
/ trials = [1=tep]
</block>

<surveypage TEp>
/questions = [1 = TE_response]
/showpagenumbers = false
/ontrialend = [values.intervalestimation = slider.te_response.response]
/recorddata = true
</surveypage>

<slider TE_response>
/ caption="How much time before the image appeared (in ms)?"
/ labels=("0ms", "100ms", "200ms", "300ms", "400ms", "500ms", "600ms", "700ms", "800ms", "900ms", "1000ms")
/responsefontstyle  = ("Arial", 1.5%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
/ range = (0, 1000)
/ increment = 1
/showticks = true
/slidersize = (70%, 30%)
/position = (10%, 50%)
/defaultresponse = 0
</slider>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search