aboutsummaryrefslogtreecommitdiff
path: root/main.scm
diff options
context:
space:
mode:
Diffstat (limited to 'main.scm')
-rw-r--r--main.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.scm b/main.scm
index 75c78df..a3e3788 100644
--- a/main.scm
+++ b/main.scm
@@ -2,11 +2,18 @@
(define bitrate 8000)
+(define (saw t) (
+ let ((m (floor-remainder (+ t (/ 1 4)) 1)))
+ (if (< m 1/2)
+ (- (* 4 m) 1)
+ (- 3 (* 4 m)))
+))
+
(define (note freq start len) (
lambda (t) (
if (or (< t start) (>= t (+ start len)))
0
- (sin (* 2 (acos -1) freq t))
+ (saw (* freq t))
)
))