Shop OBEX P1 Docs P2 Docs Learn Events
BS2 As Synthesizer? — Parallax Forums

BS2 As Synthesizer?

wingflyerwingflyer Posts: 4
edited 2009-07-17 18:16 in BASIC Stamp
Hi all,

I'm trying to make a mini synthesizer/music keyboard. Is there some way I can program the BS2 to·output sounds·like a mini music keyboard? The 'freqout' command has a fixed time but I want the sound to occurr only while a condition is met in real time like while a button's depressed, or the RC time constant's in a certain range, etc. For example, in an RC circuit I can have resistors and buttons set up so each button produces a different resistance/RC time constant and for each time constant, a different note is played while its button is depressed. Is·such a program·even possible with a BS2? confused.gif


Thanks for any help.



PS, does the BS2 have an A to D converter?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-17 16:53
    1) The BS2 can only do one thing at a time so, when it's making sounds using FREQOUT, it can't do anything else like check a keyboard. It's possible to use external hardware to do things like scanning a keyboard so the BS2 only has to quickly check whether there's a new keypress to get. That can be done in a millisecond or so and the interruption in the sound may not be noticed.

    2) The BS2 does not have an ADC. It's possible to use the RCTIME statement to measure external voltages, but it's pretty slow. There's some discussion of this on this website: www.emesystems.com. Use the "app-notes" link at the bottom of the page, then read the section on the RCTIME statement to see how to measure battery voltage. It's easy to connect an external ADC like the ADC0831 or ADC0834 (or others).
  • wingflyerwingflyer Posts: 4
    edited 2009-07-17 17:06
    Thanks Mike,

    I like the battery voltage RC time idea. Can you give me an example·of an external device I could use to scan for button presses? Also, would it work for a simple circuit I hack together rather than a computer keyboard?

    Out of curiosity, Is there a Basic Stamp chip in the series that can do more than one thing at once, or do I need a Propeller to do that?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-17 17:11
    1) There are several Nuts and Volts Columns on the subject of keypads and Stamps. Go to the main Parallax webpage and click on the Resources tab, then choose Nuts and Volts Columns and browse the index

    2) You would need to use a Propeller to do more than one thing at a time
  • waltcwaltc Posts: 158
    edited 2009-07-17 17:32
    While the BS2 can't generate sounds or music you can add a AY-3-8910 sound generator chip that can and they are pretty cheap. It was used in pretty much all arcade games and the Atari ST line of computers.

    Here's a link:
    http://www.arcadechips.com/product_info.php?products_id=154
  • wingflyerwingflyer Posts: 4
    edited 2009-07-17 18:01
    How does the speaker PAL work?
  • dev/nulldev/null Posts: 381
    edited 2009-07-17 18:16
    The SoundPAL is a great tool for making sounds. It has an onboard controller, which will play sound while you do things in the Stamp.
    Easy to use with serial interface. It has some built-in melodies, and support for the whole range of a synthesizer with notes, pitches, octaves and what not.
    It even has a 64 byte EEPROM where you can store music.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
Sign In or Register to comment.