Jump to content

AM

Members
  • Posts

    795
  • Joined

  • Last visited

Everything posted by AM

  1. "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))
  2. ;;;;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)
  3. 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))
  4. you are wright! :-) violà!! have a look to the edited post! there was also a "BUG" in the code, now it's seems okay!!
  5. 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)))
  6. so, will be possible as technique/program-change? :-)
  7. 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é
  8. 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.
  9. thanks! it's not in the library yet?
  10. ;;; 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
  11. 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)))))
  12. AM

    omn-test?

    thank you, that works! andré
  13. 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.
  14. OPUSMODUS is nearly perfect for me and my work! thanks for your great work, janusz and ?!!!
  15. AM

    omn-test?

    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. ;;;GEN-SUB-STRUCTURE;;; andré meier - 01.05.2016 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;in a given OMN-pitch/duration/articulation-structure -> stream (in events) ;;;you could build a sub-structure from another pitch-seq (:sub-pitch-structure) ;;;it changes the duration and the articulation and the velocity ;;;if keyword ":sieve 't" -> all other pitches/lengths will be replaced by rests, ;;;a bit like LACHENMANN generates his "strukturnetze" ;;;p.s. i coded this event-structure because it's more practical for my recent project ... ;;;and i think it's a very practical DATA-structure... it would be also possible to build ;;;the events by defstructure-function. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;book: ;;;http://www.editionargus.de/pd1086682662.htm?defaultVariants={EOL}&categoryId=5 ;;;a link to an analytical work -> also with OM-patches (does anybody could change it for opusmodus-use?)! ;;;http://icem-www.folkwang-uni.de/icem-web/wp-content/uploads/2004/07/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; example 1 (setq pitches (midi-to-pitch '(60 61 62 63 64 65 66 67 68 69 70 71))) (setq durations (gen-length '(1 2 3 4 5 6 7 6 5 4 3 2) 1/32)) (setq velocities (loop repeat (length pitches) collect (rnd-pick '(ppp pp p)))) (setq sub-structure (midi-to-pitch '(67 66 65 64 63 62))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; example 2 (setq pitches (midi-to-pitch '(60 61 62 63 64 65 66 67 68 69 70 71))) (setq durations (gen-length '(1 2 3 4 5 6 7 6 5 4 3 2 3 4 5 6 7 6 5 4 3 2 3 4 5 6 7 6 5 4 3 2) 1/64)) (setq velocities (loop repeat (length pitches) collect (rnd-pick '(ppp)))) (setq sub-pitch-structure (midi-to-pitch '(67 68 66 62 63 63 65 64 63 66 62 65 64))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;gen an event-stream ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq event-stream (gen-events-from-lists :durations durations :pitches pitches :velocities velocities)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;gen-sub-structure + gen-ordinary-omn ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (gen-ordinary-omn (gen-sub-structure :sieve 't ;;when T, only the sub-structure pitches will be shown, other vals = rests (a bit like lachenmann-"strukturnetz") :in-cycles 't ;; when T, the basic-pitch-seq will be repeated until all the sub-pitches were matched :event-stream event-stream :sub-pitch-structure sub-structure :replace-duration-factor 2 ;; factor who changes the duration when match :replace-articulation 'trem :replace-velocity 'f)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;subfunctions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun build-event (&key duration (pitch 'nil) (velocity 'nil) (articulation 'nil) (optional_data1 'nil) (optional_data2 'nil) (optional_data3 'nil)) (list duration pitch velocity articulation optional_data1 optional_data2 optional_data3)) ;;;;;;;;;;;;;; (defun gen-events-from-lists (&key durations pitches (velocities nil) (articulations nil) (optional_datas1 nil) (optional_datas2 nil) (optional_datas3 nil)) (loop repeat (length durations) with cnt1 = 0 with cnt2 = 0 with event-cnt = 0 when (> (nth cnt1 durations) 0) collect (list (nth cnt1 durations) (nth cnt2 pitches) (nth cnt2 velocities) (nth cnt2 articulations) (nth cnt2 optional_datas1) (nth cnt2 optional_datas2) (nth cnt2 optional_datas3) event-cnt) and do (incf cnt1) and do (incf cnt2) else collect (list (nth cnt1 durations) nil nil nil nil nil nil event-cnt) and do (incf cnt1) do (incf event-cnt))) (gen-events-from-lists :durations '(1 -2 3 4 -5 4 3 2 1 2 3 2 2 3 3 2) :pitches '(60 61 62 63 64 65 66 67 68 69 70 71) :velocities '(mf ff fff ff)) ;;;;;;;;;;;;;; (defun gen-sub-structure (&key (in-cycles 'nil) (sieve 'nil) event-stream sub-pitch-structure (replace-duration-factor 10) replace-articulation (replace-velocity 'mf)) (if (equal in-cycles 'nil) (loop for i in event-stream with cnt = 0 when (equal (second i) (nth cnt sub-pitch-structure)) collect (list (* replace-duration-factor (first i)) (second i) replace-velocity replace-articulation (fifth i) (sixth i) (seventh i) (eighth i)) and do (incf cnt) else collect (if (equal sieve 't) (list (* (abs (first i)) -1) nil nil nil nil nil nil (eighth i)) (flatten (list i)))) (loop repeat (length sub-pitch-structure) with cnt = 0 append (loop for i in event-stream when (equal (second i) (nth cnt sub-pitch-structure)) collect (list (* replace-duration-factor (first i)) (second i) replace-velocity replace-articulation (fifth i) (sixth i) (seventh i) (eighth i)) and do (incf cnt) else collect (if (equal sieve 't) (list (* (abs (first i)) -1) nil nil nil nil nil nil (eighth i)) (flatten (list i))))))) ;;;;;;;;;;;;;; (defun gen-ordinary-omn (event-stream) (length-rest-merge (loop for i in event-stream append (loop for j in (butlast i) when (not (equal j 'nil)) collect j)))) ;;;;;;;;;;;;;;
  17. ...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.
  18. 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é
  19. (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))))) here is the missing weighted-random-function...
  20. liitle example: here a little extra-function -> splittering am melody... + hoquetus.4 (take the function from last post) regards andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;gen-hoquetus.4 + time-splittered-melody;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;andré meier / 27-4-2016 ;;;hoquetus.4 with a extra-funny-melody-splittered-function ;;;good night and good luck! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;extra-functions;;;;;;;;;splittering-melody;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun weighted-t/nil (on-weight) (let ((off-weight (- 1 on-weight))) (weighted-random (list (list 't on-weight) (list 'nil off-weight))))) (defun splittering-length-seq (lengths &key (possible-lengths '(1 2 3 4)) (rest-weight 0.5) (rhy-factor 1/32)) (loop for i in lengths when (> i 0) collect (loop for j in (rnd-sum i possible-lengths) collect (if (equal (weighted-t/nil rest-weight) 't) (* j -1 rhy-factor) (* j rhy-factor))) else collect (list (* i rhy-factor)))) (defun add-pitch-seq-to-splittered-length-seq (length-seq pitch-seq) (loop for i in length-seq with cnt = 0 append (loop for j in i when (> j 0) collect (nth cnt pitch-seq)) do (incf cnt) when (> cnt (length pitch-seq)) do (setq cnt 0))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun time-splitterd-melody (length-seq pitch-seq &key (possible-lengths '(1 2 3 4)) (rest-weight 0.5) (rhy-factor 1/32)) (make-omn :length (setq lengths (splittering-length-seq length-seq :possible-lengths possible-lengths :rest-weight rest-weight :rhy-factor rhy-factor)) :pitch (add-pitch-seq-to-splittered-length-seq lengths pitch-seq))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;OMN_EXAMPLE HOQUETUS + TIME_SPLTTERED_MELODY :;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq values (flatten (time-splitterd-melody '(16 16 16 16 16 16 16 16 16 16 32 16 16 32) '(c5 d5 e5 c5 c5 d5 e5 c5 e5 f5 g5 e5 f5 g5) :rest-weight 0.5))) (setq lengths (omn :length values)) (setq pitches (omn :pitch values)) (setq pos-durations (car (last (loop for i in lengths with cnt = 0 when (> i 0) collect (incf cnt))))) (setq instrumentation (loop repeat pos-durations collect (rnd-pick '(((pno ponte ppp)) ; only an example ((vn pizz p)) ((vn pizz f) (va ponte f)) ((pno tasto ff)) ((pno pizz fff)) ((vn tasto mf) (pno ord ff) (vc tasto mf) (trp ord pp)) ((trp mute pp) (vn ponte mf)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (def-score hoquetus.4 (:key-signature '(c maj) :time-signature '(4 4) :tempo '(120) :layout (bracket-group (trumpet-layout 'trumpet) (piano-grand-layout 'piano) (violin-layout 'violin) (viola-layout 'viola) (violoncello-layout 'violoncello))) (trumpet :omn (gen-hoquetus.4 'trp :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (piano :omn (gen-hoquetus.4 'pno :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (violin :omn (gen-hoquetus.4 'vn :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (viola :omn (gen-hoquetus.4 'va :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (violoncello :omn (gen-hoquetus.4 'vc :pitch pitches :length lengths :instrument-list instrumentation) :channel 1))
  21. ;; gen-hoquetus.4 https://en.wikipedia.org/wiki/Hocket ;;; andré meier / 27-4-2016 ;;; write a instrumentation-list (instrument + techniques + velocity), pitch-list ;;; and length-list. the gen-hoquetus-function will split the melody ;;; off... in any possibilities, techniques/articulations/velocities will be added ;;; this is only a function i coded for my actual work... perhaps you could use ;;; it or code it properly :-) ;;; HAVE FUN! regards, andré (setq instrumentation '(((pno ponte ppp)) ((vn pizz p)) ((vn pizz f) (va ponte f)) ((pno tasto ff)) ((pno pizz fff)) ((vn tasto mf) (pno ord ff) (vc tasto mf) (trp ord pp)) ((trp mute pp) (vn ponte mf)))) ;; mainfuction: (defun gen-hoquetus.4 (filtered-instrument &key pitch length instrument-list) (let ((events (generate-events.4 length pitch :optional_data instrument-list))) (filtering-color.4 filtered-instrument events))) (gen-hoquetus.4 'vn :pitch '(c4 d4 e5 f6) :length '(1/32 2/32 3/32 4/32) :instrument-list instrumentation) ;; subfunctions (defun generate-events.4 (durations pitches &key (velocity '(mf)) (articulation '(-)) (optional_data 'nil)) (loop repeat (length durations) with cnt-d = 0 with cnt-rest = 0 when (> (nth cnt-d durations) 0) collect (list (nth cnt-d durations) (nth cnt-rest pitches) (nth cnt-rest velocity) (nth cnt-rest articulation) (nth cnt-rest optional_data)) and do (incf cnt-rest) and do (incf cnt-d) else collect (list (nth cnt-d durations) 'nil 'nil 'nil 'nil) and do (incf cnt-d))) (generate-events.4 '(1 2 -3 4) '(60 61 62) :optional_data instrumentation) (defun filtering-color.4 (selected-color event-stream) (loop for i in event-stream with match = 0 append (loop for x in (fifth i) when (equal (first x) selected-color) do (setq articulation (second x) velocity (third x)) and do (setq match 1)) when (and (= match 1) (> (first i) 0)) append (list (first i) (second i) velocity articulation) else collect (* -1 (abs (first i))) do (setq match 0))) (filtering-color.4 'vn (generate-events.4 (gen-length '(1 -100 2 3 4 5) 1/32) '(c4 d4 e4 e5) :optional_data instrumentation)) ;; OMN_EXAMPLE: (setq pitches (midi-to-pitch '(60 61 62 63 64 65 66 67 68 69 70))) ; only an example (setq lengths (gen-length '(1 2 3 -4 5 6 5 -4 3 -2 1) 1/16)) ; only an example (setq instrumentation (loop repeat 10 collect (rnd-pick '(((pno ponte ppp)) ; only an example ((vn pizz p)) ((vn pizz f) (va ponte f)) ((pno tasto ff)) ((pno pizz fff)) ((vn tasto mf) (pno ord ff) (vc tasto mf) (trp ord pp)) ((trp mute pp) (vn ponte mf)))))) (def-score hoquetus.4 (:key-signature '(c maj) :time-signature '(4 4) :tempo '(120) :layout (bracket-group (trumpet-layout 'trumpet) (piano-grand-layout 'piano) (violin-layout 'violin) (viola-layout 'viola) (violoncello-layout 'violoncello))) (trumpet :omn (gen-hoquetus.4 'trp :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (piano :omn (gen-hoquetus.4 'pno :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (violin :omn (gen-hoquetus.4 'vn :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (viola :omn (gen-hoquetus.4 'va :pitch pitches :length lengths :instrument-list instrumentation) :channel 1) (violoncello :omn (gen-hoquetus.4 'vc :pitch pitches :length lengths :instrument-list instrumentation) :channel 1))
  22. 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é
  23. (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))
  24. thank you!! it works with the "define articulations names", but not with "+" = it sends no programm-change (but written "legno battuto" in score...) ?
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy