Shop OBEX P1 Docs P2 Docs Learn Events
Piezospeaker — Parallax Forums

Piezospeaker

TristanZ222TristanZ222 Posts: 2
edited 2015-11-23 17:21 in General Discussion
Hey, is there a way to either use two speakers and play two different melodies simultaneously or use one speaker to play two different parts? I'm trying to play a song and I want both bass and melody to play from the boe bot

Comments

  • The FREQOUT statement can play two tones simultaneously using one I/O pin to drive one speaker. The duration of both notes has to be the same. A lot of simple songs can be played this way. If one part is silent, just provide the single active frequency to FREQOUT.

    You can't play two independent tones and you can't use two speakers although you could drive them in parallel with a simple passive filter for each (for low and high tones).

    If you really want two independent sound channels, use a Propeller. There's a nice 4-channel synthesizer in the Propeller Object Exchange that does 4-part vocal harmony synthesis (in stereo!)
  • ercoerco Posts: 20,250
    Per Mike, the BS2 has a provision for two tones, but it sounds funny, not what I expected. I looked for but can't find a demo of Hero 2000 singing 'Laura my love', where the voice alternates harmony notes several times a second. That type of harmony sounds cooler to my ears. Could also be done just with FREQOUT but would be a whole lot of work. The BS2 would enjoy more popularity IMO if there were some new GUI apps to generate code more easily, as the Scribbler GUI did. Another brand processor has several "Wizards" built into the textual programming editor. These GUIs auto-generate code for sound sequences (and let you hear them before generating code) , PWM variables, custom LCD characters, etc.
  • Wasn't the two tone feature in the BS2 derived from FSK modulation for dialing telephones? Not the kind of harmony one expects in music.

    https://en.wikipedia.org/wiki/Frequency-shift_keying
Sign In or Register to comment.