helper:handle_negatives_beats   scheme


Defined in:  https://github.com/lambdamusic/extempore-extensions/blob/main/init/init_beats.xtm

Implementation

;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; UTILITY TO ALLOW PASSING NEGATIVE VALUES TO ONBEAT FUNCTIONS
; (helper:handle_negatives_beats 4 -1/4) => 15/4
; (helper:handle_negatives_beats 4 -1/2) => 7/2
; (helper:handle_negatives_beats 4 -5) => -1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define helper:handle_negatives_beats
  (lambda (x y)
    (if (< y 0)
      (+ x y)
      y)
    ))


Back to Index

Similar Entries