Tone()

Tone()

Sound a tone with a specified frequency and duration.

Syntax

      Tone( <nFrequency>,  <nDuration> ) --> NIL

Arguments

<nFrequency> A non-negative numeric value that specifies the frequency of the tone in hertz.

<nDuration> A positive numeric value which specifies the duration of the tone in 1/18 of a second units.

Returns

Tone() always returns NIL.

Description

Tone() is a sound function that could be used to irritate the end user, his or her dog, and the surrounding neighborhood. The frequency is limited to the range 0 to 32767 Hz.

Examples

      IF lOk   // Good Sound
         Tone(  500,  1 )
         Tone( 4000,  1 )
         Tone( 2500,  1 )
      ELSE     // Bad Sound
         Tone(  300,  1 )
         Tone(  499,  5 )
         Tone(  700,  5 )
      ENDIF
      //
      Tone( 800,  1 )                         // same as ? Chr( 7 )
      Tone( 32000,  200 )                     // any dogs around yet?
      Tone( 130.80,  1 )                      // musical note - C
      Tone( 400,  0 )                         // short beep
      Tone( 700 )                            // short beep
      Tone( 10,  18.2 )                       // 1 second delay
      Tone( -1 )                             // 1/18.2 second delay
      Tone()                                 // 1/18.2 second delay

Compliance

Clipper

Platforms

All

Files

Library is core

Seealso

Chr(), SET BELL

3 responses to “Tone()

  1. Pingback: Harbour All Functions – T | Viva Clipper !

  2. Pingback: Harbour Misc Functions | Viva Clipper !

  3. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.