I've been playing with this a bit and I'm clearly missing most of your
requirements, as you seem to be playing at 400 bpm .

On my machine, this code plays your sound, with a regular beat, 100 times
per minute.
I've done no messing about with the priority of the thread but I suspect if
you want to play four times as fast, you'll need to increase the thread
priority, so I've put in a yield at the least critical point.

  Dim d As Date
  Dim LastBeat As Double
  Dim ThisTest As Double
  LastBeat=Microseconds

  While Window1.playon
    ThisTest = Microseconds
    if ThisTest - LastBeat >= 600000 Then

      HighHat.play

      LastBeat = ThisTest
      app.YieldToNextThread
    End If

  Wend

This works for me, even running the debug version in the IDE.

Please remember that while running your app in the IDE will give you a
pretty good idea what's going on, if you want to test critical timing, it's
better to check the compiled program outside the IDE.

--
Steve Garman
Using REALbasic 2005r4 Professional on Windows XP Pro


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to