February 21Feb 21 like an automatic gen-dividets (4 4 ) '(1/4 1/8 1/8 1/2 1/4 1/8 1/8 1/2 1/4 1/4 -1/8 1/8 1/8 1/8 1/8 1/4 1/2 1/2 ) maybe this function exist if it does please let me know which one it is ---->. (( 1/4 1/8 1/8 1/4 1/4 ) ( etc ....Thank you Patrick
February 21Feb 21 Does this work for you?Jesper(omn-to-time-signature '(1/4 1/8 1/8 1/2 1/4 1/8 1/8 1/2 1/4 1/4 -1/8 1/8 1/8 1/8 1/8 1/4 1/2 1/2 ) '(4 4))Or perhaps rather this.(setf foo (omn-to-time-signature '(1/4 1/8 1/8 1/2 1/4 1/8 1/8 1/2 1/4 1/4 -1/8 1/8 1/8 1/8 1/8 1/4 1/2 1/2) '(1 4)))(setf quux (omn-to-time-signature foo '(4 4)))Or a simple function.(defun divide-by (seq div &optional (time-sig '(4 4)))(flet ((div-by (val div)(let ((len (floor val div)))(if (> val div) (gen-repeat len (/ val len)) val))))(omn-to-time-signature (loop for x in (omn-encode (flatten seq)) collect (div-by x div)) time-sig)))(setf mat '(1/4 1/8 1/8 1/2 1/4 1/8 1/8 1/1 1/4 1/4 -1/8 1/8 1/8 1/8 1/8 1/8 1/4 -1/2 1/2))(divide-by mat 1/4 '(4 4))=>((1/4 1/8 1/8 1/4 1/4) (1/4 1/8 1/8 1/4 1/4) (1/4 1/4 1/4 1/4) (-1/8 1/8 1/8 1/8 1/8 1/8 1/4) (-1/2 1/4 1/4))(divide-by mat 1/6)=>((1/4 1/8 1/8 1/6 1/6 1/6) (1/4 1/8 1/8 1/6 1/6 1/6) (1/6 1/6 1/6 1/4 1/4) (-1/8 1/8 1/8 1/8 1/8 1/8 1/4) (-1/2 1/6 1/6 1/6))
Create an account or sign in to comment