Jump to content

Featured Replies

Posted
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; LENGTH-REST-RATIO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; to TEST in a OMN- or LENGTH-sequence

(defun length-rest-ratio (seq)
  (let ((liste (omn :length seq)))
    (loop for i in liste
      when (< i 0) sum (abs i) into -bag
      when (> i 0) sum i into +bag
      finally (return (ratio-to-float (* +bag (/ 1 (+ +bag -bag))))))))

(length-rest-ratio '(e. q. -q))
(length-rest-ratio '(-2 3 4 -1 -1))
(length-rest-ratio '(e. c4 ppp -q. q d3 e3 f3))
        
        
;;; evaluate this test a few times    
(if (> (length-rest-ratio (rnd-repeat 10 '(1 2 3 4 -1 -2 -3 -4))) 0.5)
  (append 'more-lengths)
  (append 'more-rests))

 

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy