;
; enhanced version of cosr that also floors the value (eg useful for generating notes, or precise beats)
(macro (cosrfloor args)
(if (> (length args) 5)
`(floor (+ ,(caddr args) (* ,(cadddr args) (cos (* 2pi (+ beat ,(cadr args)) ,(car (cddddr args)))))))
`(floor (+ ,(cadr args) (* ,(caddr args) (cos (* 2pi beat ,(cadddr args))))))))