Jump to content

AM

Members
  • Posts

    792
  • Joined

  • Last visited

Posts posted by AM

  1. the solution...

     

    (defun length-staccato (n alist)
      (let ((newlengths)
            (new-omn (omn-merge-ties (flatten  alist)))
            (time-sign (get-time-signature alist)))
        (progn 
          (setf newlengths (loop for i in (omn :length new-omn)
                             when (> i 0)
                             append (if (= n i)
                                      (list i)
                                      (list n (* -1 (abs (- i n)))))
                             
                             else collect i))
          (if (omn-formp alist)
            (omn-to-time-signature (make-omn :length newlengths
                                             :pitch (omn :pitch new-omn)
                                             :velocity (omn :velocity new-omn)
                                             :articulation (omn :articulation new-omn))
                                   time-sign)
            newlengths))))
    
    
    (length-staccato 1/16 '(q -q q q))
    (length-staccato 1/16 '(q e4 mp q tasto q -q q q))
    (length-staccato 1/16 '((e. c4 eb4 fs4 a4 tie) (s a4 e. cs4 e4 g4 e bb4 tie) (e bb4 e. d4 f4 gs4 s b4)))

     

  2. dear julio

    i don't know if there is a solution in the om-library... coded quickly one for your problem...

    the basic-rhythms (denominator) should stay constant like in your examples, then it works...

     

    first value has to be your "stacc-length", second your omn-list or a length-list, have a look to the example...

    greetings

    andré

     

    (defun length-staccato (n alist)
      (let ((newlengths (loop for i in (omn :length alist)
                          when (> i 0)
                          append (list n (* -1 (abs (- i n))))
                          else collect i)))
        (if (omn-formp alist)
          (make-omn :length newlengths
                    :pitch (omn :pitch alist)
                    :velocity (omn :velocity alist)
                    :articulation (omn :articulation alist))
          newlengths)))
    
    
    (length-staccato 1/16 '(q e4 mp q tasto q -q q q))

     

     

  3. polytempo-discussion in OM (years ago)

    https://opusmodus.com/forums/topic/353-how-to-write-a-polytempo-score/?tab=comments#comment-910

     

    ---

     

    technology for live realisation (how to conduct it)  by real musicians -> by polytempo-network:


    https://www.facebook.com/Philippe-Kocher-Composer-31442199213/

    http://philippekocher.ch/#109

    http://polytempo.zhdk.ch

     

    i used this technology already for 2 pieces... also for my next work.

    greetings

    andré

     

  4. i didn't find a OM-library-solution for this kind of thing, so i coded it...

     

    if you want to REPLACE the articulation of some specific pitches. perhaps all 'd4 sould be PONTE... you could use this.

    it was necessary to code it like that, because otherwise you get in trouble with the empty parameter-slots...

     

    should work fine

    greetings

    andré

     

    ;;; SUBFUNCTIONS
    
    (defun eliminate-nil (alist)
      (loop for i in alist
        when (not (null i))
        collect i))
    
    (defun complete-event-slots (omn-list)
      (let ((omn-art (omn :articulation (single-events (flatten omn-list)))))
        (single-events 
         (omn-replace :articulation (flatten 
                                     (eliminate-nil (loop for i in omn-art
                                                      for cnt = 0 then (incf cnt)
                                                      when (equal (car i) '-)
                                                      collect (nth (1- cnt) omn-art)
                                                      else collect i)))
                    omn-list))))
    
    ;(complete-event-slots '(5q a4 ff pizz 5q e3 -e 5q a4 f))
    
    
    ;;; MAIN FUNCTION
    
    (defun replace-articulation-of-a-pitch (omn-list &key pitches articulation (chance 1.0))
      (loop for i in (complete-event-slots (flatten omn-list))
        when (and (member (car (omn :pitch i)) pitches)
                  (prob? chance))
        append (omn-component-replace i (list articulation))
        else append i))
    
    
    
    
    
    ;;; EXAMPLE
    (replace-articulation-of-a-pitch '(5q a4 ff pizz 5q e3 p -q 5q d4 pizz)
                                     :pitches '(a4 d4) 
                                     :articulation 'ponte
                                     :chance 1.0)
    
    -> (5q a4 ff ponte 5q e3 p pizz -q 5q d4 p ponte)

     

  5. hi all

     

    does anybody already coded a FUNCTION to replace string-pitches by natural or artificial harmonics?

    is the specific notehead in OM (for the artificials)? 

    would/could be very practical... perhaps if you have fast phrases in a large ambitus... the function - if it would be very well coded - could search for the nearest/closest fingering... 

     

    greetings

    andré

  6. hi brian,

     

    i modified shortly the code, now you could do what you want...

    "step-to-pitch" will test now what the tonality-input is ... if tonality = pitches -> then use this scale, othwerwise -> "expand the scale"

     

    (defun map-infinity-series (&key seq start tonality)
      (step-to-pitch :steps (integer-to-interval (reset-seq seq))
                     :pitches (if (pitchp (car tonality))
                                tonality
                                (multiple-expand-tonality :startpitch 'c0 
                                                        :octaves 7 
                                                        :tonality tonality))
                     :start start))
    
    
    (map-infinity-series :seq '(0 -1 3 2 1 2 -1)
                         :start 'fs4
                         :tonality (make-scale 'c2 49  :alt '(1 2 1 1)))
    
    
    
    (map-infinity-series :seq '(0 -1 3 2 1 2 -1 2 2 3 3 1 -1 1 -1 2 2)
                         :start 'g4
                         :tonality '(major))
    
    
    (map-infinity-series :seq '(0 -1 3 2 1 2 -1 2 2 3 3 1 -1 1 -1 2 2)
                         :start 'fs4
                         :tonality '(messiaen-mode1 messiaen-mode2 messiaen-mode3))

    1) do it with library... like '(major) or (messiaen-mode1) or what else

    2) do ith with a pitch-sequence like your '(make-scale 'c2 49  :alt '(1 2 1 1))

     

    -> just REPLACE map-infinity-series by the new function-version

    -> ...the only thing you have to look at it: your start-pitch has to be part of your scale!

  7. violà... bit more organized...

     

    a) now you could copy the SUBFUNCTIONS+MAINFUNCTION into:  extensions -> user library. in that way all the functions will be loaded automatically, and it is not necessary to EVALUATE them before using... but it's useful to document it... 

     

    b) otherwise... all this functions in your workspace/opmo-file... (like you are donig it wright now)

     

    
    ;;; SUBFUNCTIONS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    (defun step-to-pitch (&key steps pitches start)
      (let ((pos (car (position-item start pitches))))
        (append (list (nth pos pitches))
                (loop for i in steps
                  ;; setting pos by add the step to pos
                  do (setf pos (+ pos i))
                  ;; when pitch-range to small then reset to lowest pitch+step
                  ;; could be a more intelligent solution
                  when (or (>= pos (length pitches))
                           (< pos 0))
                  do (setf pos 0);(+ 0 i))
                  collect (nth pos pitches)))))
    
    (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)))))))
    
    (defun reset-seq (seq)
      (let ((n (abs (find-min seq))))
        (loop for i in seq
          collect (+ n i))))
            
    ;;; MAINFUNCTION
                                 
    (defun map-infinity-series (&key seq start tonality)
      (step-to-pitch :steps (integer-to-interval (reset-seq seq))
                     :pitches (multiple-expand-tonality :startpitch 'c0 
                                                        :octaves 7 
                                                        :tonality tonality)
                     :start start))
    
    
    ;;; EXAMPLES OF USE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    (setf inf-list (infinity-series 128 '(1 0)))
    
    (map-infinity-series :seq inf-list
                         :start 'g4
                         :tonality '(major))
    
    (map-infinity-series :seq inf-list
                         :start 'gs3
                         :tonality '(messiaen-mode6))

     

  8. is this correct? i think it is - not smart-coded but it works - you could merge the functions into ONE (sorry for my english). perhaps there is an OPMO-library-solution, but i don't know it...

     

    greetings

     

    (defun step-to-pitch (&key steps pitches start)
      (let ((pos (car (position-item start pitches))))
        (append (list (nth pos pitches))
                (loop for i in steps
                  ;; setting pos by add the step to pos
                  do (setf pos (+ pos i))
                  ;; when pitch-range to small then reset to lowest pitch+step
                  ;; could be a more intelligent solution
                  when (or (>= pos (length pitches))
                           (< pos 0))
                  do (setf pos 0);(+ 0 i))
                  collect (nth pos pitches)))))
    
    (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)))))))
    
    (defun reset-seq (seq)
      (let ((n (abs (find-min seq))))
        (loop for i in seq
          collect (+ n i))))
            
    (step-to-pitch :steps (integer-to-interval (reset-seq '(0 1 -1 2 1 0 -2 3 -1 2 0 1 2 -1 -3 4 1 0 -2 3 0 1 -1 2 -2 3 1 0 3 -2 -4 5 -1 2 0 1 2 -1 -3 4 0 1 -1 2 1 0 -2 3 2 -1 -3 4 -1 2 0 1 -3 4 2 -1 4 -3 -5 6)))
                   :pitches (multiple-expand-tonality :startpitch 'c0 
                              :octaves 7 
                              :tonality '(major))
                   :start 'g4)

     

  9. but YOUR steps are not the same from the web-archive-example

     

    -> in the web-example it's from G in C-major, steps are -> 1 -2

    -> YOU are starting with steps ->  0 1 -1 2 ...

     

    ???

     

    but, i have no idea about this infinity-things, i only MAP your SEQ to MAJOR-scale... in the way you asked for (i think), so perhaps you have to rethink the MAIN-thing?

     

    best wishes

    andré 

     

    added 6 minutes later

    you have to think different - these are NOT steps, these is a INTEGER-TO-PITCH thing...

    perhaps mixed with tonality-map - but haven't time for that at the moment, sorry

  10. dear brian

     

    your pitch-range is too small for the step-sum... if you want to use it you have to enlarge your pitch-range.

    i've now done a small change - so you don' t have an error -> step-stack will now be set to 0, if pitches are lower or higher then your pitch-range, but in this case you don't have exact results mapping the STEPS

    so, enlarge your pitch-range -> perhaps with my "multiple-expand..."-function -> EXAMPLE 2

     

    (defun step-to-pitch (&key steps pitches start)
      (let ((pos (car (position-item start pitches))))
        (append (list (nth pos pitches))
                (loop for i in steps
                  ;; setting pos by add the step to pos
                  do (setf pos (+ pos i))
                  ;; when pitch-range to small then reset to lowest pitch+step
                  ;; could be a more intelligent solution
                  when (or (>= pos (length pitches))
                           (< pos 0))
                  do (setf pos 0);(+ 0 i))
                  collect (nth pos pitches)))))
    
    
    
    ;;; EXAMPLE 1
    
    
    (step-to-pitch :steps '(0 1 -1 2 1 0 -2 3 -1 2 0 1 2 -1 -3 4 1 0 -2 3 0 1 -1 2 -2 3 1 0 3 -2 -4 5 -1 2 0 1 2 -1 -3 4 0 1 -1 2 1 0 -2 3 2 -1 -3 4 -1 2 0 1 -3 4 2 -1 4 -3 -5 6)
                   :pitches '(c3 d3 e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6)
                   :start 'g4)
    
    
    
    
    ;;; here a function which enlarges TONALITIES OVER X-ocavtes
    ;;; so, that's easier then to type :-9
    
    
    (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)))))))
    
    
    (multiple-expand-tonality :startpitch 'c1 
                              :octaves 6 
                              :tonality '(major))
    
    
    ;;; EXAMPLE 2
    
    (step-to-pitch :steps '(0 1 -1 2 1 0 -2 3 -1 2 0 1 2 -1 -3 4 1 0 -2 3 0 1 -1 2 -2 3 1 0 3 -2 -4 5 -1 2 0 1 2 -1 -3 4 0 1 -1 2 1 0 -2 3 2 -1 -3 4 -1 2 0 1 -3 4 2 -1 4 -3 -5 6)
                   :pitches (multiple-expand-tonality :startpitch 'c0 
                              :octaves 7 
                              :tonality '(major))
                   :start 'g4)

     

     

     

     

     

  11. evaluate this, and check out the midi-destinations-function -> shows you the ports

     

    (midi-destinations)
    Quote

    The MIDI-DESTINATION returns a list of names and numbers of your port setup.

    (midi-destinations)
    => ((0 . "Bus 1") (1 . "Bus 2") (2 . "Bus 3")
        (3 . "Bus 4") (4 . "Session 1") (5 . "vPacarana"))

     

    Example:

    (right :omn rhand
           :port 0
           :channel 1
           :sound 'gm
           :program 0)

     

    or with port name:

     

    (right :omn rhand
           :port "Bus 1"
           :channel 1
           :sound 'gm
           :program 0)

     

  12. something like this? don't know if it's like this...

    you want to project a chord on these "filtered pitches"?

     

    (setf lengths  '(1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16))
    
    (setf pitches '(g5 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4
                    gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4
                    c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4
                    bb4 a4 fs4 e4 b4 fs4 a4 g4 gs4 e4 b4 a4 fs4 b4 e4 d4
                    cs5 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4
                    eb4 c5 g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4
                    e4 b4 f4 bb4 gs4 g4))
    
    (setf chord-intervals '(3 1 2 2))
    
    (make-omn :length lengths
              :pitch (loop for i in (append (list 0)
                                            (cumulative-sums
                                             (loop for k in lengths
                                               collect (/ k 1/16))))
                       append (chordize
                               (interval-to-pitch chord-intervals :start (nth i pitches)))))

     

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy