AndreOktave Posted May 4, 2021 Posted May 4, 2021 I am searching for a function in Opusmodus, witch makes it possible to add the attacks of two (more) rhythms, does anybody have a solution for this? Short example: (setf pr (primes-to 7)) (setf r1 (gen-length pr '4)) (setf r2 (gen-retrograde (gen-length pr '4))) ; function like:: ; (gen-resultants r1 r2) (see Score example) best Stefan Quote
AM Posted May 4, 2021 Posted May 4, 2021 is this a solution? ...or some ideas to it... greetings andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun gen-resultant (r1 r2 &key (rhy 1/4)) (gen-length (difference (remove-duplicates (sort-asc (flatten (append (cons 0 (gen-accumulate r1)) (cons 0 (gen-accumulate r2))))))) rhy)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; example.... correct? (gen-resultant (primes-to 7) (reverse (primes-to 7))) ;;; another example (gen-resultant '(9) '(3 1 4)) (gen-resultant '(9) '(3 1 4) :rhy 1/16) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; n-version... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; for several layers (defun gen-resultant* (r &key (rhy 1/4)) (gen-length (difference (remove-duplicates (sort-asc (flatten (loop for i in r append (cons 0 (gen-accumulate i))))))) rhy)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; correct? (gen-resultant* '((16) (9) (3 1 4) (7))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; a version with length-input - but test it, correct...? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; for several layers / with direct rhythm-input (defun gen-resultant** (r) (difference (remove-duplicates (sort-asc (flatten (loop for i in r append (cons 0 (gen-accumulate i)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; correct? (gen-resultant** '((2/4 1/4 3/4) (1/16 3/16 2/12 1/12) (3/4 3/20 2/20))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JulioHerrlein 1 Quote
AndreOktave Posted May 5, 2021 Author Posted May 5, 2021 Hi André, thank you very much for your help, your codes are working very good and it is exactly what I was looking for... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; example.... correct? ;; Yes ;(gen-resultant (primes-to 19) (reverse (primes-to 19))) ;; ================= ;;;exactly what I was looking for, thanks alot!!! (progn (defun gen-resultant (r1 r2 &key (rhy 1/4)) (gen-length (difference (remove-duplicates (sort-asc (flatten (append (cons 0 (gen-accumulate r1)) (cons 0 (gen-accumulate r2))))))) rhy)) (setf r1a (primes-to 19)) (setf r2a (reverse (primes-to 19))) ;; Resultant from r1a r2a (setf rr (gen-resultant r1a r2a :rhy 1/16)) (setf r1b (gen-length r1a '16)) (setf r2b (gen-length r2a '16)) (ps 'gm :rhy (list r1b) :rhy (list r2b) :rhy (list rr) :time-signature '(4 4 1) ) ....as long as there are no rests involved, rests are interpreted as attacks: (progn (defun gen-resultant* (r &key (rhy 1/4)) (gen-length (difference (remove-duplicates (sort-asc (flatten (loop for i in r append (cons 0 (gen-accumulate i))))))) rhy)) (setf r1c (gen-length '(16) '4)) (setf r2c (gen-length '(9) '4)) (setf r3c (gen-length '((3 1 4)) '4)) (setf r4c (gen-length '(7) '4)) ;; Resultant from r1c r2c r3c r4c (setf rrc (gen-resultant* '((16) (9) (3 1 4) (7)))) (ps 'gm :rhy (list r1c) :rhy (list r2c) :rhy (list r3c) :rhy (list r4c) :rhy (list rrc) :time-signature '(4 4 1) ) ) ... or: (progn (defun gen-resultant** (r) (difference (remove-duplicates (sort-asc (flatten (loop for i in r append (cons 0 (gen-accumulate i)))))))) (setf rha '(2/4 1/4 3/4)) (setf rhb '(1/16 3/16 2/12 1/12)) (setf rhc '(3/4 3/20 2/20)) (setf rr2 (gen-resultant** (list rha rhb rhc))) (ps 'gm :rhy (list rha) :rhy (list rhb) :rhy (list rhc) :rhy (list rr2) :time-signature '(4 4 1) ) ) Thank you very much! best Stefan AM and JulioHerrlein 1 1 Quote
JulioHerrlein Posted May 5, 2021 Posted May 5, 2021 Thank you ! Very nice ! In relation of counting the rests as items attacks, I suggested this to Janusz (probably in the next update). Best ! Julio Quote
AndreOktave Posted May 6, 2021 Author Posted May 6, 2021 Thank you for the link, will check your ideas! best wishes Stefan Quote
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.