Online Tone Generator

Capture

I made an online tone generator based on the Firefox Audio API HTML5 Web Audio API. It’s basically a large logarithmic slider that allows real-time, smooth frequency changes. You can also fine-tune the frequency in 1 Hz increments, if necessary. (Update: You can also pick a music note from a list.)

There are other tone generators on the Web, but they are not as cool (if I do say so myself) and/or they require Java or Flash.

Warning: my generator only works on recent browsers which support the Web Audio API, such as Chrome and Firefox.

What can you use a tone generator for? You can do a science experiment with resonance, tune a musical instrument, test your new audio system (how low does it go?), test the limits of your hearing (I can hear absolutely nothing above 19,000 Hz, even at maximum volume), or figure out your tinnitus frequency to better target therapy.

About these ads

60 responses to “Online Tone Generator

  1. I don’t know what tinitus means and why you have made up all this effort, but your tone generator is VERY VERY addictive. I have already spent 2 hours sliding the bar and listening to tones.

  2. Works nicely! I could hear sounds from around 45~17.600Hz being 20 years old.

  3. I liked it a lot maybe one day youll have it setup so that we can download a short sample a few seconds of a whatever tone were looking for huh

  4. HI!
    well done, thanks
    What kind of tuning did you use?
    Because the lower octaves sounded offtune to me….. :)
    (A2-B2-C3 sounds weird, to my ear the B2 is too low for example)
    It’s intresting if there is a mistake in frequncies, or is it that the ET tuning is more notcible at such low notes

    • The frequencies are calculated according to the formula for Equal Temperament (12-TET). For example, B2 is about 123.471 Hz. The frequency is listed next to the note, so you can check for yourself.

  5. Derek Rayburn

    Great Tone Generator. Was looking for something to generate low frequencies to drive away carpenter bees when the tone was amplified through large speakers mounted to my carport but low enough for my neighbors not to notice… this works! It also helped me identify my Tinnitus frequency; 4382hz! I found the freq my dog hates. I found what my laptop speakers are capable of reproducing (not much) and what my wife hates so badly she kept her fingers in her ears. This could be the most useful of my discoveries. However, ironically its the frequency that matches my tinnitus so its just as aggravating to me. I do believe these sine waves are better because Tom polishes them nightly with a special paste. This page has earned a rare bookmark from me!

    • Derek, many thanks for the report. I’m glad you’ve put my creation to so many productive uses. Off to get my polishing paste…

      P.S. Did you find the special easter-egg frequency that makes think you are a moose? That one’s fun.

  6. Hi Tomasz,
    Thanks for the tone generator. I have used it to investigate the ideas in Ross W Duffin’s book “How Equal Temperament Ruined Harmony” – about the Equal Temperament system now almost universally used in tuning musical instruments, but which mostly does not correspond to mathematically (therefore harmonically) correct frequency ratios for chords.
    (The tip about opening the generator in several browser tabs was key for this!)
    With the tone generator it is easy to hear that the Eq Temp. A major chord (using A440, C#554.36, E659.25) is very different from the pure harmony of the triad played with 440/550/660.

  7. Your tone generatort is the best I have seen. Would you consider repalcing the drop down menu for selecting a note, by a picture of a piano keyboard, that could be clicked on to select a note. I recently retired from Java programming, and it has been about 10 years since I hav done any web design, so I have no idea how hard this would be. If you are interested in the idea, I would love to help with any grunt needed.

    • Thanks for the idea. I’ve given it some thought and while a piano keyboard would definitely look better, I can’t think of any functional benefits. In fact, one disadvantage would be that piano keys are quite narrow and it would be difficult to fit the frequency (e.g. “1760 Hz”) on the key. Did you have any particular use cases in mind?

  8. Would be improved if the left & right arrow keys controlled the lowering and raising of frequencies.

  9. I would love to see an option to select a frequency for the right ear and a different frequency for the left ear even using a separate tab. Then it would be possible to try bin-aural beat experiments. Thanks fro such a wonderful and simple tool.

  10. Great tool. I used it to determine the feedback frequency of a live recording, so I could set a extremely small bandwidth equalizer to remove the noise. Thanks very much,

  11. I want to use something like this to tune my sliders of different frequencies on my equalizer. Do you make a CD that I can play in my system to do that?

  12. This is a really well designed tool. Any chance of obtaining a download which does not require being online to use it?

  13. My tinnitus rings right at 3907 HZ. Interesting. Thanks.

  14. Tomasz — best frequency-to-tone generator site I have come across! Love the frequency slider. First, a couple of MINOR improvement requests (I hope). Can the up-down frequency adjustment arrows be interactive so that single clicking makes a 1 Hz change, but holding the arrow down with the mouse makes multiple 1Hz changes (until you stop pressing on it with the mouse)? That would permit the desired frequency to be selected much faster — especially important in the higher ranges. Also, can you make the word “PLAY” green and the word “STOP” red — when you drag the slider to far too the right and the volume is blasting and numbing the brain, colors help guide one to the STOP button quickly. Also, can you tell us what Wave the tone represents? Better yet, can we select the Wave, ie. Sawtooth-Sine-Square-Triangle? Also, once you select a frequency, can the music note change instantly to match — for simplicity of presentation, I suggest dropping the Hz after the music note and just putting a “+” or “-” after the Hz to let the person know the selected frequency is a bit higher/lower than the music note indicated — if curious, the person could always adjust the frequency up/down until the “+/-” went away, indicating the frequency was now within 1Hz of the music note shown. Second, a MAJOR improvement request. Rather than have the frequency only play a wave tone, can it also play the closest piano note? I am working with some healers who prefer to discern the healing tone as a frequency, yet we want to play music notes to the person being healed (much easier to listen to). If you do even a fraction of all this, that would be great !! Your work on this sound tool is very much appreciated !!

  15. Bardzo porzadny generator, prosty w uzyciu i praktyczny. Przynajmniej mozna powoli i dokladnie sprawdzic to, co sie chce sprawdzic. Pozdrawiam.

  16. thank you, this is great for working on my tube amp…I have no idea what’s different about yours but according to my scope yours is the only one of 5 or so I tried that has true, clean, sine waves. Thanx again!

    • Oh, it’s nothing special. Every night, I polish the sine waves with a special paste until they’re completely smooth.

      • Hi Tomasz. Your sound generator is fantastic. So much so that I want to download it onto my computer to do some experiments. I am happy to pay for it if I could get it onto a couple of pc’s and get to work so I can save the HZ combinations

  17. Well done, thank you. Works in Opera 26.0 as well.

    Suggestion: I think would be better to make buttons (or single button) with changing color when generation is active. Right now if you click PLAY and you can not hear the sound (i.e. when the frequency is too low or too high to work on particular speakers) – there is no way to tell if generator is OFF or ON. This is quite confusing if you want to test working frequency range of output.

  18. Thanks for making this, I use it to localize the ‘hum’ I hear; it was consistently 66Hz but now varies between 59 and 72. At least I know it’ real now.

  19. Thanks for this – I’ve had tinnitus for a while, recently after snorkling and diving, my right ear is really bad. But I am struggling to find the frequency. When using it I do find that some frequencies I can’t actually hear as I scroll through – not sure if that is related? Anyway – thanks again for the tool even while I’m still trying to find my frequency :)

  20. Just wanted to drop in and leave a word of thanks. I’m a science teacher and I’ve been using this online application for three years now to help with my unit on sound. It is EXACTLY what I needed to do some of our experiments. Thank you!

  21. Thanks – I really appreciate this thing.
    Keith

  22. OK, now I’m getting more ideas! Can a volume control be added to this online tone generator? (I have no idea how hard that might be) So far I can open a couple of browser windows and play them at the same time to demonstrate intonation and beats, but I’d also really like to open several browser windows and set them to different overtones on the same fundamental, and adjust the volume so the fundamental is louder than its overtones… but then adjust the volume of different overtones to demonstrate what (for example) a clarinettist should be listening for in a rich, centered sound.

  23. I’ve been looking for a tone generator with a slider just like this to teach about tuning musical instruments. This is elegantly done, thank you!

  24. Pretty-deaf Dave

    I was just now looking for a tone generator to test my hearing in a ~deaf ear and had imagined something like this one with a slider….and lo and behold, here it is and elegantly and simply implemented!! Thanks so much. This is a wonderful tool, and it turns out I can hear with that ear within a narrow range. Good to know this.

  25. Hi Tomasz, this is a great tool – nice work! I have a web audio question for you… What is the difference between Firefox and Chrome when it comes to changing oscillator frequency. Have you noticed that if you slide quickly in firefox the frequency-change isn’t smooth like it is in Chrome or Safari.

    I’ve been trying to fix something I made a while ago which doesn’t work properly on Firefox for that reason (http://femurdesign.com/backup/theremin-firefox-test/)

    Any help would be much appreciated. Thanks!

  26. This is a great tool. Is there a way to get the frequencies to a a couple of decimal places? I have been using it to tune the banjo, but it is hard to get the perfect frequency…. But then again, as they say, you can tune a Harley better than you can tune a banjo.

  27. What about also displaying the pitch note for example A= 440 B= C= so on and so on. just the frequency is not enough. I have to keep searching for one of those now. by/

  28. Nice and handy!

    Definitely works with FireFox v31.0 on Manjaro Linux installation.

    Would love to see how one can balance the volume based on the frequency as the higher frequencies often are louder than the lower frequencies. (Has to do with the lower losses of energy and shorter wavelengths.) – I used to know how to automatically adjust the volume via software (much like a compressor/compander would do in a circuit).

    Anyway,

    I have made sure to bookmark this on the other part of the site. Seems that the saved-as-complete page also works well (for a locally-stored copy).

    Great idea.

    – Rev. Dragon’s Eye

  29. nice app. My wife is using it right now for her sinus infection. She is pressing a speaker into her cheek + eyebrow. Somewhere between 100-107hz seems to be the best to break up her mucous. We’ve read elsewhere that people do this and it clears up the sinus infection immediately. Fingers crossed.

  30. Best sound application EVER !!! Thanks!

  31. Agreed, good stuff – very nice presentation, simple and easy-to-use.

    One request. Can you allow frequencies lower than 20Hz? I realize that drops below human hearing, but in terms of science, it makes for great woofer visuals.

    Along that line, have you considered having multiple simultaneous tone generators? Most of the sounds we hear (especially voice) are made of multiple frequencies. I would love to demonstrate to a class how sin waves destructively and constructively react to each other.

    Keep up the good work!

    • Charles,
      I’ve modified the scale to allow frequencies starting from 1 Hz.
      I imagine demonstrating constructive and destructive interference would take some thought to do right. You’d have to make it possible to manipulate the phase. Perhaps you could do your demonstration with Audacity?

      • Tomasz, that totally rocks – thanks for the quick turn around. So even though I cannot hear the actual frequency, I can hear the physical movement of the cone even down to 10Hz. Kinda cool. :)

  32. It works in Ubuntu 12.04 with Firefox 25.
    Nice job, thanks!

  33. Have you thought of giving users the option to change the phase of the signal so that they could possibly reduce or cancel the sound from another device. I have tinnitus and would like to see if it is possible to use this method to reduce the level of the sound in my head.

  34. It’s not working for me in Firefox 18 under Windows 7. The controls are there (minus the frequency number), but I can’t interact with them.

    • Thanks, fixed. There was a syntax error in the JS — I don’t know how I managed to upload a non-functional file — I always test my sites after I upload them to the server.

      Physics will never explain things like this.

  35. So I try it in Ubuntu 12.04 with firefox 15.0 and it works propably bad. I listen good 20hz to 20173hz. Is it this bug? Does it give bad sound?

  36. It’s bad luck for me. I use linux. :D grrr But it’s good toy. Nice one.

  37. That’s why I love this blog: Tom always posts something cool. Thanks Tom!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s