diff options
Diffstat (limited to 'lambeat.scm')
-rw-r--r-- | lambeat.scm | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lambeat.scm b/lambeat.scm index e98af09..1bcc730 100644 --- a/lambeat.scm +++ b/lambeat.scm @@ -5,17 +5,15 @@ (define bitrate 8000) ; Get the music as a list sampled at the bitrate -(define (play t end) ( - cons (* 1/4 (tri (* t (music t)))) (if (< t end) - (play (+ t (/ 1 bitrate)) end) - '() - ) -)) +(define (play t end) + (cons (* 1/4 (tri (* t (music t)))) + (if (< t end) + (play (+ t (/ 1 bitrate)) end) + '()))) ; Output the list in the s16 raw audio format -(for-each (lambda (a) ( - let ((b (modulo (inexact->exact (round (* (+ a 2) 32768))) 65536))) - cons - (put-u8 (current-output-port) (modulo b 256)) - (put-u8 (current-output-port) (quotient b 256)) -)) (play 0 4)) +(for-each (lambda (a) + (let ((b (modulo (inexact->exact (round (* (+ a 2) 32768))) 65536))) cons + (put-u8 (current-output-port) (modulo b 256)) + (put-u8 (current-output-port) (quotient b 256)))) + (play 0 4)) |