"sound" "sound" activates the speaker. Format: (XCALL "sound" is a number in the range 0..4 which determines which sound command to execute. is the frequency in Hz. Very low and very high frequencies are mapped to 20 Hz. This number is used for timer control of the speaker. is a number in the range 1..65535. Zero is mapped to 65536. The speaker is activated for this many "ticks". , are numbers in the range 1..65535. Zero is mapped to 65536. These numbers are used for manual control of the speaker, and the sum + determines the size of 1 "tick". The length of a tick is processor-speed dependent. All arguments are optional. Once given, they remain in effect until explicitly changed. Also, the meaning of some arguments may vary depending on = 0 selects overall sound control. = 0 disables sound commands and <> 0 enables them. The speaker is turned off. Sound is initially enabled. = 2 selects manual control. is ignored--any number will do as a placeholder. The sum + determines the pitch through the use of delay loops. The speaker is off for a delay count of and on for . Different sums adding up to the same number give various timbres to the basic pitch. Larger sums decrease the pitch--doubling the sum will drop the sound one octave, for example. The sound lasts for ticks before returning to Scheme. = 4 turns off the speaker. If = 0, the speaker is turned off and control returns immediately to Scheme. If <> 0, control returns only after ticks. Examples: (XCALL "sound" 0 1) ;enable sound commands if they were disabled (XCALL "sound" 1 440 2000 200 200) ;on any computer, gives the "A" (= 440 Hz) ;above middle C. The last 3 parameters are duration ;values--increasing them give longer durations. ;The sum 200+200 determines the length of 1 tick ;and the sound lasts for 2000 ticks. (XCALL "sound" 1 256) ;an example of defaulting--the frequency changes ;to middle C (= 256 Hz) and other parameters are ;unchanged (XCALL "sound" 2 256 200 1075 1075) ;on a TI Business-Pro (turbo mode), gives roughly the ;same "A" above middle C. The sum 1075+1075 determines ;the pitch and the sound lasts for 200 ticks. ;The "256" argument is ignored. (XCALL "sound" 3 256 200 1075 1075) ;sounds similar to previous example except now a ;256 Hz sound (middle C) is superimposed (XCALL "sound") ;repeats the previous sound (XCALL "sound" 1 440 0) ;sound "A" and return to Scheme, leaving the sound on (XCALL "sound" 4 0) ;turn off the sound