Trying to present visual and audio together - getting 16ms lag

Rob Manchester robmanc2014 at gmail.com
Mon Aug 11 09:12:37 UTC 2014


David

The 'sync to none' solution reduced the lag to 2ms from 16ms so that is a 
significant improvement. Thanks.

Editing the pre-release value didn't seem to do anything, the files are 
very small so there is probably very little delay in loading them

Thanks
Rob 

On Thursday, 7 August 2014 21:27:39 UTC+1, McFarlane, David wrote:
>
> Rob, 
>
> To answer the question asked:  Yes, you are correct that the system 
> is losing a refresh for every object loading.  You may avoid that 
> simply by going to the Sync tab of your Slide objects and setting 
> Onset Sync to "(none)". 
>
> That said ... 
>
> To get even better synchronization between onset of your image & 
> sound, you could add the sound right to the Slide.  Your following 
> inline code (to terminate sound on response) would then have to refer 
> to the SlideSound sub-object instead, but if you look at some of the 
> automatically generated code and fuss around a little you should figure it 
> out. 
>
> Instead of 
>
>      sleep(1000-c.getattrib("TonePlay.rt") 
>
> you could simply use 
>
>      sleep(1000-TonePlay.rt) 
>
> which avoids having to deal with an attribute that may or may not be 
> set at the time.  But I would not use this method anyway, as I fear 
> that it still leaves too much room for slop (RT may not take into 
> account other delays that have set in, etc.).  Instead, I would take 
> advantage of the neat built-in timing facilities of EP objects 
> themselves, and just manipulate the NextTargetOnsetTime directly, e.g., 
>
>      SetNextTargetOnsetTime Slide1.OnsetTime + 1000 
>
> to emulate Event timing mode, or 
>
>      SetNextTargetOnsetTime Slide1.TargetOnsetTime + 1000 
>
> to emulate Cumulative timing mode.  Set the SetNextTargetOnsetTime 
> topic in the E-Basic Help facility. 
>
> Better yet, just set the Slide Durations to 1000, and PreRelease to 
> 1000, and you will not need any code at all to make each Slide start 
> 1000 ms apart (don't take my word for that, try the exercise 
> yourself).  The inline code will run during the PreRelease period as 
> directed, and the next Slide will start 1000 ms after the previous 
> one (assuming that your inline code does not run beyond the 
> PreRelease).  (In fact, EP2.0.10 now sets PreRelease to "(same as 
> duration)" by default, making much of this automatic.) 
>
> ----- 
> 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) You may reach PST's 
> trained staff (and other support facilities) at 
> https://support.pstnet.com .  3) 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 8/7/2014 01:33 PM Thursday, Rob Manchester wrote: 
> >I'm trying to edit someone else's experiment in E-Prime V1. 
> > 
> >They have a procedure that contains 8 objects. 4 of these objects 
> >are slides which contain images. The slides have duration = 0. The 
> >other 4 objects are bits of inline code that calls another procedure 
> >which contains 1) a slide with duration 1000 which has a 'soundout' 
> >object of duration 1000 that terminates on a keyboard response.  2) 
> >a further bit of code = sleep(1000-c.getattrib("TonePlay.rt")). This 
> >last bit of code I think tries to ensure that the procedure lasts 
> >1000 regardless of the reaction time to the sound. 
> > 
> >The image slides are interespersed with the inline code that call 
> >the audio procedure i.e. 
> > 
> >Image Slide Duration = 0 
> >Code calling audio proc, duration 1000ms 
> >Image Slide Duration = 0 
> >Code calling audio proc, duration 1000ms 
> >Image Slide Duration = 0 
> >Code calling audio proc, duration 1000ms 
> >Image Slide Duration = 0 
> >Code calling audio proc, duration 1000ms 
> > 
> >My screen refresh is 60hz. The idea of the code is that the Images 
> >and Audio display together for 1000s each, with the audio (but not 
> >the image) terminating on response. It works apart from the fact 
> >that the audio loads 16/17ms after the image - i.e. 1 screen 
> >refresh. The ISI between sucessive audio stimuli is 1034ms rather 
> >than 1000ms (i.e. two screen refreshes too long). Could anyone tell 
> >me why these delays are occurring? I presume the system is losing a 
> >refresh for every object loading (i.e. a delay = to a screen refresh 
> >is occuring when E-prime moves between the slide object and the 
> >inline code object. I've tried putting a pre-release value of 20ms 
> >on the slides but this doesn't seem to have had any effect. Does any 
> >have any ideas as to how to solve this? 
> > 
> >Thanks 
> >Rob 
>
>

-- 
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 at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/ad146219-7e82-4c7f-b1a7-10882023d18b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20140811/7e277dcb/attachment.htm>


More information about the Eprime mailing list