﻿<?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 4  » Randomized stimuli in two "strands"</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 23 Sep 2026 05:47:14 GMT</lastBuildDate><ttl>20</ttl><item><title>Randomized stimuli in two "strands"</title><link>https://forums.millisecond.com/Topic15203.aspx</link><description>Hi everyone,&lt;br/&gt;&lt;br/&gt;For my pitch discrimination experiment, I want to present my subjects with 2 "strands" of stimuli: one with two musical pitches where the second one is higher, and one where the second one is lower.&lt;br/&gt;These musical pitches will get closer together if they respond correctly 3 times in a row, and if they make one mistake it needs to go back a step. The upwards and downwards stimuli need to be randomized.&lt;br/&gt;Now, the problem is how to code these two strands so they move seperately, but still intermingle them randomly.&lt;br/&gt;&lt;br/&gt;I have tried several things using the / branch attribute in the trials or in the blocks. Nothing has worked yet.&lt;br/&gt;&lt;br/&gt;Here's an example of my trial/block setup now:&lt;br/&gt;- trial.srrt , srtt3 and srtt5 are upwards pitches, trial.srtt2, srtt4 and srtt6 are downwards pitches&lt;br/&gt;&lt;br/&gt;&amp;lt;trial SRTT&amp;gt;&lt;br/&gt;/ pretrialpause = 1000&lt;br/&gt;/ ontrialbegin = [if (values.speakerfixed == 1) &lt;br/&gt;{values.targetspeaker = list.targetchannel.nextvalue}]&lt;br/&gt;/ ontrialbegin = [if (values.volumefixed == 1) &lt;br/&gt;{values.volumeadjust = list.targetvolumeadjust.nextvalue}]&lt;br/&gt;/ branch = [if(trial.srtt.percentcorrect == 100 &amp;amp;&amp;amp; trial.srtt.count &amp;gt;= 3) trial.srtt3]&lt;br/&gt;/ stimulustimes = [0=target; 1500=target3]&lt;br/&gt;/ inputdevice=keyboard&lt;br/&gt;/ validresponse=(200, 208)&lt;br/&gt;/ correctresponse = (200)&lt;br/&gt;/ ontrialend = [trial.SRTT.resetstimulusframes()]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial SRTT2&amp;gt;&lt;br/&gt;/ pretrialpause = 1000&lt;br/&gt;/ ontrialbegin = [if (values.speakerfixed == 1) &lt;br/&gt;{values.targetspeaker = list.targetchannel.nextvalue}]&lt;br/&gt;/ ontrialbegin = [if (values.volumefixed == 1) &lt;br/&gt;{values.volumeadjust = list.targetvolumeadjust.nextvalue}]&lt;br/&gt;/ branch = [if(trial.srtt2.percentcorrect == 100 &amp;amp;&amp;amp; trial.srtt2.count &amp;gt;= 3) trial.srtt4]&lt;br/&gt;/ stimulustimes = [0=target; 1500=target4]&lt;br/&gt;/ inputdevice=keyboard&lt;br/&gt;/ validresponse=(200, 208)&lt;br/&gt;/ correctresponse = (208)&lt;br/&gt;/ ontrialend = [trial.SRTT2.resetstimulusframes()]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial SRTT3&amp;gt;&lt;br/&gt;/ pretrialpause = 1000&lt;br/&gt;/ ontrialbegin = [if (values.speakerfixed == 1) &lt;br/&gt;{values.targetspeaker = list.targetchannel.nextvalue}]&lt;br/&gt;/ ontrialbegin = [if (values.volumefixed == 1) &lt;br/&gt;{values.volumeadjust = list.targetvolumeadjust.nextvalue}]&lt;br/&gt;/ branch = [if(trial.srtt3.percentcorrect == 100 &amp;amp;&amp;amp; trial.srtt3.count &amp;gt;= 3) trial.srtt5]&lt;br/&gt;/ branch = [if(trial.srtt3.percentcorrect &amp;lt; 100) trial.srtt]&lt;br/&gt;/ stimulustimes = [0=target; 1500=target5]&lt;br/&gt;/ inputdevice=keyboard&lt;br/&gt;/ validresponse=(200, 208)&lt;br/&gt;/ correctresponse = (200)&lt;br/&gt;/ ontrialend = [trial.SRTT3.resetstimulusframes()]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial SRTT4&amp;gt;&lt;br/&gt;/ pretrialpause = 1000&lt;br/&gt;/ ontrialbegin = [if (values.speakerfixed == 1) &lt;br/&gt;{values.targetspeaker = list.targetchannel.nextvalue}]&lt;br/&gt;/ ontrialbegin = [if (values.volumefixed == 1) &lt;br/&gt;{values.volumeadjust = list.targetvolumeadjust.nextvalue}]&lt;br/&gt;/ branch = [if(trial.srtt4.percentcorrect == 100 &amp;amp;&amp;amp; trial.srtt4.count &amp;gt;= 3) trial.srtt6]&lt;br/&gt;/ branch = [if(trial.srtt4.percentcorrect &amp;lt; 100) trial.srtt2]&lt;br/&gt;/ stimulustimes = [0=target; 1500=target6]&lt;br/&gt;/ inputdevice=keyboard&lt;br/&gt;/ validresponse=(200, 208)&lt;br/&gt;/ correctresponse = (208)&lt;br/&gt;/ ontrialend = [trial.SRTT4.resetstimulusframes()]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial SRTT5&amp;gt;&lt;br/&gt;/ pretrialpause = 1000&lt;br/&gt;/ ontrialbegin = [if (values.speakerfixed == 1) &lt;br/&gt;{values.targetspeaker = list.targetchannel.nextvalue}]&lt;br/&gt;/ ontrialbegin = [if (values.volumefixed == 1) &lt;br/&gt;{values.volumeadjust = list.targetvolumeadjust.nextvalue}]&lt;br/&gt;/ branch = [if(trial.srtt5.percentcorrect == 100 &amp;amp;&amp;amp; trial.srtt5.count &amp;gt;= 3) trial.srtt]&lt;br/&gt;/ branch = [if(trial.srtt5.percentcorrect &amp;lt; 100) trial.srtt3]&lt;br/&gt;/ stimulustimes = [0=target; 1500=target7]&lt;br/&gt;/ inputdevice=keyboard&lt;br/&gt;/ validresponse=(200, 208)&lt;br/&gt;/ correctresponse = (200)&lt;br/&gt;/ ontrialend = [trial.SRTT5.resetstimulusframes()]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial SRTT6&amp;gt;&lt;br/&gt;/ pretrialpause = 1000&lt;br/&gt;/ ontrialbegin = [if (values.speakerfixed == 1) &lt;br/&gt;{values.targetspeaker = list.targetchannel.nextvalue}]&lt;br/&gt;/ ontrialbegin = [if (values.volumefixed == 1) &lt;br/&gt;{values.volumeadjust = list.targetvolumeadjust.nextvalue}]&lt;br/&gt;/ branch = [if(trial.srtt6.percentcorrect == 100 &amp;amp;&amp;amp; trial.srtt6.count &amp;gt;= 3) trial.srtt2]&lt;br/&gt;/ branch = [if(trial.srtt6.percentcorrect &amp;lt; 100) trial.srtt4]&lt;br/&gt;/ stimulustimes = [0=target; 1500=target8]&lt;br/&gt;/ inputdevice=keyboard&lt;br/&gt;/ validresponse=(200, 208)&lt;br/&gt;/ correctresponse = (208)&lt;br/&gt;/ ontrialend = [trial.SRTT6.resetstimulusframes()]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block SRTTblock&amp;gt;&lt;br/&gt;/ onblockbegin = [text.focus.textcolor = values.screencolor; text.focus.textbgcolor = values.screencolor]&lt;br/&gt;/ onblockbegin = [block.SRTTblock.screencolor = values.screencolor]&lt;br/&gt;/ trials = [1-6=noreplace(SRTT, SRTT2)]&lt;br/&gt;/ bgstim = (focus)&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;This setup runs the first two trials 3 times each randomly, but then only runs the next ones (2 and 4) once. It does not carry on running trial 2 and 4 three times and then moving on to 3 and 6, because the branch attribute only reads it as the 'next event'. How do I code it so that it will carry on stepwise when the subjects make three correct responses, and goes one step back when they make a mistake, but keep this seperately for upwards and downwards pitches? So, if someone makes a mistake in the upwards pitch but not in the downwards pitch, the downwards pitch will move on and the upwards pitch will go back.&lt;br/&gt;I hope this all makes some kind of sense. Ask away if something isn't clear, and please help!</description><pubDate>Mon, 15 Dec 2014 16:04:52 GMT</pubDate><dc:creator>Jurre</dc:creator></item><item><title>RE: Randomized stimuli in two "strands"</title><link>https://forums.millisecond.com/Topic15206.aspx</link><description>Thanks! Very helpful!&lt;br/&gt;&lt;br/&gt;I think I'll manage to code it now. Thanks so much!&lt;br/&gt;&lt;br/&gt;Sometimes you just need a fresh look, and you provided! It can be so simple sometimes, haha.</description><pubDate>Mon, 15 Dec 2014 16:04:52 GMT</pubDate><dc:creator>Jurre</dc:creator></item><item><title>RE: Randomized stimuli in two "strands"</title><link>https://forums.millisecond.com/Topic15204.aspx</link><description>Make just two &amp;lt;trial&amp;gt; elements -- one for each of your two "strands". I.e &amp;lt;trial up&amp;gt; and &amp;lt;trial down&amp;gt;.&lt;br/&gt;&lt;br/&gt;In your target stimulus (e.g. &amp;lt;sound&amp;gt;) elements, use &amp;lt;values&amp;gt; for selection. &lt;br/&gt;&lt;br/&gt;&amp;lt;trial up&amp;gt;&lt;br/&gt;/ stimulustimes = [0=basepitch; 1500=upwardspitch]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;with &lt;br/&gt;&amp;lt;sound upwardspitch&amp;gt;&lt;br/&gt;/ items = ("up1.wav", "up2.wav", "up3.wav", ...)&lt;br/&gt;/ select = values.uplevel&lt;br/&gt;...&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ uplevel = 1&lt;br/&gt;...&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;Increase / decrease values.uplevel according to your needs via conditional logic in /ontrialend. Do the same for the downwards pitch strand of trials.&lt;br/&gt;</description><pubDate>Mon, 15 Dec 2014 15:22:23 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>