Using video as prime in AMP task


Author
Message
Céline
Céline
New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)
Group: Forum Members
Posts: 4, Visits: 12
Hello,

I am rather new to Inquisit as I am working on my first experiment. I wanted to use an AMP task and I have modified an AMP code that I found in the Inquisit library (AMP procedure found under https://www.millisecond.com/download/library/amp). The main difference for my experiment is that I want to use a video as a prime instead of a picture. (I also have a second task where the video need to be rated on a Likert scale. This task runs without any issues.) It has been quite of a struggle to have the video running as it should, but we found a solution by adding a branch (see code below). Now I noticed that the target picture is present throughout the whole trial instead of being on screen for 100ms as coded in the parameters. It is visible behind the video and the mask. Could you please help me figure out how to fix this issue? I am completely stuck... Also, if you know of a better solution than adding a branch to have the video displayed as needed, I am more than happy to hear about it. You can find my code below. Note: I have two types of videos (called prime and shorts), they're the same, with one being cut to a shorter version (0.20 seconds for the AMP task, long version is 3 seconds long for the likert task). I omitted the text part of my code because they're not relevant to the issue here. Do let me know if I should add that too! 

Thank you in advance for your help!

Warm regards,

Céline

<parameters>
/primeDuration = 2000
/shortDuration = 200
/primeTarget_ISI = 125
/targetDuration = 100
/maskDuration = 125
</parameters>

***********************************************************************

<item attributeAlabel>
/1 = "Pleasant"
</item>

<item attributeBlabel>
/1 = "Unpleasant"
</item>

<item primeBSlabel>
/1 = "Black Smile"
</item>

<item primeBAlabel>
/1 = "Black Angry"
</item>

<item primeWSlabel>
/1 = "White Smile"
</item>

<item primeWAlabel>
/1 = "White Angry"
</item>

<item shortWAlabel>
/1 = "White Angry"
</item>

<item shortWSlabel>
/1 = "White Smile"
</item>

<item shortBSlabel>
/1 = "Black Smile"
</item>

<item shortBAlabel>
/1 = "Black Angry"
</item>

<video primeBS>
/ items = primeBS
/ select = noreplace
/ size = (50%, 50%)
</video>

<video shortBS>
/ items = shortBS
/ select = noreplace
/ size = (50%, 50%)
</video>

<video primeBA>
/ items = primeBA
/ select = noreplace
/ size = (50%, 50%)
</video>

<video shortBA>
/ items = shortBA
/ select = noreplace
/ size = (50%, 50%)
</video>

<video shortWA>
/ items = shortWA
/ select = noreplace
/ size = (50%, 50%)
</video>

<video shortWS>
/ items = shortWS
/ select = noreplace
/ size = (50%, 50%)
</video>

<video primeWS>
/ items = primeWS
/ select = noreplace
/ size = (50%, 50%)
</video>

<video primeWA>
/ items = primeWA
/ select = noreplace
/ size = (50%, 50%)
</video>


<item primeBS>
/1 = "B01_S.0000.mov"
/2 = "B02_S.0000.mov"
/3 = "B03_S.0000.mov"
/4 = "B04_S.0000.mov"
/5 = "B05_S.0000.mov"
</item>

<item shortBS>
/1 = "B01_S_short.mov"
/2 = "B02_S_short.mov"
/3 = "B03_S_short.mov"
/4 = "B04_S_short.mov"
/5 = "B05_S_short.mov"
</item>

<item primeBA>
/1 = "B01_A.0000.mov"
/2 = "B02_A.0000.mov"
/3 = "B03_A.0000.mov"
/4 = "B04_A.0000.mov"
/5 = "B05_A.0000.mov"
</item>

<item shortBA>
/1 = "B01_A_short.mov"
/2 = "B02_A_short.mov"
/3 = "B03_A_short.mov"
/4 = "B04_A_short.mov"
/5 = "B05_A_short.mov"
</item>

<item primeWS>
/1 = "W01_S.0000.mov"
/2 = "W02_S.0000.mov"
/3 = "W03_S.0000.mov"
/4 = "W04_S.0000.mov"
/5 = "W05_S.0000.mov"
</item>

<item shortWS>
/1 = "W01_S_short.mov"
/2 = "W02_S_short.mov"
/3 = "W03_S_short.mov"
/4 = "W04_S_short.mov"
/5 = "W05_S_short.mov"
</item>

<item primeWA>
/1 = "W01_A.0000.mov"
/2 = "W02_A.0000.mov"
/3 = "W03_A.0000.mov"
/4 = "W04_A.0000.mov"
/5 = "W05_A.0000.mov"
</item>

<item shortWA>
/1 = "W01_A_short.mov"
/2 = "W02_A_short.mov"
/3 = "W03_A_short.mov"
/4 = "W04_A_short.mov"
/5 = "W05_A_short.mov"
</item>


***********************************************************************
Symbol and neutral stimuli
***********************************************************************

<item symbols>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
/6 = "pic6.jpg"
/7 = "pic7.jpg"
/8 = "pic8.jpg"
/9 = "pic9.jpg"
/10 = "pic10.jpg"
/11 = "pic11.jpg"
/12 = "pic12.jpg"
/13 = "pic13.jpg"
/14 = "pic14.jpg"
/15 = "pic15.jpg"
/16 = "pic16.jpg"
/17 = "pic17.jpg"
/18 = "pic18.jpg"
/19 = "pic19.jpg"
/20 = "pic20.jpg"
</item>

<picture mask>
/ items = ("mask.jpg")
/ size = (50%, 50%)
</picture>

<shape blank>
/ shape = rectangle
/ color = white
/ size = (20%, 20%)
</shape>

**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************

<likert primeA3>
/ stimulusframes = [1=prime_liking]
/ numpoints = 7
/ anchors = [1="not at all"; 7="very much"]
</likert>


<trial primeA2>
/ ontrialbegin = [

  trial.primeA2.insertstimulustime(picture.target, parameters.primeTarget_ISI);
  trial.primeA2.insertstimulustime(picture.mask, parameters.primeTarget_ISI + parameters.targetDuration);
]
/ beginresponsetime = parameters.primeTarget_ISI
/ validresponse = ("E", "I")
/ correctresponse = ("E", "I")
/ ontrialend = [
  values.targetstim = picture.target.currentitemnumber;
]
</trial>


<text prime_liking>
/items = ("<center>To what extent do you like the face you just saw? Please use your mouse, mouse pad or touch screen to select a number below:</center>")
/fontstyle = ("Arial", 5%, true, false, false, false, 5, 1)
/position = (50%, 20%)
</text>


<trial shortBS>
/ ontrialend = [
    trial.shortBS.resetstimulusframes();
    values.primestim = video.shortbs.currentItemNumber;
    values.targetstim = picture.target.currentItemNumber;

]    
/ ontrialbegin = [
    trial.shortBS.insertstimulustime(shape.blank, parameters.shortDuration);
    trial.shortBS.insertstimulustime(picture.target, (parameters.shortDuration + parameters.primeTarget_ISI));
    trial.shortBS.insertstimulustime(picture.mask, (parameters.shortDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ validresponse = ("E", "I")
/ stimulustimes = [0=shortBS]
/ beginresponsetime = (parameters.shortDuration + parameters.primeTarget_ISI)
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]

</trial>


<trial shortBA>
/ ontrialbegin = [
    trial.shortBA.insertstimulustime(shape.blank, parameters.shortDuration);
    trial.shortBA.insertstimulustime(picture.target, (parameters.shortDuration + parameters.primeTarget_ISI));
    trial.shortBA.insertstimulustime(picture.mask, (parameters.shortDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=shortBA]
/ beginresponsetime = (parameters.shortDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.shortBA.resetstimulusframes();
    values.primestim = video.shortba.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>

<trial shortWA>
/ ontrialbegin = [
    trial.shortWA.insertstimulustime(shape.blank, parameters.shortDuration);
    trial.shortWA.insertstimulustime(picture.target, (parameters.shortDuration + parameters.primeTarget_ISI));
    trial.shortWA.insertstimulustime(picture.mask, (parameters.shortDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=shortWA]
/ beginresponsetime = (parameters.shortDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.shortWA.resetstimulusframes();
    values.primestim = video.shortba.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>

<trial shortWS>
/ ontrialbegin = [
    trial.shortWS.insertstimulustime(shape.blank, parameters.shortDuration);
    trial.shortWS.insertstimulustime(picture.target, (parameters.shortDuration + parameters.primeTarget_ISI));
    trial.shortWS.insertstimulustime(picture.mask, (parameters.shortDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=shortWS]
/ beginresponsetime = (parameters.shortDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.shortWS.resetstimulusframes();
    values.primestim = video.shortws.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>





<trial primeBS>
/ stimulustimes = [0=primeBS]
/ ontrialend = [
    trial.primeBS.resetstimulusframes();
    values.primestim = video.primebs.currentItemNumber;
    values.targetstim = picture.target.currentItemNumber;    

]    
/ ontrialbegin = [
    trial.primeBS.insertstimulustime(shape.blank, parameters.primeDuration);
    trial.primeBS.insertstimulustime(picture.target, (parameters.primeDuration + parameters.primeTarget_ISI));
    trial.primeBS.insertstimulustime(picture.mask, (parameters.primeDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ validresponse = ("E", "I")
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]

</trial>



<trial primeBA>
/ ontrialbegin = [
    trial.primeBA.insertstimulustime(shape.blank, parameters.primeDuration);
    trial.primeBA.insertstimulustime(picture.target, (parameters.primeDuration + parameters.primeTarget_ISI));
    trial.primeBA.insertstimulustime(picture.mask, (parameters.primeDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=primeBA]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.primeBA.resetstimulusframes();
    values.primestim = video.primeba.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>




<trial primeWS>
/ ontrialbegin = [
    trial.primeWS.insertstimulustime(shape.blank, parameters.primeDuration);
    trial.primeWS.insertstimulustime(picture.target, (parameters.primeDuration + parameters.primeTarget_ISI));
    trial.primeWS.insertstimulustime(picture.mask, (parameters.primeDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=primeWS]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.primeWS.resetstimulusframes();
    values.primestim = video.primews.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>


<trial primeWA>
/ ontrialbegin = [
    trial.primeWA.insertstimulustime(shape.blank, parameters.primeDuration);
    trial.primeWA.insertstimulustime(picture.target, (parameters.primeDuration + parameters.primeTarget_ISI));
    trial.primeWA.insertstimulustime(picture.mask, (parameters.primeDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=primeWA]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.primeWA.resetstimulusframes();
    values.primestim = video.primewa.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>



<trial BS2>
/ ontrialbegin = [
    trial.primeBS.insertstimulustime(shape.blank, parameters.primeDuration);    
]
/ stimulustimes = [0=primeBS]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ timeout = parameters.primeTarget_ISI
/ ontrialend = [
    trial.primeBS.resetstimulusframes();
]
/ branch = [
    likert.primeA3
]
</trial>



<trial BA2>
/ ontrialbegin = [
    trial.primeBA.insertstimulustime(shape.blank, parameters.primeDuration);    
]
/ stimulustimes = [0=primeBA]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ timeout = parameters.primeTarget_ISI
/ ontrialend = [
    trial.primeBA.resetstimulusframes();
]
/ branch = [
    likert.primeA3
]
</trial>



<trial WS2>
/ ontrialbegin = [
    trial.primeWS.insertstimulustime(shape.blank, parameters.primeDuration);    
]
/ stimulustimes = [0=primeWS]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ timeout = parameters.primeTarget_ISI
/ ontrialend = [
    trial.primeWS.resetstimulusframes();
]
/ branch = [
    likert.primeA3
]
</trial>



<trial WA2>
/ ontrialbegin = [
    trial.primeWA.insertstimulustime(shape.blank, parameters.primeDuration);    
]
/ stimulustimes = [0=primeWA]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ timeout = parameters.primeTarget_ISI
/ ontrialend = [
    trial.primeWA.resetstimulusframes();
]
/ branch = [
    likert.primeA3
]
</trial>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************

<block practice>
/ preinstructions = (instructions)
/ bgstim = (attributeAlabel, attributeBlabel)
/ trials = [
    1 = fingers;
    2 = getReady;
    3-5 = noreplace(shortBS, shortBA, shortWS, shortWA);
]
/ recorddata = true
</block>

<block test1>
/ preinstructions = (instructionsdone)
/ onblockbegin = [
    video.shortbs.resetselection();
    video.shortba.resetselection();
    video.shortws.resetselection();
    video.shortwa.resetselection();
    picture.target.resetselection();
]
/ bgstim = (attributeAlabel, attributeBlabel)
/ trials = [

    1 = fingers;
    2 = getready;
    3-62 = noreplace(shortBS, shortBA, shortWS, shortWA);

]
/ recorddata = true
</block>

<block test2>
/ onblockbegin = [
    video.primebs.resetselection();
    video.primeba.resetselection();
    video.primews.resetselection();
    video.primewa.resetselection();
]
/ trials = [
    1-2 = instructions2;
    3-22 = noreplace(BS2, BA2, WS2, WA2);
    23 = ThankYou;
    24 = exit;
]
/ recorddata = true
</block>

**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt a>
/ preinstructions = (Hello)
/ blocks = [
    1=Demographics;
    2=practice;
    3=test1;
    4=test2;
]
</expt>


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: 12K, Visits: 99K
Céline - 4/15/2024
Hello,

I am rather new to Inquisit as I am working on my first experiment. I wanted to use an AMP task and I have modified an AMP code that I found in the Inquisit library (AMP procedure found under https://www.millisecond.com/download/library/amp). The main difference for my experiment is that I want to use a video as a prime instead of a picture. (I also have a second task where the video need to be rated on a Likert scale. This task runs without any issues.) It has been quite of a struggle to have the video running as it should, but we found a solution by adding a branch (see code below). Now I noticed that the target picture is present throughout the whole trial instead of being on screen for 100ms as coded in the parameters. It is visible behind the video and the mask. Could you please help me figure out how to fix this issue? I am completely stuck... Also, if you know of a better solution than adding a branch to have the video displayed as needed, I am more than happy to hear about it. You can find my code below. Note: I have two types of videos (called prime and shorts), they're the same, with one being cut to a shorter version (0.20 seconds for the AMP task, long version is 3 seconds long for the likert task). I omitted the text part of my code because they're not relevant to the issue here. Do let me know if I should add that too! 

Thank you in advance for your help!

Warm regards,

Céline

<parameters>
/primeDuration = 2000
/shortDuration = 200
/primeTarget_ISI = 125
/targetDuration = 100
/maskDuration = 125
</parameters>

***********************************************************************

<item attributeAlabel>
/1 = "Pleasant"
</item>

<item attributeBlabel>
/1 = "Unpleasant"
</item>

<item primeBSlabel>
/1 = "Black Smile"
</item>

<item primeBAlabel>
/1 = "Black Angry"
</item>

<item primeWSlabel>
/1 = "White Smile"
</item>

<item primeWAlabel>
/1 = "White Angry"
</item>

<item shortWAlabel>
/1 = "White Angry"
</item>

<item shortWSlabel>
/1 = "White Smile"
</item>

<item shortBSlabel>
/1 = "Black Smile"
</item>

<item shortBAlabel>
/1 = "Black Angry"
</item>

<video primeBS>
/ items = primeBS
/ select = noreplace
/ size = (50%, 50%)
</video>

<video shortBS>
/ items = shortBS
/ select = noreplace
/ size = (50%, 50%)
</video>

<video primeBA>
/ items = primeBA
/ select = noreplace
/ size = (50%, 50%)
</video>

<video shortBA>
/ items = shortBA
/ select = noreplace
/ size = (50%, 50%)
</video>

<video shortWA>
/ items = shortWA
/ select = noreplace
/ size = (50%, 50%)
</video>

<video shortWS>
/ items = shortWS
/ select = noreplace
/ size = (50%, 50%)
</video>

<video primeWS>
/ items = primeWS
/ select = noreplace
/ size = (50%, 50%)
</video>

<video primeWA>
/ items = primeWA
/ select = noreplace
/ size = (50%, 50%)
</video>


<item primeBS>
/1 = "B01_S.0000.mov"
/2 = "B02_S.0000.mov"
/3 = "B03_S.0000.mov"
/4 = "B04_S.0000.mov"
/5 = "B05_S.0000.mov"
</item>

<item shortBS>
/1 = "B01_S_short.mov"
/2 = "B02_S_short.mov"
/3 = "B03_S_short.mov"
/4 = "B04_S_short.mov"
/5 = "B05_S_short.mov"
</item>

<item primeBA>
/1 = "B01_A.0000.mov"
/2 = "B02_A.0000.mov"
/3 = "B03_A.0000.mov"
/4 = "B04_A.0000.mov"
/5 = "B05_A.0000.mov"
</item>

<item shortBA>
/1 = "B01_A_short.mov"
/2 = "B02_A_short.mov"
/3 = "B03_A_short.mov"
/4 = "B04_A_short.mov"
/5 = "B05_A_short.mov"
</item>

<item primeWS>
/1 = "W01_S.0000.mov"
/2 = "W02_S.0000.mov"
/3 = "W03_S.0000.mov"
/4 = "W04_S.0000.mov"
/5 = "W05_S.0000.mov"
</item>

<item shortWS>
/1 = "W01_S_short.mov"
/2 = "W02_S_short.mov"
/3 = "W03_S_short.mov"
/4 = "W04_S_short.mov"
/5 = "W05_S_short.mov"
</item>

<item primeWA>
/1 = "W01_A.0000.mov"
/2 = "W02_A.0000.mov"
/3 = "W03_A.0000.mov"
/4 = "W04_A.0000.mov"
/5 = "W05_A.0000.mov"
</item>

<item shortWA>
/1 = "W01_A_short.mov"
/2 = "W02_A_short.mov"
/3 = "W03_A_short.mov"
/4 = "W04_A_short.mov"
/5 = "W05_A_short.mov"
</item>


***********************************************************************
Symbol and neutral stimuli
***********************************************************************

<item symbols>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
/6 = "pic6.jpg"
/7 = "pic7.jpg"
/8 = "pic8.jpg"
/9 = "pic9.jpg"
/10 = "pic10.jpg"
/11 = "pic11.jpg"
/12 = "pic12.jpg"
/13 = "pic13.jpg"
/14 = "pic14.jpg"
/15 = "pic15.jpg"
/16 = "pic16.jpg"
/17 = "pic17.jpg"
/18 = "pic18.jpg"
/19 = "pic19.jpg"
/20 = "pic20.jpg"
</item>

<picture mask>
/ items = ("mask.jpg")
/ size = (50%, 50%)
</picture>

<shape blank>
/ shape = rectangle
/ color = white
/ size = (20%, 20%)
</shape>

**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************

<likert primeA3>
/ stimulusframes = [1=prime_liking]
/ numpoints = 7
/ anchors = [1="not at all"; 7="very much"]
</likert>


<trial primeA2>
/ ontrialbegin = [

  trial.primeA2.insertstimulustime(picture.target, parameters.primeTarget_ISI);
  trial.primeA2.insertstimulustime(picture.mask, parameters.primeTarget_ISI + parameters.targetDuration);
]
/ beginresponsetime = parameters.primeTarget_ISI
/ validresponse = ("E", "I")
/ correctresponse = ("E", "I")
/ ontrialend = [
  values.targetstim = picture.target.currentitemnumber;
]
</trial>


<text prime_liking>
/items = ("<center>To what extent do you like the face you just saw? Please use your mouse, mouse pad or touch screen to select a number below:</center>")
/fontstyle = ("Arial", 5%, true, false, false, false, 5, 1)
/position = (50%, 20%)
</text>


<trial shortBS>
/ ontrialend = [
    trial.shortBS.resetstimulusframes();
    values.primestim = video.shortbs.currentItemNumber;
    values.targetstim = picture.target.currentItemNumber;

]    
/ ontrialbegin = [
    trial.shortBS.insertstimulustime(shape.blank, parameters.shortDuration);
    trial.shortBS.insertstimulustime(picture.target, (parameters.shortDuration + parameters.primeTarget_ISI));
    trial.shortBS.insertstimulustime(picture.mask, (parameters.shortDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ validresponse = ("E", "I")
/ stimulustimes = [0=shortBS]
/ beginresponsetime = (parameters.shortDuration + parameters.primeTarget_ISI)
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]

</trial>


<trial shortBA>
/ ontrialbegin = [
    trial.shortBA.insertstimulustime(shape.blank, parameters.shortDuration);
    trial.shortBA.insertstimulustime(picture.target, (parameters.shortDuration + parameters.primeTarget_ISI));
    trial.shortBA.insertstimulustime(picture.mask, (parameters.shortDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=shortBA]
/ beginresponsetime = (parameters.shortDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.shortBA.resetstimulusframes();
    values.primestim = video.shortba.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>

<trial shortWA>
/ ontrialbegin = [
    trial.shortWA.insertstimulustime(shape.blank, parameters.shortDuration);
    trial.shortWA.insertstimulustime(picture.target, (parameters.shortDuration + parameters.primeTarget_ISI));
    trial.shortWA.insertstimulustime(picture.mask, (parameters.shortDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=shortWA]
/ beginresponsetime = (parameters.shortDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.shortWA.resetstimulusframes();
    values.primestim = video.shortba.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>

<trial shortWS>
/ ontrialbegin = [
    trial.shortWS.insertstimulustime(shape.blank, parameters.shortDuration);
    trial.shortWS.insertstimulustime(picture.target, (parameters.shortDuration + parameters.primeTarget_ISI));
    trial.shortWS.insertstimulustime(picture.mask, (parameters.shortDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=shortWS]
/ beginresponsetime = (parameters.shortDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.shortWS.resetstimulusframes();
    values.primestim = video.shortws.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>





<trial primeBS>
/ stimulustimes = [0=primeBS]
/ ontrialend = [
    trial.primeBS.resetstimulusframes();
    values.primestim = video.primebs.currentItemNumber;
    values.targetstim = picture.target.currentItemNumber;    

]    
/ ontrialbegin = [
    trial.primeBS.insertstimulustime(shape.blank, parameters.primeDuration);
    trial.primeBS.insertstimulustime(picture.target, (parameters.primeDuration + parameters.primeTarget_ISI));
    trial.primeBS.insertstimulustime(picture.mask, (parameters.primeDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ validresponse = ("E", "I")
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]

</trial>



<trial primeBA>
/ ontrialbegin = [
    trial.primeBA.insertstimulustime(shape.blank, parameters.primeDuration);
    trial.primeBA.insertstimulustime(picture.target, (parameters.primeDuration + parameters.primeTarget_ISI));
    trial.primeBA.insertstimulustime(picture.mask, (parameters.primeDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=primeBA]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.primeBA.resetstimulusframes();
    values.primestim = video.primeba.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>




<trial primeWS>
/ ontrialbegin = [
    trial.primeWS.insertstimulustime(shape.blank, parameters.primeDuration);
    trial.primeWS.insertstimulustime(picture.target, (parameters.primeDuration + parameters.primeTarget_ISI));
    trial.primeWS.insertstimulustime(picture.mask, (parameters.primeDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=primeWS]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.primeWS.resetstimulusframes();
    values.primestim = video.primews.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>


<trial primeWA>
/ ontrialbegin = [
    trial.primeWA.insertstimulustime(shape.blank, parameters.primeDuration);
    trial.primeWA.insertstimulustime(picture.target, (parameters.primeDuration + parameters.primeTarget_ISI));
    trial.primeWA.insertstimulustime(picture.mask, (parameters.primeDuration + parameters.primeTarget_ISI + parameters.targetDuration));
]
/ stimulustimes = [0=primeWA]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ ontrialend = [
    trial.primeWA.resetstimulusframes();
    values.primestim = video.primewa.currentitemnumber;
    values.targetstim = picture.target.currentitemnumber;    
]
/ validresponse = ("E", "I")
/timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration
/ branch = [
    trial.primeA2
]
</trial>



<trial BS2>
/ ontrialbegin = [
    trial.primeBS.insertstimulustime(shape.blank, parameters.primeDuration);    
]
/ stimulustimes = [0=primeBS]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ timeout = parameters.primeTarget_ISI
/ ontrialend = [
    trial.primeBS.resetstimulusframes();
]
/ branch = [
    likert.primeA3
]
</trial>



<trial BA2>
/ ontrialbegin = [
    trial.primeBA.insertstimulustime(shape.blank, parameters.primeDuration);    
]
/ stimulustimes = [0=primeBA]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ timeout = parameters.primeTarget_ISI
/ ontrialend = [
    trial.primeBA.resetstimulusframes();
]
/ branch = [
    likert.primeA3
]
</trial>



<trial WS2>
/ ontrialbegin = [
    trial.primeWS.insertstimulustime(shape.blank, parameters.primeDuration);    
]
/ stimulustimes = [0=primeWS]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ timeout = parameters.primeTarget_ISI
/ ontrialend = [
    trial.primeWS.resetstimulusframes();
]
/ branch = [
    likert.primeA3
]
</trial>



<trial WA2>
/ ontrialbegin = [
    trial.primeWA.insertstimulustime(shape.blank, parameters.primeDuration);    
]
/ stimulustimes = [0=primeWA]
/ beginresponsetime = (parameters.primeDuration + parameters.primeTarget_ISI)
/ timeout = parameters.primeTarget_ISI
/ ontrialend = [
    trial.primeWA.resetstimulusframes();
]
/ branch = [
    likert.primeA3
]
</trial>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************

<block practice>
/ preinstructions = (instructions)
/ bgstim = (attributeAlabel, attributeBlabel)
/ trials = [
    1 = fingers;
    2 = getReady;
    3-5 = noreplace(shortBS, shortBA, shortWS, shortWA);
]
/ recorddata = true
</block>

<block test1>
/ preinstructions = (instructionsdone)
/ onblockbegin = [
    video.shortbs.resetselection();
    video.shortba.resetselection();
    video.shortws.resetselection();
    video.shortwa.resetselection();
    picture.target.resetselection();
]
/ bgstim = (attributeAlabel, attributeBlabel)
/ trials = [

    1 = fingers;
    2 = getready;
    3-62 = noreplace(shortBS, shortBA, shortWS, shortWA);

]
/ recorddata = true
</block>

<block test2>
/ onblockbegin = [
    video.primebs.resetselection();
    video.primeba.resetselection();
    video.primews.resetselection();
    video.primewa.resetselection();
]
/ trials = [
    1-2 = instructions2;
    3-22 = noreplace(BS2, BA2, WS2, WA2);
    23 = ThankYou;
    24 = exit;
]
/ recorddata = true
</block>

**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt a>
/ preinstructions = (Hello)
/ blocks = [
    1=Demographics;
    2=practice;
    3=test1;
    4=test2;
]
</expt>


Please don't paste entire scripts into a post's body. Instead use the ability to attach the actual script file to your post (+Insert -> Add File). Also, if your code requires any externai files to run (images, videos, etc.), please always make those files available along with the code (put them on your Dropbox, Google Drive, or similar and post the link).

Céline
Céline
New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)
Group: Forum Members
Posts: 4, Visits: 12

Hi Dave,

Thank you for bringing this to my attention. My apologies for the mistake. I have attached my code to this message an the photos and videos can be found here: https://1drv.ms/f/s!AsD3iocAmMMLibgaMGMWx9y0T-R9FA?e=nAq1De.

Warm regards,
Céline
Attachments
Micro_final_code.iqx (22 views, 33.00 KB)
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: 12K, Visits: 99K
Céline - 4/16/2024

Hi Dave,

Thank you for bringing this to my attention. My apologies for the mistake. I have attached my code to this message an the photos and videos can be found here: https://1drv.ms/f/s!AsD3iocAmMMLibgaMGMWx9y0T-R9FA?e=nAq1De.

Warm regards,
Céline

The way you'll want to do this is to have a set of "prime" trials that do nothing but display the prime video, and from these /branch to another trial that displays the other stimuli and collects the response. Example for the "shortBS" prime below:

<parameters>
/primeDuration = 2000
/shortDuration = 500
/primeTarget_ISI = 125
/targetDuration = 100
/maskDuration = 125
</parameters>

<values>
/ primestim = ""
/ targetstim = ""
</values>

<block example>
/ bgstim = (attributeAlabel, attributeBlabel)
/ trials = [1-5 = primeshortBS]
</block>

<trial primeshortBS>
/ ontrialend = [
    trial.primeshortBS.resetstimulusframes();
    values.primestim = video.shortbs.currentItemNumber;
]
/ stimulustimes = [0=shortBS] // display the prime video
/ validresponse = (0) // take no response
/ trialduration = parameters.shortDuration // for the desired duration
/ branch = [
    return trial.shortBS; // run trial that displays the remaining stimuli and takes response
]
/ recorddata = false
</trial>

<trial shortBS>
/ ontrialbegin = [
    trial.shortBS.insertstimulustime(picture.target, parameters.primeTarget_ISI); // display target
    trial.shortBS.insertstimulustime(picture.mask, (parameters.primeTarget_ISI + parameters.targetDuration)); // display mask
]
/ ontrialend = [
    values.targetstim = picture.target.currentitemnumber;
    trial.shortBS.resetstimulusframes();
]
/ stimulustimes = [0=blank] // display blank stimulus
/ validresponse = ("E", "I")
/ beginresponsetime = (parameters.primeTarget_ISI) // response relative to target onset
// timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration // i don't think you want a timeout
</trial>

<video shortBS>
/ items = shortBS
/ select = noreplace
/ size = (50%, 50%)
/ playthrough = false
</video>

<item shortBS>
/1 = "B01_S_short.mov"
/2 = "B02_S_short.mov"
/3 = "B03_S_short.mov"
/4 = "B04_S_short.mov"
/5 = "B05_S_short.mov"
</item>

<shape blank>
/ shape = rectangle
/ color = black
/ size = (50%, 50%)
</shape>

<picture mask>
/ items = ("mask.jpg")
/ size = (50%, 50%)
</picture>

<picture target>
/ items = symbols
/ select = noreplace
/ size = (50%, 50%)
</picture>

<item symbols>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
/6 = "pic6.jpg"
/7 = "pic7.jpg"
/8 = "pic8.jpg"
/9 = "pic9.jpg"
/10 = "pic10.jpg"
/11 = "pic11.jpg"
/12 = "pic12.jpg"
/13 = "pic13.jpg"
/14 = "pic14.jpg"
/15 = "pic15.jpg"
/16 = "pic16.jpg"
/17 = "pic17.jpg"
/18 = "pic18.jpg"
/19 = "pic19.jpg"
/20 = "pic20.jpg"
</item>

<text attributeAlabel>
/ items = attributeAlabel
/ valign = top
/ halign = right
/ position = (95%, 5%)
/ txcolor = green
/ fontstyle = ("Arial", 5%)
</text>

<text attributeBlabel>
/ items = attributeBlabel
/ valign = top
/ halign = left
/ position = (5%, 5%)
/ txcolor = green
/ fontstyle = ("Arial", 5%)
</text>

<item attributeAlabel>
/1 = "Pleasant"
</item>

<item attributeBlabel>
/1 = "Unpleasant"
</item>

<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum,
values.primestim, values.targetstim,response, correct, latency,
)
</data>


Céline
Céline
New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)
Group: Forum Members
Posts: 4, Visits: 12
Dave - 4/16/2024
Céline - 4/16/2024

Hi Dave,

Thank you for bringing this to my attention. My apologies for the mistake. I have attached my code to this message an the photos and videos can be found here: https://1drv.ms/f/s!AsD3iocAmMMLibgaMGMWx9y0T-R9FA?e=nAq1De.

Warm regards,
Céline

The way you'll want to do this is to have a set of "prime" trials that do nothing but display the prime video, and from these /branch to another trial that displays the other stimuli and collects the response. Example for the "shortBS" prime below:

<parameters>
/primeDuration = 2000
/shortDuration = 500
/primeTarget_ISI = 125
/targetDuration = 100
/maskDuration = 125
</parameters>

<values>
/ primestim = ""
/ targetstim = ""
</values>

<block example>
/ bgstim = (attributeAlabel, attributeBlabel)
/ trials = [1-5 = primeshortBS]
</block>

<trial primeshortBS>
/ ontrialend = [
    trial.primeshortBS.resetstimulusframes();
    values.primestim = video.shortbs.currentItemNumber;
]
/ stimulustimes = [0=shortBS] // display the prime video
/ validresponse = (0) // take no response
/ trialduration = parameters.shortDuration // for the desired duration
/ branch = [
    return trial.shortBS; // run trial that displays the remaining stimuli and takes response
]
/ recorddata = false
</trial>

<trial shortBS>
/ ontrialbegin = [
    trial.shortBS.insertstimulustime(picture.target, parameters.primeTarget_ISI); // display target
    trial.shortBS.insertstimulustime(picture.mask, (parameters.primeTarget_ISI + parameters.targetDuration)); // display mask
]
/ ontrialend = [
    values.targetstim = picture.target.currentitemnumber;
    trial.shortBS.resetstimulusframes();
]
/ stimulustimes = [0=blank] // display blank stimulus
/ validresponse = ("E", "I")
/ beginresponsetime = (parameters.primeTarget_ISI) // response relative to target onset
// timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration // i don't think you want a timeout
</trial>

<video shortBS>
/ items = shortBS
/ select = noreplace
/ size = (50%, 50%)
/ playthrough = false
</video>

<item shortBS>
/1 = "B01_S_short.mov"
/2 = "B02_S_short.mov"
/3 = "B03_S_short.mov"
/4 = "B04_S_short.mov"
/5 = "B05_S_short.mov"
</item>

<shape blank>
/ shape = rectangle
/ color = black
/ size = (50%, 50%)
</shape>

<picture mask>
/ items = ("mask.jpg")
/ size = (50%, 50%)
</picture>

<picture target>
/ items = symbols
/ select = noreplace
/ size = (50%, 50%)
</picture>

<item symbols>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
/6 = "pic6.jpg"
/7 = "pic7.jpg"
/8 = "pic8.jpg"
/9 = "pic9.jpg"
/10 = "pic10.jpg"
/11 = "pic11.jpg"
/12 = "pic12.jpg"
/13 = "pic13.jpg"
/14 = "pic14.jpg"
/15 = "pic15.jpg"
/16 = "pic16.jpg"
/17 = "pic17.jpg"
/18 = "pic18.jpg"
/19 = "pic19.jpg"
/20 = "pic20.jpg"
</item>

<text attributeAlabel>
/ items = attributeAlabel
/ valign = top
/ halign = right
/ position = (95%, 5%)
/ txcolor = green
/ fontstyle = ("Arial", 5%)
</text>

<text attributeBlabel>
/ items = attributeBlabel
/ valign = top
/ halign = left
/ position = (5%, 5%)
/ txcolor = green
/ fontstyle = ("Arial", 5%)
</text>

<item attributeAlabel>
/1 = "Pleasant"
</item>

<item attributeBlabel>
/1 = "Unpleasant"
</item>

<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum,
values.primestim, values.targetstim,response, correct, latency,
)
</data>


Hi Dave,

Thanks for the quick reply and for looking into my code. I have tested it and the target is now indeed displayed as intended, thanks! However, the blank is now displayed throughout the whole trial. I have tried to recode the onbegin trial part like in the AMP task (and thus suppressing / stimulustimes = [0=blank] and replacing it with / stimulustimes = [0=shortBS]), but that did not work as you probably already knew. The trial did not run at all then. I also tried to use the picture option instead of the shape option and give the picture a duration of 125ms in the parameters. That, unfortunately, also did not work.

Alternatively, I changed the color of the blank to white so that it appears as if it would disappear. The other stimuli appear on top so matching the background color make it look the blank is displayed as intended. My solution is, however, not very "clean". Would you know how to ensure that the blank is displayed for 125ms?

Thanks in advance!

Warm regards,
Céline
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: 12K, Visits: 99K
Céline - 4/16/2024
Dave - 4/16/2024
Céline - 4/16/2024

Hi Dave,

Thank you for bringing this to my attention. My apologies for the mistake. I have attached my code to this message an the photos and videos can be found here: https://1drv.ms/f/s!AsD3iocAmMMLibgaMGMWx9y0T-R9FA?e=nAq1De.

Warm regards,
Céline

The way you'll want to do this is to have a set of "prime" trials that do nothing but display the prime video, and from these /branch to another trial that displays the other stimuli and collects the response. Example for the "shortBS" prime below:

<parameters>
/primeDuration = 2000
/shortDuration = 500
/primeTarget_ISI = 125
/targetDuration = 100
/maskDuration = 125
</parameters>

<values>
/ primestim = ""
/ targetstim = ""
</values>

<block example>
/ bgstim = (attributeAlabel, attributeBlabel)
/ trials = [1-5 = primeshortBS]
</block>

<trial primeshortBS>
/ ontrialend = [
    trial.primeshortBS.resetstimulusframes();
    values.primestim = video.shortbs.currentItemNumber;
]
/ stimulustimes = [0=shortBS] // display the prime video
/ validresponse = (0) // take no response
/ trialduration = parameters.shortDuration // for the desired duration
/ branch = [
    return trial.shortBS; // run trial that displays the remaining stimuli and takes response
]
/ recorddata = false
</trial>

<trial shortBS>
/ ontrialbegin = [
    trial.shortBS.insertstimulustime(picture.target, parameters.primeTarget_ISI); // display target
    trial.shortBS.insertstimulustime(picture.mask, (parameters.primeTarget_ISI + parameters.targetDuration)); // display mask
]
/ ontrialend = [
    values.targetstim = picture.target.currentitemnumber;
    trial.shortBS.resetstimulusframes();
]
/ stimulustimes = [0=blank] // display blank stimulus
/ validresponse = ("E", "I")
/ beginresponsetime = (parameters.primeTarget_ISI) // response relative to target onset
// timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration // i don't think you want a timeout
</trial>

<video shortBS>
/ items = shortBS
/ select = noreplace
/ size = (50%, 50%)
/ playthrough = false
</video>

<item shortBS>
/1 = "B01_S_short.mov"
/2 = "B02_S_short.mov"
/3 = "B03_S_short.mov"
/4 = "B04_S_short.mov"
/5 = "B05_S_short.mov"
</item>

<shape blank>
/ shape = rectangle
/ color = black
/ size = (50%, 50%)
</shape>

<picture mask>
/ items = ("mask.jpg")
/ size = (50%, 50%)
</picture>

<picture target>
/ items = symbols
/ select = noreplace
/ size = (50%, 50%)
</picture>

<item symbols>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
/6 = "pic6.jpg"
/7 = "pic7.jpg"
/8 = "pic8.jpg"
/9 = "pic9.jpg"
/10 = "pic10.jpg"
/11 = "pic11.jpg"
/12 = "pic12.jpg"
/13 = "pic13.jpg"
/14 = "pic14.jpg"
/15 = "pic15.jpg"
/16 = "pic16.jpg"
/17 = "pic17.jpg"
/18 = "pic18.jpg"
/19 = "pic19.jpg"
/20 = "pic20.jpg"
</item>

<text attributeAlabel>
/ items = attributeAlabel
/ valign = top
/ halign = right
/ position = (95%, 5%)
/ txcolor = green
/ fontstyle = ("Arial", 5%)
</text>

<text attributeBlabel>
/ items = attributeBlabel
/ valign = top
/ halign = left
/ position = (5%, 5%)
/ txcolor = green
/ fontstyle = ("Arial", 5%)
</text>

<item attributeAlabel>
/1 = "Pleasant"
</item>

<item attributeBlabel>
/1 = "Unpleasant"
</item>

<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum,
values.primestim, values.targetstim,response, correct, latency,
)
</data>


Hi Dave,

Thanks for the quick reply and for looking into my code. I have tested it and the target is now indeed displayed as intended, thanks! However, the blank is now displayed throughout the whole trial. I have tried to recode the onbegin trial part like in the AMP task (and thus suppressing / stimulustimes = [0=blank] and replacing it with / stimulustimes = [0=shortBS]), but that did not work as you probably already knew. The trial did not run at all then. I also tried to use the picture option instead of the shape option and give the picture a duration of 125ms in the parameters. That, unfortunately, also did not work.

Alternatively, I changed the color of the blank to white so that it appears as if it would disappear. The other stimuli appear on top so matching the background color make it look the blank is displayed as intended. My solution is, however, not very "clean". Would you know how to ensure that the blank is displayed for 125ms?

Thanks in advance!

Warm regards,
Céline

You are misunderstanding how stimuli work. A stimulus displayed in a trial is *always* displayed for the entire duration of the trial, *unless* you overwrite that stimulus with something else at whatever time you desire. Stimuli are not erased until the trial is over.
https://www.millisecond.com/support/docs/current/html/howto/howtoerase.htm

Céline
Céline
New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)New Member (39 reputation)
Group: Forum Members
Posts: 4, Visits: 12
Dave - 4/16/2024
Céline - 4/16/2024
Dave - 4/16/2024
Céline - 4/16/2024

Hi Dave,

Thank you for bringing this to my attention. My apologies for the mistake. I have attached my code to this message an the photos and videos can be found here: https://1drv.ms/f/s!AsD3iocAmMMLibgaMGMWx9y0T-R9FA?e=nAq1De.

Warm regards,
Céline

The way you'll want to do this is to have a set of "prime" trials that do nothing but display the prime video, and from these /branch to another trial that displays the other stimuli and collects the response. Example for the "shortBS" prime below:

<parameters>
/primeDuration = 2000
/shortDuration = 500
/primeTarget_ISI = 125
/targetDuration = 100
/maskDuration = 125
</parameters>

<values>
/ primestim = ""
/ targetstim = ""
</values>

<block example>
/ bgstim = (attributeAlabel, attributeBlabel)
/ trials = [1-5 = primeshortBS]
</block>

<trial primeshortBS>
/ ontrialend = [
    trial.primeshortBS.resetstimulusframes();
    values.primestim = video.shortbs.currentItemNumber;
]
/ stimulustimes = [0=shortBS] // display the prime video
/ validresponse = (0) // take no response
/ trialduration = parameters.shortDuration // for the desired duration
/ branch = [
    return trial.shortBS; // run trial that displays the remaining stimuli and takes response
]
/ recorddata = false
</trial>

<trial shortBS>
/ ontrialbegin = [
    trial.shortBS.insertstimulustime(picture.target, parameters.primeTarget_ISI); // display target
    trial.shortBS.insertstimulustime(picture.mask, (parameters.primeTarget_ISI + parameters.targetDuration)); // display mask
]
/ ontrialend = [
    values.targetstim = picture.target.currentitemnumber;
    trial.shortBS.resetstimulusframes();
]
/ stimulustimes = [0=blank] // display blank stimulus
/ validresponse = ("E", "I")
/ beginresponsetime = (parameters.primeTarget_ISI) // response relative to target onset
// timeout = parameters.primeTarget_ISI + parameters.targetDuration + parameters.maskDuration // i don't think you want a timeout
</trial>

<video shortBS>
/ items = shortBS
/ select = noreplace
/ size = (50%, 50%)
/ playthrough = false
</video>

<item shortBS>
/1 = "B01_S_short.mov"
/2 = "B02_S_short.mov"
/3 = "B03_S_short.mov"
/4 = "B04_S_short.mov"
/5 = "B05_S_short.mov"
</item>

<shape blank>
/ shape = rectangle
/ color = black
/ size = (50%, 50%)
</shape>

<picture mask>
/ items = ("mask.jpg")
/ size = (50%, 50%)
</picture>

<picture target>
/ items = symbols
/ select = noreplace
/ size = (50%, 50%)
</picture>

<item symbols>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
/6 = "pic6.jpg"
/7 = "pic7.jpg"
/8 = "pic8.jpg"
/9 = "pic9.jpg"
/10 = "pic10.jpg"
/11 = "pic11.jpg"
/12 = "pic12.jpg"
/13 = "pic13.jpg"
/14 = "pic14.jpg"
/15 = "pic15.jpg"
/16 = "pic16.jpg"
/17 = "pic17.jpg"
/18 = "pic18.jpg"
/19 = "pic19.jpg"
/20 = "pic20.jpg"
</item>

<text attributeAlabel>
/ items = attributeAlabel
/ valign = top
/ halign = right
/ position = (95%, 5%)
/ txcolor = green
/ fontstyle = ("Arial", 5%)
</text>

<text attributeBlabel>
/ items = attributeBlabel
/ valign = top
/ halign = left
/ position = (5%, 5%)
/ txcolor = green
/ fontstyle = ("Arial", 5%)
</text>

<item attributeAlabel>
/1 = "Pleasant"
</item>

<item attributeBlabel>
/1 = "Unpleasant"
</item>

<data>
/ columns = (build, computer.platform, date, time, subject, group, session,
blockcode, blocknum, trialcode, trialnum,
values.primestim, values.targetstim,response, correct, latency,
)
</data>


Hi Dave,

Thanks for the quick reply and for looking into my code. I have tested it and the target is now indeed displayed as intended, thanks! However, the blank is now displayed throughout the whole trial. I have tried to recode the onbegin trial part like in the AMP task (and thus suppressing / stimulustimes = [0=blank] and replacing it with / stimulustimes = [0=shortBS]), but that did not work as you probably already knew. The trial did not run at all then. I also tried to use the picture option instead of the shape option and give the picture a duration of 125ms in the parameters. That, unfortunately, also did not work.

Alternatively, I changed the color of the blank to white so that it appears as if it would disappear. The other stimuli appear on top so matching the background color make it look the blank is displayed as intended. My solution is, however, not very "clean". Would you know how to ensure that the blank is displayed for 125ms?

Thanks in advance!

Warm regards,
Céline

You are misunderstanding how stimuli work. A stimulus displayed in a trial is *always* displayed for the entire duration of the trial, *unless* you overwrite that stimulus with something else at whatever time you desire. Stimuli are not erased until the trial is over.
https://www.millisecond.com/support/docs/current/html/howto/howtoerase.htm

Hi Dave,

Thanks for the clarification. I now understand how stimuli work and it seems that what I did was correct then as it is what the link that you sent me suggests as well.

Thank you very much for your help! I will make sure to remember these tips for next time :)

I wish you a nice day/evening depending on where you are in the world!

Warm regards,
Céline
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search