Shop OBEX P1 Docs P2 Docs Learn Events
Can you make 2 tones in SimpleIDE? — Parallax Forums

Can you make 2 tones in SimpleIDE?

I am a teacher and have been using the 6 pre-release chapters of the WAMM booklet to start teaching C to some of my more advanced students. All of the students are familiar with PBasic and have been programming for over a year now.

My problem: I am trying to have them adapt PBasic FREQOUT programs from the WAM book into C on SimpleIDE. I know you can have multiple frequencies on the same line in PBasic, but this function does't seem to work on the SimpleIDE. Is there another command that students can use, or do I just need to get them through the basics, then move onto .wav files?

Thanks for any help.

Comments

  • edited 2016-02-10 21:40
    Hi Mr. Lewis,

    We have a different library for two (actually up to four) tones, and that's the next thing I'm going to add to the WAMM draft, along with speech and playing a .wav file. The example programs use a C language port of some of the Spin language libraries Brett Weir wrote for his LameStation project.

    The example programs and library are in this file 07 Audio (2016.02.10).zip. Make sure to unzip 07 Audio.zip, and work from the folder that gets created, not from inside the zip itself.

    You can either make sure all your projects are in the same folder as libsound, or copy the libsound folder from ...07 Audio\ to ...Documents\SimpleIDE\Learn\Simple Libraries\Audio\. After copying the libsound folder over and restarting SimpleIDE, it won't matter where you create your projects, they'll still be able to access the library if you add #include "libsound.h" to source code.

    Plug a speaker or headphones into the Activity Board's jack.

    Try the nine example programs in the 07 Audio folder. Please disregard the comments about the badge and oLED display.

    You can also drive both sides of a piezospeaker by connecting an I/O to each terminal, then use the I/O numbers in sound_run.

    Andy
  • edited 2016-02-10 21:42
    Here are some speech synthesis example programs that use C language ports of PhiPi's phonemic speech synthesis and Chip Gracey's vocal tract Spin libraries - 08 Speech (2016.02.10). Six code examples and text2speech library included.
  • Thanks for the files. I have downloaded them and will be working with them over the next few weeks.

    Tim
Sign In or Register to comment.