|
From: Martin R. <ru...@us...> - 2004-08-16 19:50:15
|
Update of /cvsroot/foo/foo/elkfoo/examples/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19142 Modified Files: sine.foo Log Message: added comments and verbose output Index: sine.foo =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/examples/scripts/sine.foo,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sine.foo 12 Aug 2004 23:15:38 -0000 1.1 --- sine.foo 16 Aug 2004 19:50:05 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- ;; (c) 2004 rumori + ;; checking command line (if (< (length (command-line-args)) 3) (begin *************** *** 10,16 **** (quit))) (define duration (string->number (list-ref (command-line-args) 1))) (define freq (string->number (list-ref (command-line-args) 2))) (syn 1 duration (output~ 1 (sine~ (~ freq)))) ! (play) --- 11,31 ---- (quit))) + (format #t "~a script example~%" (car (command-line-args))) + (format #t "creating, playing and removing a test-file.~%") + + ;; extract parameters from command line (define duration (string->number (list-ref (command-line-args) 1))) (define freq (string->number (list-ref (command-line-args) 2))) + (format #t "duration: ~a frequency: ~a~%" duration freq) + + (format #t "synthesizing...~%") + + ;; here we do the major work (syn 1 duration (output~ 1 (sine~ (~ freq)))) ! ! (format #t "~%playing using '~a'~%" foo-default-play-command) ! ! (format #t "exiting (will remove temporary file as well)~%") ! ! ;; done |