Jump to content

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é

 

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

 

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

 

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