Sound polyphony


Closed Thread
Results 1 to 3 of 3

Thread: Sound polyphony

  1. #1
    Join Date
    May 2007
    Posts
    65

    Default Sound polyphony

    hi folks,
    Is it possible to execute 2 or more simultaneous sound voices?
    example:
    -Having 3 buzzers on 3 different pins and playing a chord or a Bach 3 voices fugue?

    I know the SOUND command doesn't play in background, it waits for the period and then goes to next command.

    I guess if possible, it could be through interrupts,

    any lights?
    "Beethoven had his critics too, see if you can name 3 of them"

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes this could be done with Timer interrupts. You'll need to determine the highest frequency first, sometimes it might be too fast to have time enough to do something else.

    Still possible to use a PIC with 3 different CCP module and who allow 3 different frequency.. but they're usually overkill and way too big. Unless i missed few models, i think the smallest would have more than 40 pins

    Now, if all your buzzers runs with multiple of 2 of a frequency (which i doubt), an external frequency divider (JK or something like that) + 1 HPWM will do the trick.... but i doubt of the frequency multiplication stuff... to me this would sound really weird ... really not pleasant to hear... even Celine Dion would be more pleasant to hear...
    Last edited by mister_e; - 14th November 2007 at 04:09.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    I think it can be done. I think the DTMFout command uses it. SOUND will not work for polyphony.

    You definitely do not need 3 buzzers. But a lot of quality coding(highly optimized asm).
    Then, you could play out samples(not just square waves of sound) which could be n-key polyphonic thru a single buzzer/speaker. Interrupts may give determinance of time between samples, but it may be hard to get the timing right.

    You might like to read up on this for ideas even though it uses the PSoC
    http://www.web-ee.com/Schematics/PolyPiano/piano.htm

    Another using the PIC is a DDS
    http://www.min.at/prinz/oe1rib/DDS/SineDDS.htm

Similar Threads

  1. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 06:28
  2. new to PIC programming could really do with some help
    By karenhornby in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th March 2008, 14:03
  3. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  4. Sound and sound control with minimal parts
    By bartman in forum General
    Replies: 23
    Last Post: - 18th January 2005, 14:08
  5. Re: quick fix for sound command?
    By Melanie in forum Code Examples
    Replies: 0
    Last Post: - 9th July 2004, 01:44

Members who have read this thread : 0

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