Shop OBEX P1 Docs P2 Docs Learn Events
Custom sounds using BS2 FREQOUT Code/Using BS2 FREQOUT from EMIC — Parallax Forums

Custom sounds using BS2 FREQOUT Code/Using BS2 FREQOUT from EMIC

KatyBriKatyBri Posts: 171
edited 2006-04-20 22:21 in BASIC Stamp
Does anyone have any BS2 FREQOUT code examples they are willing to share with me?

I'm looking for a door-bell sound, opening/closing sound of door on StarTrek, or R2D2.

Any sounds you may have will help me to experiment-see how to use the code.

Also, does anyone have any code/suggestions connecting a BS2 FREQOUT pin to the AN pin on an EMIC chip? Do the example interface schematics work, or are modifications required? EMIC examples using the FREQOUT pin on the BS2 would also be helpful.

Thanks,

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-04-19 20:31
    The Freqout command is kind of limited.

    You can output *A* note, and you can adjust the frequency of the note on-the-fly. The examples you're calling out typically require some control of the volume 'envelope' of the sound -- Attack, Decay, Sustain, Relax (ADSR). Now, I believe you CAN output the sum of two tones, which can give you some nice modulation sound effects.

    The typical experimental circuit for this has you attach a piezo-electric speaker between the pin and ground. It's not loud, but it should work. A better circuit (in Analog and Digital Interfacing) uses an op-amp to amplify the signal.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-19 21:02
    As Allan points out, there's not a lot one can do with FREQOUT -- that said, somebody got quite creative with FREQOUT-based sound effects as the attached file will demonstrate.· I wish I could give the original author credit; I found the file on the Internet with no indication of who created it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • SSteveSSteve Posts: 808
    edited 2006-04-19 21:24
    Allan:

    Actually it's Attack, Decay, Sustain, Release. Were you, perchance, a big Frankie Goes to Hollywood fan? smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-04-19 21:29
    Darn! I KNEW it was ADSR, but wasn't sure about the last R. Thanks for the correction.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-20 05:03
    I dug one out of the old BASIC Stamp archives titled R2D2.BS2.· Author unknown, but the sounds are quite realistic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Vern GranerVern Graner Posts: 337
    edited 2006-04-20 22:21
    KatyBri said...
    Does anyone have any BS2 FREQOUT code examples they are willing to share with me?
    I know you've already gotten some responses, but I thought I throw this one in as well. I built a "Decontamination Chamber" for my haunt that used the BSII to produce all the sound effects. A video of the controller (before I had it mounted in the haunt) that includes audio of all the sounds is here:

    Decontamination Chamber Video

    and a complete description of the project, along with the source code was posted to the parallax "projects" forum here

    smile.gif

    Vern

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Vern Graner CNE/CNA/SSE    | "If the network is down, then you're
    Senior Systems Engineer    | obviously incompetent so why are we
    Texas Information Services | paying you? Of course,if the network
    http://www.txis.com        | is up, then we obviously don't need
    Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG
    
    
Sign In or Register to comment.