<div dir="ltr"><div>Hallo again David</div><div> </div><div>I just want to be sure if the code:</div><div> </div><div><div><font color="#38761d">Dim ExternalCausesSound As SlideSoundOut<br> Set ExternalCausesSound = CSlideSoundOut(<wbr>ExternalCausesSlide.States("<wbr>Default").Objects("<wbr>ExternalCausesSound")) </font><font color="#000000">(ExternalCausesSound is the Name of my SlideSound)</font></div><div><font color="#38761d"></font> </div><div><font color="#38761d">Dim NewBuffer As SoundBuffer<br> Set NewBuffer = ExternalCausesSound.Buffers(1)</font></div><div><font color="#38761d"></font> </div><div>...leads to the correct Sound Buffer before I try something with SoundBuffer.Status.</div></div><div> </div><div> </div><div>At the Moment I am playing around with:</div><div> </div><div><font color="#38761d">Select Case NewBuffer.Status<br> Case ebBufferStatusStopped</font></div><div> <font color="#38761d">... (some code that stops the "Sleep" or leads to the next Slide State)</font></div><div> </div><div> </div><div>I just want to know if I am on the right way or about to get lost completely.</div><div> </div><div>Best regards</div><div>Hans</div><div> </div><div> </div><div><br>Am Donnerstag, 17. Oktober 2013 17:41:34 UTC+2 schrieb McFarlane, David:</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">Hans,
<br>
<br>I'm afraid you have lost me again. But now you should have all the
<br>pieces you need in order to do what you want, and you should be able
<br>to puzzle it out yourself from here.
<br>
<br>Best,
<br>-- David McFarlane
<br>
<br>
<br>At 10/17/2013 06:29 AM Thursday, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="KehM1IX1o9MJ">haslinge...@gmail.com</a> wrote:
<br>>Hallo David
<br>>
<br>>Thank you for the advice with SoundBuffer.Status.
<br>>
<br>>
<br>>Now here is my restatement of your specifications:
<br>>- E-Prime simultaneously presents a visual stimulus (containing a number
<br>>of target areas) and starts playing a sound.
<br>>- The visual stimulus remains until, and only until, the sound the
<br>>finishes playing.
<br>>- The subject uses the mouse to respond by clicking target areas on the
<br>>display, and when the subject clicks on a target area, the border of
<br>>that area changes Color
<br>>
<br>>
<br>>Yes, that is correct.
<br>>
<br>>
<br>>I've tried to create a code with SoundBuffer.Status. But I am not
<br>>sure if it is correct that way:
<br>>
<br>>
<br>>Dim ExternalCausesSound As SlideSoundOut
<br>> Set ExternalCausesSound =
<br>> CSlideSoundOut(<wbr>ExternalCausesSlide.States("<wbr>Default").Objects("<wbr>ExternalCausesSound"))
<br>>
<br>>
<br>>Dim NewBuffer As SoundBuffer
<br>> Set NewBuffer = ExternalCausesSound.Buffers(1)
<br>>
<br>>
<br>>Then i would try something like:
<br>>
<br>>If NewBuffer.Status = 0 Then .....
<br>>
<br>>,so if the Buffer.Status is "Stopped", the Sleep Timer would be
<br>>stopped or the current SlideState would skip to the following State.
<br>>(I've set the Sleep to something longer then the Duration of the Sound)
<br>>So basically I would need a command which I could insert after
<br>>"Then" to stop the Sleep time.
<br>>
<br>>Could I use "hitObject.Clear" for that?
<br>>
<br>>
<br>>Best regards
<br>>Hans
<br>>
<br>>
<br>>
<br>>I
<br>>
<br>>
<br>>Am Mittwoch, 16. Oktober 2013 18:31:11 UTC+2 schrieb McFarlane, David:
<br>>Hans,
<br>>
<br>>Ah, there's the confusion -- you referred to "SoundOut" when you meant
<br>>"SlideSound". SoundOut and SlideSound share a lot of properties, but
<br>>they are two different things that are used in different ways. You do
<br>>not have a SoundOut in your Procedure, just a SlideSound as a sub-object
<br>>of your Slide.
<br>>
<br>>Now here is my restatement of your specifications:
<br>>- E-Prime simultaneously presents a visual stimulus (containing a number
<br>>of target areas) and starts playing a sound.
<br>>- The visual stimulus remains until, and only until, the sound the
<br>>finishes playing.
<br>>- The subject uses the mouse to respond by clicking target areas on the
<br>>display, and when the subject clicks on a target area, the border of
<br>>that area changes color.
<br>>
<br>>Now you are just stuck accomplishing that second objective. For that, I
<br>>think you need to use SoundBuffer.Status -- see that topic in the
<br>>E-Basic Help facility. You will also have to get access to the
<br>>SoundBuffer object that plays your sound -- for that, just browse the
<br>>related topics in the E-Basic Help facility, and/or look at
<br>>sound-related code generated for you by E-Studio (that's how I figure
<br>>all this stuff out, if I can do that then so can you :) ). And of
<br>>course, you may also always contact PST Support for help, see below.
<br>>
<br>>Best,
<br>>-----
<br>>David McFarlane
<br>>E-Prime training online:
<br>><<a href="http://psychology.msu.edu/Workshops_Courses/eprime.aspx" target="_blank">http://psychology.msu.edu/<wbr>Workshops_Courses/eprime.aspx</a>><a href="http://psychology.msu.edu/Workshops_Courses/eprime.aspx" target="_blank"><wbr>http://psychology.msu.edu/<wbr>Workshops_Courses/eprime.aspx</a>
<br>>
<br>>Twitter: @EPrimeMaster
<br>>(<<a href="http://twitter.com/EPrimeMaster" target="_blank">http://twitter.com/<wbr>EPrimeMaster</a>><a href="http://twitter.com/EPrimeMaster" target="_blank">twitter.com/<wbr>EPrimeMaster</a>)
<br>>
<br>>/-----------
<br>>Stock reminder: 1) I do not work for PST. 2) PST's trained staff take
<br>>any and all questions at
<br>><<a href="http://support.pstnet.com/e%2Dprime/support/login.asp" target="_blank">http://support.pstnet.com/e%<wbr>2Dprime/support/login.asp</a>><a href="http://support.pstnet.com/e%2Dprime/support/login.asp" target="_blank">http<wbr>://support.pstnet.com/e%<wbr>2Dprime/support/login.asp</a>
<br>>, and they strive
<br>>to respond to all requests in 24-48 hours -- this is pretty much their
<br>>substitute for proper documentation, so make full use of it. 3) In
<br>>addition, PST takes questions at their Facebook page
<br>>(<<a href="http://www.facebook.com/pages/Psychology-Software-Tools-Inc/241802160683" target="_blank">http://www.facebook.com/<wbr>pages/Psychology-Software-<wbr>Tools-Inc/241802160683</a>><a href="http://www.facebook.com/pages/Psychology-Software-Tools-Inc/241802160683" target="_blank">http://<wbr>www.facebook.com/pages/<wbr>Psychology-Software-Tools-Inc/<wbr>241802160683</a>
<br>>
<br>>), and offers several instructional videos there and on their YouTube
<br>>channel
<br>>(<<a href="http://www.youtube.com/user/PSTNET" target="_blank">http://www.youtube.com/<wbr>user/PSTNET</a>><a href="http://www.youtube.com/user/PSTNET" target="_blank">http://www.<wbr>youtube.com/user/PSTNET</a>
<br>>) (no Twitter feed yet,
<br>>though). 4) If you do get an answer from PST staff, please extend the
<br>>courtesy of posting their reply back here for the sake of others.
<br>>\-----------
<br>>
<br>>
<br>><a>haslinge...@gmail.com</a> wrote:
<br>> > Hallo David
<br>> >
<br>> > Thank you for your help.
<br>> >
<br>> >
<br>> > At this point I would need you to draw
<br>> >
<br>> > out a very clear diagram of your Procedure structure, along
<br>> > with clear specifications of what you want it to do
<br>> >
<br>> >
<br>> > The Procedure looks like this:
<br>> >
<br>> >
<br>> > ...
<br>> > ...
<br>> >
<br>> > ExternalCausesProc
<br>> > ExternalCausesList
<br>> > ExternalCausesTrialProc
<br>> > Instruction (TextBox)
<br>> > restart2 (Label)
<br>> > ExternalCausesSlide (Slide)
<br>> > InLine2 (InLineCode)
<br>> > ...
<br>> > ...
<br>> >
<br>> >
<br>> > After a short Instruction, there is an Image presented on the
<br>> > ExternalCausesSlide as a Stimulus (e.g. child is getting a birthday
<br>> > present).
<br>> > There is also a SoundOut on the ExternalCausesSlide which describes the
<br>> > scene in the Image.
<br>> > Additionaly there are 4 smaller Images as possible answers for the
<br>> > Stimulus Image.
<br>> > I've made an attribute for every Image and the SoundOut in my
<br>> > ExternalCausesList.
<br>> >
<br>> > Subjects should have time to click on one of the 4 target Images until
<br>> > the SoundOut was played completely.
<br>> > I want to highlight the Image a subject chooses by changing the border
<br>> > color of that Image to "cyan" (black is my default border color) so the
<br>> > subject knows that its answer was registered and it can change the
<br>> > current answer (this is another thing i could need some help with).
<br>> >
<br>> > I tried to implement the following code (which i've found somewhere in
<br>> > this google group) for changing the border color to "cyan" and back to
<br>> > "black" (default setting) before a new Stimulus is presented:
<br>> >
<br>> > Dim hitObject As SlideImage
<br>> > Set hitObject =
<br>> > CSlideImage(<wbr>ExternalCausesSlide.States("<wbr>Default").Objects(strHit))
<br>> >
<br>> > hitObject.BorderColor = CColor("cyan")
<br>> > hitObject.Draw
<br>> > Sleep 5000
<br>> >
<br>> > hitObject.BorderColor = CColor("black")
<br>> >
<br>> >
<br>> >
<br>> > The current slide should be terminated after the Sound is played so I've
<br>> > set "End Sound Action" to "Terminate" and "End Action" (in the
<br>> > ExternalCausesSlide Properties) to "none".
<br>> > Now the color changed to "cyan" after the Sound was played and not
<br>> > immediately after the click.
<br>> >
<br>> > So i've changed the Settings to "End Action" -> "Terminate" and
<br>> > "EndSoundAction" -> "Terminate".
<br>> > Now the color changed immediately after the click occured and remained
<br>> > "Cyan" for 5sec before changing back to "black".
<br>> > But if the click occured at the end of the SoundOut with less than 5sec
<br>> > remaining, there was an interference with the Sound of the following
<br>> > Stimulus.
<br>> >
<br>> > Then I've tried "End Action" -> "Terminate" and "End Sound Action" ->
<br>> > "none".
<br>> > Now the Color changes immediately after the click and remains for the 5
<br>> > sec no matter if the Sound is completely played or not.
<br>> > But if no click occurs, there is no termination.
<br>> >
<br>> >
<br>> > Now I thought I could use the "Terminate/Terminate"-setting and a Sleep
<br>> > time which is equal to the remaining duration of the sound file after
<br>> > the click occured, (something like Sleep "Duration Sound - RT (Time
<br>> > until click?)).
<br>> > This way, the slide would terminate after the click + Sleep time or if
<br>> > the sound file was played completely (if there was no click).
<br>> > There would also not be any interference with the following Sound file,
<br>> > because the Sleep time is never longer than the Sound file itself.
<br>> >
<br>> >
<br>> >
<br>> >
<br>> > That said, first, you do not understand your code correctly. As
<br>> > written, it means the color of the image, which was clicked, changes
<br>> > to "cyan" and would later change to "black" at whatever time your
<br>> > hitObject gets redrawn, and goodness knows when that will happen.
<br>> >
<br>> >
<br>> >
<br>> > Actually, it changes back to "black".
<br>> > But maybe that is just because "black" ist my default border color and
<br>> > the settings are just reset to the default settings after Sleep.
<br>> >
<br>> >
<br>> >
<br>> > As a general strategy, I prefer to do as much as possible through the
<br>> > program structure & object properties, and to leave less to
<br>> inline code.
<br>> >
<br>> >
<br>> >
<br>> > Actually this was the prefered strategy for my project and it worked
<br>> > fine except for strHitTest for collecting Mouse Responses and logging
<br>> > the correct answer.
<br>> > Basically my program is completed, but i would like to add some little
<br>> > improvements, like this highlighting thing, to make it look better
<br>> >
<br>> > I hope my remarks are not too confusing.
<br>> >
<br>> >
<br>> > Best regards
<br>> > Hans
<br>> >
<br>> >
<br>> >
<br>> > Am Dienstag, 15. Oktober 2013 16:37:46 UTC+2 schrieb McFarlane, David:
<br>> >
<br>> > Hans,
<br>> >
<br>> > I am afraid that I do not quite follow all of this. You refer to a
<br>> > Slide, a SoundOut, and an Inline, and I do not know how they all
<br>> > interrelate (in particular, I do not recall the complication of a
<br>> > SoundOut in your first post). At this point I would need you to draw
<br>> > out a very clear diagram of your Procedure structure, along with
<br>> > clear specifications of what you want it to do.
<br>> >
<br>> > That said, first, you do not understand your code correctly. As
<br>> > written, it means the color of the image, which was clicked, changes
<br>> > to "cyan" and would later change to "black" at whatever time your
<br>> > hitObject gets redrawn, and goodness knows when that will happen. If
<br>> > you want your inline code to make the BorderColor black, then you
<br>> > must also follow that line with another hitObject.Draw command, which
<br>> > is missing from your code without comment. If you left that out on
<br>> > purpose (e.g., because the redraw will be taken care of by a later
<br>> > object), then you must add a comment to your code to explain that.
<br>> >
<br>> > As far as settting the Sleep time to something like "remaining time
<br>> > of SoundOut", I suppose you might use some combination of Clock.Read,
<br>> > SoundOut.TargetOffsetTime, and GetNextTargetOnsetTime, but I think
<br>> > that a sloppy way to do things. I would generally rather let the
<br>> > SoundOut handle the timing, and then follow that with more inline
<br>> > code to do whatever needs doing. Again, we need a better look at
<br>> > your Procedure structure, you may need to revise it.
<br>> >
<br>> > As a general strategy, I prefer to do as much as possible through the
<br>> > program structure & object properties, and to leave less to inline
<br>> > code.
<br>> >
<br>> > Regards,
<br>> > -- David McFarlane
<br>> >
<br>> >
<br>> > At 10/15/2013 04:56 AM Tuesday, <a>haslinge...@gmail.com</a> <javascript:>
<br>> > wrote:
<br>> > >Hallo David
<br>> > >
<br>> > >
<br>> > >I've tried another code for the changing border color part:
<br>> > >
<br>> > >Dim hitObject As SlideImage
<br>> > >Set hitObject =
<br>> > >CSlideImage(<wbr>ExternalCausesSlide.States("<wbr>Default").Objects(strHit))
<br>> > > hitObject.BorderColor = CColor("cyan")
<br>> > > hitObject.Draw
<br>> > > Sleep 5000
<br>> > > hitObject.BorderColor = CColor("black")
<br>> > >
<br>> > >
<br>> > >If I understood this code right, that means the color of the
<br>> > >image,which was clicked, changes to "cyan "and after 5 sec it
<br>> > >changes back to "black".
<br>> > >
<br>> > >But now I have some problems timing the change of color and the
<br>> > sound file.
<br>> > >
<br>> > >At first I set "End Action" in the Slide Properties to "(none)" and
<br>> > >"End Sound Action" in the Slide Sound Out Properties to "Terminate".
<br>> > >Then the color was only changing after the soundfile was over.
<br>> > >
<br>> > >Then I changed the settings to "End Action" -> Terminate and added
<br>> > >"Sleep 5000" in the inline code.
<br>> > >Now the color changes immediately after clicking and stays for the
<br>> > >5sec before changing back to black
<br>> > >But if the Sleep Time after clicking is longer then the remaining
<br>> > >time of the SoundOut, the SoundOut of the next Slide State isn't
<br>> > starting.
<br>> > >
<br>> > >Is there any command which sets the Sleep time to something like
<br>> > >"remaining time of SoundOut"?
<br>> > >
<br>> > >
<br>> > >Best regards
<br>> > >Hans
<br>>
<br>>--
<br>>You received this message because you are subscribed to the Google
<br>>Groups "E-Prime" group.
<br>>To unsubscribe from this group and stop receiving emails from it,
<br>>send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="KehM1IX1o9MJ">e-prime+u...@<wbr>googlegroups.com</a>.
<br>>To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="KehM1IX1o9MJ">e-p...@googlegroups.com</a>.
<br>>To view this discussion on the web visit
<br>><<a href="https://groups.google.com/d/msgid/e-prime/af93d00c-d985-43d7-897b-433e8d5f994f%40googlegroups.com" target="_blank">https://groups.google.com/d/<wbr>msgid/e-prime/af93d00c-d985-<wbr>43d7-897b-433e8d5f994f%<wbr>40googlegroups.com</a>><a href="https://groups.google.com/d/msgid/e-prime/af93d00c-d985-43d7-897b-433e8d5f994f%40googlegroups.com" target="_blank">https://<wbr>groups.google.com/d/msgid/e-<wbr>prime/af93d00c-d985-43d7-897b-<wbr>433e8d5f994f%40googlegroups.<wbr>com</a>.
<br>>For more options, visit
<br>><<a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/<wbr>groups/opt_out</a>><a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.<wbr>google.com/groups/opt_out</a>.
<br>
<br></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/c59eade2-a635-4e48-8b07-f4e272f8222c%40googlegroups.com">https://groups.google.com/d/msgid/e-prime/c59eade2-a635-4e48-8b07-f4e272f8222c%40googlegroups.com</a>.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />