> All primes to be presented in random order, with a given prime
never presented closer than 4 trials apart.> All targets to be presented in random order, though constrained to deliver the above
18 sequence types per prime type. The above is the tricky part and I don't see an easy / obvious way to do it. You either (1) need to come up with an algorithm that reliably and deterministically produces trial sequences satisfying that constraint (and then implement it) or (2) manually construct a bunch of such sequences, hardcode them into the script and then simply select one of those.
(For the record: I am not entirely sure what exactly you mean by "All targets to be presented in random order, though constrained to deliver the above
18 sequence types per prime type.")
For general background, see
https://www.millisecond.com/forums/Topic6419.aspx. For a specific example, study the sequence generation code in
https://www.millisecond.com/download/library/AAT/ (the forum topic
https://www.millisecond.com/forums/Topic12826.aspx contains some discussion of that code and its limitations.)
Apart from the constraints, the rest would look somewhat like the code below (which might give you a starting point).
<block myblock>
/ trials = [1-54=list.triallist]
</block>
<list triallist>
/ items = (trial.posprime1, trial.posprime2, trial.posprime3, trial.posprime4, trial.posprime5, trial.posprime6,
trial.negprime1, trial.negprime2, trial.negprime3, trial.negprime4, trial.negprime5, trial.negprime6,
trial.noprime1, trial.noprime2, trial.noprime3, trial.noprime4, trial.noprime5, trial.noprime6)
/ poolsize = 54
/ maxrunsize = 0
</list>
*** Positive Prime Trials ***
<trial posprime1>
/ stimulusframes = [1=posprime1]
/ validresponse = (57)
/ branch = [list.posprime1targets.nextvalue]
</trial>
<trial posprime2>
/ stimulusframes = [1=posprime2]
/ validresponse = (57)
/ branch = [list.posprime2targets.nextvalue]
</trial>
<trial posprime3>
/ stimulusframes = [1=posprime3]
/ validresponse = (57)
/ branch = [list.posprime3targets.nextvalue]
</trial>
<trial posprime4>
/ stimulusframes = [1=posprime4]
/ validresponse = (57)
/ branch = [list.posprime4targets.nextvalue]
</trial>
<trial posprime5>
/ stimulusframes = [1=posprime5]
/ validresponse = (57)
/ branch = [list.posprime5targets.nextvalue]
</trial>
<trial posprime6>
/ stimulusframes = [1=posprime6]
/ validresponse = (57)
/ branch = [list.posprime6targets.nextvalue]
</trial>
*** Negative Prime Trials ***
<trial negprime1>
/ stimulusframes = [1=negprime1]
/ validresponse = (57)
/ branch = [list.negprime1targets.nextvalue]
</trial>
<trial negprime2>
/ stimulusframes = [1=negprime2]
/ validresponse = (57)
/ branch = [list.negprime2targets.nextvalue]
</trial>
<trial negprime3>
/ stimulusframes = [1=negprime3]
/ validresponse = (57)
/ branch = [list.negprime3targets.nextvalue]
</trial>
<trial negprime4>
/ stimulusframes = [1=negprime4]
/ validresponse = (57)
/ branch = [list.negprime4targets.nextvalue]
</trial>
<trial negprime5>
/ stimulusframes = [1=negprime5]
/ validresponse = (57)
/ branch = [list.negprime5targets.nextvalue]
</trial>
<trial negprime6>
/ stimulusframes = [1=negprime6]
/ validresponse = (57)
/ branch = [list.negprime6targets.nextvalue]
</trial>
*** No Prime Trials ***
<trial noprime1>
/ stimulusframes = [1=noprime1]
/ validresponse = (57)
/ branch = [list.noprime1targets.nextvalue]
</trial>
<trial noprime2>
/ stimulusframes = [1=noprime2]
/ validresponse = (57)
/ branch = [list.noprime2targets.nextvalue]
</trial>
<trial noprime3>
/ stimulusframes = [1=noprime3]
/ validresponse = (57)
/ branch = [list.noprime3targets.nextvalue]
</trial>
<trial noprime4>
/ stimulusframes = [1=noprime4]
/ validresponse = (57)
/ branch = [list.noprime4targets.nextvalue]
</trial>
<trial noprime5>
/ stimulusframes = [1=noprime5]
/ validresponse = (57)
/ branch = [list.noprime5targets.nextvalue]
</trial>
<trial noprime6>
/ stimulusframes = [1=noprime6]
/ validresponse = (57)
/ branch = [list.noprime6targets.nextvalue]
</trial>
*** Three Target Options Per Prime ***
*** Positive ***
<list posprime1targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list posprime2targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list posprime3targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list posprime4targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list posprime5targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list posprime6targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
*** Negative ***
<list negprime1targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list negprime2targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list negprime3targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list negprime4targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list negprime5targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list negprime6targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
*** None ***
<list noprime1targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list noprime2targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list noprime3targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list noprime4targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list noprime5targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
<list noprime6targets>
/ items = (trial.postarget, trial.negtarget, trial.gabortarget)
</list>
*** Target Trials ***
*** Positive ***
<trial postarget>
/ stimulusframes = [1=postarget]
/ validresponse = (57)
</trial>
*** Negative ***
<trial negtarget>
/ stimulusframes = [1=negtarget]
/ validresponse = (57)
</trial>
*** Gabor ***
<trial gabortarget>
/ stimulusframes = [1=gabortarget]
/ validresponse = (57)
</trial>
*** Stimuli ***
*** Primes ***
*** Positive ***
<text posprime1>
/ items = ("Positive Prime 1")
</text>
<text posprime2>
/ items = ("Positive Prime 2")
</text>
<text posprime3>
/ items = ("Positive Prime 3")
</text>
<text posprime4>
/ items = ("Positive Prime 4")
</text>
<text posprime5>
/ items = ("Positive Prime 5")
</text>
<text posprime6>
/ items = ("Positive Prime 6")
</text>
*** Negative ***
<text negprime1>
/ items = ("Negative Prime 1")
</text>
<text negprime2>
/ items = ("Negative Prime 2")
</text>
<text negprime3>
/ items = ("Negative Prime 3")
</text>
<text negprime4>
/ items = ("Negative Prime 4")
</text>
<text negprime5>
/ items = ("Negative Prime 5")
</text>
<text negprime6>
/ items = ("Negative Prime 6")
</text>
*** None ***
<text noprime1>
/ items = ("No Prime 1")
</text>
<text noprime2>
/ items = ("No Prime 2")
</text>
<text noprime3>
/ items = ("No Prime 3")
</text>
<text noprime4>
/ items = ("No Prime 4")
</text>
<text noprime5>
/ items = ("No Prime 5")
</text>
<text noprime6>
/ items = ("No Prime 6")
</text>
*** Targets ***
*** Positive ***
<text postarget>
/ items = postargetitems
</text>
<item postargetitems>
/ 1 = "Positive Target 1"
/ 2 = "Positive Target 2"
/ 3 = "Positive Target 3"
/ 4 = "Positive Target 4"
/ 5 = "Positive Target 5"
/ 6 = "Positive Target 6"
/ 7 = "Positive Target 7"
/ 8 = "Positive Target 8"
/ 9 = "Positive Target 9"
/ 10 = "Positive Target 10"
/ 11 = "Positive Target 11"
/ 12 = "Positive Target 12"
</item>
*** Negative ***
<text negtarget>
/ items = negtargetitems
</text>
<item negtargetitems>
/ 1 = "Negative Target 1"
/ 2 = "Negative Target 2"
/ 3 = "Negative Target 3"
/ 4 = "Negative Target 4"
/ 5 = "Negative Target 5"
/ 6 = "Negative Target 6"
/ 7 = "Negative Target 7"
/ 8 = "Negative Target 8"
/ 9 = "Negative Target 9"
/ 10 = "Negative Target 10"
/ 11 = "Negative Target 11"
/ 12 = "Negative Target 12"
</item>
*** Gabor ***
<text gabortarget>
/ items = gabortargetitems
</text>
<item gabortargetitems>
/ 1 = "Gabor Target 1"
/ 2 = "Gabor Target 2"
/ 3 = "Gabor Target 3"
/ 4 = "Gabor Target 4"
/ 5 = "Gabor Target 5"
/ 6 = "Gabor Target 6"
/ 7 = "Gabor Target 7"
/ 8 = "Gabor Target 8"
/ 9 = "Gabor Target 9"
/ 10 = "Gabor Target 10"
/ 11 = "Gabor Target 11"
/ 12 = "Gabor Target 12"
</item>