How to fade from slide1 to slide2 (inline?)

Alon Hafri ahafri at gmail.com
Thu Jul 28 15:13:50 UTC 2011


Hi Erika,

I did not have a chance to look at your attached script so excuse me
if I mention something you've already done, but I think I can offer a
few quick tips, and maybe others can offer follow-ups or different
approaches as well.

I would make the Slide duration 0 and then use an Inline to control
the key presses and release, the changing color effect, and the trial
duration. Another thing to note is that in E-Prime registering key
releases is achieved with a minus sign, so for example {SPACE} is a
press and {-SPACE} is a release (likewise {1} is a press and {-1} is a
release). You have to set the CollectionMode property of the InputMask
to accept both presses and releases, which you can achieve I believe
either in the Input Mask properties window (maybe advanced settings)
or in code (Keyboard.CollectionMode = ebPressesAndReleases).

First put an InLine (SetTrialStartTime) at the very beginning of the
trial like this. This gets the experiment time from the start of the
trial:
'-----------------------------------------------------------------------------
Dim lngTrialStart As Long
lngTrialStart = Clock.Read
'-----------------------------------------------------------------------------

Then a label "Repeat" after the stimulus slide and before the next
InLine, and another label "SkipInLine" after the next inline:

Then the following InLine (WaitForKeypresses):
'-----------------------------------------------------------------------------
If Clock.Read - lngTrialStart >= 2500 Then GoTo SkipInLine

Dim nResps As Long

nResps = Keyboard.Responses.Count

'waits for the initial keypress
If nResps > 0 Then

   'loops until either a response is made or the trial time runs out:
   nResps = Keyboard.Responses.Count
   Do Until Keyboard.Responses(nResps) = "{SPACE}"
      If Clock.Read - lngTrialStart >= 2500 Then GoTo SkipInLine
      Sleep 1
   Loop

   'logs the keypress time:
   c.SetAttrib "Keypress", Clock.Read

   'loops the color changing code until either the release or the
trial time time runs out
   Do Until Keyboard.Responses(Keyboard.Responses.Count) = "{-SPACE}"
      If Clock.Read - lngTrialStart >= 2500 Then GoTo SkipInLine
      'insert color changing code here
   Loop
Else
   Sleep 1
   GoTo Repeat
End If

'logs the key release time:
c.SetAttrib "Keyrelease", Clock.Read
'-----------------------------------------------------------------------------

Then after the label "SkipInLine" you can have a simple InLine
(WaitForTrialEnd) that waits untilt 2500 ms has passed from the start
of the trial until the trial end:
'-----------------------------------------------------------------------------
Do Until Clock.Read - lngTrialStart >= 2500
   Sleep 1
Loop
'-----------------------------------------------------------------------------

So the trial structure would be something like:
SetTrialStartTime (InLine)
Stimulus Slide
Repeat label
WaitForKeypresses InLine
SkipInLine label
WaitForTrialEnd (InLine)

That should do it. You said you have the color changing code, yes?
Good luck! If anyone else has a different way, please share!

Alon


On Jul 27, 2:42 pm, Erika Nyhus <Erika_Ny... at brown.edu> wrote:
> I am trying to program an experiment in E Prime and was wondering if you had
> any tips/examples to help me out.
>
> What I am trying to do is have subjects indicate their confidence in their
> response by the length of time they press the response button.  While they
> are pressing the button we would like to present a visual cue (e.g. a
> growing bar or changing color) indicating the length of the button press.
> This visual cue should stop changing as soon as they release the button and
> then should remain stable until the end of the trial period.
>
> Attached is a mini-experiment in which I have gotten the color of the
> stimuli to change (adapted from the example given here) and then remain
> stable until the end of the trial period.  But I have three remaining issues
> that I would appreciate help on.  First, the stimuli should only start
> changing colors when the response button is pressed.  So I need to have the
> stimuli appear, as soon as the button is pressed it changes color, and then
> when it is released it remains that color for the remainder of the trial.
> Second, I need the total trial time to be 2500 ms including stimulus
> appearance, change in color as the button is pressed, and as the stimulus
> remains stable until the end of the trial period.  The code I have added in
> Inline3 (c.setAttrib "Dur", 2500-(ResponseTime-Slide1Time) does not appear
> to work properly as it sometimes results in very high values (e.g. Dur=5000
> ms) or negative values (e.g. Dur=-500 ms).  Third, I need to log the time
> when the response button was pressed and when it was released to get a
> measure of how long the button was pressed.
>
> --
> Erika Nyhus, Ph.D.
> Cognitive, Linguistic, and Psychological Sciences
> Brown University
> 229 Waterman St.
> Providence, RI 02912-1821
>
>  TestImage.es2
> 40KViewDownload

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list