Posted April 24Apr 24 One more small (improved) function: a starting rhythm (pattern) gradually changes its values towards a constant pulse/value (endvalue).Other possible applications: An initial pitch sequence evolves into a steady, constant pitch. A start pattern for velocity gradually shifts towards a fixed velocity.(defun gen-acc/rit (alist endvalue) ;; startpattern + endvalue (loop while (not (equal alist (gen-repeat (length alist) endvalue))) collect (setf alist (loop for i in alist when (/= i endvalue) collect (if (> i endvalue) (- i 1) (+ i 1)) else collect i)))) (list-plot (flatten (gen-acc/rit '(1 7 4 2 11 9 5 3) 3)) :join-points t :style :fill) => ((2 6 3 3 10 8 4 3) (3 5 3 3 9 7 3 3) (3 4 3 3 8 6 3 3) (3 3 3 3 7 5 3 3) (3 3 3 3 6 4 3 3) (3 3 3 3 5 3 3 3) (3 3 3 3 4 3 3 3) (3 3 3 3 3 3 3 3)) (list-plot (flatten (gen-acc/rit '(1 7 4 2 11 9 5 3) 15)) :join-points t :style :fill) => ((2 8 5 3 12 10 6 4) (3 9 6 4 13 11 7 5) (4 10 7 5 14 12 8 6) (5 11 8 6 15 13 9 7) (6 12 9 7 15 14 10 8) (7 13 10 8 15 15 11 9) (8 14 11 9 15 15 12 10) (9 15 12 10 15 15 13 11) (10 15 13 11 15 15 14 12) (11 15 14 12 15 15 15 13) (12 15 15 13 15 15 15 14) (13 15 15 14 15 15 15 15) (14 15 15 15 15 15 15 15) (15 15 15 15 15 15 15 15)) (list-plot (flatten (gen-acc/rit '(1 2 3 1 5 7 11 3 13 ) 6)) :join-points t :style :fill) => (((4 6 2 6 2 12 3 4 10) (5 6 3 6 3 11 4 5 9) (6 6 4 6 4 10 5 6 8) (6 6 5 6 5 9 6 6 7) (6 6 6 6 6 8 6 6 6) (6 6 6 6 6 7 6 6 6) (6 6 6 6 6 6 6 6 6))
May 5May 5 Author A small further development – separate sequences for note values and rests (positive and negative integers).;; subfunction to test the end of the loop (defun pos-neg (lst +val -val) (let ((pos 0) (neg 0)) (dolist (x lst (list (* +val pos) (* -val neg))) (cond ((> x 0) (incf pos)) ((< x 0) (incf neg)))))) ;; main function (defun gen-acc/rit* (alist length rest) (loop while (not (equal (sum (abs! alist)) (sum (abs! (pos-neg alist length rest))))) collect (setf alist (loop for i in alist when (or (= i length) (= i rest)) collect i else collect (if (> i 0) (if (> i length) (- i 1) (+ i 1)) (if (< i rest) (+ i 1) (- i 1))))))) ;; example (length-list-plot (gen-length (gen-acc/rit* '(3 -11 2 -13 23 5 -5 17 -2) 7 -3) ;; list with pos and neg integers + endval pos + endval neg '1/12) :join-points t :point-radius 0 :style :fill)
May 7May 7 Author Well, I don’t need this specifically, but here’s a quick sketched example: you have a pattern, and if you set it a bit cleverly (the initial and end values), then it mutates into pulses and then into another pattern. Very simple.(length-list-plot (make-omn :length (length-staccato (gen-length (flatten (list (gen-repeat 3 '(11 2 17 9 13)) (gen-acc/rit '(11 2 17 9 13) 2) (reverse (gen-acc/rit '(8 5 10 10 5) 2)) (gen-repeat 5 '(8 5 10 10 5) ))) '1/64)) :pitch '(c4)) :point-radius 0 :join-points nil :style :fill)or...(length-list-plot (make-omn :length (gen-length (flatten (list (gen-repeat 3 '(11 7 5 3)) (gen-acc/rit '(11 7 5 3) 2) (reverse (gen-acc/rit '(5 7 11 17 23) 2)) (gen-repeat 5 '(5 7 11 17 23) ))) '1/64) :pitch '(c4)) :point-radius 0 :join-points nil :style :fill)as a starting TOCCATA 😂 .. and if you like... map it on/to your favorite scale(pitch-list-plot (make-omn :pitch (integer-to-pitch (reverse (flatten (gen-acc/rit '(1 2 3 1 5 7 11 3 13 3 17 23 7 11 7 5) 9)))) :length '(t) :span :pitch) :join-points t :style :fill)
Create an account or sign in to comment