Link to home
Start Free TrialLog in
Avatar of davenseopen
davenseopen

asked on

building a Metronome

I'm looking to make a metronome for beat counting but not sure how I would do that. can anyone help here? Developing in VB.NET
SOLUTION
Avatar of cookre
cookre
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davenseopen
davenseopen

ASKER

thats why I was thinking too but I want to have to different sounds one for the first beat and the second for the other 3 beats and possibly allow the user to specify the sounds for them.
so after the first fire of the timer I want it to play the default src for the wav and then I want the source to change to the second wav then it has to go and start that again after the fourth firing
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
change  that

use Case 2, 3 to play other beat sound

use case 4 separate to play beat sound and set nCount to 0 and forget case 5 otherwise you'll miss a beat
You may want to generalize it with something like:

Initialize NextSound=1

TimerHandler:
Play sound NextSound
increment NextSound
if NextSound>NumberOfSounds NextSound=1
sorry to jump off topic for a minute ..... is there a way to generate a certain tone like a 440 MHz tone using VB.Net?
I will try what you guys have said and then distribute points accordingly

ok cookre I get what your saying
A brazillian years ago, one could control the PC speaker directly.  But with the plethora of sound cards, the common thing to do now is to play a wav file and let the drivers worry about the details.

So, the short and easy answer is to surf around for the sounds you want or make your own with any of the many such canned programs out there.
yeh I just remember when I programmed in high school with Turbo Pascal that you could generate tones depending on the frequency the user inputted or a constant value that you had hard coded into the program.
You cant make a metronome in any language that is accurate on every computer. my suggestion? put a scroll bar allowing you to adjust the rate of sound.

I would only use javascript for this project, so you dont have to do refresh the page. simply use a 'SetInteval' clause to time when a sound is played. make the SetInteral method variable be based on a dynamic choice. they could even be simple text boxes. In this way you can create a dynamically timed metronome using just javascript with no page refreshing.
yeh i know what your sayin and when I thought about it it took 2 secs to construct the code .... but just so you know I am building a windows application in VB.NET if it was for web I would have chosen to do it in Javascript or Flash
Page refresh?  I don't recall seeing mention of anything webbish.



hey i just assume people a subject is webrelated until otherwise said, regardless of category.
thanx anyway Error113 but the web version is already finished just not posted
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I already have it finished but I will take that into consideration I am going to distrubute the points here very shortly just in a rush at the moment ... mine tops out at 250 ... the points will be going to cookre and ryan r
oh and I forgot to add Thanks ... you guys are always a great help ... keep up the excellent work
you're welcome, anytime