[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+-------+##################################################################
#+-| SOUND |----------------------------------+###############################
#| +-------+ Initiates the speaker to sound a |###############################
#| tone of frequency for duration |###############################
#+--------------------------------------------+###############################
##############################################################################
##############################################################################
#+--| Summary |------------+##################################################
#| #INCLUDE io.hdr |##################################################
#+-------------------------+##################################################
##############################################################################
##############################################################################
#+--| Syntax |---------------------------------------------------+############
#| PROCEDURE sound PROTOTYPE |############
#| PARAMETERS VALUE UINT frequency, VALUE UINT duration |############
#+---------------------------------------------------------------+############
##############################################################################
##############################################################################
#########+---| Description |---------------------------------------+##########
#########| This procedure initiates the speaker to sound a tone of |##########
#########| frequency for duration. duration is measured in 100th |##########
#########| of a second. Refer to the NOTES/FREQUENCY TABLE to |##########
#########| determine the right frequence for a note. |##########
#########+---------------------------------------------------------+##########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Use a high tone to indicate a valid response |#########
#########| * and a low tone to indicate an invalid response. |#########
#########| |#########
#########| IF response() |#########
#########| sound( 440, 2 ) |#########
#########| ELSE |#########
#########| sound( 150, 2 ) |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Play a song. Here is the start of Bach's |#########
#########| * minuet in G: |#########
#########| |#########
#########| VARDEF |#########
#########| INT note[10]=440,392,440,1,394,349,330,294,559,294 |#########
#########| INT duration[10]=10,10,120,30,8,8,8,8,100,150 |#########
#########| INT r |#########
#########| ENDDEF |#########
#########| |#########
#########| PROCEDURE force_main |#########
#########| FOR r = 1 to 10 |#########
#########| SOUND note[r], duration[r] |#########
#########| NEXT |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
chr()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson