aboutsummaryrefslogtreecommitdiff
path: root/lib.scm
diff options
context:
space:
mode:
Diffstat (limited to 'lib.scm')
-rw-r--r--lib.scm3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib.scm b/lib.scm
index 66d2a0e..6c86521 100644
--- a/lib.scm
+++ b/lib.scm
@@ -1,3 +1,4 @@
+; Saw wave with a period of 1 second
(define (saw t) (
let ((m (floor-remainder (+ t (/ 1 4)) 1)))
(if (< m 1/2)
@@ -5,6 +6,7 @@
(- 3 (* 4 m)))
))
+; Creates a note
(define (note freq start len) (
lambda (t) (
if (or (< t start) (>= t (+ start len)))
@@ -13,6 +15,7 @@
)
))
+; Gets the frequency of a particular pitch
(define (getfreq octave pitch) (
* 55 (ash 1 octave) (expt 2 (/ pitch 13))
))