random stimulus presentation times


Author
Message
Jens Bölte
Jens Bölte
Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)
Group: Forum Members
Posts: 78, Visits: 60

Hello,


I am writing an Inquisit-script for a EEG-experiment. One requirement is to jitter the presentation times of various stimuli, e.g. the time interval of the fixation cross, the blank screen and the stimulus. Inquisit offers function to random number generation, e.g. rand(40,43). However a definition such as the following does not work


<trial mg1>
/stimulusframes = [10 = fixation.pic; 25 = maske; ipart(rand(40,43) = mg1.pic]
/validresponse = ("F", "J")
/correctresponse = ("J")
/pretrialpause = rand(400,600)
</trial>


Using an expression or defining the onset-variable as a counter or value did not work. At least, I did not get to run. Any suggestions?


Jens



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: 13K, Visits: 108K

It isn't supposed to work like that. To do this, you need to make use of some of the <trial> element's member functions via /ontrialbegin. You'll want to see the language reference for setstimulustime(), insertstimulustime() and resetstimulusframes().


Edited to add:


[1] There are, of course, corresponding frame-based functions: setstimulusframe(), insertstimulusframe(), etc.


[2] Here's a re-posting of a self-contained illustrative example (http://www.millisecond.com/forums/Topic11148.aspx#11148):


<list fixationduration>
/ items = (500, 5000, 10000)
</list>

<trial mytrial>
/ ontrialbegin = [trial.mytrial.setstimulustime(text.a, list.fixationduration.nextvalue);
    trial.mytrial.insertstimulustime(text.b, list.fixationduration.nextvalue)]
/ ontrialend = [trial.mytrial.resetstimulusframes()]
/ stimulustimes = [0=fixation]
/ validresponse = (57)
</trial>

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

<text a>
/ items = ("A")
/ position = (45%, 50%)
</text>

<text b>
/ items = ("B")
/ position = (55%, 50%)
</text>

<block myblock>
/ trials = [1-3=mytrial]
</block>


Jens Bölte
Jens Bölte
Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)
Group: Forum Members
Posts: 78, Visits: 60

Hello,


thanks a lot for pointing me to the proper functions. The example you provided worked nicely. I, however, get the message that the message "Failed to call the function 'setstimulusframe' on element 'trial.mg1'." When changing everything to stimulustimes, I get the comparable error message. I attached the script, perhaps this helps (BTW, the file filter of the upload function rejects iqx-files).


Best wishes Jens




Attachments
experiment.exp (365 views, 12.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: 13K, Visits: 108K

Just like in my example, you need to provide proper syntax including element type:


<trial mg1>
/ontrialbegin = [trial.mg1.setstimulusframe(mg1.pic, list.onset.nextvalue); ...]
[...]
</trial>


ought to be


<trial mg1>
/ontrialbegin = [trial.mg1.setstimulusframe(picture.mg1.pic, list.onset.nextvalue); ...]
[...]
</trial>


Jens Bölte
Jens Bölte
Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)
Group: Forum Members
Posts: 78, Visits: 60

Hello Dave,


as in your example, proper syntax helps. [:)]


Best Jens


Jens Bölte
Jens Bölte
Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)
Group: Forum Members
Posts: 78, Visits: 60

Hello,



is there a way to store/display the filename of the inserted picture in the data file?


Best wishes Jens


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: 13K, Visits: 108K

Usually


<data>
/ columns = [..., picture.mg1.pic.currentitem, ...]
[...]
</data>


Jens Bölte
Jens Bölte
Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)Guru (9.6K reputation)
Group: Forum Members
Posts: 78, Visits: 60

Hello,


good idea. I altered it a little bit by assigning the filename to a value on trialend (e.g., /ontrialend = [trial.fg2.resetstimulusframes();values.file = picture.fg2.pic.currentitem]) and then reporting values.file as a column in the data-element.


Best regards Jens


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search