Jump to content

AM

Members
  • Content count

    407
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by AM

  1. ...how ti filter all "unused/complementary" pitches inside a sieve (if you like to extend the function... could be interesting if it works also with chords) (defun neg-sieve (pitchlist) (let ((pitchlist (pitch-to-midi pitchlist))) (midi-to-pitch (loop for i from (car pitchlist) to (car (last pitchlist)) when (null (member i pitchlist)) collect i)))) (setf sieve '(fs3 g3 as3 b3 c4 cs4 ds4 e4 f4 gs4 a4 d5 eb5 fs5 g5 gs5 bb5 b5 c6 cs6 e6 f6)) (neg-sieve sieve) => (gs3 a3 d4 fs4 g4 bb4 b4 c5 cs5 e5 f5 a5 d6 eb6) (neg-sieve '(c4 d4 e4 fs4 gs4 as4 c5)) => (cs4 eb4 f4 g4 a4 b4)
  2. is there a possibility to filter some "combinations"? when i have a seq like that: (a4 gs4 a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4) i want to filter all immediate repetitions with pattern-length = 2 the result would be: (a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4) because a4-gs4 is the pair that repeats
  3. i think it's better when it's seperate. keep the function/process as simple and clear as possible?
  4. yes, that's it!! already part of the system?
  5. AM

    Opusmodus 1.2.23428

    vector functions -> welcome to stochastic music... who codes an "early-xenakis"-bot? 😂
  6. complementation to OR/AND/NOT! i hope everything is correct... https://de.wikipedia.org/wiki/Logikgatter (defun nand (&rest rest) (flet ((every-truep (x) (equal x t))) (not (every #'every-truep rest)))) (nand nil nil nil) => t (nand t t t t t t) => nil (nand nil t t t nil t) => t ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun nor (&rest rest) (contain-itemp 'nil rest)) (nor t t t t) => nil (nor nil t nil) => t (nor t nil nil nil) => t ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun xor (&rest rest) (oddp (car (count-item t rest)))) (xor t nil t t nil nil nil) => t (xor t t nil) => nil (xor nil t) => t ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun xnor (&rest rest) (evenp (car (count-item t rest)))) (xnor t nil t t nil nil nil) => nil (xnor t t nil) => t (xnor nil t) => nil (xnor t nil t t nil nil t nil) => t ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7. hi all i would like to code a NAND gate with more then two input-items (as extension to AND etc...). here is a simple version of the NAND function with two inputs, but i don't know how to exapnd it to n-inputs without putting the the inputs to in a list (like lisp-internal AND / OR)... https://en.wikipedia.org/wiki/NAND_gate i dont't want it: (nand '(t t t nil)) but like to have (nand t nil nil t t t) when i get a solution for that i will code an XOR, NOR etc.... so the "problem" is: how to manage in DEFUN more then two inputs (don't work with &optional, i think) i tried it and failed)... any ideas, lisp-nerds? 🙂 thanx! andré ;;; easy with a specific number of input-items - that works! (defun nand (a b) (not (and a b))) (nand t t) => nil (nand nil nil) => t (nand nil t) => t ;;; i like to have an input perhaps like that - with any number of input-items, like lisp's AND / OR (nand t t t t) (nand nil t t t nil t t t nil) ...
  8. (defun vector-range-drift (start end input &key (spread 8)) (let ((values (gen-divide (rnd-sum (length input) (primes spread)) input)) (n-values) (a-step) (b-step)) (progn (setf n-values (1- (length values))) (setf a-step (/ (car (difference (list (car start) (car end)))) n-values)) (setf b-step (/ (car (difference (list (cadr start) (cadr end)))) n-values)) (loop for i in values for a = (car start) then (incf a a-step) for b = (cadr start) then (incf b b-step) append (vector-range a b i))))) ;;;;; EXAMPLES -> MODULATE/DRIFT white-noise - with different spreads (list-plot (vector-range-drift '(-7.1 1) '(-0.1 10) (gen-white-noise 187) :spread 10)) (list-plot (vector-range-drift '(-7.1 1) '(-0.1 10) (gen-white-noise 187) :spread 6)) (list-plot (vector-range-drift '(-7.1 1) '(-0.1 5.6) (gen-white-noise 517))) (list-plot (vector-range-drift '(-1.1 1) '(-3.1 5.6) (gen-white-noise 317)))
  9. exactly... thanks for the solution! i will try to CODE some XOR, NOR.... based on it! i was in trouble with the "input-format" (when it's not a list) 🤔
  10. AM

    vector-range-drift

    INPUT-curves could be like that: (in that way you could imitate some early "xenakis-curves" when you map it to pitches :-)) (setf curve1 '(-5.1 -2.3 -1.1 -0.8 -0.3 -2.5)) (setf curve2 '(1.0 1.2 1.5 2.1 4.6 10.6)) (vector-range-drift curve1 curve2 (gen-white-noise 250)) as result: "imitated" by my old/simple function: (list-plot (append (vector-range-drift '(-5.1 1) '(-2.3 1.2) (gen-white-noise 50)) (vector-range-drift '(-2.3 1.2) '(-1.1 1.5) (gen-white-noise 50)) (vector-range-drift '(-1.1 1.5) '(-0.8 2.1) (gen-white-noise 50)) (vector-range-drift '(-0.8 2.1) '(-0.3 4.6) (gen-white-noise 50)) (vector-range-drift '(-0.3 4.6) '(-2.5 10.6) (gen-white-noise 50))))
  11. AM

    vector-range-drift

    perhaps you could expand the function when we could not only have "start->end-process/linear", also with a seq-curve (two) for LOW and HIGH values... would be very smart. so it's a kind of ambitus-modulation (with perhaps white-noise)
  12. AM

    find-intervals*

    function edited - some small changes... extended: :intervals '(1 2 3) -> all these interval-combinations are shown or :intervals 2 (like before) new: :reduced-interval T or NIL (default NIL) -> when T only basic-intervals search (not 1 = 1 & 13 & 25, only in ONE octave) small example ;;; SIEVE with SYMM_STRUCTURE (setf sieve1 (pitch-transpose -6 (integer-to-pitch (gen-sieve '((0 39) (0 40)) '((5) (7)))))) (pitch-to-interval sieve1) ;;; search/permutate interval-combinations (setf pitchlist (find-intervals* sieve1 :intervals '(1 2 3) :reduced-interval t :chord nil)) (setf pitchlist (rnd-unique (length pitchlist) pitchlist)) ;;; change direction of the interval-pairs (setf pitchlist (loop for i in pitchlist when (prob? 0.4) collect (reverse i) else collect i)) ;;; remove immediate repetitions (setf pitchlist (filter-repeat 1 (flatten pitchlist))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (def-score sieve-scan (:title "sieve-scan" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (make-omn :pitch pitchlist :length '(t) :velocity '(p) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  13. i coded it to analyze a pitchfield ;;; a function witch filters/shows you all pitch-combinations by INTERVAL-SIZE ;;; from 1 to 11 ("octave-independent") ;;; for example you are interested to see all FIFTH-combinations in a SIEVE ;;; or to LIST all resulting/ordered intervals (defun equal/or (n alist) (car (loop for i in alist when (equal i n) collect 't))) ;;; FUNCTION (defun find-intervals* (pitch-seq &key (intervals 'all) (chord nil) (reduced-interval nil)) (let ((combs (combination 2 pitch-seq)) (ints) (int) (all-comb-pitches-intervals)) (progn (setf ints (loop for i in combs do (setf int (car (pitch-to-interval i))) when (>= int 0) collect (cond ((and (>= int 12) (<= int 24) (equal reduced-interval nil)) (- int 12)) ((and (>= int 24) (equal reduced-interval nil)) (- int 24)) (t int)))) (setf all-comb-pitches-intervals (loop for i from 1 upto 11 append (loop for j in (loop for x in combs for y in ints collect (cons y x)) when (= (car j) i) collect j))) (if (equal intervals 'all+int) all-comb-pitches-intervals (if (equal intervals 'all) (loop for i in all-comb-pitches-intervals when (equal chord t) collect (chordize (rest i)) else collect (rest i)) (loop for i in all-comb-pitches-intervals when (if (listp intervals) (equal/or (car i) intervals) (= (car i) intervals)); when (= (car i) intervals) collect (if (equal chord t) (chordize (rest i)) (rest i)))))))) ;;; EXAMPLES (find-intervals* (gen-sieve '(c3 g7) '(3 1 5) :type :pitch) :intervals '(1 5 7) ;; as list :reduced-interval t ;; -> only on/in the same octave :chord nil) (find-intervals* (gen-sieve '(c3 g7) '(3 1 5) :type :pitch) :intervals '(1 3 7) :chord t) (find-intervals* (gen-sieve '(c3 g7) '(3 1 5) :type :pitch) :intervals 'all :chord t) (find-intervals* (gen-sieve '(c3 g7) '(3 1 5) :type :pitch) :intervals 2 :chord t) (find-intervals* (gen-sieve '(c3 g7) '(3 1 5) :type :pitch) :intervals 3) (find-intervals* (gen-sieve '(c3 g7) '(3 1 5) :type :pitch) :intervals 5) (find-intervals* (gen-sieve '(c3 g7) '(3 1 5) :type :pitch) :intervals 7) (find-intervals* (gen-sieve '(c3 g7) '(3 1 5) :type :pitch) :intervals 'all) other example -> cmd3 (setf seq (gen-sieve '(f3 fs6) '(4 2 1 1 1 2 4 7) :type :pitch)) ;(setf seq (gen-sieve '(f3 fs6) '(7 4 2 1 1 1 2 4) :type :pitch)) ;(setf seq '(gs3 cs4 ds4 g4 a4 b4 d5 e5 fs5 bb5 c6 f6)) (append (find-intervals* seq :intervals 1 :chord t) (find-intervals* seq :intervals 2 :chord t) (find-intervals* seq :intervals 5 :chord t) (find-intervals* seq :intervals 6 :chord t) (find-intervals* seq :intervals 8 :chord t)) (find-intervals* seq :intervals 'all :chord t) ;;; with interval-sizes in output-format (find-intervals* seq :intervals 'all+int) => ((1 a3 bb5) (1 b3 c4) (1 b3 c6) (1 c4 cs4) (1 cs4 d4) (1 cs4 d6) (1 d4 eb5) (1 gs4 a5) (1 a5 bb5) (1 bb5 b5) (1 b5 c6) (2 f3 g5) (2 a3 b3) (2 a3 b5) (2 b3 cs4) (2 c4 d4) (2 c4 d6) (2 cs4 eb5) (2 d4 e4) (2 e4 fs6) (2 gs4 bb5) (2 g5 a5) (2 a5 b5) (2 bb5 c6) (2 c6 d6) (3 f3 gs4) (3 a3 c4) (3 a3 c6) (3 b3 d4) (3 b3 d6) (3 c4 eb5) (3 cs4 e4) (3 e4 g5) (3 gs4 b5) (3 eb5 fs6) (3 g5 bb5) (3 a5 c6) (3 b5 d6) (4 f3 a3) (4 f3 a5) (4 a3 cs4) (4 b3 eb5) (4 c4 e4) (4 d4 fs6) (4 e4 gs4) (4 gs4 c6) (4 eb5 g5) (4 g5 b5) (4 bb5 d6) (4 d6 fs6) (5 f3 bb5) (5 a3 d4) (5 a3 d6) (5 b3 e4) (5 cs4 fs6) (5 d4 g5) (5 e4 a5) (5 g5 c6) (5 a5 d6) (6 f3 b3) (6 f3 b5) (6 a3 eb5) (6 c4 fs6) (6 cs4 g5) (6 d4 gs4) (6 e4 bb5) (6 gs4 d6) (6 eb5 a5) (6 c6 fs6) (7 f3 c4) (7 f3 c6) (7 a3 e4) (7 b3 fs6) (7 c4 g5) (7 cs4 gs4) (7 d4 a5) (7 e4 b5) (7 gs4 eb5) (7 eb5 bb5) (7 g5 d6) (7 b5 fs6) (8 f3 cs4) (8 b3 g5) (8 c4 gs4) (8 cs4 a5) (8 d4 bb5) (8 e4 c6) (8 eb5 b5) (8 bb5 fs6) (9 f3 d4) (9 f3 d6) (9 a3 fs6) (9 b3 gs4) (9 c4 a5) (9 cs4 bb5) (9 d4 b5) (9 eb5 c6) (9 a5 fs6) (10 f3 eb5) (10 a3 g5) (10 b3 a5) (10 c4 bb5) (10 cs4 b5) (10 d4 c6) (10 e4 d6) (10 gs4 fs6) (11 f3 e4) (11 a3 gs4) (11 b3 bb5) (11 c4 b5) (11 cs4 c6) (11 e4 eb5) (11 gs4 g5) (11 eb5 d6) (11 g5 fs6)) perhaps OPMO could extend it to an omn-format-FILTER - so that all other pitches (not matched pitches/sets) would be repaced by rests? would be interesting to work like that with pitchfields/sieves. so you could choose ...for example: "want to have all FIFTHS including a pitch like C or Eb or Gs (octave independent)...?
  14. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; rnd-walk in a pitchfield - with interval-control ;;; ;;; this is a little function which does an rnd-walk in a special way ;;; the function is checking all possible interval-pairs first inside the pitchfield ;;; so that is on one hand all the time "inside" the pitchfield/sieve, but also only ;;; uses the :POSSIBLE-INTERVALS, so you could control the "interval-color" of the walk ;;; in an non-chromatic-pitchfield/sieve ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun enlarge-intervals (possible-intervals &key (octaves 2)) (let ((possible-intervals (append possible-intervals (loop repeat octaves for i = 12 then (incf i 12) append (x+b possible-intervals i))))) (append possible-intervals (neg! possible-intervals)))) ;(enlarge-intervals '(2 3 4)) ;;;;;;;;;;; (defun special-rnd-walk (n &key pitchfield startpitch possible-intervals (interval-octaves 2)) (let ((int-list (loop for i in pitchfield collect (list (pitch-to-midi i) (loop for x in pitchfield with int do (setf int (car (pitch-to-interval (list i x)))) when (/= int 0) collect int)))) (possible-intervals (enlarge-intervals possible-intervals :octaves interval-octaves))) (append (list startpitch) (midi-to-pitch (loop repeat n with int with pitch = (pitch-to-midi startpitch) do (setf int (rnd-pick (filter-preserve possible-intervals (cadr (assoc pitch int-list))))) when (null int) do (setf int (rnd-pick (cadr (assoc pitch int-list)))) collect (setf pitch (pitch-to-midi (cadr (interval-to-pitch (list int) :start (midi-to-pitch pitch)))))))))) ;;;;;;;;;;; EXAMPLES ;;; rnd-walk in a "chromatic-field" - as the most easiest example/way ;;; => so all possible-intervals could be used -> THE ORDINARY WAY... (special-rnd-walk 20 :startpitch 'cs4 :pitchfield '(gs3 a3 bb3 b3 c4 cs4 d4 ds4 e4 f4 fs4 g4 gs4 a4) :possible-intervals '(1 2 3)) ;;; BUT have a look to the next examples!!! ;;; rnd-walk in a PITCHFIELD -> the function is checking all possible interval-pairs inside the pitchfield ;;; so that the rnd-walk INSIDE the PITCHFIELD could be done with specific intervals (if they are inside the field) ;;; COMPARE THE RESULT with the PITCHFIELD!!! ;;; (setf pitchfield '(gs3 cs4 ds4 g4 a4 b4 d5 e5 fs5 bb5 c6 f6)) ;;; "interval-color" of the walk is made with :possible-intervals (special-rnd-walk 5 :startpitch 'ds4 :pitchfield '(gs3 cs4 ds4 g4 a4 b4 d5 e5 fs5 bb5 c6 f6) :possible-intervals '(1 2 3)) ; + octaves of this intervals (special-rnd-walk 10 :startpitch 'ds4 :pitchfield '(gs3 cs4 ds4 g4 a4 b4 d5 e5 fs5 bb5 c6 f6) :possible-intervals '(1 3 4 5) :interval-octaves 0) ;;; reduced interval-span (special-rnd-walk 10 :startpitch 'ds4 :pitchfield '(gs3 cs4 ds4 g4 a4 b4 d5 e5 fs5 bb5 c6 f6) :possible-intervals '(5 6 7)) ; + octaves of this intervals more examples -> SOUND ;;; rnd-versions so you will here the different interval-colors inside the pitchfield (setf seq (gen-sieve '(f3 fs6) '(4 2 1 1 1 2 4 7) :type :pitch)) ;(setf seq (gen-sieve '(f3 fs6) '(7 4 2 1 1 1 2 4) :type :pitch)) ;(setf seq '(gs3 cs4 ds4 g4 a4 b4 d5 e5 fs5 bb5 c6 f6)) (setf pitchlist (special-rnd-walk (rnd-pick '(3 5 7 11)) :startpitch (rnd-pick seq) :pitchfield seq :possible-intervals (rnd-pick '((1 2) (3 4) (5 6 7))) :interval-octaves 3)) (def-score intervals (:title "walk" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (make-omn :pitch pitchlist :length '(t) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) ;;; rnd-walk in SIEVE only with intervals '(5 6 8) (setf seq (gen-sieve '((c4 g7) (c2 g7)) '((2 1 10) (3 5)) :type :pitch)) (setf pitchlist (special-rnd-walk 30 :startpitch (rnd-pick seq) :pitchfield seq :possible-intervals '(5 6 8))) (def-score intervals (:title "intervals" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (make-omn :pitch pitchlist :length '(t) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) (setf seq (gen-sieve '((c2 g7) (c2 g7)) '((2 1 10) (3 5)) :type :pitch)) ;;; EXAMPLE with changes -> all inside the same SIEVE (setf pitchlist (append (special-rnd-walk 50 :startpitch (rnd-pick seq) :pitchfield seq :possible-intervals '(1)) ; minor second (special-rnd-walk 50 :startpitch (rnd-pick seq) :pitchfield seq :possible-intervals '(2)) ; major second (special-rnd-walk 50 :startpitch (rnd-pick seq) :pitchfield seq :possible-intervals '(3 4)) ;thirds (special-rnd-walk 50 :startpitch (rnd-pick seq) :pitchfield seq :possible-intervals '(5 7)))) ; fourth-fifth (def-score intervals (:title "intervals" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (make-omn :pitch pitchlist :length '(t) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano))
  15. something new... greetings andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; BROWNIAN BRIDGE -> could be use as a rnd-process from A to B (integers or pitches) ;;; if you have a look to example with ":all-gen t", you will see the process with all generations, how it works ;;; or take a look to: ;;; https://de.wikipedia.org/wiki/Wiener-Prozess#/media/File:BrownscheBewegung.png ;;; https://de.wikipedia.org/wiki/Brownsche_Brücke ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SUB (defun pick (a b &key (span 5)) (let ((rnd1 (car (rnd-number 1 (+ a span) (- a span)))) (rnd2 (car (rnd-number 1 (+ b span) (- b span)))) (n)) (progn (setf n (car (rnd-number 1 rnd1 rnd2))) (if (or (= n a) (= n b)) (+ (rnd-pick '(1 -1)) n) n)))) ;;; MAIN ;;; MAIN (defun gen-brownian-bridge (n startend &key (all-gen nil) (output 'integer) (span 5)) (let ((seq)) (progn (setf seq (append (list startend) (loop repeat n with liste = startend do (setf liste (filter-repeat 1 (loop repeat (1- (length liste)) for cnt = 0 then (incf cnt) append (append (list (nth cnt liste) (pick (nth cnt liste) (nth (1+ cnt) liste) :span span) (nth (1+ cnt) liste)))))) collect liste))) (setf seq (if (equal all-gen t) seq (car (last seq)))) (if (equal output 'pitch) (integer-to-pitch seq) seq)))) ;;; EXAMPLES ;; SPAN influence -> span 2 (list-plot (gen-brownian-bridge 5 '(50 23) :span 2 :all-gen t) :zero-based t :point-radius 3 :join-points t) ;; SPAN influence -> span 10 (list-plot (gen-brownian-bridge 5 '(50 23) :span 20 :all-gen t) :zero-based t :point-radius 3 :join-points t) ;;; SPAN default (5) (list-plot (gen-brownian-bridge 5 '(50 23) :all-gen t) :zero-based t :point-radius 3 :join-points t) (list-plot (gen-brownian-bridge 5 '(50 23)) :zero-based t :point-radius 3 :join-points t) (gen-brownian-bridge 5 '(50 23) :all-gen t :output 'pitch) (gen-brownian-bridge 5 '(50 23) :output 'pitch) some sound-examples ;;; EXAMPLE with ALL GENS / seperated by rests (def-score brownian-bridge (:title "score title" :key-signature 'atonal :time-signature '(4 4) :tempo 72) (instrument :omn (make-omn :pitch (setf n (gen-brownian-bridge 5 '(30 10) :all-gen t :output 'pitch)) :length (loop for i in n append (list '-1/4 (loop repeat (length i) append '(t)))) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) ;;; EXAMPLE with LAST GEN -> rnd-evaluations => rnd-ways from a to b (def-score brownian-bridge (:title "score title" :key-signature 'atonal :time-signature '(4 4) :tempo 72) (instrument :omn (make-omn :pitch (gen-brownian-bridge (car (rnd-number 1 2 7)) '(30 10) :output 'pitch) :length '(t) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) two examples with different SPAN on MESSIEAN's mode5 mapped with <tonality-map> ;;; on MESSIAENS- mode5 - > 8 cycles + SPAN 10 => bigger intervals/steps (def-score brownian-bridge (:title "score title" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (make-omn :pitch (setf n (tonality-map '(messiaen-mode5 :map step :root 'fs3) (integer-to-pitch (gen-brownian-bridge 8 '(10 27) :span 10 :all-gen t)))) :length (loop for i in n append (list '-1/4 (loop repeat (length i) append '(t)))) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano)) ;;; on MESSIAENS- mode5 - > 8 cycles + SPAN 3 => smaller intervals/steps (def-score brownian-bridge (:title "score title" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (make-omn :pitch (setf n (tonality-map '(messiaen-mode5 :map step :root 'fs3) (integer-to-pitch (gen-brownian-bridge 8 '(10 27) :span 3 :all-gen t)))) :length (loop for i in n append (list '-1/4 (loop repeat (length i) append '(t)))) :span :pitch) :channel 1 :sound 'gm :program 'acoustic-grand-piano))
  16. a very simple, but useful little function... (defun gen-puls* (n tuplet period &key (stacc nil)) (gen-length (loop repeat n with period = (if (equal stacc t) (list 1 (neg! (1- period))) period) collect period) tuplet)) ;;; option: stacc or ord (gen-puls* 10 1/32 13) => (13/32 13/32 13/32 13/32 13/32 13/32 13/32 13/32 13/32 13/32) (gen-puls* 10 1/32 13 :stacc t) => (1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8 1/32 -3/8) (gen-puls* 10 1/28 9) => (9/28 9/28 9/28 9/28 9/28 9/28 9/28 9/28 9/28 9/28) (gen-puls* 10 1/28 9 :stacc t) => (1/28 -3/14 1/28 -3/14 1/28 -3/14 1/28 -3/14 1/28 -3/14 1/28 -3/14 1/28 -3/14 1/28 -3/14 1/28 -3/14 1/28 -3/14) (gen-puls* 10 1/20 13 :stacc t) => (1/20 -3/5 1/20 -3/5 1/20 -3/5 1/20 -3/5 1/20 -3/5 1/20 -3/5 1/20 -3/5 1/20 -3/5 1/20 -3/5 1/20 -3/5)
  17. like this (?)... ;;; mapping to MAJOR (setf sort-seq (integer-to-pitch (flatten (gen-sort (rnd-order (gen-integer 24)) :type 'selection)))) (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 90 :layout (treble-layout 'seq)) (seq :omn (make-omn :pitch (setf n (tonality-map '(major :map step :root 'c4) sort-seq)) :length (gen-repeat (length (flatten n)) '(t))))) ;;; mapping to MESSIAEN-mode (setf sort-seq (integer-to-pitch (flatten (gen-sort (rnd-order (gen-integer 24)) :type 'insertion)))) (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 90 :layout (treble-layout 'seq)) (seq :omn (make-omn :pitch (setf n (tonality-map '(messiaen-mode5 :map step :root 'c4) sort-seq)) :length (gen-repeat (length (flatten n)) '(t))))) ;;; mapping to a XENAKIS-SIEVE -> how can i do that with TONALITY-MAP? (but not necessary) (setf sieve (gen-sieve '((c4 g7) (c1 g7)) '((2 1 12) (3 5)) :type :pitch)) (setf sort-seq (flatten (gen-sort (rnd-order (gen-integer (length sieve))) :type 'insertion :sort '?))) (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 90 :layout (treble-layout 'seq)) (seq :omn (make-omn :pitch (setf n (loop for i in sort-seq collect (nth i sieve))) :length (gen-repeat (length (flatten n)) '(t)))))
  18. AM

    mapping integer?

    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é
  19. AM

    mapping integer?

    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)
  20. AM

    mapping integer?

    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))))
  21. AM

    mapping integer?

    in LISP (loop for i in '(0 1 2 3 4 2 1 5 3 1) collect (nth i (expand-tonality '(c4 messiaen-mode5))))
  22. hi all i'm looking for different SORTING ALGORITHMS in LISP - no problem to find (different) in the WWW... but: i would like to have as OUTPUT-result ALL generations of the SORTING-process and not only the LAST one - i'm interested in the PROCESS!! thanks for some help or any idea? (for once i do not want to code it myself :-)) greetings andré
  23. AM

    sorting algorithms

    okay, i see... and waht is the default? i think whole process (all steps) would be good
  24. AM

    sorting algorithms

    MIN/MAX-SORT a new function: min/max -> 1. max-pitch, 2. min-pitch, 3.rest of the seq .... starting next gen.... have a look at the list-plot. minmax-sort.opmo functions.opmo ;;; ordinary examples (make-omn :pitch (setf n (sorting (vector-to-pitch'(g4 eb5) (gen-white-noise 40)) :algorithm 'min/max)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (vector-to-pitch'(g4 eb5) (gen-white-noise 40)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (vector-to-pitch'(c4 bb5) (gen-white-noise 40)) :algorithm 'min/max)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (vector-to-pitch'(c4 bb5) (gen-white-noise 40)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (rnd-order '(g4 gs4 a4 bb4 b4 c5 cs5 d5 eb5 e5 f5 fs5)) :algorithm 'min/max)) :length (gen-repeat (length n) (append (gen-repeat 12 '(t)) (list '-e)))) (make-omn :pitch (setf n (sorting (rnd-order '(g4 gs4 a4 bb4 b4 c5 cs5 d5 eb5 e5 f5 fs5)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 12 '(t)) (list '-e)))) ;;; combined with filter-tie -> ties all pitch repetitions!! (filter-tie (make-omn :pitch (setf n (sorting (vector-to-pitch'(c4 bb5) (gen-white-noise 40)) :algorithm 'min/max)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e))))) (filter-tie (make-omn :pitch (setf n (sorting (vector-to-pitch'(c4 bb5) (gen-white-noise 40)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 40 '(t)) (list '-e))))) ;;; THREE SCORES with min/max (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 120 :layout (piano-solo-layout 'rhand 'lhand)) (rhand :omn (make-omn :pitch (setf n (sorting (rnd-order '(g6 gs6 a6 bb6 b6 c7 cs7 d7 eb7 e7 f7 fs7)) :algorithm 'min/max :n '<)) :length (gen-repeat (length n) (append (gen-repeat 12 '(t)) (list '-e)))) :channel 1 :sound 'gm :program 0) (lhand :omn (make-omn :pitch (setf n (sorting (rnd-order '(g1 gs1 a1 bb1 b1 c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 12 '(t)) (list '-e)))) :channel 2)) (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 120 :layout (piano-solo-layout 'rhand 'lhand)) (rhand :omn (filter-tie (make-omn :pitch (setf n (sorting (rnd-repeat 100 '(g6 gs6 a6 bb6 b6 c7 cs7 d7 eb7 e7 f7 fs7)) :algorithm 'min/max :n '<)) :length (gen-repeat (length n) (append (gen-repeat 100 '(t)) (list '-e))))) :channel 1 :sound 'gm :program 0) (lhand :omn (filter-tie (make-omn :pitch (setf n (sorting (rnd-repeat 100 '(g1 gs1 a1 bb1 b1 c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 100 '(t)) (list '-e))))) :channel 2)) (def-score example-score (:key-signature 'atonal :time-signature '(4 4) :tempo 120 :layout (piano-solo-layout 'rhand 'lhand)) (rhand :omn (filter-tie (make-omn :pitch (setf n (sorting (rnd-repeat 100 '(g6 gs6 a6 bb6 b6 c7 cs7)) :algorithm 'min/max :n '<)) :length (gen-repeat (length n) (append (gen-repeat 100 '(t)) (list '-e))))) :channel 1 :sound 'gm :program 0) (lhand :omn (filter-tie (make-omn :pitch (setf n (sorting (rnd-repeat 100 '(c2 cs2 d2 eb2 e2 f2 fs2)) :algorithm 'min/max :n '>)) :length (gen-repeat (length n) (append (gen-repeat 100 '(t)) (list '-e))))) :channel 2))
×