dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Someone Please help with building a Simple Metronome.

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Posts
    4

    Someone Please help with building a Simple Metronome.

    I'm desperately in need of a simple but reliable metronome that has a range of 40-440b.p.m (beats per minute), and accents every 4th note on a sequence, or any specified number between (2-9). I'd appreciate it if it looked like this:



    And you could type in the numbers desired into the white boxes. And the Green triangle both starts and stops the metronome. The output should be .swf.

    Here are some examples that may help:

    http://www.all-guitar-chords.com/metronome.php
    http://www.metronomeonline.com/
    http://board.flashkit.com/board/arch.../t-342455.html

    Can anyone build this for me? I'd be extremely grateful if you could. You'd totally make my day.

  2. #2
    Junior Member
    Join Date
    Feb 2007
    Posts
    4
    This might also help:

    http://board.flashkit.com/board/show...17&postcount=9

    I just don't know how to apply these GREAT resources, since I don't have a programming background.

  3. #3
    Junior Member
    Join Date
    Feb 2007
    Posts
    4
    A simpler task: That'd be just fine too.


  4. #4
    Junior Member
    Join Date
    Feb 2007
    Posts
    4
    Another coding resource, it that helps the task any more. Sorry guys, I'd do it myself, but I don't know how.


    Code:
    startTime = getTimer();
    minTimer = startTime;
    n = 1;
    freq = 333;  // <- 3 beats per second or 180 bpm
    metroI = setInterval(metroF, freq, freq);
    function metroF(compensatedFreq) {
    	errorTime = getTimer()-startTime-freq;  // this is a correction factor used 2 lines below
    	clearInterval(metroI);
    	metroI = setInterval(metroF, compensatedFreq-errorTime, compensatedFreq-errorTime);
    	if (getTimer()-minTimer>=60000) {  // this allows a test of the number of beats recorded in about 1 min
    		clearInterval(metroI);
    		trace(n);
    	}
    	startTime = getTimer();
    	n++;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center