Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by AM

  1. AM

    "gen-stacc" -> question

    thanx! i know that 4/32 = 1/8 -> but i would like to calculate with 4/32 -> numinator/denominator and not with 1/8 :-)
  2. AM


    "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))
  3. 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)))
  4. AM


    ;;;;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)
  5. AM


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


    you are wright! :-) violà!! have a look to the edited post! there was also a "BUG" in the code, now it's seems okay!!
  7. i would like to define my own articulations (because in CONTIMBRE http://www.contimbre.com you have lot of possibilities with programm-changes... and for mapping i have to define it properly) ::::::::::::::: (setq articulations '(arco - - pizz - -));; -> that works fine because ord-omn (setq articulations '(arco - - pizz - - legno-battuto - whatever - - - - );; -> i would like to write such user-defined expressions -> is there a possibilty? ::::::::::::::: (setq vn (make-omn :length lengths :pitch pitches :articulation articulations)) ;; but here is the omn-error with my own expressions, is there any solution? ::::::::::::::: if it would work i could map like this: (def-sound-set gm-violin :programs (:group violin arco 40 legno-battuto 50 pizz 60 whatever 70)) (def-score example (:key-signature 'chromatic :time-signature '(4 4) :tempo '(q 70) :layout (violin-layout 'violin)) (violin :omn vn :channel 1 :sound 'gm-violin)) :::::::::::::::
  8. AM

    articulations in OMN

    so, will be possible as technique/program-change? :-)
  9. in an OMN-stream i have (because of a special generating-algorithm) "always the same expressions" ... for example: (s a4 p ord -h s bb4 ord t cs5 f ord -w_e. s c5 mf ord t b4 p ord -q_t s d5 mf ponte cs5 ponte gs4 ffff pizz a4 mf ponte bb4 ponte f4 ponte h_e e4 ppp tasto) is there a function who reduces it at a minimum... one time ord then next ponte etc... (like length-rest-merge, but for the expressions) thanxs a.
  10. i woud like to replace a pitch by a new omn-sequence. so i have to match/eliminate the length too... is there a function anywhere? for example -> the "h gs5" '(e fs4 c5 -w h gs5 -w e. d5 h cs5) replace this values with another omn-seq, but how? i could do something like this (in ord. lisp), but then i get in trouble with the lengths (loop for i in '(e fs4 c5 -w h gs5 -w e. d5 h cs5) when (equal i 'gs5) collect '(e. gs5 ppp g5 e_t f5 d5) else collect i) -> '(e fs4 c5 -w h (e. gs5 ppp g5 e_t f5 d5) -w e. d5 h cs5) ...so the last length-val before the insert has to be eliminated too (here: h (e. gs5 ...)) ... otherwise is gonna be wrong. thanx for help a.
  11. AM


    thanks! it's not in the library yet?
  12. ;;; i coded this little function because i wanted to transpose a single pitch without having ;;; a list as output: in the library (pitch-transpose -12 '(c4)) -> (c3) ;;; (or is there such a function/format already in the library?) (defun single-pitch-transpose (pitch interval &key (midi-output 'nil)) (if (numberp pitch) (if (equal midi-output 'nil) (midi-to-pitch (+ interval pitch)) (+ interval pitch)) (if (equal midi-output 'nil) (midi-to-pitch (+ interval (pitch-to-midi pitch))) (+ interval (pitch-to-midi pitch))))) ;;example1 -> omn-in omn-out (single-pitch-transpose 'c4 -12) ;;example2 -> omn-in midi-out (single-pitch-transpose 'c4 -12 :midi-output t) ;;example3 -> midi-in omn-out (single-pitch-transpose 60 -12) ;;example4 -> midi-in midi-out (single-pitch-transpose 60 -12 :midi-output t) regards, AM
  13. AM


    but is it possible to fix it, when i make a disassemble-omn and delete all "immediate repetitions" of the articulations? that seems to be a solution -> (clear-articulations omn-list), it works works correct for my code. regards andré (defun clear-articulations (omn-list) (make-omn :pitch (omn :pitch omn-list) :length (omn :length omn-list) :velocity (omn :velocity omn-list) :articulation (append (list '-) (loop repeat (length (omn :articulation omn-list)) with cnt = 0 with art = (omn :articulation omn-list) when (not (equal (nth cnt art) (nth (+ cnt 1) art))) collect (nth (+ cnt 1) art) else collect '- do (incf cnt)))))
  14. AM


    thank you, that works! andré
  15. AM


    short question... is there (deep in the library) a function who tests if a list is in OMN-format or not? like that: (omn-test '(t gs4 f ord -e_t s f4 mf ord -w_s)) -> 't thanx for a quick answer andré
  16. AM

    Après la pluie Trio

    ...and of course... how you want to work - what's important or not, if you have/want to to work fast or slow, if you are interested in tools/workflow - it depends on in which style/genre/... you are working in. of course it's different if you produce dance/filmmusic-tracks, if you want to imitate and explore "old styles" or if you are more into "avantgard-scene-music" (whatever that should be)... ...but, i think it's interesting to think about such things.
  17. AM

    Après la pluie Trio

    a critical statement... i think by working with opusmodus (or PWGL or CM or whatever) there come up some "asthetical traps"... #1 -> using the predefined "tools" (and not programming/thinking it for youself) could be like "cooking convenience food" (nice to produce fast and smart, but im my view not for ...) #2 -> confound (?) the complexity of the algorithm with the "complexity of the musical structure" (inherent and historically) ... for example you can realize that in BOULEZ "répons" #3 -> perhaps... you will only do, what the predefined "tools" can do #4 ? ... ...whatelse could you imagine? regards, andré
  18. AM

    articulations in OMN

    a new question/wish for piano or any special-techniques on any instrument like perhaps: "guirro fingernail" or "hit the conductor!" :-), i would like to write this as a articulation/technique-name (like now pizz..).. so that i could map it with (def-sound-set..) thanx! andré
  19. AM

    articulations in OMN

    (def-sound-set gm-violin :programs (:group violin ord 40 tasto 42 ponte 44 pizz 46 slap 48 legno-batt 50 batt+legno 60 ;;; -> no program-change sended arco 52))
  20. AM

    articulations in OMN

    thank you!! it works with the "define articulations names", but not with "+" = it sends no programm-change (but written "legno battuto" in score...) ?
  21. AM

    Beginner: Slonimsky 648 as a function

    in lisp -> create OMN with (midi-to-pitch)... (setq half-row (loop repeat 13 with interval with stack = 60 with cnt = 0 when (oddp cnt) do (setq interval 13) when (evenp cnt) do (setq interval -11) when (= cnt 0) collect stack else collect (setq stack (+ stack interval)) do (incf cnt))) (midi-to-pitch (append half-row (reverse (butlast half-row))))
  22. AM

    Doubt about motif-map function

    ...technically, such pattern-match-things are - for my opinion - interesting when you write one value after the other (step by step with all paramters parallel), and then check all the time (every gen-cycle) the output on PATTERNS, and when there is a match you can change the gen-rules... data-structure with EVENTS like that... (defstruct event duration pitch velocity rhy reading_rate optional_data) (setf bot-1 (make-event)) ... and in every cycle you could write/GENERATE an EVENT (Excerpt) do (setf bot-1 (make-event :duration data :pitch (setq pitch-1 (nth seq-cnt-1 pitchfield)) :velocity (rnd-walk-in-chord '(1 0 -1) velocityfield velocity) :rhy (rnd-walk-in-chord '(1 -1) rhyfield rhy-1) :reading_rate 1; (rnd-pick'(1 2 3)) :optional_data (rnd-pick '(a b c d e)))) and then you check it (every cycle) for patterns... and if MATCH you could change the GEN-part the GEN-rules ... like a small robot who tries "to move in the world or to recognize the world"...
  23. AM

    Doubt about motif-map function

    dear rangarajan i think the motif-map-function has a PATTERN-MATCH inside, but it "replaces the MATCH", (like in a contextual-rewrite), but perhaps i don't use the name/expression "pattern-match" in a wright/correct way... i'm more composer/musician then programmer :-) here's a very basic example for am SIMPLE/PURE PATTERN MATCH: a rnd-gen-value-list (to show how you could use it), with a PATTERN-MATCH-prog who scans it. the next value - after a complete match - will be changed into a rest... but you also could start a sub-function then who do what ever you want...? (when you change the code) in a concrete project i coded it also in a more complex way - kind of "nontrivial-machines" (as an experiment) -> PATTERNmatch in pitches changes the DURATIONS, PATTERNmatch in durations changes pitches or timbre... and so on... like a "dynamic-interaction-network"... sorry for my bad english... regards andré FUNCTION - FOR A SIMPLE EXAMPLE (defun pattern_cogn (liste pattern) (loop for z in liste with cnt = 0 with pattern_cnt = 0 collect z ;;;check a value - if it's a match -> incf counter when (or (eq (nth cnt pattern) z) (eq '? (nth cnt pattern))) do (incf pattern_cnt) and do (incf cnt) else do (setq cnt (setq pattern_cnt 0)) ;;; if the pattern is MATCHED (=> counter = length pattern) -> the output changes ... for example, the next value will be a rest ;;; = consequence when (eq pattern_cnt (length pattern)) collect (* z -1) and do (setq cnt (setq pattern_cnt 0)))) FUNCTION-EVAL (pattern_cogn (loop repeat 100 collect (1+ (random 5))) ; generates rnd-values -> TO SEARCH IN IT '(4 ? 2)) ; pattern to search (here with wildcard) WHEN PATTERN MATCH THEN NEXT VALUE (* -1)
  24. AM

    Doubt about motif-map function

    short question (i didn't read the whole documentation)... when i use/work with pattern-matching, i've done it with WILDCARDS ... is there any aspect of that in the motif-map function? or is a "ordinary pattern-matching-function" in OM? like that: pattern to search/replace '(0 1 ? 3) this is musically interesting, because it works with "fuzziness".... regards, andré