Posted February 6, 20214 yr dear all here's a function (revised, should work correct now) to work with rotations - based on the work of karel goeyvaerts (defun goeyvaerts-rotation* (&key pitches static-pitches generations goeyvaerts-transpose-interval (direction 'up) low-border high-border correction-interval) (let ((pitches (filter-remove (pitch-to-midi static-pitches) (pitch-to-midi pitches)))) (midi-to-pitch (append (list (append pitches (pitch-to-midi static-pitches))) (cond ((equal direction 'up) (loop repeat generations for x in (gen-repeat 50 goeyvaerts-transpose-interval) collect (append (setf pitches (append (loop for i in pitches when (> (+ i x) (pitch-to-midi high-border)) collect (+ x (- i (abs correction-interval))) else collect (+ i x)))) (pitch-to-midi static-pitches)))) ((equal direction 'down) (loop repeat generations for x in (gen-repeat 50 goeyvaerts-transpose-interval) collect (append (setf pitches (append (loop for i in pitches when (< (- i x) (pitch-to-midi low-border)) collect (+ i correction-interval) else collect (- i x)))) (pitch-to-midi static-pitches))))))))) EXAMPLE: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; an example with multiple objects inside a chord / GOEYVAERTS uses it woth octave-rotations and with static pitches ;;; here i do it different.... ;;; :goeyvaerts-transpose-interval => in every generation the elements are transposed by next interval (circular) ;;; :static-pitches => will not rotate!! ;;; :high-border => if a pitch is higher then this it will be transposed down by :correction-interval ;;; EVALUATE THIS (setf groups (loop for i in (goeyvaerts-rotation* :pitches '(b3 d4 eb4 gb4 f5 e5 g5 ab5 a4 bb4 db5 c6) :static-pitches nil;'(e4 eb5) :direction 'up :generations 20 :goeyvaerts-transpose-interval '(2 3 5 7 5 3) :low-border 'a2 :high-border 'eb6 :correction-interval -36) collect (gen-divide '(5 3 2 2) i))) ;;; AND THIS / cmd1 => so you see the chords an see the rotation etc.. (setf chordized-groups (loop for i in groups collect (chordize i))) => you see the process of the elements
Create an account or sign in to comment