Many thanks to all Picsters for help with the dong sound generation. Stuart ----- Original Message ----- From: "Peter L. Peres" To: Sent: 11 February 2002 19:47 Subject: [pic] Sound generation on a pic "Dong" > > After a spell on other things, I am back to a PIC project, and need to > > generate a 'Dong' sound (as in "ding-dong", without the ding..) > > > > On cost grounds I can't go the ISD route, so I want to store and output > > a waveform from a 12C PIC. Question is, how can I easily create the > > table of tones/durations required? As I am tone deaf, trial and error > > could take a lifetime... > > You don't need to record a dong, just get the frequencies for a good one. > You can do that with almost any musical instrument. Sneak up to a piano or > organ and try pressing down 2 or 3 keys together at the same time & > release. > > You also don't need to record the instrument, the dong is a sine wave with > some distortion (i.e. 2nd 3rd 4th etc harmonics are present). So you need > to store the table for 1/4 wave of this in a pic and read it out and send > it to a D/A (R2R probably). You make the decreasing sound by reducing the > output all the time. A natural dong decreases in amplitude with a law that > depends on A = A * e^(1/((t+1)*q)) where e is Euler's number t is the time > from the strike and q a number proportional to the quality factor of the > gong. You can easily calculate a table for this function in a spreadsheet > and use it to amlitude modulate your gong tone. > > Similar thinking applies to any repetitive tones (bird chirp, miaow, mooh, > you get it). > > hope it helps, > > Peter > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics