Bill & Pookie wrote: > I think you are making this way to complicated. To the best of my > knowledge, the speaker is controlled by a single bit and a square wave is > sent to it to produce the tones. > > The speaker has a limited response and the volume will start decreasing at > some higher frequency as the mechanical parts of the speaker can only move > so fast. By decreasing the on time of the input to speaker you will > effectively be increasing the frequency that the speaker responds to, and at > some point the volume should start decreasing. > > So by knowing what on pulse time produces full volume and what on pulse > width produces no sound, you can control volume with the on pulse width > while keeping the original frequency. > > Bill Of course, but I have no control over the generated signal for the speaker. I just want to post-process it to vary the volume. Plus the difference in (sound) pulse width would become noticeable many times. -- Hector Martin (hector@marcansoft.com) Public Key: http://www.marcansoft.com/hector.asc -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist