SOUND Call
produces a tone
- CALL SOUND( freq<, dur>);
The inputs to the SOUND subroutine are as follows:
- freq
- is a numeric matrix or literal giving the frequency in hertz.
- dur
- is a numeric matrix or literal giving the duration in seconds.
Note that the dur argument
differs from that in the DATA step.
The SOUND subroutine generates a tone using
freq for
frequency (in hertz) and
dur for duration (in seconds).
Matrices can be specified for frequency and duration
to produce multiple tones, but if both arguments are
nonscalar, then the number of elements must match.
The duration argument is optional and
defaults to 0.25 (one quarter second).
For example, the following statements produce tones from an
ascending musical scale, all with a duration of 0.2 seconds:
notes=400#(2##do(0, 1, 1/12));
call sound(notes,0.2);
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.