Anonymous user
Sine wave: Difference between revisions
→{{header|REXX}}: added the REXX computer programming language for this task.
SqrtNegInf (talk | contribs) (Added Perl example) |
(→{{header|REXX}}: added the REXX computer programming language for this task.) |
||
Line 200:
(play (make-tone 440 0.50 (* 5 FRAME-RATE)))
</lang>
=={{header|REXX}}==
Note: This REXX program will <u>only</u> work for PC/REXX or Personal REXX.
<lang REXX>/*REXX program produces a sine wave (of a specified frequency) for N seconds. */
parse arg freq time . /*obtain optional arguments from the CL*/
if freq=='' | freq=="," then freq= 880 /*Not specified? Then use the default.*/
if time=='' | time=="," then time= 5 /* " " " " " " */
call sound freq, time /*invoke a BIF to generate a sine wave.*/
exit 0 /*stick a fork in it, we're all done. */</lang><br><br<
=={{header|Scala}}==
|