AM Posted July 15, 2016 Share Posted July 15, 2016 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é opmo and Stephane Boussuge 2 Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted July 15, 2016 Share Posted July 15, 2016 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. Quote Link to comment Share on other sites More sharing options...
AM Posted July 15, 2016 Author Share Posted July 15, 2016 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) Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted July 15, 2016 Share Posted July 15, 2016 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 Quote Link to comment Share on other sites More sharing options...
AM Posted July 15, 2016 Author Share Posted July 15, 2016 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)) lviklund and opmo 2 Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted July 16, 2016 Share Posted July 16, 2016 Wonderful André ! Thank you very much. i will experiment with this stuff asap next week ! Stéphane Quote Link to comment Share on other sites More sharing options...
opmo Posted July 16, 2016 Share Posted July 16, 2016 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) Stephane Boussuge and lviklund 2 Quote Link to comment Share on other sites More sharing options...
opmo Posted July 16, 2016 Share Posted July 16, 2016 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)) lviklund, AM and Stephane Boussuge 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.