Jump to content

AM

Members
  • Posts

    816
  • Joined

  • Last visited

Everything posted by AM

  1. okay i see, thanx! after AMBITUS-SWALLOW (for splitting voices), i have to REPLACE the value by ACC in one voice and delete the VALUE/the REST in the other voices... but - after short coding - it seems, that it's not so easy - looks like the grammar get some error and after that you have some phase-delays in the seperat omn-stream (between the voices)...
  2. a version for 2+LEVEL-markov-tables all the best andré ;;example-mat (setq pitch-seq (append '(c4 cs4 fs4 g4) '(a4 gs4 eb4 d4) '(c4 d4 eb4 ab4 bb4 b4) '(c5 bb4 e4 d4 db4 b3 f3 eb3) '(d3 g3 c4 cs4 fs4 b4) '(c5 bb4 f4 e4 b3 a3) '(g3 c4 b3 bb3 f3) '(g3 c4 b3 bb3 f3) '(g3 c4 b3 bb3 f3) '(e3 eb3 a2 bb2))) ;; different levels of transition-tables > LEVEL 2, 3, & 4 (setf transition2 (gen-markov-transitions (pitch-to-interval pitch-seq) :level 2)) (setf transition3 (gen-markov-transitions (pitch-to-interval pitch-seq) :level 3)) (setf transition4 (gen-markov-transitions (pitch-to-interval pitch-seq) :level 4)) ;; the substitution-function for LEVELS 2+ (!!!) (defun substitute-transition-value2 (transition-list value-old value-new) (loop for j in transition-list with cnt = 0 collect (loop for i in j when (and (listp i) (= cnt 0)) collect (substitute value-new value-old i) and do (incf cnt) else collect (append (substitute value-new value-old (list (first i))) (list (second i)))) do (setq cnt 0))) ;; examples (gen-markov-from-transitions (substitute-transition-value2 transition2 -1 11) :size 100 :start 2) (gen-markov-from-transitions (substitute-transition-value2 transition3 -1 11) :size 100 :start 2) (gen-markov-from-transitions (substitute-transition-value2 transition4 -1 11) :size 100 :start 2)
  3. i coded my own algorithm... so the ouput is like that, but a problem with ambitus-swallow... (setq omn-list '(s. c4 pp ponte (acc t b3 ppp flaut t f3 ppp flaut) s. e3 pp ponte -t (acc t c4 pp flaut) s. fs3 ppp tasto s. b3 ppp tasto (acc t f3 pp flaut) -t (acc t c4 pppp ord) s. cs4 pp ponte s g4 ppp ord s f4 ppp ord s. b4 pp ponte (acc t c5 pppp ord) -t s c4 pp flaut e_t b3 p tasto s f3 ppp tasto s bb3 ppp tasto e_t e3 p tasto s eb3 pp flaut -w s. c4 ppp tasto (acc t b3 pppp ord t f3 p tasto t d3 p tasto t gs2 pppp ord) s. g2 ppp tasto -w (acc t c4 ppp ord) e_t fs3 pppp tasto (acc t g3 pppp flaut t cs3 pppp flaut) e_t d3 pppp tasto (acc t gs2 ppp ord) -t s c4 pppp ponte (acc t eb4 p tasto) s e4 pp tasto s g4 pp tasto (acc t gs4 p tasto) s b4 pppp ponte -t (acc t c4 p flaut) s. g3 ppp tasto s. gs3 ppp tasto (acc t eb3 p flaut) -t e_t c4 pppp ponte s fs4 pp ord)) ;;; it works well with cmd2, but the function: ambitus-swallow ...has a problem... why? (ambitus-swallow '(cs3 fs5) omn-list) > Error: Duration must be positive when duration-add is false. > While executing: normalize-duration, in process Listener-1(6). > Type cmd-. to abort, cmd-\ for a list of available restarts. > Type :? for other options.
  4. in OMN: is there a possibilty to replace - for example all 1/32-values of an OMN-sequence - into acciaccaturas? thanxs for help andré
  5. AM

    context-markov?

    a possible solution...? greetings andré
  6. hi all, i coded a little markov-program who changes the LEVEL-size if necessary to generate the number of values you want exactly. it would be nice if someone could check/test the IDEA, and if it's correct and makes sense :-) the markov starts on LEVEL 3 and tries to generate a number of output-levels with its TRANSITION-rules (level-3-rules), if it's possible (=generating the size) everything's fine. but if it's not possible, then the programm changes on LEVEL-2-rules ... if this is also not possible (to generate the size) then it changes to LEVEL 1... here is the code... ;;;FUNCTION (defun gen-multiple-markov (sequence &key size) (let ((transitions-level-1 (gen-markov-transitions sequence :level 1)) ;; gen transition-table level-1 (transitions-level-2 (gen-markov-transitions sequence :level 2)) ;; gen transition-table level-2 (seq (gen-markov-from-transitions (gen-markov-transitions sequence :level 3) :size size))) ;; gen markov-seq on level-3 (if (< (length seq) size) ;; test if seq is too short (/= (length seq) size) (progn ;; if too short -> combine the last seq with a new one (level 2) (setq seq (append seq (gen-markov-from-transitions transitions-level-2 :size (- size (length seq)) :start (last seq)))) (if (< (length seq) size) ;; same test as above (append (append seq (gen-markov-from-transitions transitions-level-1 :size (- size (length seq)) :start (last seq)))) (append seq))) (append seq)))) ;;;TEST (gen-multiple-markov '(1 2 3 2 1 2 3 2 1 2 2 2 2 1 1 1 1 2 2 3 2 1 1 2) :size 36) best wishes and THANX andré
  7. AM

    context-markov?

    okay, in some way it's markov LEVEL 2. but i try to code something more "individual", a combination of LEVEL 1 and LEVEL 2... when i have something new i will post it...
  8. hi all, i'm looking for a markov-function who's working with a transition-table (like in OPMO), but who is "context-sensitive". the table could be something like that (but nonsense-example here): (setq transition-table '((1 (2 1) (3 1)) (2 ((1 3) 1) (2 1)) (3 (1 1) (4 1)) (1 3 (2 1) ((3 1) 1)))) is there any "hidden-function" in OPUSMODUS, or have i code it for myself? ...it makes "musically" more sense to work with context- then with single-value-decisions... thanx andré
  9. bug? keep attention with transition-values! (substitute-map -1 1 transitions) => ((-1 (2 -1) (3 3) (5 2) (8 -1)) (2 (-1 2) (5 3)) (3 (-1 2) (8 -1) (2 3)) (5 (3 2) (2 -1) (-1 3)) (8 (-1 2) (2 2) (3 -1))) -> "weight" should not be replaced! Like this
  10. i'm working on a program including "markov"... so i coded this small FUNCTION to SUBSTITUTE markov-rules-values (because in my "project" i'm generating a feedback on the markov-rules (after a pattern-match)). i know it could be coded a lot smarter but it works. have fun! andré ;;;;FUNCTION (defun substitute-transition-value (transition-list value-old value-new) (loop for j in transition-list collect (loop for i in j when (numberp i) append (substitute value-new value-old (list i)) when (listp i) collect (append (substitute value-new value-old (list (first i))) (list (second i)))))) ;;;;;EXAMPLE (setq transitions '((1 (2 1) (3 3) (5 2) (8 1)) (2 (1 2) (5 3)) (3 (1 2) (8 1) (2 3)) (5 (3 2) (2 1) (1 3)) (8 (1 2) (2 2) (3 1)))) (substitute-transition-value transitions 1 -1) => ((-1 (2 1) (3 3) (5 2) (8 1)) (2 (-1 2) (5 3)) (3 (-1 2) (8 1) (2 3)) (5 (3 2) (2 1) (-1 3)) (8 (-1 2) (2 2) (3 1)))
  11. there is a little solution: -> (omn-to-time-signature omn-list 1/16) -> after that, you could import in sibelius and then merge (by a plugin) rests etc...
  12. must be some misunderstanding! the question was not how to create tuplets... but i try to implement rhythms via XML in sieblius/finale, if you see the examples: the lengths are not structured in quarter-notes... as i'm showing in the sibelius example... would be very user-friendly for ordinary-4/4-workflow, if the XML-notatiion would show like in the sibelius-pic...but perhaps there are some functions who are doing this, and i didn't found them. i simply would like to have a "better" xml-output.. example... .
  13. is there any solution in OM?
  14. i would like to re-organize the notation of a sequence like '(5/32 1/32 1/4 1/32 5/32 1/4 3/32 1/32 5/32 1/16 1/16). is it possible to modifiy it, so that all this will be notated in "groups of quarter notes"? like this... much easyer to handle it in SIBELIUS etc... thanks for help... andré
  15. very nice :-)
  16. thanx! i know that 4/32 = 1/8 -> but i would like to calculate with 4/32 -> numinator/denominator and not with 1/8 :-)
  17. don't know if somthing like that exists... generates "stacc"-rhythms = splitting lengths for example 7/32 to 1/32 -6/32 (works with single values or lists) -> only "1 bug"... when i want to do this with 4/32 -> then lisp *reduces it" to 1/8, so it don't work for such rhythms...?!? any ideas? thanx a. ;;;FUNCTION (defun gen-stacc (n) (if (numberp n) (if (> (numerator n) 1) (list (/ 1 (denominator n)) (/ (* -1 (- (numerator n) 1)) (denominator n))) (list n)) (loop for i in n append (if (> (numerator i) 1) (list (/ 1 (denominator i)) (/ (* -1 (- (numerator i) 1)) (denominator i))) (list i))))) ;;;EXAMPLES (gen-stacc '(7/32 9/32 17/32)) (gen-stacc 4/32)
  18. "hysterical" with a value-list = multiple states :-) ;;;; SUBFUNCTIONS (defun weighted-random (list) (loop for item in list with rand-num = (random (loop for x in list sum (second x))) for add = (second item) then (+ add (second item)) when (< rand-num add) return (first item))) (defun weighted-t/nil (on-weight) (let ((off-weight (- 1 on-weight))) (weighted-random (list (list 't on-weight) (list 'nil off-weight))))) (weighted-t/nil 0.5) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; MAINFUNCTION (defun binary-hysteresis-1.2 (&key number-of-values (value-list '((0 1) (4 0) (0 1) (4 7))) (start-weight 0.1) (sensitivity 0.02) (static 1.0)) (loop repeat number-of-values with weight = start-weight with cnt1 = 0 with cnt-v = 0 when (equal (weighted-t/nil weight) 'nil) collect (first (nth cnt-v value-list)) else collect (second (nth cnt-v value-list)) and do (incf cnt1) when (= cnt1 3) do (setq weight (+ weight sensitivity) cnt1 0) when (> weight static) do (incf cnt-v) and do (setq weight start-weight) when (= cnt-v (length value-list)) do (setq cnt-v 0))) ;;example (length-list-plot (binary-hysteresis-1.2 :number-of-values 600 :start-weight 0.1 :sensitivity 0.05 :value-list '((0 1) (10 2) (7 3)) :static 2.0))
  19. ;;;;small function -> create symmetrical lists (palindrom) with markov (for generating half-seq) (setf transition '((1 (4 1) (5 1) (-6 2)) (2 (5 2) (4 1)) (3 (4 1)) (4 (5 1) (2 1)) (5 (1 3) (-6 2) (4 1)) (-6 (4 1) (3 2)) (7 (1 1) (-6 1)))) ;;;FUNCTION (defun gen-sym-markov (&key seq-length transition-matrix) (let ((vals 0)) ;falls seq-length = liste, werden positive werte gezählt und neu ;seq-length (= angepasst, formatunabhängig) (if (listp seq-length) (setq seq-length (car (last (loop for i in seq-length with cnt = 0 when (> i 0) collect (incf cnt)))))) ;entscheindung grad/ungrad (if (evenp seq-length) (progn (setq vals (gen-markov-from-transitions transition-matrix :size (/ seq-length 2) :start (rnd-pick (flatten (filter-first 1 transition-matrix))))) (append vals (reverse vals))) (progn (setq vals (gen-markov-from-transitions transition-matrix :size (/ (- seq-length 1) 2) :start (rnd-pick (flatten (filter-first 1 transition-matrix))))) (append vals (list (rnd-pick (flatten (filter-first 1 transition-matrix)))) (reverse vals)))))) ;;;;EXAMPLE (gen-sym-markov :seq-length 8 :transition-matrix transition)
  20. BINARY-HYSTERESIS-1.1 version with :start-point (default is ( / numbers-of-values 2)) it's interesting to play with :tendency and :start-weight for example -> start-weight = high (ca. 0.5) -> oscillation is beginning quickly (at start-point) but when tendency is low it needs time to switch definitly... etc... (defun binary-hysteresis-1.1 (&key number-of-values (values '(0 1)) (start-weight 0.1) (sensitivity 0.02) (start-point (if (evenp number-of-values) (/ number-of-values 2) (/ (1- number-of-values) 2)))) (loop repeat number-of-values with weight = start-weight with cnt1 = 0 for cnt2 = 0 then (incf cnt2) when (or (equal (weighted-t/nil weight) 'nil) (< cnt2 start-point)) collect (first values) else collect (second values) and do (incf cnt1) when (= cnt1 3) do (setq weight (+ weight sensitivity) cnt1 0))) ;;;; example with 0/1 (length-list-plot (binary-hysteresis-1.1 :number-of-values 200 :values '(0 1) :start-weight 0.4 :sensitivity 0.05 :start-point 80))
  21. you are wright! :-) violà!! have a look to the edited post! there was also a "BUG" in the code, now it's seems okay!!
  22. here is a little function, to use or optimize... greetings andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; a little lisp-function that's switches by a "hysteresis" from one value to the other ;;;;;;;;;;;;;;;;;;;;;;; ;;;; could be used for any-value ;;;; :start-weight -> tendency at the beginning ;;;; :sensitivity -> change-step of tendency when switch/match ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; subfunctions (defun weighted-random (list) (loop for item in list with rand-num = (random (loop for x in list sum (second x))) for add = (second item) then (+ add (second item)) when (< rand-num add) return (first item))) (defun weighted-t/nil (on-weight) (let ((off-weight (- 1 on-weight))) (weighted-random (list (list 't on-weight) (list 'nil off-weight))))) (weighted-t/nil 0.5) ;;;; mainfunction (defun binary-hysteresis-1.0 (&key number-of-values (values '(0 1)) (start-weight 0.1) (sensitivity 0.02)) (loop repeat number-of-values with weight = start-weight with cnt = 0 when (equal (weighted-t/nil weight) 'nil) collect (first values) else collect (second values) and do (incf cnt) when (= cnt 3) do (setq weight (+ weight sensitivity) cnt 0))) ;;;; example with 0/1 (length-list-plot (binary-hysteresis-1.0 :number-of-values 200 :values '(0 1) :start-weight 0.1 :sensitivity 0.07)) ;;;; example with two pitches (make-omn :pitch (binary-hysteresis-1.0 :number-of-values 200 :values '(c4 c5) :start-weight 0.05 :sensitivity 0.1) :length (gen-repeat 200 '(1/32)))
  23. so, will be possible as technique/program-change? :-)
  24. 1) main-idea: a little function (perhaps more interesting when rhy-display-bugs are fixed) ...to use if you want to do "real-fractal-structures", or replace (with motif-map) a length-value with a rhythmical-substructure, or do "rhy-projections" on other lengths... (defun gen-prop-rhythms (proportions main-length) (loop for i in proportions collect (* i (/ main-length (apply '+ (mapcar #'abs proportions)))))) (gen-prop-rhythms '(3 2 5) 4/4)) 2) extension: replace a value from a sequence (generated with "gen-prop-rhythms") with a new gen-prop-seq, and merge it to a new rhy-layer.... repeat this x-times... (defun merge-two-layers (main-layer sub-layer repl-val) (loop repeat (length main-layer) with cnt = 0 when (= cnt (position repl-val main-layer)) append sub-layer else collect (nth cnt main-layer) do (incf cnt))) ;;example-1: (setq layer-1 (gen-prop-rhythms '(3 2 5) 4/4)) ; creates a rhy-structure in 4/4 (setq layer-2 (gen-prop-rhythms '(3 2 5) (second layer-1))) ; creates a rhy-structure on second length of layer1 (merge-two-layers layer-1 layer-2 (second layer-1)) ; merge this two "rhy-sequences" ;;example-2 (more complex example, but same thing) (setq layer-1 (gen-prop-rhythms '(8 3 2 5) 9/4)) (setq layer-2 (gen-prop-rhythms '(5 2 3) (fourth layer-1))) (setq layer-1+2 (merge-two-layers layer-1 layer-2 (fourth layer-1))) (setq layer-3 (gen-prop-rhythms '(2 3 1) 1/4)) (setq layer-1+2+3 (merge-two-layers layer-1+2 layer-3 (third layer-1+2))) greetings andré
  25. thanx, stephane!
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy