Jump to content
Sign in to follow this  
AM

shift-length-proportions / morph

Recommended Posts

shift-length-proportions 

 

a bit like gen-morph for LENGTHS. every item of a length-list will change linear till the endpattern is reached.

 

 


;;; subfunction

(defun compare (start end &key (step 1/32))
  (list (loop 
          for i in start
          for j in end
          
          when (/= i j)
          collect (if (> i 0)
                    (if (< i j)
                      (+ i step)
                      (- i step))
                    (if (> i j)
                      (- i step)
                      (+ i step)))
                    
          else collect i)
        end))


;;; mainfunction

(defun shift-length-proportions (start end &key (step 1/32) (rnd-pick nil))
  (let ((seq))
    (progn 
      (setf seq
            (progn 
              (setf start (omn :length start)
                    end (omn :length end))
              (append (list start)
                      (loop until (equal start end)
                        collect (setf start (car (compare start end :step step)))))))
  (if (or (null rnd-pick) (equal rnd-pick 'all))
    seq
    (rnd-sample rnd-pick seq)))))
  

;;; EXAMPLES

(shift-length-proportions '(1/32 7/32 1/16 3/16 1/4 -1/2) '(1/16 1/16 1/16 1/16 1/16 -1/2) :step 1/32)
(shift-length-proportions '(1/16 1/16 1/16 1/16 1/16 -1/2) '(1/16 7/32 1/16 3/16 1/4 -1/2)  :step 1/32)


(shift-length-proportions '(1/32 7/32 1/16 3/16 1/4 -1/2) '(1/16 1/16 1/16 1/16 1/16 -1/2) :step 1/32 :rnd-pick 3)
(shift-length-proportions '(1/32 7/32 1/16 3/16 1/4 -1/2) '(1/16 1/16 1/16 1/16 1/16 -1/2) :step 1/32 :rnd-pick 4)
(shift-length-proportions '(e q h e.. s -h) '(q q q q q -h) :step 1/32 :rnd-pick 3)


 

Share this post


Link to post
Share on other sites

Note to all. Please add to your examples the results of the expressions. This will help to understand the idea on the spot :-) 

Share this post


Link to post
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.

Sign in to follow this  

  • Similar Topics

    • By AM
      greetings
      andré
       
      p.s. it's the PITCH-version of "shift-length-proportions", i've worked with these things a long time ago... in COMMON MUSIC 🙂
       
       
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; a function which transforms a pattern (each pitch linearly and independent) to another pattern ;;;; by interval "STEP" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SUBFUNCTION (defun compare (start end &key (step 1)) (list (loop for i in start for j in end when (/= i j) collect (if (> i 0) (if (< i j) (+ i step) (- i step)) (if (> i j) (- i step) (+ i step))) else collect i) end)) ;;; MAIN (defun morph* (start end &key (step 1)) (progn (setf start (pitch-to-midi start) end (pitch-to-midi end)) (midi-to-pitch (append (list start) (loop until (equal start end) collect (setf start (car (compare start end :step step)))))))) (morph* (rnd-order '(c7 cs2)) '(e5 eb5)) => ((cs2 c7) (d2 b6) (eb2 bb6) (e2 a6) (f2 gs6) (fs2 g6) (g2 fs6) (gs2 f6) (a2 e6) (bb2 eb6) (b2 d6) (c3 cs6) (cs3 c6) (d3 b5) (eb3 bb5) (e3 a5) (f3 gs5) (fs3 g5) (g3 fs5) (gs3 f5) (a3 e5) (bb3 eb5) (b3 eb5) (c4 eb5) (cs4 eb5) (d4 eb5) (eb4 eb5) (e4 eb5) (f4 eb5) (fs4 eb5) (g4 eb5) (gs4 eb5) (a4 eb5) (bb4 eb5) (b4 eb5) (c5 eb5) (cs5 eb5) (d5 eb5) (eb5 eb5) (e5 eb5)) (morph* (rnd-order '(c4 cs4 d4 ds4)) '(e5 eb5 d5 cs5)) => ((c4 eb4 cs4 d4) (cs4 e4 d4 eb4) (d4 f4 eb4 e4) (eb4 fs4 e4 f4) (e4 g4 f4 fs4) (f4 gs4 fs4 g4) (fs4 a4 g4 gs4) (g4 bb4 gs4 a4) (gs4 b4 a4 bb4) (a4 c5 bb4 b4) (bb4 cs5 b4 c5) (b4 d5 c5 cs5) (c5 eb5 cs5 cs5) (cs5 eb5 d5 cs5) (d5 eb5 d5 cs5) (eb5 eb5 d5 cs5) (e5 eb5 d5 cs5)) (morph* (rnd-order '(c7 cs2 d4 ds6)) '(e5 eb5 d5 cs5)) => ((eb6 cs2 d4 c7) (d6 d2 eb4 b6) (cs6 eb2 e4 bb6) (c6 e2 f4 a6) (b5 f2 fs4 gs6) (bb5 fs2 g4 g6) (a5 g2 gs4 fs6) (gs5 gs2 a4 f6) (g5 a2 bb4 e6) (fs5 bb2 b4 eb6) (f5 b2 c5 d6) (e5 c3 cs5 cs6) (e5 cs3 d5 c6) (e5 d3 d5 b5) (e5 eb3 d5 bb5) (e5 e3 d5 a5) (e5 f3 d5 gs5) (e5 fs3 d5 g5) (e5 g3 d5 fs5) (e5 gs3 d5 f5) (e5 a3 d5 e5) (e5 bb3 d5 eb5) (e5 b3 d5 d5) (e5 c4 d5 cs5) (e5 cs4 d5 cs5) (e5 d4 d5 cs5) (e5 eb4 d5 cs5) (e5 e4 d5 cs5) (e5 f4 d5 cs5) (e5 fs4 d5 cs5) (e5 g4 d5 cs5) (e5 gs4 d5 cs5) (e5 a4 d5 cs5) (e5 bb4 d5 cs5) (e5 b4 d5 cs5) (e5 c5 d5 cs5) (e5 cs5 d5 cs5) (e5 d5 d5 cs5) (e5 eb5 d5 cs5))  
      added 2 minutes later think about: could be interesting when we could map it on a SCALE... so we should /could extract the STEPS between ... and map it on whatever!! this would make sense, beause it has not to be chromatic then, could be used on all "tonalities" or systems...
×
×
  • Create New...