Cool Sound Effects?


Results 1 to 8 of 8

Threaded View

  1. #7
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Cool Sound Effects?

    Here are a couple more sound effects. All of these use the freqout command. I tried them on a PIC18F4550 at 48 mhz. You can listen to them on the attached sound file.


    Howler
    Code:
    Howler:
      FOR sndcnt = 1 TO 4
        FREQOUT sound2pin, 500, 467, 687           ' was combine 1400 Hz and 2060 Hz
        FREQOUT Sound2pin, 500, 817, 867           ' was combine 2450 Hz and 2600 Hz
      NEXT sndcnt
    Space Transporter
    Code:
    Space_Transporter:
      'DEBUG "Space Transporter", CR
      FOR sndcnt = 5 TO 5000 STEP 5                  ' frequency sweep up
        FREQOUT sound2pin, 15, sndcnt, sndcnt */ 323    ' play note, note * 1.26
      NEXT sndcnt
      FOR sndcnt = 5000 TO 5 STEP -5                 ' frequency sweep down
        FREQOUT sound2pin, 15, sndcnt;, sndcnt */ 323  ' play note, note * 1.26
      NEXT sndcnt
    Warp
    Code:
    Warp:
    for sndcnt2 = 200 to 450 step 1
       FREQOUT Sound2pin,7,sndcnt2;,(sndcnt2 -166)
    next sndcnt2
    warble/alarm sinusoidal - could use some work
    Code:
    sineval var byte[32]
    sineval[0] = 128
    sineval[1] = 148
    sineval[2] = 167
    sineval[3] = 185
    sineval[4] = 200
    sineval[5] = 213
    sineval[6] = 222
    sineval[7] = 228
    sineval[8] = 230
    sineval[9] = 228
    sineval[10] = 222
    sineval[11] = 213
    sineval[12] = 200
    sineval[13] = 185
    sineval[14] = 167
    sineval[15] = 148
    sineval[16] = 128
    sineval[17] = 108
    sineval[18] = 189
    sineval[19] = 171
    sineval[20] = 156
    sineval[21] = 143
    sineval[22] = 134
    sineval[23] = 128
    sineval[24] = 126
    sineval[25] = 128
    sineval[26] = 134
    sineval[27] = 143
    sineval[28] = 156
    sineval[29] = 171
    sineval[30] = 189
    sineval[31] = 208
    
    warble:       ;alarmish sinusoidal - needs some work!
     for sbuff = 1 to 10
         for sndcnt2 = 0 to 31 step 1
             FREQOUT Sound2pin,7,(500 +sineval[sndcnt2]);,(sndcnt2 -166)
         next sndcnt2
     next sbuff
    Attached Files Attached Files
    Last edited by ScaleRobotics; - 19th February 2012 at 17:45. Reason: Add sound file
    http://www.scalerobotics.com

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