Random value for stimulus onset times


Author
Message
Andrew Haigh
Andrew Haigh
Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)
Group: Forum Members
Posts: 4, Visits: 6
Hi there

I was wondering if anyone knows how to set stimulustimes values to the value of an expression.

For example, I have

/stimulustimes=[0=s1; 1000=s2; 1400=instructions]

and I want the onset of s2 to occur at a random interval between 800 ms and 1200 ms after the onset of s1 rather than being fixed at 1000 ms..

Thanks in advance.

Andrew

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
Andrew Haigh - Friday, April 26, 2019
Hi there

I was wondering if anyone knows how to set stimulustimes values to the value of an expression.

For example, I have

/stimulustimes=[0=s1; 1000=s2; 1400=instructions]

and I want the onset of s2 to occur at a random interval between 800 ms and 1200 ms after the onset of s1 rather than being fixed at 1000 ms..

Thanks in advance.

Andrew

You need to do that by calling the insertstimulustime() function /ontrialbegin:

<expressions>
/ rand_onset = round(rand(800,1200))
</expressions>

<values>
/ current_onset = 0
</values>

<trial mytrial>
/ ontrialbegin = [
values.current_onset = expressions.rand_onset;
trial.mytrial.insertstimulustime(text.s2, values.current_onset);
]
/ ontrialend = [
trial.mytrial.resetstimulusframes();
]
/ stimulustimes=[0=s1; 1400=instructions]
/ validresponse = (57)
</trial>

<text s1>
/ items = ("s1")
/ position = (50%, 40%)
</text>

<text s2>
/ items = ("s2 @ onset <%values.current_onset%>")
/ position = (50%, 50%)
</text>

<text instructions>
/ items = ("instructions")
/ position = (50%, 60%)
</text>

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





Andrew Haigh
Andrew Haigh
Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)
Group: Forum Members
Posts: 4, Visits: 6
Dave - Friday, April 26, 2019
Andrew Haigh - Friday, April 26, 2019
Hi there

I was wondering if anyone knows how to set stimulustimes values to the value of an expression.

For example, I have

/stimulustimes=[0=s1; 1000=s2; 1400=instructions]

and I want the onset of s2 to occur at a random interval between 800 ms and 1200 ms after the onset of s1 rather than being fixed at 1000 ms..

Thanks in advance.

Andrew

You need to do that by calling the insertstimulustime() function /ontrialbegin:

<expressions>
/ rand_onset = round(rand(800,1200))
</expressions>

<values>
/ current_onset = 0
</values>

<trial mytrial>
/ ontrialbegin = [
values.current_onset = expressions.rand_onset;
trial.mytrial.insertstimulustime(text.s2, values.current_onset);
]
/ ontrialend = [
trial.mytrial.resetstimulusframes();
]
/ stimulustimes=[0=s1; 1400=instructions]
/ validresponse = (57)
</trial>

<text s1>
/ items = ("s1")
/ position = (50%, 40%)
</text>

<text s2>
/ items = ("s2 @ onset <%values.current_onset%>")
/ position = (50%, 50%)
</text>

<text instructions>
/ items = ("instructions")
/ position = (50%, 60%)
</text>

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





Hi Dave,

That's a really helpful reply thanks so much!

I have another related question that I was wondering if you or anyone else knew the answer to. My experiment uses audio files as stimuli, and the onset of these stimuli isn't synchronised with any events happening on the monitor. It's a temporal perception paradigm so timing is a crucial element of the experiment. The help docs say this about the "insertstimulustime" function:     

"Adds the stimulus to the frame of a trial corresponding to the specified time."

My question is does Inquisit still trigger the audio file at the time of the beginning of the next frame if the stimulus is not being presented on the monitor or is it able to place the stimulus at exactly the time indicated by the output of the rand expression?

Thanks

Andrew



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
Andrew Haigh - Tuesday, May 14, 2019
Dave - Friday, April 26, 2019
Andrew Haigh - Friday, April 26, 2019
Hi there

I was wondering if anyone knows how to set stimulustimes values to the value of an expression.

For example, I have

/stimulustimes=[0=s1; 1000=s2; 1400=instructions]

and I want the onset of s2 to occur at a random interval between 800 ms and 1200 ms after the onset of s1 rather than being fixed at 1000 ms..

Thanks in advance.

Andrew

You need to do that by calling the insertstimulustime() function /ontrialbegin:

<expressions>
/ rand_onset = round(rand(800,1200))
</expressions>

<values>
/ current_onset = 0
</values>

<trial mytrial>
/ ontrialbegin = [
values.current_onset = expressions.rand_onset;
trial.mytrial.insertstimulustime(text.s2, values.current_onset);
]
/ ontrialend = [
trial.mytrial.resetstimulusframes();
]
/ stimulustimes=[0=s1; 1400=instructions]
/ validresponse = (57)
</trial>

<text s1>
/ items = ("s1")
/ position = (50%, 40%)
</text>

<text s2>
/ items = ("s2 @ onset <%values.current_onset%>")
/ position = (50%, 50%)
</text>

<text instructions>
/ items = ("instructions")
/ position = (50%, 60%)
</text>

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





Hi Dave,

That's a really helpful reply thanks so much!

I have another related question that I was wondering if you or anyone else knew the answer to. My experiment uses audio files as stimuli, and the onset of these stimuli isn't synchronised with any events happening on the monitor. It's a temporal perception paradigm so timing is a crucial element of the experiment. The help docs say this about the "insertstimulustime" function:     

"Adds the stimulus to the frame of a trial corresponding to the specified time."

My question is does Inquisit still trigger the audio file at the time of the beginning of the next frame if the stimulus is not being presented on the monitor or is it able to place the stimulus at exactly the time indicated by the output of the rand expression?

Thanks

Andrew



The timing would still be locked to the frame, even for non-visual stimuli.

Andrew Haigh
Andrew Haigh
Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)
Group: Forum Members
Posts: 4, Visits: 6
Dave - Tuesday, May 14, 2019
Andrew Haigh - Tuesday, May 14, 2019
Dave - Friday, April 26, 2019
Andrew Haigh - Friday, April 26, 2019
Hi there

I was wondering if anyone knows how to set stimulustimes values to the value of an expression.

For example, I have

/stimulustimes=[0=s1; 1000=s2; 1400=instructions]

and I want the onset of s2 to occur at a random interval between 800 ms and 1200 ms after the onset of s1 rather than being fixed at 1000 ms..

Thanks in advance.

Andrew

You need to do that by calling the insertstimulustime() function /ontrialbegin:

<expressions>
/ rand_onset = round(rand(800,1200))
</expressions>

<values>
/ current_onset = 0
</values>

<trial mytrial>
/ ontrialbegin = [
values.current_onset = expressions.rand_onset;
trial.mytrial.insertstimulustime(text.s2, values.current_onset);
]
/ ontrialend = [
trial.mytrial.resetstimulusframes();
]
/ stimulustimes=[0=s1; 1400=instructions]
/ validresponse = (57)
</trial>

<text s1>
/ items = ("s1")
/ position = (50%, 40%)
</text>

<text s2>
/ items = ("s2 @ onset <%values.current_onset%>")
/ position = (50%, 50%)
</text>

<text instructions>
/ items = ("instructions")
/ position = (50%, 60%)
</text>

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





Hi Dave,

That's a really helpful reply thanks so much!

I have another related question that I was wondering if you or anyone else knew the answer to. My experiment uses audio files as stimuli, and the onset of these stimuli isn't synchronised with any events happening on the monitor. It's a temporal perception paradigm so timing is a crucial element of the experiment. The help docs say this about the "insertstimulustime" function:     

"Adds the stimulus to the frame of a trial corresponding to the specified time."

My question is does Inquisit still trigger the audio file at the time of the beginning of the next frame if the stimulus is not being presented on the monitor or is it able to place the stimulus at exactly the time indicated by the output of the rand expression?

Thanks

Andrew



The timing would still be locked to the frame, even for non-visual stimuli.

I see thanks Dave.
One last question if you don't mind. I was wondering if you or anyone else reading this knows of any background processes like antivirus software or automated Window maintenance operations that have been found to affect timing in Inquisit?
Andrew

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
Andrew Haigh - Tuesday, May 14, 2019
Dave - Tuesday, May 14, 2019
Andrew Haigh - Tuesday, May 14, 2019
Dave - Friday, April 26, 2019
Andrew Haigh - Friday, April 26, 2019
Hi there

I was wondering if anyone knows how to set stimulustimes values to the value of an expression.

For example, I have

/stimulustimes=[0=s1; 1000=s2; 1400=instructions]

and I want the onset of s2 to occur at a random interval between 800 ms and 1200 ms after the onset of s1 rather than being fixed at 1000 ms..

Thanks in advance.

Andrew

You need to do that by calling the insertstimulustime() function /ontrialbegin:

<expressions>
/ rand_onset = round(rand(800,1200))
</expressions>

<values>
/ current_onset = 0
</values>

<trial mytrial>
/ ontrialbegin = [
values.current_onset = expressions.rand_onset;
trial.mytrial.insertstimulustime(text.s2, values.current_onset);
]
/ ontrialend = [
trial.mytrial.resetstimulusframes();
]
/ stimulustimes=[0=s1; 1400=instructions]
/ validresponse = (57)
</trial>

<text s1>
/ items = ("s1")
/ position = (50%, 40%)
</text>

<text s2>
/ items = ("s2 @ onset <%values.current_onset%>")
/ position = (50%, 50%)
</text>

<text instructions>
/ items = ("instructions")
/ position = (50%, 60%)
</text>

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





Hi Dave,

That's a really helpful reply thanks so much!

I have another related question that I was wondering if you or anyone else knew the answer to. My experiment uses audio files as stimuli, and the onset of these stimuli isn't synchronised with any events happening on the monitor. It's a temporal perception paradigm so timing is a crucial element of the experiment. The help docs say this about the "insertstimulustime" function:     

"Adds the stimulus to the frame of a trial corresponding to the specified time."

My question is does Inquisit still trigger the audio file at the time of the beginning of the next frame if the stimulus is not being presented on the monitor or is it able to place the stimulus at exactly the time indicated by the output of the rand expression?

Thanks

Andrew



The timing would still be locked to the frame, even for non-visual stimuli.

I see thanks Dave.
One last question if you don't mind. I was wondering if you or anyone else reading this knows of any background processes like antivirus software or automated Window maintenance operations that have been found to affect timing in Inquisit?
Andrew

Generally no, it's fine to have regular processes running in the background on a decent machine and those will not affect timing. If you are on an extremely resource-constrained system, however, e.g. with little RAM, then it may make sense to minimize the amount of background processes if you're in a position to do so (i.e. the machine in question is an offline lab machine under your control). Hope this helps!

Andrew Haigh
Andrew Haigh
Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)Associate Member (287 reputation)
Group: Forum Members
Posts: 4, Visits: 6
Dave - Wednesday, May 15, 2019
Andrew Haigh - Tuesday, May 14, 2019
Dave - Tuesday, May 14, 2019
Andrew Haigh - Tuesday, May 14, 2019
Dave - Friday, April 26, 2019
Andrew Haigh - Friday, April 26, 2019
Hi there

I was wondering if anyone knows how to set stimulustimes values to the value of an expression.

For example, I have

/stimulustimes=[0=s1; 1000=s2; 1400=instructions]

and I want the onset of s2 to occur at a random interval between 800 ms and 1200 ms after the onset of s1 rather than being fixed at 1000 ms..

Thanks in advance.

Andrew

You need to do that by calling the insertstimulustime() function /ontrialbegin:

<expressions>
/ rand_onset = round(rand(800,1200))
</expressions>

<values>
/ current_onset = 0
</values>

<trial mytrial>
/ ontrialbegin = [
values.current_onset = expressions.rand_onset;
trial.mytrial.insertstimulustime(text.s2, values.current_onset);
]
/ ontrialend = [
trial.mytrial.resetstimulusframes();
]
/ stimulustimes=[0=s1; 1400=instructions]
/ validresponse = (57)
</trial>

<text s1>
/ items = ("s1")
/ position = (50%, 40%)
</text>

<text s2>
/ items = ("s2 @ onset <%values.current_onset%>")
/ position = (50%, 50%)
</text>

<text instructions>
/ items = ("instructions")
/ position = (50%, 60%)
</text>

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





Hi Dave,

That's a really helpful reply thanks so much!

I have another related question that I was wondering if you or anyone else knew the answer to. My experiment uses audio files as stimuli, and the onset of these stimuli isn't synchronised with any events happening on the monitor. It's a temporal perception paradigm so timing is a crucial element of the experiment. The help docs say this about the "insertstimulustime" function:     

"Adds the stimulus to the frame of a trial corresponding to the specified time."

My question is does Inquisit still trigger the audio file at the time of the beginning of the next frame if the stimulus is not being presented on the monitor or is it able to place the stimulus at exactly the time indicated by the output of the rand expression?

Thanks

Andrew



The timing would still be locked to the frame, even for non-visual stimuli.

I see thanks Dave.
One last question if you don't mind. I was wondering if you or anyone else reading this knows of any background processes like antivirus software or automated Window maintenance operations that have been found to affect timing in Inquisit?
Andrew

Generally no, it's fine to have regular processes running in the background on a decent machine and those will not affect timing. If you are on an extremely resource-constrained system, however, e.g. with little RAM, then it may make sense to minimize the amount of background processes if you're in a position to do so (i.e. the machine in question is an offline lab machine under your control). Hope this helps!

Yes that's exactly what I wanted to hear thanks!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search