Jump to content
Sign in to follow this  
AM

modify the pitch contour in a pitch-field

Recommended Posts

greetings

andré

;;; MODIFY THE PITCH CONTOUR inside a pitchfield or tonality
;;; please evaluate the example and have a look to the contours

;;; subfunction

(defun position-items (items alist)
  (loop 
    for item in items
    append (position-item item alist)))


;;; function

(defun compr/expand-melody (melody field &key (type 'add) (n 1) (shift 0))
  (let* ((ints (loop for i in  (difference 
                                (position-items (pitch-to-midi melody) 
                                                (pitch-to-midi field)))
                 collect (cond ((equal type 'add)
                                (cond ((<= i -1)
                                       (- i n))
                                      ((>= i 1)
                                       (+ i n))
                                      (t i)))

                               ((equal type 'fibonacci)
                                (cond ((>= i 1)
                                       (+ i (fibonacci i)))
                                      ((<= i -1)
                                       (- i (fibonacci (abs i))))
                                      (t i)))

                               ((equal type 'summativ)
                                (cond ((>= i 1)
                                       (+ i (+ i n)))
                                      ((<= i -1)
                                       (- i (+ (abs i) n)))
                                      (t i)))))))

    (position-filter
     (x+b (interval-to-integer ints :start (car  (position-items melody field))) shift)
     field)))



;;; expand 1a

(progn
  (setf seed (random 100))

  (pitch-list-plot
   (list
    

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n 1)

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n 2)

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n 3)

        (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n 5)
    
   (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1) :type :pitch) :seed seed))
   
   :join-points t))


;;; expand 1b => using shift (changed startposition)

(progn
  (setf seed (random 100))

  (pitch-list-plot
   (list
    

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n 1
                         :shift 1)

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n 2
                         :shift 2)

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n 3
                         :shift 3)

        (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n 5
                         :shift 4)
    
   (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1) :type :pitch) :seed seed))
   
   :join-points t))



;;; compress 

(progn
  (setf seed (random 100))

  (pitch-list-plot
   (list
    

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n -1)

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n -2)

        (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'add
                         :n -3)

    
   (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1) :type :pitch) :seed seed))
   
   :join-points t))



;;; expand 2 with fibonacci

(progn
  (setf seed (random 100))

  (pitch-list-plot
   (list
    
    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'fibonacci)
    
    (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1) :type :pitch) :seed seed))
   
   :join-points t))



;;; expand 3 summativ

(progn
  (setf seed (random 100))

  (pitch-list-plot
   (list
    

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'summativ
                         :n 1)

    (compr/expand-melody (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1)  :type :pitch) :seed seed) 
                         (gen-sieve '(c1 c9) '(2 1 1) :type :pitch)
                         :type 'summativ
                         :n 2)

    
   (rnd-sample 7 (gen-sieve '(c4 c5) '(2 1 1) :type :pitch) :seed seed))
   
   :join-points t))

 

 

some evaluations -> different melodic contours (rnd / in a sieve) and its expansions

 

Share this post


Link to post
Share on other sites

generate some examples...

 


;;; evaluate shift-cmd-e

(progn
  ;gen a sieve
  (setf sieve (gen-sieve '((c0 c5) (c3 c6) (c4 c8))
                        '((14 1 2) (5 5 1 2) (6 2 1))
                        :type :pitch))

  ; gen a line inside the sieve
  (setf sample (append (gen-rotate (random 8) 
                                   (pick-sample-from-center sieve (rnd-pick '(7 11))))
                     ))

  (pitch-list-plot
   (list
    ; gen modified loines with "compr/expand-melody"
    (setf line1 sample)

    (setf line2 (compr/expand-melody sample 
                                      sieve
                                      :type 'add
                                      :n 1
                                      :shift -5))

    (setf line3 (compr/expand-melody sample 
                                      sieve
                                      :type 'add
                                      :n 2
                                      :shift -8))

    (setf line4 (compr/expand-melody sample 
                                      sieve
                                      :type 'add
                                      :n 3
                                      :shift -11)))
   
   :join-points t)



  (setf chordseq (loop 
                   for i in line1
                   for j in line2
                   for k in line3
                   for l in line4
                   
                   append (chordize (list i j k l)))))




;;; ecvaluate with command2
(setf omn (list 's chordseq))
(setf omn (flatten (list 't line1 '-h 't line2 '-h 't line3 '-h 't line4)))

 

Share this post


Link to post
Share on other sites
Posted (edited)

perhaps you have some better ideas - ...perhaps with range/ambitus... sometimes in trouble - but i only use it for my current work, and so it's no problem 🙂

 

could be nice if you could do the add-system also with an external list input -> not fibonacci or primes or sum, but perhaps also with any integer or float list. so MODIFY-function could be done with any DATA...

 

and perhaps it could be also nice for LENGTH and DYNAMICS, i would like that (all-in-one)

Edited by AM
edited

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 opmo
      A new CIRCLE-PITCH-PLOT function (examples below) will be part of the forthcoming Opusmodus 1.3.
       
      The function CIRCLE-PIOTCH-PLOT returns a geometrical representation of relationships among the 12 pitch classes of the chromatic scale in pitch class space and provides an easy way to identify patterns and similarities between harmonic structures.
       
      Clockwise motion represents ascending pitch motion, and counterclockwise motion represents descending pitch motion.
       
      Examples:
       
      Major Triad
      (circle-pitch-plot '(c4e4g4))
       
      Minor Triad
      (circle-pitch-plot '(c4f4ab4))
       
      Augmented Triad
      (circle-pitch-plot '(c4e4gs4))
       
      All 4 augmented triads
      (circle-pitch-plot '(c4e4gs4 db4f4a4 d4fs4bb4 eb4g4b4))
       
       
      With :style :fill
      (circle-pitch-plot '(c4e4gs4 db4f4a4 d4fs4bb4 eb4g4b4) :style :fill)
       
      Example with chord names.
      Fully-Diminished 7th Chord
      (circle-pitch-plot 'dim7)
       
      All 3 fully-diminished 7th chords
      (circle-pitch-plot '((c4 dim7) (cs4 dim7) (d4 dim7)))
       
      Whole-Tone Scale
      (circle-pitch-plot '(0 2 4 6 8 10))
       
      The complex of 2 Whole-Tone Scale
      (circle-pitch-plot '((0 2 4 6 8 10) (1 3 5 7 9 11)) :style :fill)
       
      Chromatic Scale
      (circle-pitch-plot 'chromatic :point-radius 4)
       
      The complex of 6 tritones
      (circle-pitch-plot '((0 6) (1 7) (2 8) (3 9) (4 10) (5 11)) :point-radius 4)
       
      Tonalities
      (circle-pitch-plot 'mixolydian-greek :point-radius 4)
      (circle-pitch-plot 'bartok :point-radius 4)
      (circle-pitch-plot 'messiaen-mode3 :point-radius 4)
      (circle-pitch-plot 'hyojo :point-radius 4)
       
      Contrary Motion
      (circle-pitch-plot '(0 1 11 2 10 3 9 4 8 5 7 6)              :sort nil :join-first nil)
      (circle-pitch-plot '((0 1) (0 2) (0 3) (0 4) (0 5) (0 6)                (0 7) (0 8) (0 9) (0 10) (0 11)) :point-radius 4)
       
      Example with Forte notation
      (circle-pitch-plot '(6-32 6-7))
       
      Example with omn-form sequence and :type :pitches
       
      (circle-pitch-plot '(((leg s g2 p dbow+sul d3 sul b3 dig1 a3 b3 d3 b3 d3)                 (leg g2 d3 b3 a3 b3 d3 b3 d3)))              :type :pitches)  

       
      Circle types
      (circle-pitch-plot '((4 9 11) (3 5 10) (0 3 6 9)) :style :fill)
      (circle-pitch-plot '((4 9 11) (3 5 10) (0 3 6 9))              :type :pitches :style :fill)  

      (circle-pitch-plot '((4 9 11) (3 5 10) (0 3 6 9))              :type :fifths :style :fill)  

       
      Examples with :sort and :remove-duplicates set to nil
      (circle-pitch-plot '(0 2 6 0 3 7 0 4 8))
      (circle-pitch-plot '(0 2 6 0 3 7 0 4 8) :sort nil)
      (circle-pitch-plot '(0 2 6 0 3 7 0 4 8)              :sort nil :remove-duplicates nil)
      (circle-pitch-plot '(0 2 6 0 3 7 0 4 8)              :sort nil :remove-duplicates nil :join-first nil)  

      (circle-pitch-plot '(8 4 2 0 10 2 8 10 4 6 8)              :sort nil :remove-duplicates nil)
       
      Best wishes,
      Janusz
    • By AM
      hi all, i think a it's a beginner-question...
       
      in SIBELIUS i can write for microtonal things MIDI PITCH BEND MESSAGES to every note i want - or automatically by a plugin. in the score/above the note then it's written for example : ~B0,70 etc....
       
      (my PLAYER (conTimbre) works from SIBELIUS via VST) - now the question: how do i send such MIDI-pitch-bend-messages from OPUSMODUS? the opmo-tuning seems to work different and don't work with conTimbre-player...
       
      https://www.contimbre.com/en/
       
      thanx for any help
      andré
    • By AM
      works, but only for one-time-repetiton... could you use it?
       
      (defun merge-lengths-of-a-pitch-rep (omn-seq) (let* ((omn-seq (single-events omn-seq)) (l)) (flatten (loop repeat (length omn-seq) for cnt = 0 then (incf cnt) when (equal (omn :pitch (nth cnt omn-seq)) (omn :pitch (nth (1+ cnt) omn-seq))) do (progn (setf l (length-note-merge (append (omn :length (nth cnt omn-seq)) (omn :length (nth (1+ cnt) omn-seq))))) (incf cnt)) and collect (omn-replace :length l (nth cnt omn-seq)) else collect (nth cnt omn-seq))))) (merge-lengths-of-a-pitch-rep '(e c4 mf d4 d4 e4 f4 f4)) => (e c4 mf q d4 mf e e4 mf q f4 mf)  
×
×
  • Create New...