Sound on button press
Vera
vera.donk at googlemail.com
Fri Apr 15 15:58:33 UTC 2011
Hi Liwenna, hi David,
I tried both of your solutions (and actually encountered problems with
both of them), but they gave me some useful ideas to actually solve my
problem and I would like to post the solution I found for future
users. :-)
To your SetNextTargetOnsetTime David, as I had to set the End Action
to (terminate), the slideimage would actually disappear (which is not
what I wanted, I just wanted to have a sound to confirm button press
WITHOUT the slideimage disappearing).
As for your solution Liwenna, using 2 identical slides of which the
second one with a sound, I actually found a small problem in the
inline that you proposed. It turns out that "slide.duration" is
actually referring to the duration you set for the slide (e.g. 2000
ms). If you then do
slide2.duration = 2000 - slide1.duration basically you get 2000 - 2000
= 0. :-)
The correct way (for me at least) to do it is:
slide2.duration = slide1.duration - slide1.RT (e.g. 2000 - 1345 = 655
= duration slide2)
(and make sure to put the duration of slide2 on 0 (zero) ms).
Then it works perfectly! :-)
I also would like to thank you, David for your hint towards
SetNextTargetOnsetTime StimSlide.OnsetTime. Although I couldn't use it
this time, it might be useful in the future.
In other words: thanks to both of you! :-)
Have an nice weekend!
Greetings,
Vera
On Apr 14, 10:49 pm, David McFarlane <mcfar... at msu.edu> wrote:
> 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