Jump to content
Sign in to follow this  
AM

mapping integer?

Recommended Posts

hi all, 

 

what is the OPMO-function to map an integer-seq like (11 22 9 4 3 1 10 21 23 20 8 0 13 6 24 16 7 14 17 19 2 18 15 5 12) to a scale -> 0 has to be lowest pitch of the scale etc...

no problem to solve it via LISP-code, but what is the correct OPMO-function to map it on TONALITIES?

 

thanx

andré

 

Share this post


Link to post
Share on other sites

i coded a function now, that maps all integers to all TONALITIES, like i want it... 

SORTING OLIVIER's MODI and going crazy 🙂

 



;;; SUB

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


;;; MAIN

(defun integer-to-tonality (seq tonality &key (startpitch 'c4))
  (progn
    (if (not (pitchp (car tonality)))
      (setf tonality (multiple-expand-tonality :startpitch startpitch 
                                               :octaves 8 
                                               :tonality tonality))
      tonality)

    (loop for i in seq
      collect (nth i tonality))))




;;;;;;;;;;;;;



(setf seq (flatten (gen-sort  (rnd-order (gen-integer 24) :seed 49) :type 'selection)))

(def-score example-score
           (:key-signature 'atonal
                           :time-signature '(4 4)
                           :tempo 90
                           :layout (piano-solo-layout 'rhand 'lhand))
  

  (rhand :omn (make-omn :pitch (integer-to-tonality seq 
                                                    '(messiaen-mode4 
                                                      messiaen-mode5 
                                                      messiaen-mode6)
                                                    :startpitch 'c4)

                        :length (gen-repeat (length seq) 't)))


  (lhand :omn (make-omn :pitch (integer-to-tonality (x+b seq 3) ; transp integer-seq
                                                    '(messiaen-mode3 
                                                      messiaen-mode1 
                                                      messiaen-mode2)
                                                    :startpitch 'c2)

                        :length (gen-repeat (length seq) 't))))

 

Share this post


Link to post
Share on other sites

thanks stephane! it seems that's the function i was looking for 😎 ... but not exaxtly... seems not to work "with integers larger then highest scale-pitch" (only in 1 octave?)

 

 (vector-map (expand-tonality '(c4 messiaen-mode5)) '(0 12 13 14 1 2 3 4 2 1 5 3 1))
=> (c4 g4 b4 b4 c4 cs4 cs4 cs4 cs4 c4 f4 cs4 c4)

 

with my function - the whole range possible, also with "mixed" toanlities

 

(setf seq (flatten (gen-sort (rnd-order (gen-integer 24) :seed 49) :type 'selection)))

(integer-to-tonality seq '(messiaen-mode4 
                           messiaen-mode5 
                           messiaen-mode6)
                           :startpitch 'c4)

=> (fs5 c7 cs5 fs4 f4 cs4 f5 b6 cs7 as6 c5 c4 b5 gs4 d7 e6 b4 c6 f6 gs6 d4 fs6 d6 g4 g5 c4 c7 cs5 fs4 f4 cs4 f5 b6 cs7 as6 c5 fs5 b5 gs4 d7 e6 b4 c6 f6 gs6 d4 fs6 d6 g4 g5 c4 cs4 cs5 fs4 f4 c7 f5 b6 cs7 as6 c5 fs5 b5 gs4 d7 e6 b4 c6 f6 gs6 d4 fs6 d6 g4 g5 c4 cs4 d4 fs4 f4 c7 f5 b6 cs7 as6 c5 fs5 b5 gs4 d7 e6 b4 c6 f6 gs6 cs5 fs6 d6 g4 g5 c4 cs4 d4 f4 fs4 c7 f5 b6 cs7 as6 c5 fs5 b5 gs4 d7 e6 b4 c6 f6 gs6 cs5 fs6 d6 g4 g5 c4 cs4 d4 f4 fs4 g4 f5 b6 cs7 as6 c5 fs5 b5 gs4 d7 e6 b4 c6 f6 gs6 cs5 fs6 d6 c7 g5 c4 cs4 d4 f4 fs4 g4 gs4 b6 cs7 as6 c5 fs5 b5 f5 d7 e6 b4 c6 f6 gs6 cs5 fs6 d6 c7 g5 c4 cs4 d4 f4 fs4 g4 gs4 b4 cs7 as6 c5 fs5 b5 f5 d7 e6 b6 c6 f6 gs6 cs5 fs6 d6 c7 g5 c4 cs4 d4 f4 fs4 g4 gs4 b4 c5 as6 cs7 fs5 b5 f5 d7 e6 b6 c6 f6 gs6 cs5 fs6 d6 c7 g5 c4 cs4 d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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  

×