Jump to content
Sign in to follow this  
AM

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)))

 

Share this post


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

Share this post


Link to post
Share on other sites

Could you explain more what you mean with seq-curve, low and high. Example could help or simply add the functionality to the function.

Share this post


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

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×