looping sounds

David McFarlane mcfarla9 at msu.edu
Fri May 9 17:11:30 UTC 2008


Jessica,

>I tried this code, trying to adapt what you all gave me:
>
>If (toneCount <= 5) And (TrainingSound2.RESP <> "") Then
>         Goto Label4 (where Label 4 was placed before the Start Screen)
>Else
>         toneCount = 0
>End If

Indeed, the "... And (TrainingSound2.RESP <> "")" means it will never 
stop without a response.  To make it stop you need to rewrite that 
test as either

If (toneCount <= 5) And (TrainingSound2.RESP <> "") Then

or

If (toneCount <= 5) And (TrainingSound2.RESP = "{SPACE}") Then

Pay close attention to the differing use of = vs. <>, and "" vs. 
"{SPACE}".  This first example will exit the loop for *any* key 
press, the second example will exit only for a *space* key.

Now, it sounds like, after the program plays five tones without a 
response, you want it to skip the movie.  If that is correct then ... 
well, let's review the experiment structure first so we have 
something to refer to (thanks for posting that).  Here is how I 
understand your experiment structure, with a few names changed to 
suit my tastes:

- TrialList  (this contains your three trials)
     - TrialProc
         - StartScreenLabel
         - StartScreen (where you press a button to proceed to the trial)
         - TrainingSound1
         - TrainingSound2
         - TrialResponseScript
         - MovieLabel
         - Movie
         - NoMovieLabel

Now we have three possible outcomes:  repeat the loop, play the 
movie, or skip the movie and go right to the next trial.  We need to 
rearrange the logic of TrialResponseScript a bit, maybe something 
like this (again, some renaming and commenting to suit my tastes):

toneCount = toneCount + 1
If TrainingSound2.RESP <> "" Then  ' stop for any response
     toneCount = 0  ' reset counter for next time
     Goto MovieLabel
ElseIf toneCount <= 5 Then
     Goto StartScreenLabel  ' repeat the training loop
Else  ' completed 5 loops with no response
     toneCount = 0  ' reset counter for next time
     Goto NoMovieLabel  ' no response, so skip the movie
End If


There might be a better way to arrange that (makes me nervous to have 
put same the counter reset in two branches), but that's enough 
thinking for now.

-- David McFarlane, Professional Faultfinder


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