Shop OBEX P1 Docs P2 Docs Learn Events
Chime Frequencies — Parallax Forums

Chime Frequencies

MikeSMikeS Posts: 131
edited 2005-01-16 00:33 in BASIC Stamp
Does any one know of a couple of FREQOUT statements that would make a good chime tone? I want my digital clock app. to chime on the hour. I have tried many combinations and can not seem to find the right one. Being tone deaf and not very musically inclined doesnt help any. The boss (wife) says if it does not sound like a chime she does not want to hear it!

thanks in advance
Mike

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-01-08 21:37
    I would start by playing two frequencies at once, separated by about 20 cycles.· By varying the difference between the two frequencies you can get some nice effects.· I would probably start with one of the frequencies about 1000 cycles and adjust it from there.· Probably the duration should be about 1000ms to begin with.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-01-08 21:48
    I would make the difference between the frequencies 1 Hertz, and the length 1/2 second. The reason for that is, the interference between the two frequencies causes the tone to start loud and fade to zero in 1/2 second. That is a more pleasing effect than abrupt off. Then make a progression of tones in a harmonic sequence of simple ratios, for example, 1:4/3:3/2.

    On a BS2 or BS2e the units of frequency are in Hertz and the time is one millisecond, so,
    FREQOUT 0,500,440,441
    FREQOUT 0,500,586,587
    FREQOUT 0,500,660,661

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • NewzedNewzed Posts: 2,503
    edited 2005-01-08 23:02
    Mike, here is a little chime sequence I worked out.· See how Mrs. S likes this:

    Start:
    FREQOUT 10,1200,440,449
    ·· PAUSE 200
    ·· FREQOUT 10,1200,660,669
    ·· PAUSE 200
    ·· FREQOUT 10,2000,500,509
    ·· PAUSE 2000
    ·· GOTO start

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • MikeSMikeS Posts: 131
    edited 2005-01-09 23:22
    Thanks Sid and Tracy for your help.
    I was playing around with two frequencies that were very far apart with long durations. Mrs. S. will like these. I fed these into my LM386 Amp circuit and they sounded great.
    Thanks again
    Mike S.
  • NewzedNewzed Posts: 2,503
    edited 2005-01-09 23:26
    Where are they?· I'd like to hear them [noparse]:)[/noparse])

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • MikeSMikeS Posts: 131
    edited 2005-01-10 02:52
    Sid,

    I did not write my post very well. Before I got help from you and Tracy I was trying Freqout statements with frequencies and durations that were way off the mark. You dont need to hear any of the noise I was generating.

    The ones that sound great are the ones you and Tracy gave me.

    tongue.gif·Mike
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-13 21:49
    It may be that your questions have all been answered, but I am going to post a response anyway.· First let me point out that I am not an avid·Basic Stamp user, but it has been foisted upon me since I have taken·this new job;· so I don't know exactly how to write the program for you.· Second, I would like to say that in a previous lifetime I was a organ technician (still am on a part-time basis) and I have a good understanding of the musical tones required to create a fairly realistic-sounding bell chime.· In fact I built one many years ago (using several 555 timers) to simulate a swinging bell sound for my church's steeple, and it wasn't bad.· Since I have this valuable knowledge, I am compelled to share this information because it appeals to my ego.smilewinkgrin.gif

    Anyway, one of the techniques used by organ companies in some of the older models was to use four frequencies:· A root tone, a fifth, an ocatave, and a third above the octave (I think that's a fifteenth).· The fifteenth is used as the strike sound, which is heard as a brief pulse and then is gone;· the other three tones are mixed together with a decay effect.· The root tone was slightly higher in amplitude than the others.

    Frequencies involved would be like this, if you were striking an "A" note

    Root=A=440 hz
    fifth=E=659.2551 hz
    Octave=A=880 hz
    Fifteenth=C#=1108.731 hz·

    I hope this helps.· Even if it doesn't it's fun to show off.



    ·
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-13 22:19
    Interesting. I'm not sure how you would do that on a stamp. The FREQOUT has a primary and secondary frequency argument. But that's it.

    Does the ear have a "persistance" the way an eye does? Could you, for example:

    for x = 1 to 1000
    freqout pin, 1, 440, 659 ' integer only in PBASIC
    freqout pin, 1, 880, 1109
    next

    I've only got the piezo speaker that came my kits so that wouldn't be a good test. I can hardly hear anything out of it.

    Jim
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-14 16:08
    Having been a flower child of the 60's the term "freqout" seems to conjure up images totally unrelated to the Basic Stamp.· However, with great control I shall try to refocus my flower power energies to the issue at hand.

    I had to look up the 'freqout' command to try to understand it a little better.· It sounds like this is a good start, although the tones may be out of tune just enough to irritate the most sensitive of our perfect-pitched friends.· There are a couple of points that should be made, though.

    For a more faithful reproduction of the strike effect, the 1109hz tone needs to have a pin of its own because it does not have the same duration as the other tones.· Its duration should be on the order of 1/10 second, to simulate the sound of a metal clapper striking the bell.· Try hitting a glass of water with a spoon, and you'll hear that there is a very brief harmonic -- a "tink" -- that is generated when the two hard surfaces meet.

    Secondly, for the other tones there needs to be a means of creating a decay.· I don't think one could count on an aural persistance to help create the effect for the listener.· A simple keying circuit can be made using diodes and capacitors, which is how I did it on the chime tone generator I built·20 years ago or so.· The diode acts as a switch that conducts the tones when it is forward biased, and blocks them when reverse biased.· When the "bell" is "struck," the capacitor is quickly charged and then allowed to slowly discharge through the diode, reducing the amplitude of the tone as the voltage level drops.· This is a really cool circuit.· If anyone's more interested in this I will look for it over the weekend and scan it and post it here.· I think I have it somewhere in an old Wurlitzer service manual.

    I once used this technique on a product I designed a few years ago based on the Intel 8751 processor.· The product required·an alarm for different events, and each event needed to have a different alarm tone.· So the 8751 generated a frequency on one output, and then triggered the keying circuit on another output.· It worked great.·

    There is an entire science devoted to the sound and casting of bells, it's called campanology (some may argue that the correct term is tintinabulation, but that word does not describe it within the context of a science).· Real bells have many more characteristics other than the four harmonics and strike tones·that are·described here.· The chime sound replicated in some of the older organs were pretty realistic, but some did not accurately reflect the many harmonics created by a ringing bell.· I remember seeing a Nova program many years ago on the subject.· The harmonics of a bell that is cast in the standard way create a sound that actually has a minor chord element to it.· Some psychologists (who really ought to get a life) felt that this minor tone in a bell had a subliminal depressive effect on the human mind.· Experiments were done casting bells that would contain a major chord element to their sounds.· The results were interesting.· The bells didn't sound real, at least not to me,·though there was a definite major harmonic.· Even stranger was that the bells looked bizarre.· There was a bulge around the girth of the bell about midway up, making the bell look pregnant.· I don't remember what the psychological response was.

    Well, I guess I've showed off enough for today.
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-14 19:34
    okc.engineer said...
    If anyone's more interested in this I will look for it over the weekend and scan it and post it here. I think I have it somewhere in an old Wurlitzer service manual.

    I too have a hard time not chuckling whenever I type FREQOUT.

    I don't know about Mike, who started this thread, but I'd sure like to see the circuit. I have another project developing in the back of my mind which will need alarms. While some events will need "Hey you! Pay attention!!!" alarms, others will be more of an "oh, by the way" type. The later would be really nice if they were a pleasant tone or chime instead of an electronic beep.

    Jim
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-14 22:37
    Hi Jim,

    I will certainly look for that this weekend and hopefully can post it on Monday. If I can't find it I still have just enough remembery to do a rough sketch, though the component values will not likely be on target, but you can play with those on your breadboard.

    The product of which I spoke is one that was a upgrade from a previous similar product developed by an engineer who was no longer with the company. He used a simple oscillator to generate an electronic beep, like you spoke of, and being the arteest that I am, I always found it to be very annoying. When I had the opportunity to redesign the product, that was one of the first things I changed. It was one of the few things I did in the 13 years I was with that company that earned a mildly enthusiastic attaboy from my boss, but we won't go there.

    The tone was not a full chime sound, like we have been discussing here... just a single tone on the order of a doorbell. The 8751 allowed me to vary not only the pitch but the strike rate, so you can have a wide range of notification urgencies. I think I just made up that word.

    Check back here sometime Monday, I hope I will have the info you need.
  • okc.engineerokc.engineer Posts: 12
    edited 2005-01-15 22:12
    OK, here is a PDF file of the circuit and a description of how it works.· I'm happy to answer any questions.· Please let me know how it works out for you.
  • edited 2005-01-15 23:28
    Newzed said...

    Mike, here is a little chime sequence I worked out.· See how Mrs. S likes this:

    Start:
    FREQOUT 10,1200,440,449
    ·· PAUSE 200
    ·· FREQOUT 10,1200,660,669
    ·· PAUSE 200
    ·· FREQOUT 10,2000,500,509
    ·· PAUSE 2000
    ·· GOTO start

    This worked great, now have something to play with.

    Tks

    Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Old redneck hillbilly born and raised on a redwood stump
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-16 00:33
    Thanks for a great write up. About half of it makes sense to me, which actually speak quite well for the way you wrote it. At this point, everything is a learning experience for me. I'll head off the get some parts and give this a try.

    Thank you for your efforts.

    Jim
Sign In or Register to comment.