Jump to content

AM

Members
  • Content Count

    609
  • Joined

  • Last visited

Posts posted by AM

  1. for my current project i have to CONVERT/MAP pitches/lengths/velocity or MIDI into a binary sequence. so i coded this simple FUNCTION... feel free to use/adapt....

     

    greetings

    andré

     

     

    ;; SUB
    
    (defun fill-to-x-bit (listseq &key (bitlength 7))
      (loop for i in listseq
        when (< (length i) bitlength)
        collect (append (gen-repeat (- bitlength (length i)) 0) i)
        else collect i))
                       
    ;; MAIN
                       
    (defun convert-to-binary (alist &key (parameter 'pitch) (length-resolution 127) (velocity-resolution 12) (pitch-resolution nil))
      (let ((alist (progn 
                     (setf alist (cond ((stringp alist)
                                        (flatten (midi-to-omn alist :instrument 1)))
                                       (t alist)))
                     
                     (if (omn-formp alist)
                       (cond ((equal parameter 'pitch)
                              (setf alist (omn :pitch alist)))
                             ((equal parameter 'length)
                              (setf alist (omn :length alist)))
                             ((equal parameter 'velocity)
                              (setf alist (omn :velocity alist))))
                       alist))))
                               
    
      (cond ((pitchp (car alist))
             (progn
               (setf alist  (pitch-to-midi (pitch-melodize alist)))
               (fill-to-x-bit (decimal-to-binary (vector-round 0 (if (null pitch-resolution)
                                                                  (- (find-max alist) (find-min alist))
                                                                  pitch-resolution) alist)))))
    
            ((lengthp (car alist))
              (fill-to-x-bit (decimal-to-binary  (vector-round 0 length-resolution (mapcar 'float (omn :length alist))))))
    
            ((velocityp (car alist))
              (fill-to-x-bit (decimal-to-binary  (vector-round 0 velocity-resolution (get-velocity  alist)))))
            )))
    
    ;; EXAMPLES => the function recognizes the input-format: omn, pitch, length... or MIDI
    
    (convert-to-binary '(c4 d4 eb3 e5 f3))
    => ((0 0 0 1 0 0 1) (0 0 0 1 0 1 1) (0 0 0 0 0 0 0) (0 0 1 1 0 0 1) (0 0 0 0 0 1 0))
    
    (convert-to-binary '(t c4 d4 eb3 e5) :parameter 'pitch)
    => ((0 0 0 1 0 0 1) (0 0 0 1 0 1 1) (0 0 0 0 0 0 0) (0 0 1 1 0 0 1))
    
    (convert-to-binary '(w h q -1/4 w -s -3t t t. s 3s 5q q. w))
    => ((1 1 1 1 1 1 1) (1 0 0 1 1 0 0) (0 1 1 0 0 1 1) (0 0 0 0 0 0 0) (1 1 1 1 1 1 1) (0 0 1 0 0 1 1) (0 0 1 1 0 0 0) (0 0 1 1 1 0 1) (0 0 1 1 1 1 0) (0 1 0 0 0 0 0) (0 0 1 1 1 0 0) (0 0 1 1 1 1 0) (1 0 0 0 0 0 0) (1 1 1 1 1 1 1))
    
    (convert-to-binary '(ppppp pppp ppp pp p mp mf f ff fff ffff fffff))
    => ((0 0 0 0 0 0 0) (0 0 0 0 0 0 1) (0 0 0 0 0 1 0) (0 0 0 0 0 1 1) (0 0 0 0 1 0 0) (0 0 0 0 1 0 1) (0 0 0 0 1 1 0) (0 0 0 0 1 1 1) (0 0 0 1 0 0 1) (0 0 0 1 0 1 0) (0 0 0 1 0 1 1) (0 0 0 1 1 0 0))
    
    ;; for midi => insert midipath
    (convert-to-binary  <midipath> :parameter 'pitch)
    =>

     

     

     

  2. like that? should work...

    it "loops" x-times (depends on length of seeds-list) and collect the rhythms...

     

    (setf seeds (vector-round 1 100 (gen-white-noise 8 :seed 13)))
    
    
    (setf rhythm (loop for i in seeds 
                   collect (euclidean-rhythm 16 4 16 's :type 2 :seed i)))

     

     

    perhaps there is an OPMO-solution, this is LISP

  3. dear ole  

     

    i have no "preseted" soundsets for my work...

    in my current "sketch" i'm using/something something like this..

     

    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    (add-text-attributes
     '(e-bow "e-bow")
     '(harm-I "harm-1")
     '(harm-II "harm-II")
     '(harm-III "harm-III")
     '(harm-IV "harm-IV")
      '(harm-V "harm-V")
     '(harm-VI "harm-VI"))
    
    (def-sound-set gm-guitar
       :programs
      (:group guitar 
              ord 0
              bartok-pizz 1
              tap 2
              ponte 3
              harm-I 4
              harm-II 5
              harm-III 6
              harm-IV 7
              harm-V 8
              harm-VI 9))
    
    
    (def-sound-set gm-vibraphone
       :programs
      (:group vibraphone 
              ord 0
              tap 2))
    
    
    (def-sound-set gm-piano
       :programs
      (:group piano 
              ord 0
              e-bow 1))

     

    for this CT-setup...

     

    git vibra pno.cePlayerOrc

     

     

     

  4. i have been working with conTimbre for a long time and it is exactly what i was looking for. playing techniques can easily be done by OPMO or SIBELIUS (vst3) via program changes. it has a great many different playing techniques. I always found IRCAM_LIB to be very inadequate, as there were not enough playing techniques etc. / you can also control CT via OSC (and as standalone or via MAXMSP). when I wrote for ensemble with additional e-player, CT-live always worked very well.

     

    (The only negative point I could say is that there are a few SAMPLES that weren't played / recorded very well. But with the size of the library, that's okay with me)

  5. Dear all

     

    Today I dealt briefly how to control PROCESSING (software and programming language) by Midi. There is a great interface for this: "rwmidi" by Giuseppe Torre. You can download and install it, it works fine!  

     

    A short Video (no Sound) with a very simple Processing Example

     

     

    I think this is a good combination if you want to visualize your midi output (or just use de midi-data in realtime)  or if you want to program a separate VISUAL track in OPMO. Here is a small example (I can't program usable in PROCESSING yet, sorry :-)) Downloads etc. are here ...

     

    https://processing.org

    https://gitlab.com/giuseppetorre/rwmidi-revival-master

     

    here's a video, how to install etc...

    https://www.youtube.com/watch?v=7iFUenT5B68&feature=youtu.be

     

    and as an attachm. my "sketch" in processing

    sketch_Processing_from_Midi.pde

     

    Greetings André

     

    P.S. I think there ist also a way to send data by OSC

     

  6. dear all

     

    here's an example (from my current work)...

     

    this little video shows how i generate/display SCORE (instrumental parts) on a screen + virtual conductor (piano part). the example is "nonsense", but shows how it looks/works... you see the bars (generating), the cue, beat... and the arrow (that shows you where to read/play) ...also you hear some bad (sry) sound-simulation of the setup.

     

    in this way i can generate a whole piece in realtime on STAGE (all musicians will read their part from their own screen). this one will be for 5 instruments, ePlayer and modular synthesizer. during the performance an algorithm (or some data-streams) will generate the piece in OPMO. with OSC i can send all datas (score, beat, tempo..)  from OPMO to POLYTEMPO-NETWORK  (https://polytempo.zhdk.ch) and work and coordinate different independent tempo layers, conducting etc...

     

    for more POLYTEMPO informations... have a look here: https://polytempo.zhdk.ch

     

    greetings

    andré

     

     

  7. here is a sketch for an alternative "binary-(or element-)layer-FUNCTION

     

    (defun element-layer (lists &key (rnd nil))
      (let ((lists (if (null rnd)
                     lists
                     (rnd-order lists :list t))))
        (car 
         (last 
          (loop for x in (rest lists)
            with list = (car lists)
            collect (setf list (loop for i in list
                                 with cnt = 0 
                                 when (equal i 0)
                                 collect (nth cnt x)
                                 and do (incf cnt)
                                 else collect i)))))))
      
    
    (element-layer  (list  '(1 0 0 1 1 0 0 1 0 0 0 0)
                           '(0 2 3 0 4 5 0 6 0 7 8 0)
                           '(11 12 13 14 15 16 17))
                    :rnd nil)
    
     => (1 11 2 1 1 3 12 1 4 5 13 6)
    
    ;;; hierarchic: every 0's will be replaced by the values from the next/sub-list...

     

  8. you want to map some integers (in your case pc..) to attributes? like that?

     

    (position-filter  '(0 1 2 3 4 5)  '(pizz arco ponte molto-ponte stacc stacc+pizz ten+arco ten+molto-ponte))
    => (pizz arco ponte molto-ponte stacc stacc+pizz)
    
    
    (position-filter  (pcs '6-Z10) '(pizz arco ponte molto-ponte stacc stacc+pizz ten+arco ten+molto-ponte))
    => (pizz arco molto-ponte stacc stacc+pizz ten+molto-ponte)
    
    or in pure CCL
    
    (loop 
      for i in '(0 1 2 3 4 5)
      with attr-list = '(pizz arco ponte molto-ponte stacc stacc+pizz ten+arco ten+molto-ponte)
      collect (nth i  attr-list))
    => (pizz arco ponte molto-ponte stacc stacc+pizz)

     

  9. like that..?... some code...

    greetings

    andré

     

    (defun replace-velocities-in-a-seq (omn-list &key pitch velocity-list)
      (flatten 
       (loop 
         with cnt = 0
         for i in (single-events omn-list)
         
         when (equal (cadr i) pitch)
         collect (omn-replace :velocity (nth cnt velocity-list) i)
         and do (incf cnt)
         else collect i
    
         when (> cnt (length velocity-list))
         do (setf cnt 0))))
    
    
    
    (replace-velocities-in-a-seq '(e c4 ppppp d4 d4 e4 f4 d4 d4 g4 b4 d4 d4 d4 d4)
                                 :pitch 'd4
                                 :velocity-list '(p mp mf f ff))
    
    ;=> (e c4 ppppp e d4 p e d4 mp e e4 ppppp e f4 ppppp e d4 mf e d4 f e g4 ppppp e b4 ppppp e d4 ff e d4 ppppp e d4 p e d4 mp)
    
    ;; if there are more 'd4's then velocity-values, -> it starts again with first velocity-value (= cycle)

     

  10. dear janusz

     

    at the moment i'm working with AUDULUS 3 and OPMO, work's fine.

    but there are some problems with the articulation. is it possible that in ord. there is a little "overlapping" between two notes? in this case AUDULUS don't "recognize" a change of velocity etc... with stacc it works fine (but with a gap).

     

    is there a "non-overlapping"-articulation with almost no gap between the notes?

     

    thanks

    andré

     

     

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy