tri-wave   macro


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/scheme.xtm

Implementation

(define-macro (tri-wave x)
  `(let* ((xx (+ ,x 0.000000001))
          (xmod2pi (- xx (* TWOPI (floor (/ xx TWOPI))))))
     (* (/ 1.0 PI)
        (if (< xmod2pi PI) xmod2pi (- TWOPI xmod2pi)))))


Back to Index