Millisecond Forums

Stimulus Randomization Question


https://www.millisecond.com/forums/Topic10718.aspx

By Lostcode - 6/24/2013

I have two stimuli that need to be displayed 250 times in total.


Image 1 = 48 times


Image 2 = 202 times


They must be randomized though.


Anyway to tell the block to do this?

By Dave - 6/24/2013

Yes, selection at the <block> level works according to the proportions given. See the examples in the documentation for the /trials attribute for details. One short example here (many more can be found by searching the forum):


/ trials = [1-10 = noreplace(a,a,b,b,b)]


will result in 4 'a' trials and 6 'b' trials in random order.


Another option is to use a <list> element for trial selection in the respective <block>s' /trials attribute. The desired trial-ratio can be specified via the <list>'s /itemprobabilities.

By Lostcode - 6/24/2013

I am having a 100ms gap between the instructions and the beginning of a blank screen.


The instructions end when 0 key is pressed.
I need it to be instant.

By Lostcode - 6/24/2013

Looking through my code I do not see what the cause could be. It's just a random gap of ~100ms between marker data.

By Lostcode - 6/24/2013

Does Inquisit put an automatic 50ms gap between stimulus???

By Dave - 6/24/2013

Sorry, I'm not following. (a) What's the relation to the trial-ratio question in this thread and (b) how would anyone know what code you are referring to (I don't see any of that posted)? Can you clarify? Otherwise I can't help here.

By Dave - 6/24/2013


Does Inquisit put an automatic 50ms gap between stimulus???



vg


No. But you may be mistaken about how trial timings work / the interplay between the various components. For that, see the "How to Control Trial Duration and Inter-Trial Intervals" topic in the docs.

By Lostcode - 6/24/2013

Here is the trials and blocks:

<trial instructions>
/ stimulustimes = [1=instructions]
/ validresponse = ("0")
/ errormessage = false
/ recorddata = false
/ responsemessage = ("0", tPort, 50)
</trial>



<trial break>
/ stimulustimes    = [1=blank, bPort; 50=zeroPort]
/ trialduration = values.break
/ errormessage = false
/ recorddata = false
</trial>


<trial warnsound>
/ stimulustimes = [0=warnsound]
/ trialduration = 500
/ errormessage = false
/ recorddata = false
</trial>



<block instructions>
/ screencolor = (0, 0, 0)
/ trials = [1=instructions]
</block>

<block warning>
/ onblockbegin = [values.break=200]
/ screencolor = (0, 0, 0)
/ trials = [1=break; 2=warnsound; 3=break; 4=warnsound; 5=break; 6=warnsound]
</block>



When I run this there is a gap of 100ms between Instructions and the first break in warning block.

By Dave - 6/24/2013

And why is that a problem? Also, why are you running the instructions trial in a separate block? Note that there'll be at least a single frame between <block>s for cleanup.

By Lostcode - 6/24/2013

Whoops. Put it in there. But there is still a delay of about ~88ms from beginning of instruction marker to the beginning of the break marker.

By Dave - 6/24/2013

As far as I can see, the instructions trial has no fixed duration. Also, as the marker depends on the time of response submission, there is no way to predict when exactly it will occur. Once it does occur, you've specified it to last 50 ms. Presumably, you also haven't set the respective <port> or other stims to /erase=false in <trial instructions>, thus introducing a frame between trials for cleanup / stimulus erasing. In sum, you may get a variable delay of a couple of frames.

By Lostcode - 6/24/2013

So what would be the best way to eliminate the extra delay? Setting stims to erase=false?

By Dave - 6/24/2013

So what would be the best way to eliminate the extra delay? Setting stims to erase=false?


Yes.

By Lostcode - 6/24/2013

I am getting ranges between the ~88ms to ~146ms still.


I have multiple trials for breaks in the beginning. What factors usually cause the trials to get extra ms added on?

By Dave - 6/24/2013

Cleanup, stimulus erasing. You should read the help topic mentioned previously ("How to control trial duration..."), the topic for the /erase attribute as well as the "How to erase stimuli" topic. Also: It is useful to think about timing strictly in terms of (display) frames and make proper use of /pretrialpause and /posttrialpause.

By Lostcode - 6/26/2013

Still having problems with extra ms intervals. Would you be willing to look at the code via email?

By Dave - 6/26/2013

I can do that. Note that you can simply attach the script to this thread (see the 'Options' tab for upload controls). Also, please indicate clearly where you see delays (i.e., include data to illustrate the issue) and what you expect the code to do (i.e., include comments in the relevant portions of your script).