aboutsummaryrefslogtreecommitdiff
path: root/lambeat.scm
diff options
context:
space:
mode:
Diffstat (limited to 'lambeat.scm')
-rw-r--r--lambeat.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lambeat.scm b/lambeat.scm
index ac3bb76..e98af09 100644
--- a/lambeat.scm
+++ b/lambeat.scm
@@ -1,12 +1,13 @@
(use-modules (ice-9 binary-ports))
(include "music.scm")
+; Bitrate is the number time to sample the music function each second
(define bitrate 8000)
; Get the music as a list sampled at the bitrate
-(define (play t) (
- cons (music t) (if (< t 30)
- (play (+ t (/ 1 bitrate)))
+(define (play t end) (
+ cons (* 1/4 (tri (* t (music t)))) (if (< t end)
+ (play (+ t (/ 1 bitrate)) end)
'()
)
))
@@ -17,4 +18,4 @@
cons
(put-u8 (current-output-port) (modulo b 256))
(put-u8 (current-output-port) (quotient b 256))
-)) (play 0))
+)) (play 0 4))