Millisecond Forums

stimuli near the end of a trial with variable trial duration

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

By nidhi_desai - 4/24/2022

Hi, 
Is there a way to add stimuli near the end of the trial even though the trial duration is variable. The trialduration is calcuated using the rand(lowerLimit, upperLimit) function for each trial. But I need to add a few stimuli 10 ms before the end of this trial. Is there a way to do this besides just starting in new <trial> for the last 10 ms.

Thank you,
Nidhi Desai
By Dave - 4/25/2022

nidhi_desai - 4/24/2022
Hi, 
Is there a way to add stimuli near the end of the trial even though the trial duration is variable. The trialduration is calcuated using the rand(lowerLimit, upperLimit) function for each trial. But I need to add a few stimuli 10 ms before the end of this trial. Is there a way to do this besides just starting in new <trial> for the last 10 ms.

Thank you,
Nidhi Desai

You can insert a stimulus into a trial's stimulus presentation sequence at a variable time per its insertstimulustime() function.

https://www.millisecond.com/support/docs/current/html/language/functions/insertstimulustime.htm
By nidhi_desai - 5/4/2022

Thank you Dave for your response. I had tried using insertstimulustime in the past, but remember if it cause issues when the stimulus was a <port> instead of some other display type of stimuli. I am wondering if the insertstimulustime would work with inserting a port element into the trial as well??
By Dave - 5/4/2022

nidhi_desai - 5/4/2022
Thank you Dave for your response. I had tried using insertstimulustime in the past, but remember if it cause issues when the stimulus was a <port> instead of some other display type of stimuli. I am wondering if the insertstimulustime would work with inserting a port element into the trial as well??

Yes, you can absolutely use it to insert a port stimulus into the stimulus presentation sequence. The type of stimulus really does not matter.