Jump to content

Recommended Posts

Rose (pink) is in French the name of a color, a flower but also the name of a theoretical noise: the pink noise.

Other name for pink-noise is 1/f noise.

First, I define a 1/f function.

1/F-VALUE function is a modified version of 1-OVER-F function found in: 

Algorithmic Composition: A Gentle Introduction to Music Composition Using Common LISP and Common Music by Mary Simoni.

(defun 1/f-value (number min max)
  (do* ((counter 0 (incf counter))
        (blue (+ 1 (random max))
              (if (= counter 4)
                (+ 1 (random max)) blue))
        (green (+ 1 (random max))
               (if (or (= counter 2)
                       (= counter 4)
                       (= counter 6))
                 (+ 1 (random max)) green))
        (red (+ 1 (random max)) (+ 1 (random max)))
        (total (+ blue green red) (+ blue green red))
        (the-list (cons total ()) (cons total the-list)))
       ((= counter (- number 1)) (vector-round min max (reverse the-list)))))

 

Now, definition of a melody generator with pitch, length and velocity parameters taken from 1/F-VALUE function.

(defun gmel (lenmap nbvalp nbvalr min max amb velmin velmax restprob)
  (length-rest-weight
   restprob
   (make-omn
    :pitch (vector-to-pitch amb (1/f-value nbvalp min max))
    :length (vector-map lenmap (1/f-value nbvalr min max))
    :velocity (vector-to-velocity
               velmin velmax
               (vector-smooth 0.2 (1/f-value nbvalp min max))))))

 

Length parameters:

(setf lenmap1 '(1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/12 1/16))
(setf lenmap2 '(1/3 1/4 1/5 1/6 1/7 1/8 1/12 1/16))
(setf lenmap3 '(1/6 1/7 1/8 1/12 1/16))
(setf lenmap4 '(1/8 1/12 1/16))

 

Now, create some parts (p1 p2 etc..) with a repeated use of the gmel function with GEN-LOOP:

(setf p1 (gen-loop 12
          (gmel
           (apply-eval (rnd-pick '(lenmap1 lenmap2 lenmap3 lenmap4)))
           (rnd-pick '(64 12 32 24))
           (rnd-pick '(8))
           1
           (rnd-pick '(100 50 40 10))
           '(c4 c6) 'p 'ff '(3 1))))

 

(setf p2 (gen-loop 8
          (gmel
           (apply-eval (rnd-pick '(lenmap1)))
           (rnd-pick '(64 12 32 24))
           (rnd-pick '(8))
           1
           (rnd-pick '(100 50 40 10))
           '(c4 c6) 'p 'ff '(3 1))))

 

(setf p3 (gen-loop 12
          (gmel
           (apply-eval (rnd-pick '(lenmap1 lenmap2 lenmap3 lenmap4)))
           (rnd-pick '(64 12 32 24))
           (rnd-pick '(8 4 12))
           1
           (rnd-pick '(40 20 10))
           '(c4 c6) 'p 'ff '(3 1))))

 

(setf p4 (gen-loop 8
          (gmel
           (apply-eval (rnd-pick '(lenmap1 lenmap2 lenmap3 lenmap4)))
           (rnd-pick '(64 12 32 24))
           (rnd-pick '(8 4 12))
           1
           (rnd-pick '(100))
           '(c4 c6) 'p 'ff '(3 1))))

 

(setf p5 (gen-loop 12
          (gmel
           (apply-eval (rnd-pick '(lenmap1 lenmap2 lenmap3 lenmap4)))
           (rnd-pick '(64 12 32 24))
           (rnd-pick '(8))
           1
           (rnd-pick '(100 50 40 10))
           '(c4 c6) 'p 'ff '(3 1))))

 

(setf p6 (gen-loop 8
          (gmel
           (apply-eval (rnd-pick '(lenmap1)))
           (rnd-pick '(64 12 32 24))
           (rnd-pick '(8))
           1
           (rnd-pick '(100 50 40 10))
           '(c4 c6) 'p 'ff '(3 1))))

 

(setf p7 (gen-loop 12
          (gmel
           (apply-eval (rnd-pick '(lenmap1 lenmap2 lenmap3 lenmap4)))
           (rnd-pick '(64 1232 24))
           (rnd-pick '(8))
           1
           (rnd-pick '(100 50 40 10))
           '(c4 c6) 'p 'ff '(6 1))))

 

(setf p8 (gen-loop 12
          (gmel
           (apply-eval (rnd-pick '(lenmap1 lenmap2 lenmap3 lenmap4)))
           (rnd-pick '(64 12 32 24))
           (rnd-pick '(8))
           1
           (rnd-pick '(100 50 40 10))
           '(g5 c7) 'p 'ff '(2 1))))

 

(setf p9 (gen-loop 12
          (gmel
           (apply-eval (rnd-pick '(lenmap1 lenmap2 lenmap3 lenmap4)))
           (rnd-pick '(64 12 32 24))
           (rnd-pick '(8))
           1
           (rnd-pick '(100 50 40 10))
           '(c4 c6) 'p 'ff '(6 1))))

 

(setf p10 (gen-loop 12
           (gmel
            (apply-eval (rnd-pick '(lenmap1 lenmap2 lenmap3 lenmap4)))
            (rnd-pick '(64 12 32 24))
            (rnd-pick '(8))
            1
            (rnd-pick '(100 50 40 10))
            '(c4 c6) 'p 'ff '(3 1))))

 

(setf p11 (gen-loop 8
           (gmel
            (apply-eval (rnd-pick '(lenmap1)))
            (rnd-pick '(64 12 32 24))
            (rnd-pick '(8))
            1
            (rnd-pick '(100 50 40 10))
            '(c4 c6) 'p 'ff '(3 1))))

 

Assemble all the part into one piece

(setf full (assemble-seq p2 p1 p3 p4 p5 p6 p7 p8 p9 p10 p11))

 

Define a template (master-span) for time signatures

(setf master-span (rnd-sample (length full) '(1 2/4 3/4 4/4 5/4 6/8 9/8 7/4)))

 

Apply the template to the piece

(setf full-msp (length-span master-span full))

 

Score definition:

(def-score rose
           (:composer "S.Boussuge"
            :copyright "Copyright © 2014 S.Boussuge"
            :key-signature atonal
            :time-signature (get-time-signature full-msp)
            :tempo 138
            :layout (flute-layout 'flute))
  
  (flute :omn full-msp
         :channel 1
         :sound 'gm
         :program 'flute))

SB.

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.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy