<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">Hello Pamela,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">I currently don’t have enough time for a proper analysis of your code and setup, but there are few things to think about:<o:p></o:p></FONT></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">1) Try to preload the sound files into different Sound objects at the start of the experiment. This will prevent unpredictable delays caused by loading the audio files during a trial. Preloading should be possible by adding properly configured SoundOut objects to the ‘unreferenced E-Objects’ section. This should be done for each sound. You can simple start such sound objects by calling the Play or Run methods.<o:p></o:p></FONT></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">2) Note that some soundcards have problems playing very short tracks. This problem seems to be related with the internal buffering mechanism of the sound card (or the DirectX drivers.) In our lab we once had a situation where sometimes the tail of track A was replayed at the start of track B. We solved this issue by adding some silence at the start and end of each WAV-file. Another option is to create a single WAV-file which contains all the audio you would like to play. (We even developed a small library for this which can be used by EPrime to generate WAV-files at runtime by adding existing WAV files into one large audio stream.)<o:p></o:p></FONT></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">3) Because it is not always easy to check the exact onsets of the sound stimuli, it is sometimes desirable to be able to record the sound output itself along with the EEG. The easiest way would be to record the attenuated audio signal itself on a bipolar input. However, because galvanic connection of external equipment with the EEG amplifier is not allowed, you will require special isolation electronics to be able to do this safely. Another option would be some dedicated electronics that translates the audio signal into a digital trigger pulse, which can be recorded on the trigger input. In some cases this will eliminate the need of creating the digital triggers in EPrime.<o:p></o:p></FONT></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">hope this helps.<o:p></o:p></FONT></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">best,<o:p></o:p></FONT></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">Paul Groot<o:p></o:p></FONT></FONT></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-ansi-language: EN-US"><FONT size=3><FONT color=#000000><FONT face="Times New Roman">VU University <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:City w:st="on"><st1:place w:st="on">Amsterdam</st1:place></st1:City></FONT></FONT></FONT><o:p></o:p></SPAN></P>
<BR> <BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #008080 2px solid; MARGIN-RIGHT: 0px">
<HR id=EC_stopSpelling>
Date: Thu, 18 Jan 2007 09:20:50 -0600<BR>From: pamela.n.carton@gmail.com<BR>To: eprime@mail.talkbank.org<BR>Subject: Repetitive Sound Presentation and Trigger Issues<BR><BR><SPAN><SPAN><SPAN><SPAN><SPAN>Hello-<BR><BR>We are currently doing a study in which we will present pictures followed by a fixation point. During the pictures and the fixation points, we want to present clicks spaced at 100 ms repetitively. Also, we want to implement a startle probe that will play once randomly throughout the image presentation. Similarly, we want the clicks to resume after the startle probe presentation. Finally, a fixation point should appear when the image presentation is completed. During the fixation point, the clicks should simultaneously be presented. This will be done for 48 pictures.<BR><BR>To clarify, the program should look as follows:<BR>-picture presentation with simultaneous 100 ms clicks<BR>-random startle probe once during the picture presentation<BR>-resume 100 ms clicks for the remainder of the picture presentation<BR>-present a fixation point on the screen with simultaneous 100 ms click presentation<BR>-repeat<BR><BR>Several items to note before reading on:<BR>-We are using a NeuroScan SynAmps 2<BR>-The way we have our study designed on E-Prime, we are using slide objects with different active states. Specifically, we have inline coding initializing the Stimulus slide object. The Stimulus slide object has two active states: an image state that presents the image and a sound out (on the state) for the clicks, and a fixation state that presents the fixation point and another sound out (on the state as well) for the startle probe. We also have some more inline code to switch the Stimulus states following that slide object, and that is then followed by another slide object with two different active states. The first of those states is a fixation point with a sound out on it that plays the clicks. The second state of that object does not display any images, but it is supposed to present the startle probe.<BR><BR>Now that the general set up of our program is out of the way, here's the trouble we are having:<BR><BR>Firstly, when we try to get the clicks to play while we have WritePorts and triggers in the inline code, we are able to see triggers properly executed, but we cannot get the clicks to play in the correct, repetitive 100 ms manner. Specifically, it will sound as though the clicks are spaced out inconsistently and unevenly. This does not seem to have an effect on the startle probe, however, which is presented as it should be. When we expect to hear the clicks again post-startle probe presentation (but before the fixation point and clicks presentation), we get one or two unevenly spaced out clicks. Then, at the fixation point, the 100 ms clicks resume at a faster pace than how they should be presented. The pictures and the fixation points are displayed correctly during this set up, thank goodness.<BR><BR>Here's some of the code we have tried using in our SwitchStimStates: <BR>' Switches ActiveState to Startle, then waits until<BR>' startle is scheduled to play<BR>While StimDur < Cdbl(c.GetAttrib("StimStartleOffset"))*1000<BR>StimDur = Clock.ReadMicrosec - ClockRead<BR>ClickTrig = StimDur\(ClickBin*1000)<BR>Writeport Triggerport, c.getattrib("StimTrigger") + ClickTrig + 1<BR>Stim.play<BR>Sleep SleepDur<BR>LoopDur = 0<BR>ClockRead2 = Clock.ReadMicrosec<BR><BR>'Click Trigger<BR>While LoopDur < ClickDur*500<BR>LoopDur = Clock.ReadMicrosec - ClockRead2<BR>Wend<BR>WritePort TriggerPort, HoldValue<BR>Sleep SleepDur<BR>While LoopDur < ClickDur*1000<BR>LoopDur = Clock.ReadMicrosec - ClockRead2<BR>Wend<BR>Wend<BR><BR>'Set sound volume for startle probe and play it<BR>If CInt(c.GetAttrib("StimStartleOffset")) <> 0 Then<BR>theSound.Buffers(1).Volume = 0<BR>theSound.Buffers(1).filename = "E:\\Experiment Stimuli\\Startles\\startle_44100.wav"<BR>theSound.Buffers(1).load<BR>Stim.play<BR><BR>'Trigger Startle Probe<BR>Writeport Triggerport, c.getattrib("StimStartleTrigger")<BR>Sleep SleepDur<BR>WritePort TriggerPort, HoldValue<BR>Sleep c.getattrib("StartleDuration") - SleepDur <BR>End If<BR><BR>'Set sound volume back to baseline<BR>theSound.Buffers(1).Volume = CInt(c.GetAttrib("SoundVolume"))<BR>theSound.Buffers(1).filename = "E:\\Experiment Stimuli\\Startles\\click_44100_100ms.wav"<BR>theSound.Buffers(1).load<BR><BR>' Waits until stimulus is finished<BR>While StimDur < CDbl(c.GetAttrib("StimDuration"))*1000 - ClickDur*1000<BR>StimDur = Clock.ReadMicrosec - ClockRead<BR>Stim.play<BR>LoopDur = 0<BR>ClockRead2 = Clock.ReadMicrosec<BR>'Click Trigger<BR>ClickTrig = StimDur\(ClickBin*1000)<BR>Writeport Triggerport, c.getattrib("StimTrigger") + ClickTrig + 1<BR>Sleep SleepDur<BR>WritePort TriggerPort, HoldValue<BR>Sleep SleepDur <BR>'Wait remainder of ClickDur<BR>While LoopDur < ClickDur*1000 <BR>LoopDur = Clock.ReadMicrosec - ClockRead2<BR>Wend<BR>Wend<BR><BR>We then tried to comment out the the Click Trigger section of code - thus, we were hoping that the program would present the sound stimuli properly when we eliminated certain triggers. Indeed, the clicks prior to the startle probe were presented as we hoped and the startle probe itself was presented as we would expect. In addition, the clicks during the fixation point were presented properly. The images were also presented correctly, the same as before. However, we face two problems in the set up of the program this way: 1) There were no triggers, obviously, and we need to find a way to get this program running correctly, both in sound presentation and in triggers, 2) We do NOT get the clicks presented at all after the startle probe. That is to say, we do get clicks presented properly during the fixation point and prior to the startle probe, just not immediately after the startle probe.<BR><BR>We have tried to remedy these problems in several ways. We ensured that in our code, we use double back slashes in listing the directories for the sound files – we know that E-Prime often has trouble interpreting where to find the sounds from a specific drive without the double back slashes. Also, we had upgraded E-Prime from version <A href="http://1.1.4.1/" target=_blank>1.1.4.1</A> to version 1.2. This did not seem to make difference at all in either way we attempted the program. In addition, we have tried using E-Prime Beta versions <A href="http://2.0.1.52/" target=_blank>2.0.1.52</A> and <A href="http://2.0.1.57/" target=_blank>2.0.1.57</A> to no avail. <BR><BR>Finally, we tried recreating this program without images. Instead, we have tried to use the clicks and startle probe with Sound Out objects instead of on slide objects. More specifically, we created a PreStim slide object with a fixation point. This was followed by a Sound Out object that presents the 100 ms clicks. <BR><BR>After that code, we added another Sound Out object with the startle probe sound. Finally, we added the PostStim slide object with two different active states. The first of those states is a fixation point with a sound out on it that plays the clicks. The second state of that object does not display any images, but it is supposed to present the startle probe.<BR><BR>When we attempted this basic set up, it failed to perform as we hoped. The clicks and startles were presented, but the spacing of the clicks was not 100 ms – they were spaced unevenly and in random chunks.<BR><BR>So, again, we cannot get our program to successfully do the following:<BR>-play clicks at 100 ms intervals repetitively<BR>-simultaneously get the triggers working<BR>-get the clicks to play post-startle probe (but before the fixation point with clicks)<BR><BR>If you have any suggestions as to how we might resolve these issues, which seem to be of a fundamental nature for E-Prime, please do not hesitate in responding.<BR><BR>Thanks for reading this post. If you are confused or would like more clarification as to what we are trying to do in this program, I'll be happy to answer any questions.</SPAN></SPAN></SPAN></SPAN></SPAN><BR clear=all><BR><BR>-Pam Carton<BR>
<DIV></DIV><BR>------------------------------------------<BR>Pamela N. Carton, Research Analyst<BR>Vanderbilt University <BR>301 Wilson Hall<BR>111 21st Ave South<BR>Nashville, TN 37203<BR>office: (615) 343-5452<BR>cell: (914) 522-3905 </BLOCKQUOTE><br /><hr />Met MSN Spaces kun je per e-mail je weblog bijwerken. Publiceer leuke verhalen, foto's en meer! Het is gratis! <a href='http://clk.atdmt.com/MSN/go/msnnksac0030000001msn/direct/01/?href=http://www.imagine-msn.com/spaces' target='_new'>Het is gratis!</a></body>
</html>