Subtracting Duration of Subsequent slide from the Duration of Previous slide

25 views
Skip to first unread message

Jason He

unread,
Jun 2, 2016, 9:06:09 PM6/2/16
to E-Prime
Hey all,

I'm new to this group :). This is an embarassingly simple question, and one that I haven't been able to figure out with much success.
I'm having participants respond to a stimulis, and when they respond to the stimulus, I want E-prime to jump to the next object, which is a mask. 

I.e. If a participant spends 2000ms on the stimulus, then I want the mask to be present for 3000ms. 
or If a participant spends 5000ms on the stimulus, then I want the mask to be present for 0ms

Stimulus.Duration + Mask.Duration = 5000

My current Inline looks like:

Stimulus.Finishtime < 5000 Then
         Mask.Duration = Mask.Duration - Stimulus.Finishtime

Jason He

unread,
Jun 2, 2016, 9:11:17 PM6/2/16
to E-Prime
Sorry accidentally hit post. 

So my code is:

 Stimulus.Finishtime < 5000 Then
         Mask.Duration = Mask.Duration - Stimulus.Finishtime
         End If

The problem I'm having is, E-prime uses the Stimulus.Finishtime of the first trial over and over again, when I want E-prime to use the Stimulus.Finishtime of the current trial.
I've used .Finishtime because .Duration wasn't working for me (kept getting error messages saying 'can't apply to a constant'

Cheers in advance,
Jason

David McFarlane

unread,
Jun 16, 2016, 6:15:32 PM6/16/16
to e-p...@googlegroups.com
Jason,

I would use (and have used) an entirely different approach. Try this:

- Set the Duration of your Mask to the same Duration of your Stimulus,
i.e., 5000 (yes, really)!

- Use the following inline code after Stimulus:

SetNextTargetOnsetTime Stimulus.TargetOnsetTime

That's all. Now, Mask will think that it was supposed to start at the
same time as the Stimulus started, and will use up 5000 ms from the
TargetOnsetTime of the Stimulus. Simple, clean, & effective. (See the
SetNextTargerOnsetTime topic in the E-Basic Help facility for
documentation.)

Note that, in any case, if Mask has it Onset Sync set to "vertical
blank", then you will always get at least one frame of the Mask. If you
want to avoid that, you would have to do some If-Then test and Goto some
Label if the Stimulus has used all its time, presumably because Stimulus
got no response. Here are a couple examples:

If Stimulus.RTTime Then ' got a respsonse
SetNextTargerOnsetTime Stimulus.TargetOnsetTime
Else ' no response
Goto PostMaskLabel
End If

or

If Stimulus.InputMasks.IsPending() Then ' no response
Goto PostMaskLabel
Else ' got a response
SetNextTargerOnsetTime Stimulus.TargetOnsetTime
End If

And of course, the PostMaskLabel appears after the Mask object in the
Procedure.

---------------
David McFarlane
E-Prime training online:
http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster)
Reply all
Reply to author
Forward
0 new messages