2 slides equal to one time duration

212 views
Skip to first unread message

Kim Goodyear

unread,
Oct 8, 2013, 10:00:20 PM10/8/13
to e-p...@googlegroups.com
I am trying to have two sequential slides that are equal to one time duration of 2500 ms.  The first slide and the second slide are completely identical, except in the second slide the text color changes to red so that the participant can see their selection,  I want the first slide to terminate and then have the second slide come up so that they both equal the same 2500 ms.  Since the response time will vary I don't know how to make both slides equal to the same 2500.  I don't know why, but if the buttons aren't selected right away, the total duration is around 5000, or if there is a delay in the response, the total duration is around 4200.  I am not sure how to fix this issue, any advice would be great.  Here is my inline script:

Dim ResetSlide as integer
Dim x as integer

ResetSlide = StimDisplay.Duration + StimDisplay2.Duration
ResetSlide = x
x = 2500

David McFarlane

unread,
Oct 14, 2013, 2:22:55 PM10/14/13
to e-p...@googlegroups.com
Not sure I follow your description of the problem. But let's suppose
you have two Slides in your Procedure, let's call them ASlide and
BSlide. ASlide takes a response, and the Procedure moves on to
present BSlide whenever ASlide gets a response, or 2000 ms, whichever
comes first. And you want the total duration for ASlide & BSlide to
be 2500 ms, i.e., BSlide should last for 2500 - (ASlide_actual_duration).

There are many ways to skin this cat. My favorite method goes as
follows. Set the Duration of BSlide to 2500, and in an Inline
between ASlide and BSlide, do the following:

SetNextTargetOnsetTime ASlide.OnsetTime

That's all! Understanding how this works takes some deeper
understanding of E-Prime timing models & mechanisms, more than I can
go into here, but look at the SetNextTargetOnsetTime topic in the
E-Basic Help facility. But in short, with that bit of code, BSlide
will use the actual OnsetTime from ASlide in order to compute its own
ending time, and so will end at 2500 ms from the OnsetTime of ASlide,
whithout you having to do anything more. Presto!

-----
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster )

/----
Stock reminder: 1) I do not work for PST. 2) PST's trained staff
take any and all questions at https://support.pstnet.com , and they
strive to respond to all requests in 24-48 hours, so make full use of
it. 3) In addition, PST offers several instructional videos on their
YouTube channel (http://www.youtube.com/user/PSTNET ). 4) If you do
get an answer from PST staff, please extend the courtesy of posting
their reply back here for the sake of others.
\----

Kim Goodyear

unread,
Oct 14, 2013, 2:51:04 PM10/14/13
to e-p...@googlegroups.com
Hi David,

Thank you for your feedback.  This was very informative!  The only issue that I have is that this works when there is a response to "ASlide,"  if there is no response then the total duration of the 2 slides is different.  Should I make the duration of "ASlide" something different than 2500?  

David McFarlane

unread,
Oct 14, 2013, 3:07:57 PM10/14/13
to e-p...@googlegroups.com
First, PLEASE PLEASE folks, when you reply, include the previous
discussion! I don't mean to pick on you personally, Kim, but others
keep doing this and we have to get a firm message out. A week or so
might easily go by between posts, and by then I forgot what I or
others have already contributed. In this case I do recall, but it is
a great courtesy to spare others the trouble by including *all* of
the relevant previous discussion in your followups.

Now, as I said before, I had to make some guesses because you did not
put all the specifications into your original post. I had to guess
that the Duration of your "ASlide" was less than 2500, now we have
that clarified, thanks.

So first, did you try my suggestion? If you did, then you should
find that, when ASlide runs the full 2500 ms (or even longer), BSlide
will show for exactly one video frame. To avoid this you need to add
just a bit more inline code and one more thing to your Procedure,
which I will tell you as soon as you perform the exercise that I
suggested and can tell whether or not I know what I am talking about
(or perhaps with that hint you will just figure it out on your own).

Oh, and what Duration *do* you use for your "ASlide"?

Best,
-- David McFarlane

David McFarlane

unread,
Oct 21, 2013, 2:33:55 PM10/21/13
to e-p...@googlegroups.com
Just for the record, I need to correct a bit of my advice
here. Earlier, I said that using

SetNextTargetOnsetTime ASlide.OnsetTime

between ASlide and BSlide would make the total duration from the
start of ASlide to the end of BSlide equal the specified Duration of
BSlide (in this case, 2500 ms). But I neglected to say that, for
this to work, you must also set BSlide to use Cumulative timing
mode. This works because, in Cumulative timing mode, the TargetOnset
time for whatever follows BSlide will be based on the TargetOnsetTime
of BSlide (instead of actual OnsetTime), and BSlide.TargetOnsetTime
will come from the NextTargetOnsetTime implied in the code above. I
generally like this approach because it eliminates any errors due to
delays in starting BSlide.

Furthermore, the line of code above makes the total duration of
ASlide + BSlide act like Event timing mode (think it through). If
you want that to instead act like Cumulative timing mode, then that
line should read

SetNextTargetOnsetTime ASlide.TargetOnsetTime

i.e., use .TargetOnsetTime instead of just .OnsetTime.


If you stubbornly insist on keeping BSlide set to Event timing mode,
then the TargetOnset time for whatever follows BSlide will be based
on the actual OnsetTime of BSlide, and you have no recourse but to
manipulate the Duration of BSlide. In that case, your inline code
between ASlide and BSlide should look more like

BSlide.Duration = 2500 - (Clock.Read - ASlide.OnsetTime)

or if you prefer,

c.SetAttrib "BSlideDuration", 2500 - (Clock.Read - ASlide.OnsetTime)

and then use "[BSlideDuration]" as an attribute reference for the
Duration of BSlide (see comments on assigning object properties
directly in code vs. via attribute reference at
https://groups.google.com/d/topic/e-prime/dWpfjk-BeLs and
https://groups.google.com/d/topic/e-prime/g1Fv2CGaSeg ).

Manipulating Duration (instead of NextTargetOnsetTime) also means
that the actual duration of BSlide (and ASlide + BSlide) will vary
depending on any delays in starting BSlide, but maybe that is what you want.

-----
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster )

/----
Stock reminder: 1) I do not work for PST. 2) PST's trained staff
take any and all questions at https://support.pstnet.com , and they
strive to respond to all requests in 24-48 hours, so make full use of
it. 3) In addition, PST offers several instructional videos on their
YouTube channel (http://www.youtube.com/user/PSTNET ). 4) If you do
get an answer from PST staff, please extend the courtesy of posting
their reply back here for the sake of others.
\----


吉祥如意

unread,
Oct 30, 2013, 11:03:47 PM10/30/13
to e-p...@googlegroups.com
Dear  David McFarlane,
 I have tried your suggestion, it really works and it's quite simple compared with what I performed before as : BSlide.Duration=2500-ASlide.RT,  and one more question, why you use 2500 - (Clock.Read - ASlide.OnsetTime).
Thanks a lot.


2013/10/22 David McFarlane <mcfa...@msu.edu>
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/526573bf.0286320a.39d7.2574SMTPIN_ADDED_MISSING%40gmr-mx.google.com.

For more options, visit https://groups.google.com/groups/opt_out.

David McFarlane

unread,
Oct 31, 2013, 4:01:41 PM10/31/13
to e-p...@googlegroups.com
Glad you found that useful.

Hope I understand your question... Let's see, we have

BSlide.Duration = 2500 - ASlide.RT

and since RT = (ASlide.RTTime - ASlide.OnsetTime), that is the same as

BSlide.Duration = 2500 - (ASlide.RTTime - ASlide.OnsetTime)

which is not all that different from

BSlide.Duration = 2500 - (Clock.Read - ASlide.OnsetTime)

So the difference is slight. But here's the
deal. The goal here is to make BSlide end
precisely 2500 ms after the onset of
ASlide. Some small time may pass between
ASlide.RTTime and the time when BSlide starts,
and if that happens then if you base
BSlide.Duration on ASlide.RTTime then the
Duration will be a little too long and that will
make the full time of ASlide + BSlide longer than
intended. Using the Clock.Read in code
immediately before BSlide should give you a
closer estimate of the Duration needed for
BSlide, but even here, any delay between the
computation of BSlide.Duration and when BSlide
actually starts running will result in Duration
being just a little too long. May not be enough
to matter, but why not be more exact if we can?

So I advise *against* doing things this way just
because of the complications of all these little
delays. Instead, my main advice of using
SetNextTargetOnsetTime along with Cumulative
timing mode avoids these complications, and used
properly, can result in precise timing.

-----
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster )

/----
Stock reminder: 1) I do not work for PST. 2)
PST's trained staff take any and all questions at
https://support.pstnet.com , and they strive to
respond to all requests in 24-48 hours, so make
full use of it. 3) In addition, PST offers
several instructional videos on their YouTube
channel (http://www.youtube.com/user/PSTNET
). 4) If you do get an answer from PST staff,
please extend the courtesy of posting their reply
back here for the sake of others.
\----


At 10/30/2013 11:03 PM Wednesday, =?GB2312?B?vKrP6cjn0uI=?= wrote:
>Dear David McFarlane,
> I have tried your suggestion, it really works
> and it's quite simple compared with what I
> performed before as :
> BSlide.Duration=2500-ASlide.RT, and one more
> question, why you use 2500 - (Clock.Read - ASlide.OnsetTime).
>Thanks a lot.
>
>
>2013/10/22 David McFarlane <<mailto:mcfa...@msu.edu>mcfa...@msu.edu>
><https://groups.google.com/d/topic/e-prime/dWpfjk-BeLs>https://groups.google.com/d/topic/e-prime/dWpfjk-BeLs
>and
><https://groups.google.com/d/topic/e-prime/g1Fv2CGaSeg>https://groups.google.com/d/topic/e-prime/g1Fv2CGaSeg
>).
>
>Manipulating Duration (instead of
>NextTargetOnsetTime) also means that the actual
>duration of BSlide (and ASlide + BSlide) will
>vary depending on any delays in starting BSlide,
>but maybe that is what you want.
>
>
>-----
>David McFarlane
>E-Prime training
>online:
><http://psychology.msu.edu/Workshops_Courses/eprime.aspx>http://psychology.msu.edu/Workshops_Courses/eprime.aspx
>Twitter: @EPrimeMaster
>(<https://twitter.com/EPrimeMaster>https://twitter.com/EPrimeMaster )
>
>/----
>Stock reminder: 1) I do not work for PST. 2)
>PST's trained staff take any and all questions
>at
><https://support.pstnet.com>https://support.pstnet.com
>, and they strive to respond to all requests in
>24-48 hours, so make full use of it. 3) In
>addition, PST offers several instructional
>videos on their YouTube channel
>(<http://www.youtube.com/user/PSTNET>http://www.youtube.com/user/PSTNET
><http://psychology.msu.edu/Workshops_Courses/eprime.aspx>http://psychology.msu.edu/Workshops_Courses/eprime.aspx
>Twitter: @EPrimeMaster
>(<https://twitter.com/EPrimeMaster>https://twitter.com/EPrimeMaster )
>
>/----
>Stock reminder: 1) I do not work for PST. 2)
>PST's trained staff take any and all questions
>at
><https://support.pstnet.com>https://support.pstnet.com
>, and they strive to respond to all requests in
>24-48 hours, so make full use of it. 3) In
>addition, PST offers several instructional
>videos on their YouTube channel
>(<http://www.youtube.com/user/PSTNET>http://www.youtube.com/user/PSTNET

gorgeous yayuan geng

unread,
Oct 31, 2013, 10:03:05 PM10/31/13
to e-p...@googlegroups.com
Dear  David McFarlane,

I'm totally agree with you that we need to be precise. I just  understand what you mean and my origianl problem is due to my confusion for the meaning of all these kinds of time. 

I need to work hard to make these name familiar to me.

Thanks.

All my best,

Sally
 


2013/11/1 David McFarlane <mcfa...@msu.edu>
Glad you found that useful.

Hope I understand your question...  Let's see, we have

    BSlide.Duration = 2500 - ASlide.RT

and since RT = (ASlide.RTTime - ASlide.OnsetTime), that is the same as

    BSlide.Duration = 2500 - (ASlide.RTTime - ASlide.OnsetTime)

which is not all that different from


    BSlide.Duration = 2500 - (Clock.Read - ASlide.OnsetTime)

So the difference is slight.  But here's the deal.  The goal here is to make BSlide end precisely 2500 ms after the onset of ASlide.  Some small time may pass between ASlide.RTTime and the time when BSlide starts, and if that happens then if you base BSlide.Duration on ASlide.RTTime then the Duration will be a little too long and that will make the full time of ASlide + BSlide longer than intended.  Using the Clock.Read in code immediately before BSlide should give you a closer estimate of the Duration needed for BSlide, but even here, any delay between the computation of BSlide.Duration and when BSlide actually starts running will result in Duration being just a little too long.  May not be enough to matter, but why not be more exact if we can?

So I advise *against* doing things this way just because of the complications of all these little delays.  Instead, my main advice of using SetNextTargetOnsetTime along with Cumulative timing mode avoids these complications, and used properly, can result in precise timing.


-----
David McFarlane
E-Prime training online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster )

/----
Stock reminder:  1) I do not work for PST.  2) PST's trained staff take any and all questions at https://support.pstnet.com , and they strive to respond to all requests in 24-48 hours, so make full use of it.  3) In addition, PST offers several instructional videos on their YouTube channel (http://www.youtube.com/user/PSTNET ).  4) If you do get an answer from PST staff, please extend the courtesy of posting their reply back here for the sake of others.
\----


At 10/30/2013 11:03 PM Wednesday, =?GB2312?B?vKrP6cjn0uI=?= wrote:
Dear  David McFarlane,

 I have tried your suggestion, it really works and it's quite simple compared with what I performed before as : BSlide.Duration=2500-ASlide.RT,  and one more question, why you use 2500 - (Clock.Read - ASlide.OnsetTime).
Thanks a lot.


2013/10/22 David McFarlane <<mailto:mcfa...@msu.edu>mcfarl...@msu.edu>
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages