﻿<?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 6  » How to set stimulus times after a stimuli after a stimuli with a random presentation length + having mutliple stimuli with random resentation lengths</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 11 Mar 2026 22:30:33 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to set stimulus times after a stimuli after a stimuli with a random presentation length + having mutliple stimuli with random resentation lengths</title><link>https://forums.millisecond.com/Topic35846.aspx</link><description>&lt;blockquote data-id="35844" class="if-quote-wrapper" unselectable="on" data-guid="1702296210631" contenteditable="false" id="if_insertedNode_1702296209484"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35844" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="35844" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="35844" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Lewis99 - 12/10/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35844"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hi everyone,&lt;br/&gt;I'm trying to have a trial that goes like this:&lt;br/&gt;Fixation cross jittering between 2100-2900ms, then text with an emotion regulation strategy (distraction or reappraisal) is presented for 2000ms, a blank screen jittering between 400-800ms and finally an image is presented for 3000ms. &lt;br/&gt;&lt;br/&gt;I have figured out so far (i think) how to get my fixation cross to have a random presentation time, but what I am unsure of is how to present stimuli after that. If I don't know when the fixation cross will end, how do I know what time to write in /stimulustimes in my trial. See my code below: &lt;br/&gt;&lt;br/&gt;&amp;lt;trial regulationone&amp;gt;&lt;br/&gt;/ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.fixationrand = rand(2100, 2900);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.regulationone.insertstimulustime(text.fixation, values.fixationrand):&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;/ stimulustimes = [0=fixation]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;trial.priming.resetstimulusframes(); ]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;For example, i don't think I can have "/ stimulustimes = [0=fixation; 2900=strategy]" as then there may be a gap between the cross disappearing and the stimuli popping up.&lt;br/&gt;&lt;br/&gt;My second question, is how do I then include other stimuli that jitter (e.g., the blank screen) later in this trial as I assume I can't use the same line of code that follows the /ontrailbegin?&lt;br/&gt;Thanks for your help, &lt;br/&gt;Lewis&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="35844"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You display your fixation cross at t0. Calculate its on-screen duration (the jitter) /ontrialbegin and store it in a variable. That gives you the onset time for the next stimulus (emotion regulation strategy), so you use the insertstimulustime() function to put it at that time. That stimulus has an on-screen duration of 2000, which gives you the onset of the next stimulus (blank screen), so you again use insertstimulustime() to put it there. Calculate the blank jitter, and that gives you the onset for the final stimulus, the image. That stimulus has an on-screen duration of 3000, so you blank the screen after that, again using insertstimulustime().&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;values&amp;gt;&lt;br/&gt;/ fixationduration = 0&lt;br/&gt;/ blankduration = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial exampletrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.exampletrial.resetstimulusframes(); // reset stimulus presentation sequence to its original state&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.fixationduration = round(rand(2100, 2900)); // random fixation on-screen duration&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.blankduration = round(rand(400, 800)); // random blank duration&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// clear the screen after fixation period and display emo reg stimulus at that time&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.exampletrial.insertstimulustime(clearscreen, values.fixationduration);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.exampletrial.insertstimulustime(text.emoreg, values.fixationduration);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// clear the screen 2000 ms after emo reg&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.exampletrial.insertstimulustime(clearscreen, values.fixationduration + 2000);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// display image after random blank period&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.exampletrial.insertstimulusframe(picture.image, values.fixationduration + 2000 + values.blankduration);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// clear screen after 3000 ms image duration&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.exampletrial.insertstimulustime(clearscreen, values.fixationduration + 2000 + values.blankduration + 3000);&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0=fixation;]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;[/code]&lt;br/&gt;</description><pubDate>Wed, 13 Dec 2023 01:40:59 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>How to set stimulus times after a stimuli after a stimuli with a random presentation length + having mutliple stimuli with random resentation lengths</title><link>https://forums.millisecond.com/Topic35844.aspx</link><description>Hi everyone,&lt;br/&gt;I'm trying to have a trial that goes like this:&lt;br/&gt;Fixation cross jittering between 2100-2900ms, then text with an emotion regulation strategy (distraction or reappraisal) is presented for 2000ms, a blank screen jittering between 400-800ms and finally an image is presented for 3000ms. &lt;br/&gt;&lt;br/&gt;I have figured out so far (i think) how to get my fixation cross to have a random presentation time, but what I am unsure of is how to present stimuli after that. If I don't know when the fixation cross will end, how do I know what time to write in /stimulustimes in my trial. See my code below: &lt;br/&gt;&lt;br/&gt;&amp;lt;trial regulationone&amp;gt;&lt;br/&gt;/ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.fixationrand = rand(2100, 2900);&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.regulationone.insertstimulustime(text.fixation, values.fixationrand):&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;/ stimulustimes = [0=fixation]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;trial.priming.resetstimulusframes(); ]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;For example, i don't think I can have "/ stimulustimes = [0=fixation; 2900=strategy]" as then there may be a gap between the cross disappearing and the stimuli popping up.&lt;br/&gt;&lt;br/&gt;My second question, is how do I then include other stimuli that jitter (e.g., the blank screen) later in this trial as I assume I can't use the same line of code that follows the /ontrailbegin?&lt;br/&gt;Thanks for your help, &lt;br/&gt;Lewis&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 13 Dec 2023 00:57:02 GMT</pubDate><dc:creator>Lewis99</dc:creator></item><item><title>RE: How to set stimulus times after a stimuli after a stimuli with a random presentation length + having mutliple stimuli with random resentation lengths</title><link>https://forums.millisecond.com/Topic35850.aspx</link><description>&lt;br/&gt;Awesome thanks for clarifying Dave :)&lt;br/&gt;</description><pubDate>Wed, 13 Dec 2023 00:57:02 GMT</pubDate><dc:creator>Lewis99</dc:creator></item><item><title>RE: How to set stimulus times after a stimuli after a stimuli with a random presentation length + having mutliple stimuli with random resentation lengths</title><link>https://forums.millisecond.com/Topic35849.aspx</link><description>&lt;blockquote data-id="35848" class="if-quote-wrapper" unselectable="on" data-guid="1702383482039" contenteditable="false" id="if_insertedNode_1702383481462"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35848" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="35848" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="35848" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Lewis99 - 12/12/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35848"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;br/&gt;Sorry Dave, just wanted to check, you wrote "Resetstimulusframes" instead of "Resetstimulustimes" at the start there. Is it meant to be frame or times there as all the others are times.&lt;br/&gt;Thanks again,&lt;br/&gt;Lewis &lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="35848"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;/stimulustimes just map onto /stimulusframes, because displays work at a discrete refresh interval&amp;nbsp; (e.g. 20ms for a display running at 50Hz, 10ms for a display running at 100Hz; one single such refresh interval is a display frame). When you specify timings in /stimulustimes, Inquisit picks the display frame that falls closest to the specified time, given the display's refresh interval. There is no separate resetstimulustimes() function -- there is only resetstimulusframes(), which is all that is needed.&lt;br/&gt;</description><pubDate>Tue, 12 Dec 2023 12:46:20 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to set stimulus times after a stimuli after a stimuli with a random presentation length + having mutliple stimuli with random resentation lengths</title><link>https://forums.millisecond.com/Topic35848.aspx</link><description>&lt;br/&gt;Sorry Dave, just wanted to check, you wrote "Resetstimulusframes" instead of "Resetstimulustimes" at the start there. Is it meant to be frame or times there as all the others are times.&lt;br/&gt;Thanks again,&lt;br/&gt;Lewis &lt;br/&gt;</description><pubDate>Tue, 12 Dec 2023 06:29:29 GMT</pubDate><dc:creator>Lewis99</dc:creator></item><item><title>RE: How to set stimulus times after a stimuli after a stimuli with a random presentation length + having mutliple stimuli with random resentation lengths</title><link>https://forums.millisecond.com/Topic35847.aspx</link><description>&lt;br/&gt;That worked fantastic thank you for your help Dave! </description><pubDate>Tue, 12 Dec 2023 05:49:39 GMT</pubDate><dc:creator>Lewis99</dc:creator></item></channel></rss>