All Activity

This stream auto-updates   

  1. Today
  2. EXAMPLE 3 -> inserts "by hand" ;;; ----------------------------------------------------------------------------- ;;; EXAMPLE 3 PLACING BY HAND AT BAR/BEAT ;;; ----------------------------------------------------------------------------- (init-seed 5) ;(init-seed (random 5)) ;;; GENERATING A "NONSENSE STRUCTURAL NET" (setf basic-mat (omn-to-time-signature (make-omn :pitch (integer-to-pitch (rnd-row)) :length (flatten (gen-mix (gen-length (gen-repeat 12 1) 1/16) (gen-length (mapcar '1+ (rnd-row)) -1/8))) :velocity '(ppp)) '(4 4))) ;;; ----------------------------------------------------------------------------- ;;; YOU WANT TO PUT AN INSERT at BAR 3 on the 2/16 beat (setf mat0 (inserting-on-bar/beat* (length-rest-merge basic-mat) :insert (rnd-sample-seq 5 (make-omn :pitch (integer-to-pitch (rnd-row)) :length (rnd-repeat 12 '(1/32)) :velocity '(fff))) :time-sign '(4 4) :bar 3 :beat '(2 16))) ;;; ----------------------------------------------------------------------------- ;;; YOU WANT TO PUT AN INSERT at BAR 2 on the 3/20 beat (setf mat0 (inserting-on-bar/beat* (length-rest-merge mat0) :insert (rnd-sample-seq 5 (make-omn :pitch (integer-to-pitch (rnd-row)) :length (rnd-repeat 12 '(1/20)) :velocity '(fff))) :time-sign '(4 4) :bar 2 :beat '(3 20))) ;;; ----------------------------------------------------------------------------- ;;; YOU WANT TO PUT AN INSERT at BAR 6 on the 5/24 beat (setf mat0 (inserting-on-bar/beat* (length-rest-merge mat0) :insert (rnd-sample-seq 5 (make-omn :pitch (integer-to-pitch (rnd-row)) :length (rnd-repeat 12 '(1/24)) :velocity '(fff))) :time-sign '(4 4) :bar 6 :beat '(5 24))) (setf mat0 (length-rest-merge mat0)) ;;; ----------------------------------------------------------------------------- ;;; SCORE ;;; ----------------------------------------------------------------------------- (def-score solo-trumpet (:title "solo trumpet" :key-signature 'atonal :time-signature '(4 4) :tempo 134 :layout (bracket-group (treble-layout 'original) (treble-layout 'overwrite1))) (original :omn basic-mat; ORIGINAL :channel 1 :sound 'gm :program 'acoustic-grand-piano) (overwrite1; ORIGINAL WITH INSERTS/OVERWRITES :omn mat0 :channel 1 :sound 'gm :program 'acoustic-grand-piano)) added 1 minute later it's not perfect, some bugs from time to time (if you do something "special")... try to fix it... greetings andré
  3. ;;; ----------------------------------------------------------------------------- ;;; EXAMPLE -> an abstract example how it works (get-position/inserting-on-bar/beat*) ;;; ----------------------------------------------------------------------------- ;;; SUB (defun get-position (seq value &key (get 'all)) (let ((beat) (bar (car (loop for i in seq for bar = 1 then (incf bar) append (loop for j in (single-events i) when (pattern-matchp j (list value)) collect bar))))) (progn (setf beat (loop for k in (loop for i in (single-events (nth (1- bar) seq)) when (not (pattern-matchp i (list value))) append (omn :length i) else collect 'match) when (numberp k) collect (abs k) into bag when (equal k 'match) do (return (list (1+ (numerator (abs (sum bag)))) (denominator (abs (sum bag)))))))) (cond ((equal get 'all) (list bar beat)) ((equal get 'bar) (append bar)) ((equal get 'beat) (append beat))))) (defun get-resolution2 (beat) (cond ((memberp (cadr beat) '(3 6 12 24 48)) 1/24) ((memberp (cadr beat) '(1 2 4 8 16 32)) 1/16) ((memberp (cadr beat) '(5 10 20 40)) 1/20) ((memberp (cadr beat) '(7 14 28 56)) 1/28))) ;;; MAIN: INSERTING SEQ WITH OVERWRITE (defun inserting-on-bar/beat* (seq &key insert time-sign bar beat) (let ((resolution (get-resolution2 beat)) (ord-time-sign time-sign) (time-sign (if (listp (car time-sign)) (loop for i in time-sign when (> (caddr i) 1) append (loop repeat (caddr i) collect (list (car i) (cadr i))) else collect (list (car i) (cadr i))) (append time-sign))) (distance (if (listp (car time-sign)) (+ (car (loop repeat (- bar 1) for i in time-sign collect (/ (* (1- bar) (/ (car i) (cadr i))) (get-resolution2 beat)))) (/ (/ (1- (car beat)) (cadr beat)) (get-resolution2 beat))) (+ (/ (* (1- bar) (/ (car time-sign) (cadr time-sign))) (get-resolution2 beat)) (/ (/ (1- (car beat)) (cadr beat)) (get-resolution2 beat)))))) (omn-to-time-signature (omn-merge-ties (flatten (loop repeat (length (omn-to-time-signature seq (list (numerator resolution) (denominator resolution)))) for cnt = 0 then (incf cnt) with new-seq = (omn-to-time-signature seq (list (numerator resolution) (denominator resolution))) with insert-rounded = (append insert (rest (length-rational-quantize (list (apply '+ (omn :length insert))) :round resolution))) when (= cnt distance) collect insert-rounded and do (setf cnt (+ (/ (get-span (flatten insert-rounded)) resolution) cnt -1)) else collect (nth cnt new-seq)))) ord-time-sign))) ;;; ----------------------------------------------------------------------------- ;;; THE EXAMPLE ;;; ----------------------------------------------------------------------------- (init-seed (random 20)) ;;; GENERATING A "NONSENSE STRUCTURAL NET" (setf basic-mat (omn-to-time-signature (make-omn :pitch (integer-to-pitch (rnd-row)) :length (flatten (gen-mix (gen-length (gen-repeat 12 1) 1/16) (gen-length (mapcar '1+ (rnd-row)) -1/16))) :velocity '(ppp)) '(4 4))) ;;; ----------------------------------------------------------------------------- ;;; THE "GET-POSITION" searchs the position (bar/beat) of a specific value) ;;; and "inserting-on-bar/beat*" overwrites the basic OMN, and the iNSERT ;;; is sproutet at the VALUE-point => here is an example with axiom and 4 generations ;;; FIRST GENERATION -> VALUE 'b4 (setf mat0 (inserting-on-bar/beat* basic-mat :insert '(s b4 ff cs5 ds5 e5 e fs5 fs5) :time-sign '(4 4) :bar (get-position basic-mat 'b4 :get 'bar) :beat (get-position basic-mat 'b4 :get 'beat))) ;;; SECOND GENERATION -> VALUE 'gs4 (setf mat1 (inserting-on-bar/beat* mat0 :insert (pitch-transpose -3 (pitch-invert '(s b4 ff cs5 ds5 e5 e fs5 fs5) ) ) :time-sign '(4 4) :bar (get-position mat0 'gs4 :get 'bar) :beat (get-position mat0 'gs4 :get 'beat))) ;;; THIRD GENERATION -> VALUE 'g4 (setf mat2 (inserting-on-bar/beat* mat1 :insert '(q g4 ff e4 h e4 q f4 d4 h d4) :time-sign '(4 4) :bar (get-position mat1 'g4 :get 'bar) :beat (get-position mat1 'g4 :get 'beat))) ;;; FOURTH GENERATION -> VALUE 'ds5 (is an elemnt of the INSERT in first generation!) (setf mat3 (inserting-on-bar/beat* mat2 :insert (pitch-transpose 4 (pitch-invert '(s b4 ff cs5 ds5 e5 e fs5 fs5) ) ) :time-sign '(4 4) :bar (get-position mat2 'ds5 :get 'bar) :beat (get-position mat2 'ds5 :get 'beat))) (def-score solo-trumpet (:title "solo trumpet" :key-signature 'atonal :time-signature '(4 4) :tempo 134 :layout (bracket-group (treble-layout 'original) (treble-layout 'overwrite1) ; gen1 (treble-layout 'overwrite2) ; gen2 (treble-layout 'overwrite3) ; gen 3 (treble-layout 'overwrite4))) ; gen 4 (original :omn basic-mat :channel 1 :sound 'gm :program 'acoustic-grand-piano) (overwrite1 :omn mat0 :channel 1 :sound 'gm :program 'acoustic-grand-piano) (overwrite2 :omn mat1 :channel 1 :sound 'gm :program 'acoustic-grand-piano) (overwrite3 :omn mat2 :channel 1 :sound 'gm :program 'acoustic-grand-piano) (overwrite4 :omn mat3 :channel 1 :sound 'gm :program 'acoustic-grand-piano)) added 12 minutes later another, easy-to-understand example ;;; ----------------------------------------------------------------------------- ;;; EXAMPLE2 ;;; ----------------------------------------------------------------------------- (init-seed (random 20)) ;;; GENERATING A "NONSENSE STRUCTURAL NET" (setf basic-mat (omn-to-time-signature (make-omn :pitch (integer-to-pitch (rnd-row)) :length (flatten (gen-mix (gen-length (gen-repeat 12 1) 1/16) (gen-length (mapcar '1+ (rnd-row)) -1/16))) :velocity '(ppp)) '(4 4))) ;;; ----------------------------------------------------------------------------- ;;; PICKING A PITCH RANDOMLY (setf value (rnd-pick (flatten (omn :pitch basic-mat)))) ;;; INSERTS AT THE POSITION OF THE RANDOMLY CHOSEN PITCH (setf mat0 (inserting-on-bar/beat* basic-mat :insert (make-omn :pitch (pitch-transpose-start value '(b4 cs5 ds5 e5 e fs5 fs5 gs5 gs5 gs5 gs5 fs5)) :length '(s s s s e e s s s s q) :velocity '(fff)) :time-sign '(4 4) :bar (get-position basic-mat value :get 'bar) :beat (get-position basic-mat value :get 'beat))) (def-score solo-trumpet (:title "solo trumpet" :key-signature 'atonal :time-signature '(4 4) :tempo 134 :layout (bracket-group (treble-layout 'original) (treble-layout 'overwrite1))) (original :omn basic-mat :channel 1 :sound 'gm :program 'acoustic-grand-piano) (overwrite1 :omn mat0 :channel 1 :sound 'gm :program 'acoustic-grand-piano))
  4. hi, yes - with this two functions (get-posititon & inserting-on-bar/beat*) you will have a lot of possibilities... 1) post-processing an OMN without changing the global time structure 2) working with "strukturnetze" (lachenmann) 3) countrepoints 4) idea of palimpsts .... ...so, perhaps OPMO could code it smarter then me (that's not complicated :-))? ... i try to do an example today with something like a "strukturnetz"
  5. Hi, could be also useful for counterpoint ! Great ! S.
  6. Yesterday
  7. ;;; gets the position => bar and beat where the value is ;;; => could be used in combination with "inserting-on-bar/beat*", ;;; if you are looking for a specific value to sprout a sequqnce ;;; FUNCTION (defun get-position (seq value &key (get 'all)) (let ((beat) (bar (car (loop for i in seq for bar = 1 then (incf bar) append (loop for j in (single-events i) when (pattern-matchp j (list value)) collect bar))))) (progn (setf beat (loop for k in (loop for i in (single-events (nth (1- bar) seq)) when (not (pattern-matchp i (list value))) append (omn :length i) else collect 'match) when (numberp k) collect (abs k) into bag when (equal k 'match) do (return (list (1+ (numerator (abs (sum bag)))) (denominator (abs (sum bag)))))))) (cond ((equal get 'all) (list bar beat)) ((equal get 'bar) (append bar)) ((equal get 'beat) (append beat))))) ;;; EXAMPLES: (setf seq '((h c4 q q) (e f4 pp f4 mp f4) (-3q 3q cs5 -3q h))) (get-position seq 'cs5 :get 'all) (get-position seq 'cs5 :get 'bar) (get-position seq 'cs5 :get 'beat) (get-position seq 'pp :get 'all)
  8. hi all the following function could be usefull, it's a first sketch, but it seems to work.... if you want to INSERT a new OMN-seq, perhaps in bar 2 on the 3/20 in your BASIC-OMN-sequence... with this function you can do this, it will overwrite your original phrase. test it or tell me whatelse would be better... greetings andré ;;; ------------------------------------------------------------------------ ;;; INSERTING SEQ BY OVERWRITING ;;; ------------------------------------------------------------------------ ;;; SUB (defun get-resolution2 (beat) (cond ((memberp (cadr beat) '(3 6 12 24 48)) 1/24) ((memberp (cadr beat) '(1 2 4 8 16 32)) 1/16) ((memberp (cadr beat) '(5 10 20 40)) 1/20) ((memberp (cadr beat) '(7 14 28 56)) 1/28))) ;;; MAIN: INSERTING SEQ BY OVERWRITING (defun inserting-on-bar/beat* (seq &key insert time-sign bar beat) (let ((resolution (get-resolution2 beat)) (ord-time-sign time-sign) (time-sign (if (listp (car time-sign)) (loop for i in time-sign when (> (caddr i) 1) append (loop repeat (caddr i) collect (list (car i) (cadr i))) else collect (list (car i) (cadr i))) (append time-sign))) (distance (if (listp (car time-sign)) (+ (car (loop repeat (- bar 1) for i in time-sign collect (/ (* (1- bar) (/ (car i) (cadr i))) (get-resolution2 beat)))) (/ (/ (1- (car beat)) (cadr beat)) (get-resolution2 beat))) (+ (/ (* (1- bar) (/ (car time-sign) (cadr time-sign))) (get-resolution2 beat)) (/ (/ (1- (car beat)) (cadr beat)) (get-resolution2 beat)))))) (omn-to-time-signature (omn-merge-ties (flatten (loop repeat (length (omn-to-time-signature seq (list (numerator resolution) (denominator resolution)))) for cnt = 0 then (incf cnt) with new-seq = (omn-to-time-signature seq (list (numerator resolution) (denominator resolution))) with insert-rounded = (append insert (rest (length-rational-quantize (list (apply '+ (omn :length insert))) :round resolution))) when (= cnt distance) collect insert-rounded and do (setf cnt (+ (/ (get-span (flatten insert-rounded)) resolution) cnt -1)) else collect (nth cnt new-seq)))) ord-time-sign))) ;;; EXAMPLES (inserting-on-bar/beat* '((e c6 a5 h b5 tie) (q b5 b5 a5 tie) (h a5 q a5) (h. g5)) :insert '(s f3 e3 eb3 d3) :time-sign '(3 4) :bar 2 :beat '(2 16)) (inserting-on-bar/beat* '((e c6 a5 h b5 tie) (q b5 b5 a5 tie) (h a5 q a5) (h. g5)) :insert '(3q c5 b4 bb4 a4) :time-sign '(3 4) :bar 1 :beat '(2 12)) ;;; EXAMPLE WITH different TIME-SIGNATURES (inserting-on-bar/beat* '(e c6 a5 h b5 tie q b5 b5 a5 tie h a5 q a5 h. g5) :insert '(5q c5 b4 bb4 a4) :time-sign '((2 4 1) (3 8 1) (5 8 1) (3 4 1)) :bar 3 :beat '(3 20))
  9. Last week
  10. Last piece from 3 Images pour Violon et Piano. SB.
  11. Congratulation a great composition beautifully structured and a great performance as well.
  12. hi janusz was there a bug in my code? of course YOU coded it smarter :-) greetings andré
  13. Hello people! This is a relatively recent work that I composed with Opusmodus. A septet... Alto Flute, Clarinet, Trombone, Viola, Violoncello, Piano, Percussion This is a live recording from the premiere at the Trieste Prima Festival and is by Ensemble MD7 conducted by Steven Loy.
  14. This function will give you the correct result: (defun gen-collatz (n) (prog (value out) (setf value n) (setf out (cons value out)) loop (cond ((eql value 1) (return (nreverse out)))) (setf value (if (evenp value) (/ value 2) (+ (* 3 value) 1))) (setf out (cons value out)) (go loop))) (gen-collatz 12) => (12 6 3 10 5 16 8 4 2 1) (gen-collatz 27) => (27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822 911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1)
  15. New: BLOCK-CHORD-REDUCE The function BLOCK-CHORD-REDUCE reduces (compress) every bar of every instrument into a single chord. (setf rh '((-q. e gs3 f) (-q e a4 p stacc -) (-e q f5 f ten -e) ((acc e g6 mf) e6 p stacc -q.) (e cs4fs4c5 f marc -q e d3 p) (-e gs3 f - g6 p stacc) (-q. (acc e ds5 fff) e6 ff stacc) (-q c5 f ten) (-e (acc d6 mf) b5 p stacc - b3f5bb5 ff) (-q e a4 p stacc -) (-e cs4 f - c5 p stacc) (-q. e gs3 f))) (setf lh '((-q e bb5 f -) (-e a4 p stacc -q) (q cs4 f ten -e (acc b2 mf) d3 p stacc) (-q. e fs4c5f5 f marc) (-q e e6 p -) (-q e bb5 f -) (e b2 p stacc - (acc eb4 fff) d3 ff stacc -) (-e q fs4 f ten -e) ((acc e e3 mf) e g3 p stacc -q.) (e gs3cs4g4 ff marc -q e a4 p stacc) (-q e f5 f -) (e fs4 p stacc -q.))) In this example we use the time-signature from the sequence rh: (block-chord-reduce (list rh lh) :time rh) => ((1/2 gs3bb5) (1/2 a4) (1/2 f5cs4b2d3) (1/2 g6e6fs4c5f5) (1/2 cs4fs4c5d3e6) (1/2 gs3g6bb5) (1/2 ds5e6b2eb4d3) (1/2 c5fs4) (1/2 d6b5b3f5bb5e3g3) (1/2 gs3cs4g4a4) (1/2 cs4c5f5) (1/2 gs3fs4)) Reduce with option :row t (modus 12): (block-chord-reduce (list rh lh) :time rh :row t) Examples: Score: Howto Score/Chord Progression1.opmo (setf violin1 '(#|1|# (-t a3 f -s -t b3 -s -t b3 -s -t b3 -s -t b3 -s -t b3 -s -t b3 -s -t c4 -s) #|2|# (t c4 f c4 -s. t c4 c4 c4 c4 c4 -s. t c4 -s. t c4 -s. t d4 -s. t d4 -s. t d4 -s) #|3|# (-t d4 f -s. t d4 -s. t e4 -s. t e4 -s. t e4 -s. t e4 -s. t e4 -s. t e4 -s) #|4|# (-t e4 f -s. e e4 s s c4 c4 c4 c4 c4 c4 c4 t - - - d4 -s) #|5|# (-t e4 f -s -t e4 -s -t e4 -s -t e4 -s -t e4 -s -t e4 -s -t e4 -s -t e4 -s) #|6|# (-t a4 f -s -t a4 -s -t a4 -s -t a4 -s -t a4 -s -t a4 -s -t a4 -s -t a4 -s) #|7|# (-t b4 f -s. t b4 -s. t b4 -s. t b4 b4 b4 - b4 -s -t b4 -s -t b4 -s -t b4 -s) #|8|# (-t b4 f -s. t b4 -s. t b4 -s. t b4 b4 c5 - c5 -s -t c5 -s -t d5 -s -t d5 -s) #|9|# (e.. d5 f s s s q e5 s s s t - s e5 t) #|10|# (-t s e5 f t - s e5 t - s e5 t - s e5 t - s e5 t - s e5 t - s a5 t - a5 -s) #|11|# (-t b5 f -s. t b5 b5 c6 c6 c6 -q -s. t a3 b3 b3 b3 e -s.) #|12|# (-e -t b3 f b3 c4 c4 e -q t c4 c4 c4 c4 e s.) #|13|# (s c4 f -s. s d4 -e. t d4 d4 - d4 d4 e4 - e4 e4 e4 - e4 e4 e4 - e4 s -t) #|14|# (-e -t s c4 f -e. t c4 c4 - c4 c4 c4 - c4 c4 d4 - e4 e4 e4 - e4 -s.) #|15|# (-e -t s e4 f -e. t e4 e4 - e4 a4 a4 - a4 a4 a4 - a4 a4 a4 - b4 -s.) #|16|# (s b4 f -s. s b4 -e. t b4 b4 - b4 b4 b4 - b4 b4 b4 - b4 b4 b4 - b4 s c5 -t) #|17|# (-e -t c5 f c5 d5 d5 e -q t d5 d5 d5 e5 e s.) #|18|# (-t e5 f -s. t e5 e5 e5 e5 e5 -q -s. t e5 e5 e5 e5 e -s.) #|19|# (-t s e5 f t - s e5 t - s e5 t a5 - s a5 t - s b5 t - s b5 t c6 - s c6 t - a3 -s) #|20|# (e.. b3 f s s s q s s c4 c4 t - s c4 t) #|21|# (-t c4 f -s. t c4 -s. t c4 -s. t c4 c4 d4 - d4 -s -t d4 -s -t d4 -s -t d4 -s) #|22|# (-t e4 f -s. t e4 -s. t e4 -s. t e4 e4 e4 - e4 -s -t e4 -s -t e4 -s -t c4 -s) #|23|# (-t c4 f -s -t c4 -s -t c4 -s -t c4 -s -t c4 -s -t c4 -s -t c4 -s -t d4 -s) #|24|# (-t e4 f -s -t e4 -s -t e4 -s -t e4 -s -t e4 -s -t e4 -s -t e4 -s -t e4 -s) #|25|# (-t a4 f -s. e a4 s s s s s s s b4 b4 t - - - b4 -s) #|26|# (-t b4 f -s. t b4 -s. t b4 -s. t b4 -s. t b4 -s. t b4 -s. t b4 -s. t b4 -s) #|27|# (t b4 f b4 -s. t b4 c5 c5 c5 d5 -s. t d5 -s. t d5 -s. t d5 -s. t d5 -s. t d5 -s) #|28|# (-t e5 f -s -t e5 -s -t e5 -s -t e5 -s -t e5 -s -t e5 -s -t e5 -s -t e5 -s))) (setf violin2 '(#|1|# (-q... s e4 f fs4 fs4 t t t t t g3 -et t g3) #|2|# (t g3 f s s t t t t t -e.. t a3 a3 a3 a3 e.. -e) #|3|# (-t b3 f b3 b3 b3 e.. -s. s b3 b3 b3 t t g4 g4 g4 g4 -et t g4) #|4|# (t g4 f s s t a4 b4 b4 b4 b4 - b4 -s. t b4 -s. t b4 -s. t b4 -q) #|5|# (-t e5 f e5 e5 e5 e.. -et t e5 e5 e5 fs5 e.. -e) #|6|# (-t fs5 f fs5 fs5 fs5 e.. -ht s. fs5) #|7|# (s. fs5 f s e. s e. s e. t g5 - s g5 t) #|8|# (-t s a5 f t - s a5 t - s a5 t - b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5 b5) #|9|# (-t e6 f -s. t e6 -s. t e6 -s t fs6 fs6 fs6 g6 - g6 -s. t g6 -s. t e4 -s. t fs4 -s) #|10|# (t fs4 f fs4 -qs. t fs4 fs4 fs4 g3 g3 -qs. t g3 g3 g3) #|11|# (t g3 f g3 -qs. t g3 g3 g3 a3 a3 -qs. t a3 a3 a3) #|12|# (t b3 f b3 -qs. t b3 b3 b3 b3 b3 -qs. s. b3) #|13|# (e.. b3 f s g4 g4 g4 q s s s t - s a4 t b4) #|14|# (-t s b4 f t - s b4 t - s b4 t - s b4 t e5 - s e5 t - s e5 t - s e5 t - s. e5) #|15|# (-t s fs5 f t - s fs5 t - s fs5 t - s fs5 t - s fs5 t - s fs5 t - s fs5 t - s. fs5) #|16|# (e.. g5 f s s s a5 q s s s t - s b5 t) #|17|# (t b5 f b5 -qs. t b5 b5 b5 b5 b5 -qs. s. b5) #|18|# (t b5 f b5 -qs. t b5 b5 b5 b5 b5 -qs. t b5 b5 e6) #|19|# (t e6 f e6 -qs. t fs6 fs6 fs6 g6 g6 -qs. t g6 e4 fs4) #|20|# (-t fs4 f -s. t fs4 -s. t fs4 -s t fs4 fs4 g3 g3 - g3 -s. t g3 -s. t g3 -s. t g3 -s) #|21|# (-t s g3 f t - s g3 t - s a3 t - a3 a3 a3 b3 b3 b3 b3 b3 b3 b3 b3 b3 g4 g4 g4 g4 g4 g4 g4) #|22|# (s. g4 f s a4 e. b4 s e. s e. t - s b4 t) #|23|# (-t e5 f e5 e5 e5 e.. -ht s. e5) #|24|# (-t e5 f e5 fs5 fs5 e.. -et t fs5 fs5 fs5 fs5 e.. -e) #|25|# (t fs5 f s s t t t t t g5 - g5 -s. t g5 -s. t a5 -s. t a5 -q) #|26|# (-t a5 f a5 a5 a5 e.. b5 -s. s b5 b5 b5 t t t t t -et t b5) #|27|# (t b5 f s s t t t t t -e.. t b5 e6 e6 e6 e.. fs6 -e) #|28|# (-q... s fs6 f fs6 g6 t t t e4 -q))) (setf viola '(#|1|# (-w) #|2|# (-w) #|3|# (-w) #|4|# (-w) #|5|# (-h -e -t g5 f -s. t e4 -s. t g4 -s) #|6|# (-t c6 f -s. e d5 s g3 e5 d5 fs3 d5 fs5 g4 e3 g3 c5 -s.) #|7|# (-w) #|8|# (-w) #|9|# (-w) #|10|# (-h -e -t d5 f g5 e4 g4 e3 -s. d3) #|11|# (e.. fs3 f s g5 e6 g5 q c5 s d5 c5 d5 t g5 - s e3 t d3) #|12|# (-t s fs5 f t g5 - s e5 t g5 - s e4 t g5 - s c5 t d5 - s g5 t e6 - s d5 t fs5 - s g4 t fs3 - g5 -s) #|13|# (-t e4 f -q -s. e g5 t c3 -s. s d3 -e. t g5 e3 d6) #|14|# (t e4 f d5 fs3 g5 e4 g4 c5 d6 g4 d5 g4 e4 d3 s fs5 -e. s g3 -e. t e3 g3 c5) #|15|# (t g3 f c5 d5 g5 e3 d5 fs3 g4 e3 g5 e3 g3 c6 s d3 -e. s g5 -e. t e6 d3 fs5) #|16|# (-t d5 f -q -s. e fs5 t g5 -s. s e4 -e. t g5 c5 d6) #|17|# (-t s g3 f t e3 - s g5 t e3 - s d5 t fs4 - s g3 t e5 - s g3 t c6 - s d5 t g5 - s e4 t g4 - c6 -s) #|18|# (e.. d5 f s g3 e5 d5 q fs3 s d5 fs5 g4 t e3 - s g3 t c5) #|19|# (-h -e -t d5 f g5 e4 g4 e3 -s. d3) #|20|# (-w) #|21|# (-w) #|22|# (-w) #|23|# (-t fs3 f -s. e g5 s e6 g5 c5 d5 c5 d5 g5 e3 d3 fs5 -s.) #|24|# (-h -e -t g5 f -s. t e5 -s. t g5 -s) #|25|# (-w) #|26|# (-w) #|27|# (-w) #|28|# (-w))) (setf cello '(#|1|# (-w) #|2|# (-w) #|3|# (-w) #|4|# (-w) #|5|# (-w) #|6|# (-w) #|7|# (-w) #|8|# (-w) #|9|# (-w) #|10|# (-q -e -t e4 f c3 e3 a4 b3 -q -s. t e2 c4 b3) #|11|# (t d2 f b3 -q -s. t d4 e3 c2 e2 a3 -q -s. t b3 e4 c3) #|12|# (t e3 f c2 -q -s. t b2 d2 e4 c5 e4 -q -s. a3) #|13|# (e.. b3 f s a3 b3 e4 q c2 s b2 d4 e4 t c4 - s e4 t c3) #|14|# (-t s e4 f t a3 - s b3 t e4 - s c5 t b3 - s d4 t e3 - s d2 t e4 - s c3 t e4 - s a2 t b2 - s. e4) #|15|# (-t s c2 f t b4 - s c3 t b3 - s d2 t e4 - s c3 t e3 - s a3 t b4 - s e3 t b3 - s e3 t c3 - s. b2) #|16|# (e.. d4 f s e2 c2 e2 q a3 s e2 a3 b3 t e4 - s c2 t b3) #|17|# (t d2 f e3 -q -s. t c2 e4 c2 e2 a4 -q -s. b2) #|18|# (t e4 f c5 -q -s. t b2 d4 b3 d4 e4 -q -s. t c3 e4 a3) #|19|# (-q -e -t b4 f e2 c2 e4 c2 -q -s. t b3 d3 e2) #|20|# (-w) #|21|# (-w) #|22|# (-w) #|23|# (-w) #|24|# (-w) #|25|# (-w) #|26|# (-w) #|27|# (-w) #|28|# (-w))) (block-chord-reduce (list violin1 violin2 viola cello)) (block-chord-reduce (list violin1 violin2 viola cello) :row t) The option :time allows to change the scope of the analysis: (block-chord-reduce (list violin1 violin2 viola cello) :time 4/8) (block-chord-reduce (list violin1 violin2 viola cello) :time 1/4) The option :bar allows to view a specified bar number only: (block-chord-reduce (list violin1 violin2 viola cello) :bar '(10 11)) Best wishes, JP
  16. 2nd Image from 3 Images for Violin and Piano. SB.
  17. Earlier
  18. A simple example based on an All Interval Row for pitch material and euclidean rhythm for Flute rhythmic generation. ;; All interval row generation (setf row (air 16 :prime :type :pitch)) ;;; Strings chords ;; Chords gen from Air (setf chords1 (harmonic-progression '(0 0 0 0 2 2 2 2) row :size 4 :step '(1 2 2 1) ;; step throught row :relative t ;; chords relative path voice leading :seed 8392 )) ;; Strings chords assembly with pitches from chords1 ;; and length generation (whole notes '(w) repeated 32 times) ;; dynamic = pp (setf chords1.omn (filter-tie ;; tie repeated notes (make-omn :length (gen-repeat 32 '((w))) :pitch chords1 :velocity '((pp)) ))) ;;; Melody generation for Flute ;; Get the length (size) of chords1.omn (setf size (length chords1.omn)) ;; Pitch material (setf melo1.pmat (rnd-order (melodize (gen-trim size (mclist (harmonic-progression '(0 0 0 0 2 2 2 2) row :size 5 :step '(1 2 2 1) )))))) ;; Melodic generation with euclidean rhythm (setf melo1.omn (pitch-transpose 12 (make-omn :pitch melo1.pmat :length (euclidean-rhythm (gen-repeat size '(16)) 1 12 's :type 2 ) :velocity '((mf)) ))) (def-score temp ( :key-signature 'chromatic :time-signature '(4 4) :composer "Stéphane Boussuge" :copyright "Copyright © 2017 s.boussuge" :tempo 64 ) (strings1 :omn chords1.omn :channel 1 :port 0 :sound 'gm :program 'acoustic-grand-piano :controllers (1 (gen-dynamic-controller chords1.omn)) ) (flute1 :omn melo1.omn :channel 2 :port 0 :sound 'gm :program 'acoustic-grand-piano :controllers (1 (gen-dynamic-controller melo1.omn)) ) ) SB. AudioOutput.mp3
  19. (guitar-down8-layout 'inst)
  20. Small duet for Violin and Piano from 3 Images pour Violon et Piano. The 2 others duet are in progress. I've used some midi pre-recorded material prepared and edited in Logic before importation into Opusmodus and after import, i've processed this material with opmo functions and export back to Logic X for final edition and final score edit. SB.
  21. Hi, I was wondering how to get an octave treble clef and the correct transposing notation when writing for guitar. At the moment my def-score look like this: (def-score Crossing_Waves (:key-signature 'chromatic :time-signature timesigs :tempo 72 :layout (guitar-layout 'inst)) (inst :length lengths :pitch pitches :velocity dynamics :channel 1 :sound 'gm :sound 'acoustic-guitar-nylon) Notation is in treble clef in one system as it should, but as sounding pitch without the 8 under the treble clef. Kind Regards, Erik
  22. Hi Janusz, Thanks for the new functions, and specially Events-Analysis for analyse. Didier
  23. ;;; -------------------------------------------------------------------------- ;;; "mirror image" of a cutout ;;; -------------------------------------------------------------------------- ;;; this function is generating a "mirror image" of a cutout ;;; by random-length/pos or by event-numbers ;;; the "untaken" part will be replaced by rests ;;; the "special thing is" to connect it exactly/immediately to the original-seq ;;; and as filtered-seq you could use it in an other part/instrument ;;; i coded it for my current work... so, take it or delete it! (defun mirror-seq (n omn-list &key (type 'r)) (let ((single-seq (single-events omn-list)) (seq) (rests)) (progn (setf seq (flatten (loop repeat (if (listp n) (cadr n) (1+ (random (- (length single-seq) n)))) for i in single-seq collect i))) (setf rests (neg! (apply '+ (mapcar 'abs (omn :length (flatten seq)))))) (setf seq (cond ((equal type 'r) (gen-retrograde seq)) ((equal type 'i) (pitch-invert seq)) ((equal type 'ri) (pitch-invert (gen-retrograde seq))))) (setf seq (flatten (loop repeat (if (listp n) (- (cadr n) (car n)) n) for i in (single-events seq) collect i))) (flatten (list rests seq))))) ;;; examples ;;; if n = integer -> random-seq ;;; if n = integer-list -> event-posititon => constant ;;; types r / i / ri (setf seq '(e. b3 mf c4 s d4 pp q eb4 e4 f4 t fs4)) ;;; retro (setf exp1 (mirror-seq 2 seq :type 'r)) (setf exp2 (mirror-seq '(1 4) seq :type 'r)) ;;; retro/inv ;(setf exp1 (mirror-seq 2 seq :type 'ri)) ;(setf exp2 (mirror-seq '(1 4) seq :type 'ri)) ;;; inv ;(setf exp1 (mirror-seq 2 seq :type 'i)) ;(setf exp2 (mirror-seq '(1 4) seq :type 'i)) (def-score only-anonsense-example (:title "exp" :key-signature 'atonal :time-signature '(4 4) :tempo 124 :layout (bracket-group (treble-layout 'original) (treble-layout 'exp1) (bass-layout 'exp2))) (original :omn seq :channel 1 :port 1 :sound 'gm :program 'acoustic-grand-piano) (exp1 :omn (pitch-transpose 0 exp1) :channel 1 :port 1 :sound 'gm :program 'acoustic-grand-piano) (exp2 :omn (pitch-transpose 0 exp2) :channel 1 :port 1 :sound 'gm :program 'acoustic-grand-piano)) added 3 minutes later in comination with length-augmentation (and tranpositions) you could generate a "distorted mirror image" in an other part/instrument
  24. New: POSITION-ATTRIBUTE ATTRIBUTE-MAP EVENTS-ANALYSIS OM Developer/Predicates: 12TONEP CONTAIN-ATTRIBUTEP ATTRIBUTE-SYMBOLP EVENT-RESTP POSITION-ATTRIBUTE: The function POSITION-ATTRIBUTE returns a lists of bar numbers and positions values of a given attribute in a sequence. This function is a companion to the ATTRIBUTE-MAP function. Examples: (setf mat '((h. f6 mp stacc) (-q h a4d2 p fermata e fermata) (e. a4d2 p - h e4g3 mf s fs6 p e c6 mp ten e. cs4 p tie) (e cs4 p q gs5eb6 h b2 p stacc e stacc) (q b2 p tie s q f6a4 mf -e q. d2 p ten) (h d2 p tie s q e4 mp tr2 s tr2 -q. q f4 stacc) (s f4 h. a3gs5 p fermata -e. -s))) (position-attribute 'fermata mat) => ((2 (1/4 3/4)) (7 (1/16))) (position-attribute '(fermata stacc) mat) => (((2 (1/4 3/4)) (7 (1/16))) ((1 (0)) (4 (3/8 7/8)) (6 (5/4)))) ATTRIBUTE-MAP: The function ATTRIBUTE-MAP aligns attributes of one sequence (instrument) to another sequence. It is especially useful when aligning attributes like fermatas. Examples: (setf inst1 '((5h fs6 mp stacc 5q f6 ten - fs6 fermata) (3h bb6 p stacc -3q) (5q gs6 f stacc a6 ten - gs6 fs6 fermata) (5e gs6 mf stacc fs6 stacc 5q g6 ten - gs6 fermata g6) (s bb6 mp stacc b6 ten bb6 -) (5q f6 p stacc 5h fs6 ten 5q f6 -) (5q eb6 f stacc - 5h e6 ten 5q eb6))) (setf inst2 '((3q c6 mf -3h) (-5q gs5 p 5h g5 5e gs5 g5) (-3q 3h bb5 p) (-3h 3e bb5 mf a5) (-3q 3h a5 mp) (5e bb5 p c6 -5q 5h b5 5e 5e cs6) (-s c6 f d6 e6))) Inserting fermata attribute into the inst2 sequence: (setf map (position-attribute 'fermata inst1)) => ((1 (1/5)) (3 (1/5)) (4 (3/20))) (attribute-map 'fermata map inst2) => ((3q c6 mp -3h fermata) (-5q gs5 p 5h g5 5e gs5 g5) (-3q 3h bb5 f fermata) (-3h 3e bb5 mf fermata a5) (-3q 3h a5 mp) (5e bb5 p c6 -5q 5h b5 5e 5e cs6) (-s c6 f d6 e6)) Inserting fermata and stacc attributes into the inst2 sequence: (setf map2 (position-attribute '(fermata stacc) inst1)) => (((1 (1/5)) (3 (1/5)) (4 (3/20))) ((1 (0)) (2 (0)) (3 (0)) (4 (0 1/40)) (5 (0)) (6 (0)) (7 (0)))) (attribute-map '(fermata stacc) map2 inst2) => ((3q c6 mf stacc -3h fermata) (-5q gs5 mf 5h g5 5e gs5 g5) (-3q 3h bb5 mf fermata) (-3h 3e bb5 mf stacc+fermata a5) (-3q 3h a5 mp) (5e bb5 p stacc c6 -5q 5h b5 5e 5e cs6) (-s c6 f d6 e6)) EVENTS-ANALYSIS: The function EVENTS-ANALYSIS analyses a list of events of a given bar in a sequence. Examples: (setf mat '((5h fs6 mp stacc 5q f6 ten - fs6 fermata) (3h bb6 p stacc -3q) (5q gs6 f stacc a6 ten - gs6 fs6 fermata) (5e gs6 mf stacc fs6 stacc 5q g6 ten - gs6 fermata g6) (s bb6 mp fermata-l b6 ten bb6 -) (5q f6 p stacc 5h fs6 ten 5q f6 -) (5q eb6 f stacc - 5h e6 ten 5q eb6))) (events-analysis 2 mat) => Bar: 2 Time Signature: (1 4 1) Events: ((3h bb6 p stacc) (-3q)) Span: (1/6 1/12) Pitch: (bb4) Prime Form: nil Normal Order: nil Velocity: (p) Ambitus: (bb6 bb6) Interval Ambitus: 0 (events-analysis 4 mat) => Bar: 4 Time Signature: (1 4 1) Events: ((5e gs6 mf stacc) (5e fs6 mf stacc) (5q g6 mf ten) (-5q) (5q gs6 mf fermata) (5q g6 mf)) Span: (1/40 1/40 1/20 1/20 1/20 1/20) Pitch: (gs4 fs4 g4) Prime Form: (0 1 2) Normal Order: (6 7 8) Velocity: (mf) Ambitus: (fs6 gs6) Interval Ambitus: 2 (setf mat2 '((h. f6 mp stacc) (-q h a4d2 p fermata e fermata) (e. a4d2 p - h e4g3 mf s fs6 p e c6 mp ten e. cs4 p tie) (e cs4 p q gs5eb6 h b2 p stacc e stacc) (q b2 p tie s q f6a4 mf -e q. d2 p ten) (h d2 p tie s q e4 mp tr2 s tr2 -q. q f4 stacc) (s f4 h. a3gs5 p fermata -e. -s))) (events-analysis 5 mat2) => Bar: 5 Time Signature: (17 16 1) Events: ((q b2 p tie) (s b2 p) (q f6a4 mf) (-e) (q. d2 p ten)) Span: (1/4 1/16 1/4 1/8 3/8) Pitch: (b4 f4 a4 d4) Prime Form: (0 2 5 8) Normal Order: (9 11 2 5) Velocity: (p mf) Ambitus: (d2 f6) Interval Ambitus: 51 12tonep: Returns true if list is a 12-tone scale, and NIL otherwise. Examples: (12tonep '(4 10 1 3 5 2 6 8 9 11 7 0)) => t (12tonep '(e4 as4 cs4 ds4 f4 d4 fs4 gs4 a4 b4 g4 c4)) => t (12tonep '(e4 as4 cs4 ds4 f4 d4 fs4 gs4 a4 b4 f4 c4)) => nil CONTAIN-ATTRIBUTEP: Returns true if attribute is found in the sequence, and NIL otherwise. Examples: (contain-attributep 'fermata '(-h fermata)) => t (contain-attributep 'stacc '(-e a4 fermata+stacc d4 p fermata)) => t ATTRIBUTE-SYMBOLP: Returns true if object is a attribute, and NIL otherwise. Examples: (attribute-symbolp 'tie) => t (attribute-symbolp 'ponte+ten) => t EVENT-RESTP: Returns true if event is a rest, and NIL otherwise. Examples: (event-restp '(-q)) => t (event-restp '(-q fermata)) => t Best wishes, JP
  25. In the velocity documents you find all the answers. Example All 127 velocities in floating point numbers: (vector-to-velocity 0.1 1.0 (gen-integer 1 127) :type :float) => (0.1 0.11 0.11 0.12 0.13 0.14 0.14 0.15 0.16 0.16 0.17 0.18 0.19 0.19 0.2 0.21 0.21 0.22 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.28 0.29 0.29 0.3 0.31 0.31 0.32 0.33 0.34 0.34 0.35 0.36 0.36 0.37 0.38 0.39 0.39 0.4 0.41 0.41 0.42 0.43 0.44 0.44 0.45 0.46 0.46 0.47 0.48 0.49 0.49 0.5 0.51 0.51 0.52 0.53 0.54 0.54 0.55 0.56 0.56 0.57 0.58 0.59 0.59 0.6 0.61 0.61 0.62 0.63 0.64 0.64 0.65 0.66 0.66 0.67 0.68 0.69 0.69 0.7 0.71 0.71 0.72 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.78 0.79 0.79 0.8 0.81 0.81 0.82 0.83 0.84 0.84 0.85 0.86 0.86 0.87 0.88 0.89 0.89 0.9 0.91 0.91 0.92 0.93 0.94 0.94 0.95 0.96 0.96 0.97 0.98 0.99 0.99 1.0)
  26. thanks for the quick answer! So the floating point numbers velocity ranges from 0.1 to 0.99 or how do it relate to the 1-127 midi steps? I want to create an as-smooth-as-possible crescendo from the lowest possible value to the highest over x steps.. Can you point me to some more information about 'floating point numbers velocity'?
  27. What about floating point numbers velocity (make-omn :length '(e = = = = = = =) :pitch '(c4 cs5 b3 c4) :velocity '(0.1 0.2 0.21 0.32)) => (e c4 0.1 cs5 0.2 b3 0.21 c4 0.32 0.1 cs5 0.2 b3 0.21 c4 0.32)
  1. Load more activity