Jump to content

AM

Members
  • Posts

    792
  • Joined

  • Last visited

Posts posted by AM

  1. 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é

     

  2. 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.

     

  3. ;;; 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

  4. 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)))))
      

     

  5. 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.

     

  6. 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é

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

     

  8. ...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.

  9. 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é

     

     

     

  10. 
    (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...

     

  11. 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))
    

     

     

     

  12. ;; 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))

     

  13. 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é

  14. (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))

     

  15. 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))

     

    :::::::::::::::

     

  16. 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))))

  17. ...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"...

  18. 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)

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

     

     

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy