Jump to content

AM

Members
  • Posts

    793
  • Joined

  • Last visited

Reputation Activity

  1. Like
    AM reacted to Stephane Boussuge in Petite suite Partie 4/6   
    Hi folks,
    Here's a work in progress made with the fantastic COUNTERPOINT function.
     
     
    S.
  2. Thanks
    AM got a reaction from JulioHerrlein in harmonics for equal tempered tunings / guitar // sorting single-events?   
    dear julio
     
    i would code it! you could do a "systematic/formalized sketch" (not in LISP) and with that you would try to program a function 🙂
     
    best
    a.
  3. Like
    AM got a reaction from opmo in harmonics for equal tempered tunings / guitar // sorting single-events?   
    here it is... but NOT microtonal. just for equal tempered tunings
     
    it was too complicated (and not necessary) for me to code it (with attributes and cents, it's a bit ... 🤔), so i coded it just for my needs ... for equal tempered tunings...
    could use it for guitar/strings, just to have a list of your SCORDATURA-harmonics to work with.
     
    would be interesting if someone could CODE a function which transforms a "sounding-pitch-guitar-score" into the "play-score".
    so i wouldn't have to do it by hand... 
    where are the guitar players here? 🙂 julio? janusz?
     
    greetings
    andré
     
    (defun sort-to-pitch-events (events sort) (let* ((int (loop for i in events collect (list (pitch-to-integer (second i)) i))) (out (sortcar sort int))) (loop for i in out collect (second i)))) ;;----------------------------------------------------------------------------------- (defun gen-natural-harmonics (openstrings &key (scale nil) (n 16)) (progn (add-text-attributes '(str1 "str1") '(str2 "str2") '(str3 "str3") '(str4 "str4")'(str5 "str5") '(str6 "str6")) (let* ((cent-list (cents-to-attribute '(0 2 0 -14 2 -31 0 4 -14 -49 -2 41 -31 -12 0))) (harmonic (loop for i from 2 to n collect (compress (list 'num i)))) (harmonic-seq (loop for i in openstrings for j in (list 'str6 'str5 'str4 'str3 'str2 'str1) collect (make-omn :pitch (rest (harmonics i n)) :length '(q) :articulation (loop for i in cent-list for x in harmonic collect (if (equal i '-) (compress (list x '+ j)) (compress (list i '+ x '+ j)))) :span :pitch)))) (if (null scale) harmonic-seq (sort-to-pitch-events (single-events (flatten harmonic-seq)) '<))))) ;;----------------------------------------------------------------------------------- ;;----------------------------------------------------------------------------------- ;; attributes: string number + partial number + CENTS ;; sorted by strings (gen-natural-harmonics '(e1 a1 ds2 g2 a2 b2) :n 7) => ((q e2 num2+str6 b2 2c+num3+str6 e3 num4+str6 gs3 -14c+num5+str6 b3 2c+num6+str6 d4 -31c+num7+str6) (q a2 num2+str5 e3 2c+num3+str5 a3 num4+str5 cs4 -14c+num5+str5 e4 2c+num6+str5 g4 -31c+num7+str5) (q eb3 num2+str4 bb3 2c+num3+str4 eb4 num4+str4 g4 -14c+num5+str4 bb4 2c+num6+str4 cs5 -31c+num7+str4) (q g3 num2+str3 d4 2c+num3+str3 g4 num4+str3 b4 -14c+num5+str3 d5 2c+num6+str3 f5 -31c+num7+str3) (q a3 num2+str2 e4 2c+num3+str2 a4 num4+str2 cs5 -14c+num5+str2 e5 2c+num6+str2 g5 -31c+num7+str2) (q b3 num2+str1 fs4 2c+num3+str1 b4 num4+str1 eb5 -14c+num5+str1 fs5 2c+num6+str1 a5 -31c+num7+str1)) ;; sorted by pitch (gen-natural-harmonics '(e1 f1 a1 d2) :n 7 :scale t) => ((q e2 mf num2+str6) (q f2 mf num2+str5) (q a2 mf num2+str4) (q b2 mf 2c+num3+str6) (q c3 mf 2c+num3+str5) (q d3 mf num2+str3) (q e3 mf num4+str6) (q e3 mf 2c+num3+str4) (q f3 mf num4+str5) (q gs3 mf -14c+num5+str6) (q a3 mf -14c+num5+str5) (q a3 mf num4+str4) (q a3 mf 2c+num3+str3) (q b3 mf 2c+num6+str6) (q c4 mf 2c+num6+str5) (q cs4 mf -14c+num5+str4) (q d4 mf -31c+num7+str6) (q d4 mf num4+str3) (q eb4 mf -31c+num7+str5) (q e4 mf 2c+num6+str4) (q fs4 mf -14c+num5+str3) (q g4 mf -31c+num7+str4) (q a4 mf 2c+num6+str3) (q c5 mf -31c+num7+str3))  
  4. Like
    AM reacted to opmo in harmonics for equal tempered tunings / guitar // sorting single-events?   
    Here it is:
    (defun sort-to-pitch-events (events sort) (let* ((int (loop for i in events collect (list (pitch-to-integer (second i)) i))) (out (sortcar sort int))) (loop for i in out collect (second i)))) (setf events '((e e4 mf) (e a4 mf) (e d5 mf) (e g5 mf) (e b5 mf) (e d6 mf) (e b4 mf 2c) (e e5 mf 2c) (e a5 mf 2c) (e d6 mf 2c) (e fs6 mf 2c) (e a6 mf 2c) (e e5 mf) (e a5 mf) (e d6 mf) (e g6 mf) (e b6 mf) (e d7 mf) (e gs5 mf -14c) (e cs6 mf -14c) (e fs6 mf -14c) (e b6 mf -14c) (e eb7 mf -14c) (e fs7 mf -14c) (e b5 mf 2c) (e e6 mf 2c) (e a6 mf 2c) (e d7 mf 2c) (e fs7 mf 2c) (e a7 mf 2c) (e d6 mf -31c) (e g6 mf -31c) (e c7 mf -31c) (e f7 mf -31c) (e a7 mf -31c) (e c8 mf -31c) (e e6 mf) (e a6 mf) (e d7 mf) (e g7 mf) (e b7 mf) (e d8 mf))) (sort-to-pitch-events events '>) => ((e d8 mf) (e c8 mf -31c) (e b7 mf) (e a7 mf 2c) (e a7 mf -31c) (e g7 mf) (e fs7 mf -14c) (e fs7 mf 2c) (e f7 mf -31c) (e eb7 mf -14c) (e d7 mf) (e d7 mf 2c) (e d7 mf) (e c7 mf -31c) (e b6 mf) (e b6 mf -14c) (e a6 mf 2c) (e a6 mf 2c) (e a6 mf) (e g6 mf) (e g6 mf -31c) (e fs6 mf 2c) (e fs6 mf -14c) (e e6 mf 2c) (e e6 mf) (e d6 mf) (e d6 mf 2c) (e d6 mf) (e d6 mf -31c) (e cs6 mf -14c) (e b5 mf) (e b5 mf 2c) (e a5 mf 2c) (e a5 mf) (e gs5 mf -14c) (e g5 mf) (e e5 mf 2c) (e e5 mf) (e d5 mf) (e b4 mf 2c) (e a4 mf) (e e4 mf)) (sort-to-pitch-events events '<) => ((e e4 mf) (e a4 mf) (e b4 mf 2c) (e d5 mf) (e e5 mf 2c) (e e5 mf) (e g5 mf) (e gs5 mf -14c) (e a5 mf 2c) (e a5 mf) (e b5 mf) (e b5 mf 2c) (e cs6 mf -14c) (e d6 mf) (e d6 mf 2c) (e d6 mf) (e d6 mf -31c) (e e6 mf 2c) (e e6 mf) (e fs6 mf 2c) (e fs6 mf -14c) (e g6 mf) (e g6 mf -31c) (e a6 mf 2c) (e a6 mf 2c) (e a6 mf) (e b6 mf) (e b6 mf -14c) (e c7 mf -31c) (e d7 mf) (e d7 mf 2c) (e d7 mf) (e eb7 mf -14c) (e f7 mf -31c) (e fs7 mf -14c) (e fs7 mf 2c) (e g7 mf) (e a7 mf 2c) (e a7 mf -31c) (e b7 mf) (e c8 mf -31c) (e d8 mf))  
  5. Thanks
    AM got a reaction from JulioHerrlein in GHOST INVISIBLE CHARACTER FOR SPAN and LIST Skipping Needed   
    real LISP knowledge is very helpful for me. i think it's enough if you know (work with) the fundamentals - like... list/append/cons/loop/loop-inside-a-loop/progn/push/pop/collect/defun... ...
     
    so that you can code your specific solutions! 
     
    greetings
    andré
  6. Like
    AM reacted to opmo in Microtonal notations   
    here it is:

  7. Like
    AM reacted to JulioHerrlein in COOL !! - Length Diminution with fractions   
    I discovered today that you can use just length-diminution to expand OR contract rhythms, just by using fractions. You can use ti to make some proportional metric modulation stuff.
     
    Here are some examples. 
    ORIGINAL
    (length-diminution 1/1 '(q e e e e s s s s))

    CONTRACT
    (length-diminution 2/1 '(q e e e e s s s s))

    EXPAND
    (length-diminution 1/2 '(q e e e e s s s s))

     
    (length-diminution 1/3 '(q e e e e s s s s))

    (length-diminution 3/2 '(q e e e e s s s s))
     

     
    (length-diminution 3/4 '(q e e e e s s s s))

     
    And so on !!
    This is cool !
    Best,
    Julio
     
  8. Like
    AM reacted to Stephane Boussuge in Does Opusmodus come with sample library?   
    I've made a soundest for BBC Symphonic Orchestra Core version but it probably works as well with this one.
     
    You will find it attached to this post.
     
    best
     
    SB.
     
    BBCSO.lisp
  9. Thanks
    AM got a reaction from JulioHerrlein in row-permutation   
    row-permutation (with rule) for n-generations
     
    (defun row-permutation (n row rules &key (one-based nil)) (let ((rules (if (equal one-based t) (mapcar '1- rules) rules))) (loop repeat n collect (setf row (position-filter rules row))))) (row-permutation 5 '(a4 c5 cs5 g4 eb5 gs4 e5 d5 f4 b4 bb4 fs4) '(0 1 6 5 2 3 7 8 11 9 4 10)) => ((a4 gs4 eb5 c5 cs5 e5 d5 bb4 f4 g4 b4) (a4 e5 cs5 gs4 eb5 d5 bb4 b4 f4 c5 g4) (a4 d5 eb5 e5 cs5 bb4 b4 g4 f4 gs4 c5) (a4 bb4 cs5 d5 eb5 b4 g4 c5 f4 e5 gs4) (a4 b4 eb5 bb4 cs5 g4 c5 gs4 f4 d5 e5)) (row-permutation 5 '(a4 c5 cs5 g4 eb5 gs4 e5 d5 f4 b4 bb4 fs4) '(1 4 6 5 2 3 7 8 11 9 10 12) :one-based t) => ((a4 g4 gs4 eb5 c5 cs5 e5 d5 bb4 f4 b4 fs4) (a4 eb5 cs5 c5 g4 gs4 e5 d5 b4 bb4 f4 fs4) (a4 c5 gs4 g4 eb5 cs5 e5 d5 f4 b4 bb4 fs4) (a4 g4 cs5 eb5 c5 gs4 e5 d5 bb4 f4 b4 fs4) (a4 eb5 gs4 c5 g4 cs5 e5 d5 b4 bb4 f4 fs4))  
  10. Thanks
    AM got a reaction from JulioHerrlein in Jean Barraqué - "séries proliférantes"   
    violà... now it works fine 🙂  - OPMO could integrate it....  
     
    it's easier than i thought: a single index-series is read from the r-i and only this one is used! similar to LACHEMANN, only he determines this index-series himself (for that i coded this simple row-permutation-function)...
     
    greetings
    a.
     
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SUB (defun row-permutation (n row rules &key (one-based nil)) (let* ((rules (if (equal one-based t) (mapcar '1- rules) rules))) (loop repeat n collect (setf row (position-filter rules row))))) ;;; MAIN (defun serie-proliferantes (n row) (let ((index-no (loop for x in (pitch-to-midi (pitch-invert (gen-retrograde row))) collect (or (position x (pitch-to-midi row)) (position (- x 12) (pitch-to-midi row)) (position (+ x 12) (pitch-to-midi row)))))) (list row (pitch-invert (gen-retrograde row)) (row-permutation n (pitch-invert (gen-retrograde row)) index-no)))) (serie-proliferantes 6 '(c5 ab4 g4 db5 e4 d4 bb4 eb4 b4 f4 fs4 a4)) => ((c5 ab4 g4 db5 e4 d4 bb4 eb4 b4 f4 fs4 a4) (a4 c5 cs5 g4 eb5 gs4 e5 d5 f4 b4 bb4 fs4) ((fs4 a4 g4 cs5 d5 c5 eb5 gs4 b4 f4 e5 bb4) (bb4 fs4 cs5 g4 gs4 a4 d5 c5 f4 b4 eb5 e5) (e5 bb4 g4 cs5 c5 fs4 gs4 a4 b4 f4 d5 eb5) (eb5 e5 cs5 g4 a4 bb4 c5 fs4 f4 b4 gs4 d5) (d5 eb5 g4 cs5 fs4 e5 a4 bb4 b4 f4 c5 gs4) (gs4 d5 cs5 g4 bb4 eb5 fs4 e5 f4 b4 a4 c5)))  
  11. Like
    AM got a reaction from opmo in Jean Barraqué - "séries proliférantes"   
    here  a function... to barraqué's techniques
     
    (defun serie-proliferantes (row) (let* ((ri_row (pitch-invert (gen-retrograde row))) (row (loop for z in (loop for x in (pitch-to-midi ri_row) collect (or (position x (pitch-to-midi row)) (position (- x 12) (pitch-to-midi row)) (position (+ x 12) (pitch-to-midi row)))) collect (nth z ri_row)))) row)) (serie-proliferantes '(c5 ab4 g4 db5 e4 d4 bb4 eb4 b4 f4 fs4 a4)) => (fs4 a4 g4 cs5 d5 c5 eb5 gs4 b4 f4 e5 bb4)  
    Jean Barraqué — Wikipédia
    FR.WIKIPEDIA.ORG  
    seen here:
    https://www.amazon.de/Jean-Barraqué-Musik-Konzepte-Heinz-Klaus-Metzger/dp/3883774499
     
    page 19-20
     
     

     

     
  12. Like
    AM got a reaction from opmo in Jean Barraqué - "séries proliférantes"   
    violà... now it works fine 🙂  - OPMO could integrate it....  
     
    it's easier than i thought: a single index-series is read from the r-i and only this one is used! similar to LACHEMANN, only he determines this index-series himself (for that i coded this simple row-permutation-function)...
     
    greetings
    a.
     
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SUB (defun row-permutation (n row rules &key (one-based nil)) (let* ((rules (if (equal one-based t) (mapcar '1- rules) rules))) (loop repeat n collect (setf row (position-filter rules row))))) ;;; MAIN (defun serie-proliferantes (n row) (let ((index-no (loop for x in (pitch-to-midi (pitch-invert (gen-retrograde row))) collect (or (position x (pitch-to-midi row)) (position (- x 12) (pitch-to-midi row)) (position (+ x 12) (pitch-to-midi row)))))) (list row (pitch-invert (gen-retrograde row)) (row-permutation n (pitch-invert (gen-retrograde row)) index-no)))) (serie-proliferantes 6 '(c5 ab4 g4 db5 e4 d4 bb4 eb4 b4 f4 fs4 a4)) => ((c5 ab4 g4 db5 e4 d4 bb4 eb4 b4 f4 fs4 a4) (a4 c5 cs5 g4 eb5 gs4 e5 d5 f4 b4 bb4 fs4) ((fs4 a4 g4 cs5 d5 c5 eb5 gs4 b4 f4 e5 bb4) (bb4 fs4 cs5 g4 gs4 a4 d5 c5 f4 b4 eb5 e5) (e5 bb4 g4 cs5 c5 fs4 gs4 a4 b4 f4 d5 eb5) (eb5 e5 cs5 g4 a4 bb4 c5 fs4 f4 b4 gs4 d5) (d5 eb5 g4 cs5 fs4 e5 a4 bb4 b4 f4 c5 gs4) (gs4 d5 cs5 g4 bb4 eb5 fs4 e5 f4 b4 a4 c5)))  
  13. Like
    AM reacted to JulioHerrlein in Jean Barraqué - "séries proliférantes"   
    Thank you, for the information !!
    André, could you do a brief explanation of the function, please ?
    I´m interested in ways of construction 12 tone sequences, aka rows...
    Unfortunately, I can´t read german despite my german surname...
    All the best !!
     
    Here is some recent review articles about AIR series, by Marco Nardelli
     
    https://www.researchgate.net/publication/342093979_The_Hitchhiker's_Guide_to_the_All-Interval_12-Tone_Rows
     
  14. Thanks
    AM got a reaction from JulioHerrlein in Jean Barraqué - "séries proliférantes"   
    thank you for the LINKS, i will read the papers!
    greetings
    andré
  15. Like
    AM got a reaction from JulioHerrlein in Jean Barraqué - "séries proliférantes"   
    thanx, dear julio. 
     
    the "serialists" often have suitable concepts for formalization 😄
     
    greetings
    andré
  16. Like
    AM reacted to Deb76 in Jean Barraqué - "séries proliférantes"   
    Thank you for this function / script regarding "les séries proliférantes". By carrying out a research on the book "Jean Barraqué, Ecrits" and published by the "publications of the Sorbonne" I discovered this site around Jean Barraqué and in particular examples of the scores and the booklets of "Séquence (1950-55) , "Le temps restitué (1959)", "... au delà du hasard (1959)", "Chant après chant (1966)" and "Concerto (1968)". I tell myself that under the documentation that might be of interest to members :
     
    Bärenreiter Verlag - Download
    WWW.BAERENREITER.COM Concerning "Ecrits Jean Barraqué, réunis, présentées et annotées par Laurent Feneyrou", for those who read French, I found a communication and an article published on the site "Entretemps". The communication to "Samedi d'Entretemps of October 26, 2002," Jean Barraqué: de l'écrit, le devenir" by Franck C. Yeznikan, evokes in particular the analyzes published in the book on Beethoven, Debussy, Webern, Messiaen:
     
    Jean Barraqué : de l'écrit, le devenir
    WWW.ENTRETEMPS.ASSO.FR  
    "Le Souci du Développement chez Barraqué" by François Nicolas, published in Entretemps n ° 5 in 1987, evokes the two main references of Barraqué according to the author, "Beethoven and Debussy ", his admiration of Webern and Schubert. Without forgetting the interest and taste of Barraqué concerning musical analysis.

    And to stay on topic on "les séries proliférantes", a theoretical explanation on this technique developed by Barraqué to escape the immutable intervallic structures of series  : 
     
    Le souci du développement chez Barraqué
    WWW.ENTRETEMPS.ASSO.FR  

  17. Like
    AM reacted to Stephane Boussuge in Hô Chi Minh City for chamber ensemble   
  18. Like
    AM got a reaction from lviklund in L-System   
    one other interesting approach could be, to use l-systems on a "higher level"... (a lot of work to this is already made in OPENMUSIC)
    a sequence like '(a b a c a d a a b a e ...) ;; as a "nonsense-l-system-example-seq"
    could be used as a seq for FUNCTIONS... means:
     
    an input/omn-seq would be transformed by an l-system-function-sequence, for example...
     
    a = rotate pitches and lengths
    b = invert pitches
    c = sample-seq pitches
    d = change velocities
     
    so you could work with more complex input-gestalts... and when you are doing this on a second/third-level inside of such GESTALTS you will have something like this MODEL...
     
    Hypercycle (chemistry) - Wikipedia
    EN.WIKIPEDIA.ORG  
     
    i think HANSPETER KYBURZ is "the MASTER" for L-SYSTEMS in MUSICAL COMPOSITION, and i he talked about this things in his lectures
     
    Details - Hochschule für Musik Hanns Eisler Berlin
    WWW.HFM-BERLIN.DE Hanspeter Kyburz - Wikipedia
    EN.WIKIPEDIA.ORG  
    famous pieces with/on this are:
     
    CELLS
     
     
    or
    PARTS
     
     
     
     
     
    https://www.youtube.com/channel/UCkBcN66Y0mYZ8EJ_ihZvkdg
     
  19. Like
    AM got a reaction from Stephane Boussuge in L-System   
    one other interesting approach could be, to use l-systems on a "higher level"... (a lot of work to this is already made in OPENMUSIC)
    a sequence like '(a b a c a d a a b a e ...) ;; as a "nonsense-l-system-example-seq"
    could be used as a seq for FUNCTIONS... means:
     
    an input/omn-seq would be transformed by an l-system-function-sequence, for example...
     
    a = rotate pitches and lengths
    b = invert pitches
    c = sample-seq pitches
    d = change velocities
     
    so you could work with more complex input-gestalts... and when you are doing this on a second/third-level inside of such GESTALTS you will have something like this MODEL...
     
    Hypercycle (chemistry) - Wikipedia
    EN.WIKIPEDIA.ORG  
     
    i think HANSPETER KYBURZ is "the MASTER" for L-SYSTEMS in MUSICAL COMPOSITION, and i he talked about this things in his lectures
     
    Details - Hochschule für Musik Hanns Eisler Berlin
    WWW.HFM-BERLIN.DE Hanspeter Kyburz - Wikipedia
    EN.WIKIPEDIA.ORG  
    famous pieces with/on this are:
     
    CELLS
     
     
    or
    PARTS
     
     
     
     
     
    https://www.youtube.com/channel/UCkBcN66Y0mYZ8EJ_ihZvkdg
     
  20. Like
    AM got a reaction from Stephane Boussuge in Jean Barraqué - "séries proliférantes"   
    here  a function... to barraqué's techniques
     
    (defun serie-proliferantes (row) (let* ((ri_row (pitch-invert (gen-retrograde row))) (row (loop for z in (loop for x in (pitch-to-midi ri_row) collect (or (position x (pitch-to-midi row)) (position (- x 12) (pitch-to-midi row)) (position (+ x 12) (pitch-to-midi row)))) collect (nth z ri_row)))) row)) (serie-proliferantes '(c5 ab4 g4 db5 e4 d4 bb4 eb4 b4 f4 fs4 a4)) => (fs4 a4 g4 cs5 d5 c5 eb5 gs4 b4 f4 e5 bb4)  
    Jean Barraqué — Wikipédia
    FR.WIKIPEDIA.ORG  
    seen here:
    https://www.amazon.de/Jean-Barraqué-Musik-Konzepte-Heinz-Klaus-Metzger/dp/3883774499
     
    page 19-20
     
     

     

     
  21. Like
    AM reacted to Rangarajan in L-System   
    Hi,
    Opusmodus team has done a great job in supporting L-system. I have been spending some time to understand this feature; seems quite powerful.
     
    I have just uploaded a blog post on this topic. Your comments and suggestions will be very much appreciated.
     
    Does OM implementation support the full functionality as outlined in this paper?
     
    - Rangarajan
  22. Like
    AM reacted to opmo in Opusmodus 2.1.26209   
    2.1.26209

    – New Functions:
    CHORD-DERIVE - Chord rotation method developed by Pierre Boulez. RHYTHMIC-LEVEL - Returns a list of rhythmic levels derived from a span and its division, according to given proportions. RP - This function result derives from a pair-list and returns a number of repeats on a given item.  
    – Additions:
    PITCH-VARIANT - additional variant symbol 'a (random order).
      Downloads
  23. Thanks
    AM got a reaction from JulioHerrlein in gen-hoquetus   
    ;; 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))  
  24. Thanks
    AM got a reaction from opmo in convert-to-binary   
    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é
     
     
    (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)) ;;;; CONVERT PITCH/LENGTH or VELOCITY TO BINARY INFORMATION (defun convert-to-binary (alist &key (parameter 'pitch) (length-resolution 127) (velocity-resolution 127) (pitch-resolution 127) (event nil) (bitlength 7)) (let ((pitch) (length) (velocity) (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))) ((equal event 't) (setf alist (single-events alist)))) alist)))) (if (null event) (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)) :bitlength bitlength))) ((lengthp (car alist)) (fill-to-x-bit (decimal-to-binary (vector-round 1 length-resolution (mapcar 'float (omn :length alist)))) :bitlength bitlength)) ((velocityp (car alist)) (fill-to-x-bit (decimal-to-binary (vector-round 1 velocity-resolution (get-velocity alist))) :bitlength bitlength))) (progn (setf pitch (progn (setf alist (pitch-to-midi (pitch-melodize (omn :pitch alist)))) (fill-to-x-bit (decimal-to-binary (vector-round 0 (if (null pitch-resolution) (- (find-max alist) (find-min alist)) pitch-resolution) alist)) :bitlength bitlength))) (setf length (fill-to-x-bit (decimal-to-binary (vector-round 1 length-resolution (mapcar 'float (omn :length alist)))) :bitlength bitlength)) (setf velocity (fill-to-x-bit (decimal-to-binary (vector-round 1 velocity-resolution (get-velocity (omn :velocity alist)))) :bitlength bitlength)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (convert-to-binary '(c4 cs5 fs3 c5 f5) :bitlength 15) (convert-to-binary '(-e e -q h e) :bitlength 15) (convert-to-binary '(p p ffff mp ) :bitlength 15)  
     
     
  25. Like
    AM got a reaction from Stephane Boussuge in convert-to-binary   
    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é
     
     
    (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)) ;;;; CONVERT PITCH/LENGTH or VELOCITY TO BINARY INFORMATION (defun convert-to-binary (alist &key (parameter 'pitch) (length-resolution 127) (velocity-resolution 127) (pitch-resolution 127) (event nil) (bitlength 7)) (let ((pitch) (length) (velocity) (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))) ((equal event 't) (setf alist (single-events alist)))) alist)))) (if (null event) (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)) :bitlength bitlength))) ((lengthp (car alist)) (fill-to-x-bit (decimal-to-binary (vector-round 1 length-resolution (mapcar 'float (omn :length alist)))) :bitlength bitlength)) ((velocityp (car alist)) (fill-to-x-bit (decimal-to-binary (vector-round 1 velocity-resolution (get-velocity alist))) :bitlength bitlength))) (progn (setf pitch (progn (setf alist (pitch-to-midi (pitch-melodize (omn :pitch alist)))) (fill-to-x-bit (decimal-to-binary (vector-round 0 (if (null pitch-resolution) (- (find-max alist) (find-min alist)) pitch-resolution) alist)) :bitlength bitlength))) (setf length (fill-to-x-bit (decimal-to-binary (vector-round 1 length-resolution (mapcar 'float (omn :length alist)))) :bitlength bitlength)) (setf velocity (fill-to-x-bit (decimal-to-binary (vector-round 1 velocity-resolution (get-velocity (omn :velocity alist)))) :bitlength bitlength)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (convert-to-binary '(c4 cs5 fs3 c5 f5) :bitlength 15) (convert-to-binary '(-e e -q h e) :bitlength 15) (convert-to-binary '(p p ffff mp ) :bitlength 15)  
     
     
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy