diff options
Diffstat (limited to 'lib.scm')
-rw-r--r-- | lib.scm | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -5,12 +5,18 @@ (- (* 4 m) 1) (- 3 (* 4 m))))) +; Square wave with a period of 1 second +(define (square t) + (let ((m (floor-remainder t 1))) + (if (< m 0.5) 1 -1))) + ; Creates a note (define (note freq start len) (lambda (t) ( if (or (< t start) (>= t (+ start len))) 0 - freq))) + (* 1/4 (tri (* 1.5 t freq)))))) +; ; Gets the frequency of a particular pitch (define (getfreq octave pitch) |