2 Replies Latest reply on Dec 1, 2006 5:42 AM by Newsgroup_User

    Metronome trick

    Level 7
      Sorry to bring back the subject, but this is important to me.

      So, again, here is a link to a metronome online.

      http://www.metronomeonline.com/

      This SWF works on both PC and PDA and is just what I need.

      Would anyone know how to do that ?

      - I have tried playing the sound in the timeline of a clip, but in slow
      computers, it does not keep synchronised.

      - I have tried Shikozel's "intervalID=setInterval(this,"tickSound",mSec)"
      trick but unfortunetely, this metronome is supposed to work on PDA as
      well and they don't manage the Millisecondes "mSec" very well. PDAs have
      problem to follow the rythm. As a result, a
      192 BPM ends up at around 60 BPM.

      However, this swf metronome does work on PDA, I have tested it.

      So they use another trick.

      But which one ?

      Thanks for any help


        • 1. Re: Metronome trick
          crazyjoemilan Level 2
          You could run a setInterval script to run as fast as possible, and check against it. Kind of like an old logic loop (I always call it the wrong thing, but its a timeline loop of some sort) but faster.

          PSEudoCODE
          ...
          function makeNoise(speed:Number) {
          if the timer equals (or is slightly greater than) 1/280 of a second since last time (or "speed") {
          play sound
          }
          then reset some variables w/o recalling the setInterval function
          }
          trial = setInterval(makeNoise, 1, speed);
          I wonder how many hits that function would get on a slow machine or a PDA. I'm sure it would be enough to get an accurate metronome. Well, I'm not THAT sure.
          • 2. Re: Metronome trick
            Level 7
            Thanks Mr Helpy

            I'll try that and see if it comes "Helpy"

            I'll let you know, but thanks again.

            Bruno

            "Mr Helpy mcHelpson" <webforumsuser@macromedia.com> a écrit dans le message
            de news: ekotbt$e8k$1@forums.macromedia.com...
            > You could run a setInterval script to run as fast as possible, and check
            > against it. Kind of like an old logic loop (I always call it the wrong
            > thing,
            > but its a timeline loop of some sort) but faster.
            >
            > PSEudoCODE
            > ...
            > function makeNoise(speed:Number) {
            > if the timer equals (or is slightly greater than) 1/280 of a second since
            > last
            > time (or "speed") {
            > play sound
            > }
            > then reset some variables w/o recalling the setInterval function
            > }
            > trial = setInterval(makeNoise, 1, speed);
            > I wonder how many hits that function would get on a slow machine or a PDA.
            > I'm sure it would be enough to get an accurate metronome. Well, I'm not
            > THAT
            > sure.
            >