Millisecond Forums

How to specify a variable trial duration

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

By thomas.biba - 11/24/2020

Greetings, 

I am looking to create a task (assuming a 60 Hz refresh rate) that A) presents a cue for 13 frames (200 ms), then B) implements a variable SOA from 13 - 67 frames (200 - 1100 ms), then C) presents a target for 31 frames (500 ms), then D) allows for a response for 124 frames (2000 ms), and E) a variable ITI of 78 - 117 frames (1200-1800 ms). I was able to get A,B, and C, yet I am struggling to implement D and E. My code implementing those steps is below (note that this code ends the trial once a response is make which is not what I am looking for). Any suggestions on how to implement D and E? 

Many thanks, 

Thomas

<item Objects_t1>
/1 = "8ball.jpg"
/2 = "50dollarbill.jpg"
/3 = "accordion01.jpg"
/4 = "aceofdiamond.jpg"
</item>

<picture ObjectsP_t1>
/ items = ObjectsI_t1
/ select = sequence
/ size = (550, 550)
/ position = (50%, 45%)
/ erase = false
</picture>

<text cue>
/ items = ("+")
</text>

<shape blank>
/ color = (175, 175, 175)
/ shape = rectangle
/ size = (2000, 1000)
</shape>

<defaults>
/ screencolor = (175, 175, 175)
/ fontstyle = ("arial")
</defaults>

<list SOAduration>
/ items = (26, 67, 26, 67)
</list>

<list StimEnd>
/ items = (57, 98, 57, 98)
</list>

<trial testT_1>
/ ontrialbegin = [trial.testT_1.insertstimulusframe(picture.ObjectsP_t1, list.SOAduration.nextvalue);
      trial.testT_1.insertstimulusframe(shape.blank, list.StimEnd.nextvalue);]
/ ontrialend = [trial.mytrial.resetstimulusframes()]
/ stimulusframes = [1=cue; 13=blank]
/ validresponse = (anyresponse)
</trial>

<block TestB_1>
/ trials = [1-4 = sequence(testT_1)]
/ errormessage = false
</block>

<expt>
/ blocks = [1=TestB_1]
</expt>
By Dave - 11/24/2020

thomas.biba - 11/24/2020
Greetings, 

I am looking to create a task (assuming a 60 Hz refresh rate) that A) presents a cue for 13 frames (200 ms), then B) implements a variable SOA from 13 - 67 frames (200 - 1100 ms), then C) presents a target for 31 frames (500 ms), then D) allows for a response for 124 frames (2000 ms), and E) a variable ITI of 78 - 117 frames (1200-1800 ms). I was able to get A,B, and C, yet I am struggling to implement D and E. My code implementing those steps is below (note that this code ends the trial once a response is make which is not what I am looking for). Any suggestions on how to implement D and E? 

Many thanks, 

Thomas

<item Objects_t1>
/1 = "8ball.jpg"
/2 = "50dollarbill.jpg"
/3 = "accordion01.jpg"
/4 = "aceofdiamond.jpg"
</item>

<picture ObjectsP_t1>
/ items = ObjectsI_t1
/ select = sequence
/ size = (550, 550)
/ position = (50%, 45%)
/ erase = false
</picture>

<text cue>
/ items = ("+")
</text>

<shape blank>
/ color = (175, 175, 175)
/ shape = rectangle
/ size = (2000, 1000)
</shape>

<defaults>
/ screencolor = (175, 175, 175)
/ fontstyle = ("arial")
</defaults>

<list SOAduration>
/ items = (26, 67, 26, 67)
</list>

<list StimEnd>
/ items = (57, 98, 57, 98)
</list>

<trial testT_1>
/ ontrialbegin = [trial.testT_1.insertstimulusframe(picture.ObjectsP_t1, list.SOAduration.nextvalue);
      trial.testT_1.insertstimulusframe(shape.blank, list.StimEnd.nextvalue);]
/ ontrialend = [trial.mytrial.resetstimulusframes()]
/ stimulusframes = [1=cue; 13=blank]
/ validresponse = (anyresponse)
</trial>

<block TestB_1>
/ trials = [1-4 = sequence(testT_1)]
/ errormessage = false
</block>

<expt>
/ blocks = [1=TestB_1]
</expt>

See this recent thread:

https://www.millisecond.com/forums/Topic30232.aspx
By thomas.biba - 11/25/2020

Hi David, 

Thanks this is very helpful! However, while close, this is not exactly what I am looking to do (see my code at the end [section B] for how I implemented what was outlined in that previous thread). One additional thing I am hoping to do is to pseudo-randomize the SOA interval (and ITI), and also have a certain number of trials for each SOA bin in discrete SOA time bins (one bin every two frames.. e.g. 200, 233.33, 266.66 ...1100 etc..). It doesn't seem this level of control is possible within Inquisit so I was thinking of preparing list elements that contain all the SOA values for subsequent trials that I want and inputing that in on a trial-wise basis. I tried to implement this below [section A], and while it doesn't crash, the total trial times it produces seem to be off (I presume this might have to do with incorrectly resetting the stimulus frames at the beginning of the trial?). I am wondering how to resolve this. 

Many thanks, 

Thomas

[section A] ------------------------ additional step I am looking to implement ----------------------

<list SOA>
/ items = (200, 1100, 200, 1100)
</list>

<list ITI>
/ items = (1200, 1800, 1200, 1800)
</list>

<trial testT_1>
/ ontrialbegin = [
    trial.testT_1.resetstimulusframes();
    trial.testT_1.insertstimulustime(text.cue, parameters.start);
    trial.testT_1.insertstimulustime(picture.ObjectsP_t1, parameters.cueDur + list.SOA.nextvalue);
    trial.testT_1.insertstimulustime(shape.blank, parameters.cueDur + list.SOA.nextvalue + parameters.targDur);
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + list.SOA.nextvalue + parameters.targDur
/ trialduration = parameters.cueDur + list.SOA.nextvalue + parameters.targDur + parameters.respDur + list.ITI.nextvalue
/ validresponse = (anyresponse)
</trial>

[section B] ----------------------- code that runs (fully randomizing SOA and ITI) ---------------------

<parameters>
/ start = 0
/ cueDur = 200
/ targDur = 500
/ respDur = 2000
</parameters>

<values>
/ SOA = -1
/ ITI = -1
</values>

<trial testT_1>
/ ontrialbegin = [
    trial.testT_1.resetstimulusframes();
    trial.testT_1.insertstimulustime(text.cue, parameters.start);
    values.SOA = round(rand(200, 1100));
    trial.testT_1.insertstimulustime(picture.ObjectsP_t1, parameters.cueDur + values.SOA);
    trial.testT_1.insertstimulustime(shape.blank, parameters.cueDur + values.SOA + parameters.targDur);
    values.ITI = parameters.respDur + round(rand(1200, 1800));
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + values.SOA + parameters.targDur
/ trialduration = parameters.cueDur + values.SOA + parameters.targDur + values.ITI
/ validresponse = (anyresponse)
</trial>

<block TestB_1>
/ trials = [1-4 = sequence(testT_1)]
/ errormessage = false
</block>

<expt>
/ blocks = [1=TestB_1]
</expt>
By thomas.biba - 11/25/2020

Whoops I noticed there is an error in the code that works [section B]. It should be (the only change is adding parameters.respDur to total trial time computation):

<trial testT_1>
/ ontrialbegin = [
  trial.testT_1.resetstimulusframes();
  trial.testT_1.insertstimulustime(text.cue, parameters.start);
  values.SOA = round(rand(200, 1100));
  trial.testT_1.insertstimulustime(picture.ObjectsP_t1, parameters.cueDur + values.SOA);
  trial.testT_1.insertstimulustime(shape.blank, parameters.cueDur + values.SOA + parameters.targDur);
  values.ITI = parameters.respDur + round(rand(1200, 1800));
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + values.SOA + parameters.targDur
/ trialduration = parameters.cueDur + values.SOA + parameters.targDur + parameters.respDur + values.ITI
/ validresponse = (anyresponse)
</trial>
By Dave - 11/25/2020

thomas.biba - 11/25/2020
Hi David, 

Thanks this is very helpful! However, while close, this is not exactly what I am looking to do (see my code at the end [section B] for how I implemented what was outlined in that previous thread). One additional thing I am hoping to do is to pseudo-randomize the SOA interval (and ITI), and also have a certain number of trials for each SOA bin in discrete SOA time bins (one bin every two frames.. e.g. 200, 233.33, 266.66 ...1100 etc..). It doesn't seem this level of control is possible within Inquisit so I was thinking of preparing list elements that contain all the SOA values for subsequent trials that I want and inputing that in on a trial-wise basis. I tried to implement this below [section A], and while it doesn't crash, the total trial times it produces seem to be off (I presume this might have to do with incorrectly resetting the stimulus frames at the beginning of the trial?). I am wondering how to resolve this. 

Many thanks, 

Thomas

[section A] ------------------------ additional step I am looking to implement ----------------------

<list SOA>
/ items = (200, 1100, 200, 1100)
</list>

<list ITI>
/ items = (1200, 1800, 1200, 1800)
</list>

<trial testT_1>
/ ontrialbegin = [
    trial.testT_1.resetstimulusframes();
    trial.testT_1.insertstimulustime(text.cue, parameters.start);
    trial.testT_1.insertstimulustime(picture.ObjectsP_t1, parameters.cueDur + list.SOA.nextvalue);
    trial.testT_1.insertstimulustime(shape.blank, parameters.cueDur + list.SOA.nextvalue + parameters.targDur);
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + list.SOA.nextvalue + parameters.targDur
/ trialduration = parameters.cueDur + list.SOA.nextvalue + parameters.targDur + parameters.respDur + list.ITI.nextvalue
/ validresponse = (anyresponse)
</trial>

[section B] ----------------------- code that runs (fully randomizing SOA and ITI) ---------------------

<parameters>
/ start = 0
/ cueDur = 200
/ targDur = 500
/ respDur = 2000
</parameters>

<values>
/ SOA = -1
/ ITI = -1
</values>

<trial testT_1>
/ ontrialbegin = [
    trial.testT_1.resetstimulusframes();
    trial.testT_1.insertstimulustime(text.cue, parameters.start);
    values.SOA = round(rand(200, 1100));
    trial.testT_1.insertstimulustime(picture.ObjectsP_t1, parameters.cueDur + values.SOA);
    trial.testT_1.insertstimulustime(shape.blank, parameters.cueDur + values.SOA + parameters.targDur);
    values.ITI = parameters.respDur + round(rand(1200, 1800));
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + values.SOA + parameters.targDur
/ trialduration = parameters.cueDur + values.SOA + parameters.targDur + values.ITI
/ validresponse = (anyresponse)
</trial>

<block TestB_1>
/ trials = [1-4 = sequence(testT_1)]
/ errormessage = false
</block>

<expt>
/ blocks = [1=TestB_1]
</expt>


You can sample your SOAs and ITIs from lists without any problem whatsoever.

<trial testT_1>
/ ontrialbegin = [
  trial.testT_1.resetstimulusframes();
  trial.testT_1.insertstimulustime(text.cue, parameters.start);
  values.SOA =list.SOA.nextvalue;
  trial.testT_1.insertstimulustime(picture.ObjectsP_t1, parameters.cueDur + values.SOA);
  trial.testT_1.insertstimulustime(shape.blank, parameters.cueDur + values.SOA + parameters.targDur);
  values.ITI = parameters.respDur + list.ITI.nextvalue;
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + values.SOA + parameters.targDur
/ trialduration = parameters.cueDur + values.SOA + parameters.targDur + values.ITI
/ validresponse = (anyresponse)
</trial>

Not sure what makes you think the times are off.
By thomas.biba - 11/25/2020

Great! I see, I didn't realize you could pipe list elements into the values element to call that within ontrialbegin. However, when I run this I get the correct trail times in my output when SOA's and ITI's value are the same across trials. However, when I change them to be different each time, I don't get the total trial time I would expect (see two scenarios below). Am I missing something here?

Thanks,

T

------------- same times ------------

<list SOA>
/ items = (200, 200, 200, 200)
</list>

<list ITI>
/ items = (1200, 1200, 1200, 1200)
</list>

trial times = (4100, 4100, 4100, 4100)   *** what I get

------------- diff times ------------

<list SOA>
/ items = (200, 200, 1100, 1100)
</list>

<list ITI>
/ items = (1200, 1200, 1800, 1800)
</list>

trial times = (5600, 4700, 5000, 4100)   *** what I get
trial times = (4100, 4100, 5600, 5600)  *** what I would expect
By thomas.biba - 11/25/2020

Wait sorry I figured it out! I just had to add sequence! Thanks for your help here!

<list SOA>
/ items = (200, 200, 1100, 1100)
/ select = sequence
</list>

<list ITI>
/ items = (1200, 1200, 1800, 1800)
/ select = sequence
</list>
By Dave - 11/25/2020

thomas.biba - 11/25/2020
Wait sorry I figured it out! I just had to add sequence! Thanks for your help here!

<list SOA>
/ items = (200, 200, 1100, 1100)
/ select = sequence
</list>

<list ITI>
/ items = (1200, 1200, 1800, 1800)
/ select = sequence
</list>

Wasn't clear to me from your description that you wanted the SOAs and ISIs linked . To do that, you don't have to set the lists to sequential selection, you just need to link the 2nd list to the 1st. I.e.

<list SOA>
/ items = (200, 200, 1100, 1100)
</list>

<list ITI>
/ items = (1200, 1200, 1800, 1800)
/ selectionmode = list.SOA.currentindex
</list>

A SOA value will be sampled randomly (without replacement) from the SOA list and the corresponding ITI value will be selected in the ITI list.
By thomas.biba - 1/31/2021

Hi Dave,

I have another question related to this thread. I am looking to get the timing information in my data file indicating when each of the stimuli are presented within the trial (since time is key for this experiment). Also, I am looking to present the stimuli based on the frame rather than the time, which I have successfully implemented in the code below. Therefore, is there a way to get a read out of when a stimulus is presented - using  insertstimulusframe() nesting within the onstrialbegin[] attribute - for each trail in the data output file? Specifically, I want to get a read out in milliseconds when the following stimuli (e.g., text.cue, picture.ObjectsP_t1, and shape.blank) are presented. Is there a way to get this info? If not, is there an alternate way to present stimuli in this way such that these data are recorded and accessible?

Many thanks, 
Thomas 

<parameters>
/ start = 0
/ cueDur = 200
/ targDur = 500
/ respDur = 2000
</parameters>

<parameters>
/ start_FR = 1
/ cueDur_FR = 13
/ targDur_FR = 31
/ respDur_FR = 122
</parameters>

<values>
/ SOA = 0
/ ITI = 0
</values>

<values>
/ SOA_FR = 0
/ ITI_FR = 0
</values>

<list SOA>
/ items = (200, 200, 1100, 1100)
/ select = sequence
</list>

<list SOA_FR>
/ items = (13, 13, 67, 67)
/ select = sequence
</list>

<list ITI>
/ items = (1200, 1200, 1800, 1800)
/ select = sequence
</list>

<list ITI_FR>
/ items = (74, 74, 110, 110)
/ select = sequence
</list>

<trial testT_1>
/ ontrialbegin = [
trial.testT_1.resetstimulusframes();
trial.testT_1.insertstimulusframe(text.cue, parameters.start_FR);
values.SOA =list.SOA.nextvalue;
values.SOA_FR =list.SOA_FR.nextvalue;
trial.testT_1.insertstimulusframe(picture.ObjectsP_t1, parameters.cueDur_FR + values.SOA_FR);
trial.testT_1.insertstimulusframe(shape.blank, parameters.cueDur_FR + values.SOA_FR + parameters.targDur_FR);
values.ITI = parameters.respDur + list.ITI.nextvalue;
values.ITI_FR = parameters.respDur_FR + list.ITI_FR.nextvalue;
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + values.SOA + parameters.targDur
/ trialduration = parameters.cueDur + values.SOA + parameters.targDur + values.ITI
/ validresponse = (anyresponse)
</trial>
By Dave - 2/1/2021

thomas.biba - 1/31/2021
Hi Dave,

I have another question related to this thread. I am looking to get the timing information in my data file indicating when each of the stimuli are presented within the trial (since time is key for this experiment). Also, I am looking to present the stimuli based on the frame rather than the time, which I have successfully implemented in the code below. Therefore, is there a way to get a read out of when a stimulus is presented - using  insertstimulusframe() nesting within the onstrialbegin[] attribute - for each trail in the data output file? Specifically, I want to get a read out in milliseconds when the following stimuli (e.g., text.cue, picture.ObjectsP_t1, and shape.blank) are presented. Is there a way to get this info? If not, is there an alternate way to present stimuli in this way such that these data are recorded and accessible?

Many thanks, 
Thomas 

<parameters>
/ start = 0
/ cueDur = 200
/ targDur = 500
/ respDur = 2000
</parameters>

<parameters>
/ start_FR = 1
/ cueDur_FR = 13
/ targDur_FR = 31
/ respDur_FR = 122
</parameters>

<values>
/ SOA = 0
/ ITI = 0
</values>

<values>
/ SOA_FR = 0
/ ITI_FR = 0
</values>

<list SOA>
/ items = (200, 200, 1100, 1100)
/ select = sequence
</list>

<list SOA_FR>
/ items = (13, 13, 67, 67)
/ select = sequence
</list>

<list ITI>
/ items = (1200, 1200, 1800, 1800)
/ select = sequence
</list>

<list ITI_FR>
/ items = (74, 74, 110, 110)
/ select = sequence
</list>

<trial testT_1>
/ ontrialbegin = [
trial.testT_1.resetstimulusframes();
trial.testT_1.insertstimulusframe(text.cue, parameters.start_FR);
values.SOA =list.SOA.nextvalue;
values.SOA_FR =list.SOA_FR.nextvalue;
trial.testT_1.insertstimulusframe(picture.ObjectsP_t1, parameters.cueDur_FR + values.SOA_FR);
trial.testT_1.insertstimulusframe(shape.blank, parameters.cueDur_FR + values.SOA_FR + parameters.targDur_FR);
values.ITI = parameters.respDur + list.ITI.nextvalue;
values.ITI_FR = parameters.respDur_FR + list.ITI_FR.nextvalue;
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + values.SOA + parameters.targDur
/ trialduration = parameters.cueDur + values.SOA + parameters.targDur + values.ITI
/ validresponse = (anyresponse)
</trial>

You can use the stimuli's respective timestamp and/or stimulusonset properties.

https://www.millisecond.com/support/docs/v6/html/language/properties/timestamp.htm
https://www.millisecond.com/support/docs/v6/html/language/properties/stimulusonset.htm


By thomas.biba - 2/3/2021

Great thanks! I got everything to run as desired. You feedback is much appreciated as always!

T
By thomas.biba - 3/8/2021

Hi Dave, 

I have one more follow up question. I am looking to get the stimulus information (e.g., the image name) for each trial. Typically, I think this is specified using the stimulusitem field, however I tried that here and that column is blank when I look at the data output. So then I tried to specify with similarl syntax as was done with the stimulusonset element, but this also is not working. Any suggestions for how to get the stimulus name in the output so that I know which stimuli were presented for which trial (as a reminder I have my trial code for an encoding block below - but you can also look at previous posts in the thread for more detail)?

Many thanks, 
Thomas

<data>
/ columns=(group, subject, blockcode, trialnum, stimulusitem, stimulusnumber, picture.black_fix.stimulusonset,
picture.P_Enc_r1.stimulusitem, picture.P_Ret_r1.stimulusitem, picture.col_fix_r1.stimulusonset, values.SOA_r1, values.ITI_r1, values.SOA_FR_r1, picture.P_Enc_r1.stimulusonset,
picture.P_Enc_r2.stimulusitem, picture.P_Ret_r2.stimulusitem, picture.col_fix_r2.stimulusonset, values.SOA_r2, values.ITI_r2, values.SOA_FR_r2, picture.P_Enc_r2.stimulusonset,
picture.P_Enc_r3.stimulusitem, picture.P_Ret_r3.stimulusitem, picture.col_fix_r3.stimulusonset, values.SOA_r3, values.ITI_r3, values.SOA_FR_r3, picture.P_Enc_r3.stimulusonset,
picture.P_Enc_r4.stimulusitem, picture.P_Ret_r4.stimulusitem, picture.col_fix_r4.stimulusonset, values.SOA_r4, values.ITI_r4, values.SOA_FR_r4, picture.P_Enc_r4.stimulusonset,
shape.blank.stimulusonset, response, latency)
/ separatefiles = true
</data>

<trial T_Enc_r4>
/ ontrialbegin = [
trial.T_Enc_r4.resetstimulusframes();
trial.T_Enc_r4.insertstimulusframe(picture.col_fix_r4, parameters.start_FR);
trial.T_Enc_r4.insertstimulusframe(picture.black_fix, parameters.cueDur_FR);
values.SOA_r4 =list.SOA_r4.nextvalue;
values.SOA_FR_r4 =list.SOA_FR_r4.nextvalue;
trial.T_Enc_r4.insertstimulusframe(picture.P_Enc_r4, parameters.cueDur_FR + values.SOA_FR_r4);
trial.T_Enc_r4.insertstimulusframe(shape.blank, parameters.cueDur_FR + values.SOA_FR_r4 + parameters.targDur_FR);
trial.T_Enc_r1.insertstimulusframe(text.kpr_man, parameters.cueDur_FR + values.SOA_FR_r1 + parameters.targDur_FR);
trial.T_Enc_r1.insertstimulusframe(text.kpr_nat, parameters.cueDur_FR + values.SOA_FR_r1 + parameters.targDur_FR);
trial.T_Enc_r1.insertstimulusframe(text.kpr_big, parameters.cueDur_FR + values.SOA_FR_r1 + parameters.targDur_FR);
trial.T_Enc_r1.insertstimulusframe(text.kpr_small, parameters.cueDur_FR + values.SOA_FR_r1 + parameters.targDur_FR);
values.ITI_r4 = parameters.respDur + list.ITI_r4.nextvalue;
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + values.SOA_r4 + parameters.targDur
/ trialduration = parameters.cueDur + values.SOA_r4 + parameters.targDur + values.ITI_r4
/ validresponse = ("q","w","o","p")
</trial>
By Dave - 3/8/2021

thomas.biba - 3/9/2021
Hi Dave, 

I have one more follow up question. I am looking to get the stimulus information (e.g., the image name) for each trial. Typically, I think this is specified using the stimulusitem field, however I tried that here and that column is blank when I look at the data output. So then I tried to specify with similarl syntax as was done with the stimulusonset element, but this also is not working. Any suggestions for how to get the stimulus name in the output so that I know which stimuli were presented for which trial (as a reminder I have my trial code for an encoding block below - but you can also look at previous posts in the thread for more detail)?

Many thanks, 
Thomas

<data>
/ columns=(group, subject, blockcode, trialnum, stimulusitem, stimulusnumber, picture.black_fix.stimulusonset,
picture.P_Enc_r1.stimulusitem, picture.P_Ret_r1.stimulusitem, picture.col_fix_r1.stimulusonset, values.SOA_r1, values.ITI_r1, values.SOA_FR_r1, picture.P_Enc_r1.stimulusonset,
picture.P_Enc_r2.stimulusitem, picture.P_Ret_r2.stimulusitem, picture.col_fix_r2.stimulusonset, values.SOA_r2, values.ITI_r2, values.SOA_FR_r2, picture.P_Enc_r2.stimulusonset,
picture.P_Enc_r3.stimulusitem, picture.P_Ret_r3.stimulusitem, picture.col_fix_r3.stimulusonset, values.SOA_r3, values.ITI_r3, values.SOA_FR_r3, picture.P_Enc_r3.stimulusonset,
picture.P_Enc_r4.stimulusitem, picture.P_Ret_r4.stimulusitem, picture.col_fix_r4.stimulusonset, values.SOA_r4, values.ITI_r4, values.SOA_FR_r4, picture.P_Enc_r4.stimulusonset,
shape.blank.stimulusonset, response, latency)
/ separatefiles = true
</data>

<trial T_Enc_r4>
/ ontrialbegin = [
trial.T_Enc_r4.resetstimulusframes();
trial.T_Enc_r4.insertstimulusframe(picture.col_fix_r4, parameters.start_FR);
trial.T_Enc_r4.insertstimulusframe(picture.black_fix, parameters.cueDur_FR);
values.SOA_r4 =list.SOA_r4.nextvalue;
values.SOA_FR_r4 =list.SOA_FR_r4.nextvalue;
trial.T_Enc_r4.insertstimulusframe(picture.P_Enc_r4, parameters.cueDur_FR + values.SOA_FR_r4);
trial.T_Enc_r4.insertstimulusframe(shape.blank, parameters.cueDur_FR + values.SOA_FR_r4 + parameters.targDur_FR);
trial.T_Enc_r1.insertstimulusframe(text.kpr_man, parameters.cueDur_FR + values.SOA_FR_r1 + parameters.targDur_FR);
trial.T_Enc_r1.insertstimulusframe(text.kpr_nat, parameters.cueDur_FR + values.SOA_FR_r1 + parameters.targDur_FR);
trial.T_Enc_r1.insertstimulusframe(text.kpr_big, parameters.cueDur_FR + values.SOA_FR_r1 + parameters.targDur_FR);
trial.T_Enc_r1.insertstimulusframe(text.kpr_small, parameters.cueDur_FR + values.SOA_FR_r1 + parameters.targDur_FR);
values.ITI_r4 = parameters.respDur + list.ITI_r4.nextvalue;
]
/ stimulustimes = [0=clearscreen]
/ beginresponsetime = parameters.cueDur + values.SOA_r4 + parameters.targDur
/ trialduration = parameters.cueDur + values.SOA_r4 + parameters.targDur + values.ITI_r4
/ validresponse = ("q","w","o","p")
</trial>

<picture> elements do not have a property called "stimulusitem". The property you are looking for is called currentitem:

https://www.millisecond.com/support/docs/v6/html/language/properties/currentitem.htm

That's a different thing than stimulusitem columns in /columns. How those work is explained in the documentation at https://www.millisecond.com/support/docs/v6/html/language/attributes/columns.htm under "Remarks":

Also see: https://www.millisecond.com/forums/FindPost22790.aspx
By thomas.biba - 3/10/2021

Great thanks this is very helpful as always!

Thomas