AM Posted July 21, 2018 Share Posted July 21, 2018 ;;; CHANGE-TIME-STRUCTURES ;;; works okay, but not exactly precise because of rhy-to-integer, which is not very easy in some cases ;;; this function changes basic-rhy-structures (if it's all the time perhaps in x/32) ;;; to other/changing sections. the lengths/rests will be rounded like in LENGTH-RATIONAL-QUANTIZE ;;; rhy+span => '((32 2) (44 7)) => means in 32 three values, in 44 seven values (defun change-time-structure (omnseq rhy+span &key (basic-rhy 32) (round 1/4)) (let* ((intseq (loop for i in (omn :length (flatten omnseq)) collect (* i basic-rhy))) (rhyseq (mapcar #'car rhy+span)) (spanseq (mapcar #'cadr rhy+span)) (divided-intseq (gen-divide spanseq intseq))) (length-rational-quantize (flatten (gen-length divided-intseq rhyseq)) :round round))) (change-time-structure '(2/44 -2/44 3/44 5/44 6/44) '((32 2) (20 2) (28 3)) :basic-rhy 44) => (1/16 -1/16 -1/8 3/20 1/4 -1/10 3/14 -1/28) (change-time-structure '(2/32 -2/32 3/32 5/32 6/32) '((20 2) (44 2) (28 3)) :basic-rhy 32) => (1/10 -1/10 -1/20 3/44 5/44 -3/44 3/14 -1/28) could be done better -> go for it greetings andré loopyc 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.