Jump to content

Recommended Posts

i'm sure that it would also work with tonality-map,

but i was interested to code a simple version for my own to understand all the things :-)

 

;;; i wanted to map every interval-sequence to every possible pitchfield...
;;; all the sequences are "centered" (i needed that for my project)
;;; with :base  you could move up and down the center
;;; :pitchfield has to be a OMN-pitch-sequence

;;; FUNCTION
(defun interval-projection-on-pitchfield (&key pitchfield intervals (base 0))
  (let ((integers (pitch-to-integer (interval-to-pitch intervals)))
        (base-0-integers)
        (centering)
        (pos))
    (setq base-0-integers (loop for i in integers 
                            collect (+ (abs (find-min integers)) i)))
    (setq centering (if (evenp (find-max base-0-integers)) ;; finds the center of the seq
                      (/ (find-max base-0-integers) 2)
                      (/ (1+ (find-max base-0-integers)) 2)))

    (loop for i in base-0-integers
      do (setq pos (+ i (* -1 centering) base)) ;; compensating center & base

      when (< pos 0) do (setq pos 0) ;; corr if intervals to big (+/-)
      when (> pos (1- (length pitchfield))) do (setq pos (1- (length pitchfield)))
      
      collect (nth pos pitchfield))))


;;; EXAMPLE
(interval-projection-on-pitchfield :pitchfield (append 
                                                (expand-tonality '(c4 messiaen-mode5)) 
                                                (expand-tonality '(c5 messiaen-mode5)) 
                                                (expand-tonality '(c6 messiaen-mode5)))
                                             
                                   :intervals  '(1 2 3 1 2 -4 -3 -2 3 5 7 -2)
                                   :base 12)

 

short question: is there a possibilty to build this

(append (expand-tonality '(c4 messiaen-mode5)) 
        (expand-tonality '(c5 messiaen-mode5)) 
        (expand-tonality '(c6 messiaen-mode5)))

with ONE function (i need more ambitus then 1 octave)...

 

thanx, andré

 

 

 

Link to comment
Share on other sites

Thank you for this very interesting function André.

 

I would love to have more easy way and tools for working with tonality on more than one octave.

 

This one is a very good one and can be very useful when working with pitchfields.

 

About your question, i don't know another way to construct your pitch field based on multiple expand-tonality into One function.

 

May be Janusz ?

 

anyway, i like very much your function.

 

Thanks again for sharing it.

 

SB.

Link to comment
Share on other sites

dear stephane

 

thanx to you! volià, here is a simple short code for this "problem"...

regards

andré

 

;;;FUNCTION

(defun multiple-expand-tonality (&key startpitch octaves tonality)
  (remove-duplicates ;remove is for "cutting" if there are too much pitches (OMN loops last octave!)
   (loop repeat octaves
     with pitch = startpitch
     append (expand-tonality (list pitch tonality))
     do (setq pitch (car (pitch-transpose 12 (list pitch)))))))

;;;EXAMPLE
(multiple-expand-tonality :startpitch 'c2 
                          :octaves 3 
                          :tonality 'messiaen-mode1)

 

Link to comment
Share on other sites

Perfect, thank you but would be useful be able to create a pitch-field based on multiple tonality like that:

 

(multiple-expand-tonality :startpitch 'c2 
                          :octaves 3 
                          :tonality '(messiaen-mode1 messiaen-mode3 messiaen-mode4))

but it is already very good like that.

 

Thank you very much.

 

Stéphane

 

Link to comment
Share on other sites

violà, i think this is what you are looking for...

(defun multiple-expand-tonality (&key startpitch octaves tonality)
  (remove-duplicates ;remove is for "cutting" if there are too much pitches (OMN loops last octave!)
   (loop repeat octaves
     with pitch = startpitch
     with cnt = 0 

     when (= cnt (length tonality))
     do (setq cnt 0)

     append (expand-tonality (list pitch (nth cnt tonality)))
     do (incf cnt)
     do (setq pitch (car (pitch-transpose 12 (list pitch)))))))
     

(multiple-expand-tonality :startpitch 'c2 
                          :octaves 6 
                          :tonality '(messiaen-mode1 messiaen-mode2 messiaen-mode3))

 

Link to comment
Share on other sites

Tonality can be any sequence:

(setf messiaen
      (append (expand-tonality '(c4 messiaen-mode1)) 
              (expand-tonality '(c5 messiaen-mode2))
              (expand-tonality '(c6 messiaen-mode3))))

(tonality-map '(messiaen :shift t)
'(c4 cs4 d4 eb4 e4 f4 fs4 g4 gs4 a4 bb4 b4 c5 cs5 d5 eb5))
=> (c4 d4 e4 fs4 gs4 bb4 c5 cs5 eb5 e5 fs5 g5 a5 bb5 c6 d6)

 

 

 

Link to comment
Share on other sites

Examples with newly added keyword :sort (the default is t):

;;; TEST
(setf mat '(c4 cs4 d4 ds4 e4 f4 fs4 g4 gs4 a4 bb4 b4 c5 cs5 d5))
(mapcar 'pitch-to-integer
        (list
         (tonality-map '((3 0 1 4 6 11 13) :root 3 :sort nil) mat)
         (tonality-map '((3 0 1 4 6 11 13) :root 3 :sort nil :shift t) mat)
         (tonality-map '((3 0 1 4 6 11 13) :root 3 :sort t :shift t) mat)
         (tonality-map '((3 0 1 4 6 11 13) :root 3 :sort nil :fixed t) mat)
         (tonality-map '((3 0 1 4 6 11 13) :root 3 :sort t :fixed t) mat)
         ))
=> ((3 4 4 6 6 6 11 11 11 12 13 13 15 16 16)
    (3 0 1 4 6 11 13 15 12 13 16 18 23 25 27)
    (3 4 6 7 9 14 16 15 16 18 19 21 26 28 27)
    (3 4 4 6 6 6 11 11 11 13 13 13 13 13 13)
    (3 4 4 6 7 7 9 9 9 14 14 14 16 16 16))

 

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