Sound on button press

David McFarlane mcfarla9 at msu.edu
Thu Apr 14 20:49:58 UTC 2011


Vera,

Agree with liw generally about handling the timing, but I would just 
use a SoundOut object instead of a Slide or anything visual, that way 
your visual stim will simply remain while your sound plays with no 
further fuss.

My own favorite trick for getting timing like this to work is to make 
use of the more esoteric SetNextTargetOnsetTime (see the online 
E-Basic Help).  On your stimulus Slide (let's call it StimSlide), set 
End Action to (terminate) and leave its Duration at 2000.  Follow 
that with an inline, and then a SoundOut object (let's call it 
FeedbackSound) and set its Duration to 2000.  In the inline between 
StimSlide and FeedbackSound, just put

SetNextTargetOnsetTime StimSlide.OnsetTime

Now, whenever your program gets to FeedbackSound, it will think that 
FeedbackSound was supposed to start at the same time as StimSlide and 
then end 2000 ms later, i.e., 2000 ms after StimSlide started.  Isn't 
that slick?  And it required no computation.

Admittedly, using tricks like this does rely on some deeper 
understanding of the inner hidden workings of E-Prime, and I don't 
have time to explain all that just now.  Also, your subject may get a 
short beep even for no response, so you may have to work out a little 
more code to get everything to work the way you want (see liw's 
further discussion earlier).

-- David McFarlane, Professional Faultfinder


At 4/14/2011 12:00 PM Thursday, you wrote:
>Hi Vera!
>
>first thing that comes to mind (I think something like this was
>discussed here before... ages ago). Create a second, similar, slide
>right after the current one you have now but add your sound object to
>this slide so that the sound is heard when this slide appears.
>Inbetween the two slides place an inline that sets the second slide's
>duration to the remainder of the 2000 ms (slide2.duration = 2000 -
>slide1.duration) and perhaps add a goto label line to entirely skip
>the second slide in case of no response... i.e. "if slide1.resp = ""
>then goto jumplabel", place the label called jumplabel after the
>second slide .
>
>A quick and dirty suggestion, I hope it helps you, though.
>
>best,
>
>liw
>
>On Apr 14, 4:27 pm, Vera <vera.d... at googlemail.com> wrote:
> > Hi group!
> >
> > I already got some useful help here about a year ago and everything
> > worked fine (after a while you kind of get the "hang" of
> > eprime...;-) ), but now I seem to run into a problem (which actually
> > seems a very easy-to-do-thing to me, but I haven't figured out a way
> > to do this yet).
> >
> > I show participants an image on a slide for 2000 ms
> >
> > They have to answer by pushing a button whether a target is present
> > (if there is no target, they shouldn't do anything -> typical go-nogo
> > task). The image will however stay visible 2000 ms independent of
> > their answer (every trial = 2000 ms of image).
> >
> > Now, as this is all taking place in a driving environment, where quite
> > a lot is going on, I would like to give out a sound once a button is
> > pushed (but the image still needs to stay there!).
> >
> > I of course have the option of using a feedback-display, but then I
> > only get the sound, once the slide disappears.
> >
> > I really would like to have the sound on button press, just to confirm
> > the participant "ok, noticed your response" (or not: there will not be
> > sound in absence of a response).
> >
> > Any ideas on how to do this?
> >
> > Thanks in advance!
> >
> > Greetings,
> > Vera

-- 
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