Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>sound() - create arcade and space sound effects</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     sound() - create arcade and space sound effects
  Usage:    sound(<freq>,<duration>,[<loops>],[<addfreq>])
  Params:   integer <frequency> - an integer in the range of 20
            to 20khz (normal human hearing)
            integer <duration> - the duration of the sound in
            roughly 1/1000th's of a second (speed varies with
            speed of the computer)
            integer <loops> - the number of times to repeat the
            sound produced by the <freq> and <duration>. Optional,
            if left off then default is 0 repeats.
            integer <addfreq> - the number to add to the frequency
            upon each iteration of the <loops> parameter, optional,
            default is 0. If this number is positive, then this
            parameter is added to the <freq> to produce ever
            higher tones upon each <loop>. If this number is
            negative, then it is subtracted from <freq> to produce
            ever lower tones upon each <loop>.

  Returns:  nothing

 ---------------------------------- Example ---------------------------------

            * This example produces a rising sound like an arcade

                 sound(100,35,30,100)

            * This example produces a decrementing sound like a
            * slide whistle

                 sound(3500,10,100,25)

  Note:     Since the sound() function is not tied to the timer
            tick like the tone() function, faster changes in sound
            are possible. This lets you produce much more
            interesting sounds then just a single tone. Also,
            since the sound can be repeated so quickly, the sound()
            function is good to use inside loops that display
            exploding text and windows.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson