Jump to content

vector-range-drift


Recommended Posts

(defun vector-range-drift (start end input &key (spread 8))
  (let ((values (gen-divide (rnd-sum (length input) (primes spread)) input))
        (n-values)
        (a-step)
        (b-step))

    (progn
      (setf n-values (1- (length values)))
      (setf a-step (/ (car (difference (list (car start) (car end)))) n-values))
      (setf b-step (/ (car (difference (list (cadr start) (cadr end)))) n-values))

      (loop for i in values
        for a = (car start) then (incf a a-step)
        for b = (cadr start) then (incf b b-step)
        append (vector-range a b i)))))
 



;;;;; EXAMPLES -> MODULATE/DRIFT white-noise - with different spreads

(list-plot
 (vector-range-drift '(-7.1 1) '(-0.1 10)
                                (gen-white-noise 187)
                                :spread 10))

(list-plot
 (vector-range-drift '(-7.1 1) '(-0.1 10)
                                (gen-white-noise 187)
                                :spread 6))



(list-plot
 (vector-range-drift '(-7.1 1) '(-0.1 5.6)
                     (gen-white-noise 517)))

(list-plot
 (vector-range-drift '(-1.1 1) '(-3.1 5.6)
                                (gen-white-noise 317)))

 

Link to comment
Share on other sites

perhaps you could expand the function when we could not only have "start->end-process/linear", also with a seq-curve (two) for LOW and HIGH values... would be very smart. so it's a kind of ambitus-modulation (with perhaps white-noise)

Link to comment
Share on other sites

INPUT-curves could be like that: (in that way you could imitate some early "xenakis-curves" when you map it to pitches :-))

 

(setf curve1 '(-5.1 -2.3 -1.1 -0.8 -0.3 -2.5))
(setf curve2 '(1.0 1.2 1.5 2.1 4.6 10.6))

 

(vector-range-drift curve1 curve2 (gen-white-noise 250))
		

 

as result:

 

screen.jpeg

 

 

 

"imitated" by my old/simple function:

 

(list-plot
 (append
  (vector-range-drift '(-5.1 1) '(-2.3 1.2)
                      (gen-white-noise 50))
  (vector-range-drift '(-2.3 1.2) '(-1.1 1.5)
                      (gen-white-noise 50))
  (vector-range-drift '(-1.1 1.5) '(-0.8 2.1)
                      (gen-white-noise 50))
  (vector-range-drift '(-0.8 2.1) '(-0.3 4.6)
                      (gen-white-noise 50))
  (vector-range-drift '(-0.3 4.6) '(-2.5 10.6)
                      (gen-white-noise 50))))

 

 

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