Decaying sounds synthesis with PWM


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Default Decaying sounds synthesis with PWM

    Hello everyone

    Anyone knows if is possible to emulate decaying sounds like gong, bells, music boxes (carillon) etc using only the PWM output ?

    I know such sound are basically tones with exponentially decaying envelope and wondering if their spectrums can be somewhat emulated with appropriate modulation of frequency and/or duty cycle of a PWM output (say the PIC PWM module) without using an external Programmable Gain Amplifier for the envelope.

    I can barely remember someone did it with an attiny15 or so ...
    ____
    MazE

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    I have not tried it with straight PWM, but take a look at the SOUND command. It should help you a bit with the freqs.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    Quote Originally Posted by amaze1 View Post
    Hello everyone

    Anyone knows if is possible to emulate decaying sounds like gong, bells, music boxes (carillon) etc using only the PWM output ?...
    I have read wav files from an SD card and output using only PWM with excellent results.
    From a pic only you may get a second or so.

    Norm

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    Quote Originally Posted by amaze1 View Post
    Hello everyone

    I know such sound are basically tones with exponentially decaying envelope and wondering if their spectrums can be somewhat emulated with appropriate modulation of frequency and/or duty cycle of a PWM output (say the PIC PWM module) without using an external Programmable Gain Amplifier for the envelope.
    Constructing bell-esque sounds using synths normally involves several sine waves and complicated algorithms (eg think Yamaha DX7) ...I'd hazard a guess & say that reading/playing a sample would be the best way to achieve what you want (ie no recourse to external envelope shaping hw)

  5. #5
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    I guess you can do this. I can hazard a way to do it. Use the Timer/CCP module to generate the frequency/ies you need. Another output is used as envelope control which snubs the output. So, you have frequency and amplitude modulation in effect. Never tried it, so, don't hold me to this. Just an idea that can work

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    Some different ways to do sound here: http://www.picbasic.co.uk/forum/showthread.php?t=8113
    Last edited by ScaleRobotics; - 6th August 2011 at 17:30.

  7. #7
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    Quote Originally Posted by amaze1 View Post
    Hello everyone

    Anyone knows if is possible to emulate decaying sounds like gong, bells, music boxes (carillon) etc using only the PWM output ?

    I know such sound are basically tones with exponentially decaying envelope and wondering if their spectrums can be somewhat emulated with appropriate modulation of frequency and/or duty cycle of a PWM output (say the PIC PWM module) without using an external Programmable Gain Amplifier for the envelope.

    I can barely remember someone did it with an attiny15 or so ...
    I use the SOUND command for my DINGs and DONGs . It works ok for me.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  8. #8


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    Hello rsocor!
    I am a new member living in France and working with PIC microcontroller. I search the hex , basic, c file for making a sound bell gong carillon with pic 16F family. Could you send me theses files and the electronic schematics?
    Thank you very much

    Best regard

    Emmanuel from FRANCE

  9. #9
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    Quote Originally Posted by manuespagne View Post
    Hello rsocor!
    I am a new member living in France and working with PIC microcontroller. I search the hex , basic, c file for making a sound bell gong carillon with pic 16F family. Could you send me theses files and the electronic schematics?
    Thank you very much

    Best regard

    Emmanuel from FRANCE
    Try this,

    http://www.picbasic.co.uk/forum/show...ighlight=music

    I tested it and it worked!
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  10. #10


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    Thank you very much roscor for your answer

    In fact, i want to simulate the sound of the old IC from SIEMENS SAB 0600, by using a PWM Output and a RC Filter. Can you join me a hex file for a pic and a file in basic or in C.
    The melody of the old cartoon candy i don't have the compiler, can you send me the hex file for the PIC 12F675

    Do you know, the IC SAB 0600, have you simulate it?

    Thank you much for your answer
    Have Good day

    Emmanuel from FRANCE

  11. #11
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Decaying sounds synthesis with PWM

    I don’t know if I ever posted it here, but I did polyphonic with the PBP freqout command.
    The other chip on the board is a MAX232.


Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts