Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>sound()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SOUND()

Syntax:     SOUND(<expN1>,<expN2>)

Arguments:  <expN1> denotes the frequency of the note in Hertz.
            <expN2> stipulates the duration of the note in 1/100 seconds.

Returns:    A character string.
            A null string is always returned.

Usage:      SOUND() can be used to produce notes in the range 21 to
            65535 Hertz, for a maximum period of 655.35 seconds per
            note.  The lengths of the notes can be graduated in
            hundredths of seconds.

            You should store the data required in a database, since even
            short melodies require large amounts of data.  A high
            speed hard disk, or, better still a RAM disk should be used,
            so that the performance will not be effected by delays in
            access to the disk.  A table of notes and their
            frequencies for three octaves is shown below.  The frequency
            is doubled to go one octave higher.

            Pitch  Frequency    Pitch  Frequency    Pitch  Frequency
            -----  ---------    -----  ---------    -----  ---------
            C3        131       C4        262       C5        523
            C#        139       C#        277       C#        554
            D         147       D         294       D         587
            D#        156       D#        311       D#        622
            E         165       E         330       E         659
            F         175       F         349       F         698
            F#        185       F#        370       F#        740
            G         196       G         392       G         784
            G#        208       G#        415       G#        831
            A         220       A         440       A         880
            A#        233       A#        466       A#        932
            B         247       B         494       B         988

Notes:      The value for frequencies below 21 Hertz are invalid, but
            can nevertheless be used for pauses.

Library:    CT1.LIB


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

Examples:   * The C major scale.
            SOUND(262,40)
            SOUND(294,40)
            SOUND(330,40)
            SOUND(349,40)
            SOUND(392,40)
            SOUND(440,40)
            SOUND(494,40)
            SOUND(523,40)

            * Pause for half a second.
            SOUND(0,50)


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