-
Posts
798 -
Joined
-
Last visited
Content Type
Forums
Events
Store
Video Gallery
Everything posted by AM
-
is there a possibilty to ONLY show INSIDE the LISTENER what i like to: some (print ....)-stuff ...and not all the "function-calls" like ..... ratio-to-msec rnd-pick :seed 990096 rnd1 :seed 858709 compress rnd1 :seed 223329 compress list-to-string ratio-to-msec ratio-to-msec ratio-to-msec prob :seed 115209 prob :seed 40751 stop-score-player score-player .... thanx for a hint andré
-
(defun interval-distance (alist n) (let ((alist (if (pitchp (car alist)) (pitch-to-midi alist) alist)) (n (if (pitchp n) (pitch-to-midi n) n))) (loop for i in alist collect (- i n)))) (interval-distance '(c4 d4 b2 e7) 'c4) => (0 2 -13 40) (interval-distance '(c4 d4) 'c4) => (0 2) (interval-distance '(43 44) '41) => (2 3) (interval-distance '(56 48 11) 'c4) => (-4 -12 -49)
-
you're welcome....
-
is this a solution? ...or some ideas to it... greetings andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun gen-resultant (r1 r2 &key (rhy 1/4)) (gen-length (difference (remove-duplicates (sort-asc (flatten (append (cons 0 (gen-accumulate r1)) (cons 0 (gen-accumulate r2))))))) rhy)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; example.... correct? (gen-resultant (primes-to 7) (reverse (primes-to 7))) ;;; another example (gen-resultant '(9) '(3 1 4)) (gen-resultant '(9) '(3 1 4) :rhy 1/16) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; n-version... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; for several layers (defun gen-resultant* (r &key (rhy 1/4)) (gen-length (difference (remove-duplicates (sort-asc (flatten (loop for i in r append (cons 0 (gen-accumulate i))))))) rhy)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; correct? (gen-resultant* '((16) (9) (3 1 4) (7))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; a version with length-input - but test it, correct...? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; for several layers / with direct rhythm-input (defun gen-resultant** (r) (difference (remove-duplicates (sort-asc (flatten (loop for i in r append (cons 0 (gen-accumulate i)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; correct? (gen-resultant** '((2/4 1/4 3/4) (1/16 3/16 2/12 1/12) (3/4 3/20 2/20))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
Tom Johnson / Pascal's Triangle Modulo Seven ... and more
AM replied to AM's topic in Function Examples
listen to the processes... (make-omn :pitch (integer-to-pitch (pascal-triangle 50 :johnson-modulo (1+ (random 23)))) :length '(t) :span :pitch) an example with parallel processes (chordized).. (setf chordlist (loop for i in (flatten (integer-to-pitch (pascal-triangle 20 :johnson-modulo (1+ (random 23))))) for j in (flatten (integer-to-pitch (pascal-triangle 20 :johnson-modulo (1+ (random 23))))) for k in (flatten (integer-to-pitch (pascal-triangle 20 :johnson-modulo (1+ (random 23))))) append (chordize (list i j k)))) (make-omn :pitch chordlist :length '(t) :span :pitch) -
here is a short program (based on JOHNSON's writing... pascal-code found in www and modified) to generate TOM JOHNSON's series of numbers for "pascal's triangle ...". maybe interesting to play with the MODULO like JOHNSON did (mod 7)... try it! greetings andré ;;; SUB (defun pascal-next-row (a &key (johnson-modulo nil)) (loop :for q :in a :and p = 0 :then q :as s = (if (null johnson-modulo) (list (+ p q)) (list (mod (+ p q) johnson-modulo))) :nconc s :into a :finally (rplacd s (list 1)) (return a))) ;;; MAIN (defun pascal-triangle (n &key (johnson-modulo nil)) (loop :for a = (list 1) :then (pascal-next-row a :johnson-modulo johnson-modulo) :repeat n :collect a)) ;;; => pascal-triangle (pascal-triangle 7) => ((1) (1 1) (1 2 1) (1 3 3 1) (1 4 6 4 1) (1 5 10 10 5 1) (1 6 15 20 15 6 1)) ;;; => pascal-triangle with MODULO like tom johnson in PASCAL'S TRIANGLE MODULO SEVEN (pascal-triangle 21 :johnson-modulo 7) => ((1) (1 1) (1 2 1) (1 3 3 1) (1 4 6 4 1) (1 5 3 3 5 1) (1 6 1 6 1 6 1) (1 0 0 0 0 0 0 1) (1 1 0 0 0 0 0 1 1) (1 2 1 0 0 0 0 1 2 1) (1 3 3 1 0 0 0 1 3 3 1) (1 4 6 4 1 0 0 1 4 6 4 1) (1 5 3 3 5 1 0 1 5 3 3 5 1) (1 6 1 6 1 6 1 1 6 1 6 1 6 1) (1 0 0 0 0 0 0 2 0 0 0 0 0 0 1) (1 1 0 0 0 0 0 2 2 0 0 0 0 0 1 1) (1 2 1 0 0 0 0 2 4 2 0 0 0 0 1 2 1) (1 3 3 1 0 0 0 2 6 6 2 0 0 0 1 3 3 1) (1 4 6 4 1 0 0 2 1 5 1 2 0 0 1 4 6 4 1) (1 5 3 3 5 1 0 2 3 6 6 3 2 0 1 5 3 3 5 1) (1 6 1 6 1 6 1 2 5 2 5 2 5 2 1 6 1 6 1 6 1)) ;;; look!! (list-plot (flatten (pascal-triangle 50 :johnson-modulo 7)) :point-radius 0 :style :fill) (list-plot (flatten (pascal-triangle 50 :johnson-modulo 11)) :point-radius 0 :style :fill) (list-plot (flatten (pascal-triangle 80 :johnson-modulo 17)) :point-radius 0 :style :fill) (list-plot (flatten (pascal-triangle 50 :johnson-modulo 3)) :point-radius 0 :style :fill) ;;; rnd-testing (list-plot (flatten (pascal-triangle 80 :johnson-modulo (1+ (random 23)))) :point-radius 0 :style :fill) Bildschirmvideo aufnehmen 2021-04-10 um 23.47.59.mov
-
lieber torsten, herzlichen dank! beste grüsse andré
-
yes, but i do not compose with OPMO - it's too strange with rhythm/instrumentation/notation. most of the time i'm sketching with OPMO and compose "by hand". guitar-scordatura: i thought i'd rather "pull the pitches out of MIDI/XML" and then convert them.. i will see... but, THANX! greetings andré could look like that (excerpt of a piece for solo trp - also with some SORT-ALGORITHMS inside (sketched/calculated with OPMO) works fine with SIBELIUS for layouting etc...
-
thanks, dear julio, i'll take a look at it, but depending on the situation, programming takes more time than doing it by hand
-
i am currently working on a piece for piano, guitar and drums. the guitar will have a "scordatura" so that i can do different harmonics and resonances than with the usual tunings. so that I can now make a more readable score, I would like to write the guitar part on two systems: one system as it sounds and one readable for the guitarist (because of the scordatura/fingerings)... it would be nice if we could do a FUNCTION which transforms the "sounding pitch part" (readable in score) into the "guitar-specific-part" (how to play for guitarist)...
-
dear julio i would code it! you could do a "systematic/formalized sketch" (not in LISP) and with that you would try to program a function best a.
-
here it is... but NOT microtonal. just for equal tempered tunings it was too complicated (and not necessary) for me to code it (with attributes and cents, it's a bit ... ), so i coded it just for my needs ... for equal tempered tunings... could use it for guitar/strings, just to have a list of your SCORDATURA-harmonics to work with. would be interesting if someone could CODE a function which transforms a "sounding-pitch-guitar-score" into the "play-score". so i wouldn't have to do it by hand... where are the guitar players here? julio? janusz? greetings andré (defun sort-to-pitch-events (events sort) (let* ((int (loop for i in events collect (list (pitch-to-integer (second i)) i))) (out (sortcar sort int))) (loop for i in out collect (second i)))) ;;----------------------------------------------------------------------------------- (defun gen-natural-harmonics (openstrings &key (scale nil) (n 16)) (progn (add-text-attributes '(str1 "str1") '(str2 "str2") '(str3 "str3") '(str4 "str4")'(str5 "str5") '(str6 "str6")) (let* ((cent-list (cents-to-attribute '(0 2 0 -14 2 -31 0 4 -14 -49 -2 41 -31 -12 0))) (harmonic (loop for i from 2 to n collect (compress (list 'num i)))) (harmonic-seq (loop for i in openstrings for j in (list 'str6 'str5 'str4 'str3 'str2 'str1) collect (make-omn :pitch (rest (harmonics i n)) :length '(q) :articulation (loop for i in cent-list for x in harmonic collect (if (equal i '-) (compress (list x '+ j)) (compress (list i '+ x '+ j)))) :span :pitch)))) (if (null scale) harmonic-seq (sort-to-pitch-events (single-events (flatten harmonic-seq)) '<))))) ;;----------------------------------------------------------------------------------- ;;----------------------------------------------------------------------------------- ;; attributes: string number + partial number + CENTS ;; sorted by strings (gen-natural-harmonics '(e1 a1 ds2 g2 a2 b2) :n 7) => ((q e2 num2+str6 b2 2c+num3+str6 e3 num4+str6 gs3 -14c+num5+str6 b3 2c+num6+str6 d4 -31c+num7+str6) (q a2 num2+str5 e3 2c+num3+str5 a3 num4+str5 cs4 -14c+num5+str5 e4 2c+num6+str5 g4 -31c+num7+str5) (q eb3 num2+str4 bb3 2c+num3+str4 eb4 num4+str4 g4 -14c+num5+str4 bb4 2c+num6+str4 cs5 -31c+num7+str4) (q g3 num2+str3 d4 2c+num3+str3 g4 num4+str3 b4 -14c+num5+str3 d5 2c+num6+str3 f5 -31c+num7+str3) (q a3 num2+str2 e4 2c+num3+str2 a4 num4+str2 cs5 -14c+num5+str2 e5 2c+num6+str2 g5 -31c+num7+str2) (q b3 num2+str1 fs4 2c+num3+str1 b4 num4+str1 eb5 -14c+num5+str1 fs5 2c+num6+str1 a5 -31c+num7+str1)) ;; sorted by pitch (gen-natural-harmonics '(e1 f1 a1 d2) :n 7 :scale t) => ((q e2 mf num2+str6) (q f2 mf num2+str5) (q a2 mf num2+str4) (q b2 mf 2c+num3+str6) (q c3 mf 2c+num3+str5) (q d3 mf num2+str3) (q e3 mf num4+str6) (q e3 mf 2c+num3+str4) (q f3 mf num4+str5) (q gs3 mf -14c+num5+str6) (q a3 mf -14c+num5+str5) (q a3 mf num4+str4) (q a3 mf 2c+num3+str3) (q b3 mf 2c+num6+str6) (q c4 mf 2c+num6+str5) (q cs4 mf -14c+num5+str4) (q d4 mf -31c+num7+str6) (q d4 mf num4+str3) (q eb4 mf -31c+num7+str5) (q e4 mf 2c+num6+str4) (q fs4 mf -14c+num5+str3) (q g4 mf -31c+num7+str4) (q a4 mf 2c+num6+str3) (q c5 mf -31c+num7+str3))
-
thank you, janusz... i will post the FUNCTION...
-
thanx! (i'm doing a little function to get all the natural harmonics for guitar tunings equal tempered or microtonal...)
-
hi all little question: i would like to SORT an (single-event)-list by pitch... and be able to keep the event-data "in the set" (=> the attribute-cents should be bound to pitch!) ((e e4 mf) (e a4 mf) (e d5 mf) (e g5 mf) (e b5 mf) (e d6 mf) (e b4 mf 2c) (e e5 mf 2c) (e a5 mf 2c) (e d6 mf 2c) (e fs6 mf 2c) (e a6 mf 2c) (e e5 mf) (e a5 mf) (e d6 mf) (e g6 mf) (e b6 mf) (e d7 mf) (e gs5 mf -14c) (e cs6 mf -14c) (e fs6 mf -14c) (e b6 mf -14c) (e eb7 mf -14c) (e fs7 mf -14c) (e b5 mf 2c) (e e6 mf 2c) (e a6 mf 2c) (e d7 mf 2c) (e fs7 mf 2c) (e a7 mf 2c) (e d6 mf -31c) (e g6 mf -31c) (e c7 mf -31c) (e f7 mf -31c) (e a7 mf -31c) (e c8 mf -31c) (e e6 mf) (e a6 mf) (e d7 mf) (e g7 mf) (e b7 mf) (e d8 mf)) any solutions? thanx! andré
-
GHOST INVISIBLE CHARACTER FOR SPAN and LIST Skipping Needed
AM replied to JulioHerrlein's topic in Function Examples
real LISP knowledge is very helpful for me. i think it's enough if you know (work with) the fundamentals - like... list/append/cons/loop/loop-inside-a-loop/progn/push/pop/collect/defun... ... so that you can code your specific solutions! greetings andré- 29 replies
-
- ways of skipping
- swallow
-
(and 2 more)
Tagged with:
-
have a look here...?
-
dear all here's a function (revised, should work correct now) to work with rotations - based on the work of karel goeyvaerts (defun goeyvaerts-rotation* (&key pitches static-pitches generations goeyvaerts-transpose-interval (direction 'up) low-border high-border correction-interval) (let ((pitches (filter-remove (pitch-to-midi static-pitches) (pitch-to-midi pitches)))) (midi-to-pitch (append (list (append pitches (pitch-to-midi static-pitches))) (cond ((equal direction 'up) (loop repeat generations for x in (gen-repeat 50 goeyvaerts-transpose-interval) collect (append (setf pitches (append (loop for i in pitches when (> (+ i x) (pitch-to-midi high-border)) collect (+ x (- i (abs correction-interval))) else collect (+ i x)))) (pitch-to-midi static-pitches)))) ((equal direction 'down) (loop repeat generations for x in (gen-repeat 50 goeyvaerts-transpose-interval) collect (append (setf pitches (append (loop for i in pitches when (< (- i x) (pitch-to-midi low-border)) collect (+ i correction-interval) else collect (- i x)))) (pitch-to-midi static-pitches))))))))) EXAMPLE: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; an example with multiple objects inside a chord / GOEYVAERTS uses it woth octave-rotations and with static pitches ;;; here i do it different.... ;;; :goeyvaerts-transpose-interval => in every generation the elements are transposed by next interval (circular) ;;; :static-pitches => will not rotate!! ;;; :high-border => if a pitch is higher then this it will be transposed down by :correction-interval ;;; EVALUATE THIS (setf groups (loop for i in (goeyvaerts-rotation* :pitches '(b3 d4 eb4 gb4 f5 e5 g5 ab5 a4 bb4 db5 c6) :static-pitches nil;'(e4 eb5) :direction 'up :generations 20 :goeyvaerts-transpose-interval '(2 3 5 7 5 3) :low-border 'a2 :high-border 'eb6 :correction-interval -36) collect (gen-divide '(5 3 2 2) i))) ;;; AND THIS / cmd1 => so you see the chords an see the rotation etc.. (setf chordized-groups (loop for i in groups collect (chordize i))) => you see the process of the elements
-
violà... now it works fine - OPMO could integrate it.... it's easier than i thought: a single index-series is read from the r-i and only this one is used! similar to LACHEMANN, only he determines this index-series himself (for that i coded this simple row-permutation-function)... greetings a. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SUB (defun row-permutation (n row rules &key (one-based nil)) (let* ((rules (if (equal one-based t) (mapcar '1- rules) rules))) (loop repeat n collect (setf row (position-filter rules row))))) ;;; MAIN (defun serie-proliferantes (n row) (let ((index-no (loop for x in (pitch-to-midi (pitch-invert (gen-retrograde row))) collect (or (position x (pitch-to-midi row)) (position (- x 12) (pitch-to-midi row)) (position (+ x 12) (pitch-to-midi row)))))) (list row (pitch-invert (gen-retrograde row)) (row-permutation n (pitch-invert (gen-retrograde row)) index-no)))) (serie-proliferantes 6 '(c5 ab4 g4 db5 e4 d4 bb4 eb4 b4 f4 fs4 a4)) => ((c5 ab4 g4 db5 e4 d4 bb4 eb4 b4 f4 fs4 a4) (a4 c5 cs5 g4 eb5 gs4 e5 d5 f4 b4 bb4 fs4) ((fs4 a4 g4 cs5 d5 c5 eb5 gs4 b4 f4 e5 bb4) (bb4 fs4 cs5 g4 gs4 a4 d5 c5 f4 b4 eb5 e5) (e5 bb4 g4 cs5 c5 fs4 gs4 a4 b4 f4 d5 eb5) (eb5 e5 cs5 g4 a4 bb4 c5 fs4 f4 b4 gs4 d5) (d5 eb5 g4 cs5 fs4 e5 a4 bb4 b4 f4 c5 gs4) (gs4 d5 cs5 g4 bb4 eb5 fs4 e5 f4 b4 a4 c5)))
-
row-permutation (with rule) for n-generations (defun row-permutation (n row rules &key (one-based nil)) (let ((rules (if (equal one-based t) (mapcar '1- rules) rules))) (loop repeat n collect (setf row (position-filter rules row))))) (row-permutation 5 '(a4 c5 cs5 g4 eb5 gs4 e5 d5 f4 b4 bb4 fs4) '(0 1 6 5 2 3 7 8 11 9 4 10)) => ((a4 gs4 eb5 c5 cs5 e5 d5 bb4 f4 g4 b4) (a4 e5 cs5 gs4 eb5 d5 bb4 b4 f4 c5 g4) (a4 d5 eb5 e5 cs5 bb4 b4 g4 f4 gs4 c5) (a4 bb4 cs5 d5 eb5 b4 g4 c5 f4 e5 gs4) (a4 b4 eb5 bb4 cs5 g4 c5 gs4 f4 d5 e5)) (row-permutation 5 '(a4 c5 cs5 g4 eb5 gs4 e5 d5 f4 b4 bb4 fs4) '(1 4 6 5 2 3 7 8 11 9 10 12) :one-based t) => ((a4 g4 gs4 eb5 c5 cs5 e5 d5 bb4 f4 b4 fs4) (a4 eb5 cs5 c5 g4 gs4 e5 d5 b4 bb4 f4 fs4) (a4 c5 gs4 g4 eb5 cs5 e5 d5 f4 b4 bb4 fs4) (a4 g4 cs5 eb5 c5 gs4 e5 d5 bb4 f4 b4 fs4) (a4 eb5 gs4 c5 g4 cs5 e5 d5 b4 bb4 f4 fs4))
-
thanks, julio... could you have a quick look to the function? and to the article from didier.... perhaps you see my mistake (or the mistake in the article) subito ? barraqué described the mechanism and it seems easy to code it. but where is the mistake with more then 3 gens? perhaps didier has an idea?