Jump to content

goeyvaerts-rotation


Recommended Posts

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

 

 

50686864_Bildschirmfoto2021-02-06um11_26_02.thumb.png.12ab5fda7919b2b8a5abaa3ab1ae3a2b.png

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy