Jump to content

loopyc

Members
  • Posts

    54
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    loopyc reacted to Stephane Boussuge in Harmonizing a major scale using 4-part-drop-2 inversion x   
    Hi Wim,
     
    a possible solution:
     
    (setf chords (mclist (mapcar (lambda(x) ;; mapcar will apply the inversion to each chord (chord-inversion 3 x)) (harmonic-progression ;; harmonic progression definition (integer-transpose -1 '(1 2 3 4 5 6 7)) ;;degree for the chords '(c4 major) ;; scale used :size 4 ;; chords size )))) (setf drop2 (chordize-list (pitch-transpose-n '(0 0 -12 0) (pitch-melodize chords)))) SB.
  2. Thanks
    loopyc reacted to Stephane Boussuge in make-chord-if-length   
    Here's a new function a bit similar to my old "add-interval-if-length" function but bit more sophisticated.
    It use gen-chord3 to create chord on defined length.
     
    ;;; ============================================== ;;; UTILITY FUNCTIONS ;;; (defun make-chord-if-length-aux (omn &key (test #'>) (length-val 1/8) (interval-list '((4 7)(7 12))) (cycle t)(relative nil) seed) (setf seed (rnd-seed seed)) (let ((s-events (single-events omn))) (loop for e in s-events for i in (gen-trim (length s-events) interval-list) when (funcall test (omn-encode (first e)) length-val) append (omn-replace :pitch (gen-chord3 (list (second e)) i :cycle cycle :relative relative :seed (seed)) e ) else append e))) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4)) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7)(3 10))) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7 11 14)(7 9 16)) :cycle nil) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7 11 14)(7 9 16)) :cycle nil :seed 4) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7 11 14)(7 9 16)) :cycle nil :relative t) ;(make-chord-if-length-aux '(q c4 d4 e4 f4 e g4 a4) :interval-list '((4 7 11 14)(7 9 16)) :cycle nil :relative t :seed 4) ;;; ============================= ;;; MAIN FUNCTION (defun make-chord-if-length (omn &key (test #'>) (length-val 1/8) (interval-list '((4 7)(7 12)))(cycle nil)(relative nil) seed) (setf seed (rnd-seed seed)) (do-verbose ("make-chord-if-length :seed ~s :length-val ~s :interval-list ~s :cycle ~s :relative ~s" seed length-val interval-list cycle relative) (let ((test-fn (case test (> #'>) (< #'<) (= #'=) (otherwise test)))) (if (listp (car omn)) (mapcar #'(lambda (x) (make-chord-if-length-aux x :test test-fn :length-val (omn-encode length-val) :interval-list interval-list :cycle cycle :relative relative :seed (seed))) omn) (make-chord-if-length-aux omn :test test-fn :length-val (omn-encode length-val) :interval-list interval-list :cycle cycle :relative relative :seed (seed)))))) ;;; Tests ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4))) ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :seed 8) ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :interval-list '((2 9)(7 11))) ;(make-chord-if-length '((q c4 d4 e4 f4 g4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :cycle t) ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :cycle nil :relative t) ;(make-chord-if-length '((q c4 e d4 e4 f4 h d4)(s a4 b4 a4 g4 h f4)(q c4 d4 h e4)) :cycle nil :relative t :seed 8) i've also attached the original file to this post.
    SB.
    make-chord-if-length.lisp
  3. Thanks
    loopyc reacted to JulioHerrlein in PAT MARTINO Idiomatic Jazz Lines Generator   
    This is for generating some jazz licks in the style of the LINEAR EXPRESSIONS, by jazz guitarist PAT MARTINO.
    The rhythm slots of the example contain the same 16th value, but it can be worked out as Rhythmic Cells. I was testing straight 16th lines.
     
    https://www.amazon.com/Linear-Expressions-Pat-Martino/dp/1423460898/ref=sr_1_1?ie=UTF8&amp;qid=1539901867&amp;sr=8-1&amp;keywords=linear+expression+martino
     
    ;;; PAT MARTINO LINEAR Expressions Lick Generator JAZZ IDIOMS (setf r0 '(s) r1 '(s s s s) r2 '(s s s s s s s s) r3 '(s s s s) r4 '(s s s s) r5 '(s s s s s s s s) r6 '(s s s s s s s s) r7 '(s s s s s s s s) r8 '(s s s s s s s s) r9 '(s s s s s s s s) r10 '(s s s s s s s s)) (setf p0 '(g3 a3 bb3 c4 cs4 d4 f4 d4) p1 '(e4 fs4 g4 a4 c5 a4 bb4 d5) p2 '(f5 a5 ab5 e5 g5 f5 e5 d5) p3 '(c5 a4 bb4 d5 a4 bb4 a4 g4) p4 '(a3 bb3 d4 f4 a4 bb4 a4 ab4) p5 '(g4 a4 bb4 c5 d5 f5 a5 c6) p6 '(bb5 d5 f5 a5 g5 gb5 f5 g5) p7 '(e5 f5 e5 d5 c5 a4 g4 a4) p8 '(d4 e4 fs4 a4 fs4 g4 a4 c5) p9 '(a4 bb4 d5 f5 a5 bb5 a5 ab5) p10 '(g5 f5 d5 ds5 e5 g5 bb5 d6)) (setf v0 '(f) v1 '(mp) v2 '(f) v3 '(pp) v4 '(p f mf) v5 '(fff) v6 '(fff) v7 '(mf) v8 '(p) v9 '(f) v10 '(ff)) (setf sec (gen-repeat 10 (rnd-unique 12 '(0 1 2 3 4 5 6 7 8 9 10) ))) (setf r-list (assemble-section 'r sec)) (setf p-list (assemble-section 'p sec)) (setf v-list (assemble-section 'v sec)) (setf phrases (make-omn :length r-list :pitch p-list :velocity v-list)) (def-score collage (:key-signature 'atonal :time-signature '(2 4) :tempo 144 :layout (piano-grand-layout 'piano)) (piano :omn phrases :channel 1 :sound 'gm :program 0) )  
  4. Thanks
    loopyc reacted to AM in count-up/down   
    use it or not...
    greetings
    andré
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; count-up/down => not well coded but it works ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; A FUNCTION which counts a integer-list from its values (individual) ;;; to value B (all the same end-value :to (default is 1)) ;;; n => how many output values (approx: depends on input/round... was not important for my project) ;;; up or down (default is 'down) ;;; with variabel STEPS => sequencieally (horizontal) or with steps for each value individiual (vertical) ;;; with COUNT => means how many lists with same values (like "global-steps") ;;; SUB (defun round-to (number precision &optional (what #'round)) (let ((div (expt 10 precision))) (/ (funcall what (* number div)) div))) ;;; MAIN (defun count-up/down (n intlist &key (steps '(1)) (count 1) (type 'horizontal) (direction 'down) (to 1)) (let* ((cycles (round-to (/ (1- n) (length intlist)) 0)) (intlists (cond ((equal type 'horizontal) (loop repeat cycles for cnt = 0 then (incf cnt) for stp in (if (< (length steps) cycles) (filter-first cycles (flatten (gen-repeat cycles steps))) steps) when (= cnt 0) append (loop repeat count collect intlist) when (integerp (/ cnt count)) collect (setf intlist (if (equal direction 'down) (loop for i in intlist when (>= (- i stp) to) collect (- i stp) else collect to) (loop for i in intlist when (<= (+ i stp) to) collect (+ i stp) else collect to))) else collect intlist)) ((equal type 'vertical) (loop repeat cycles for cnt = 0 then (incf cnt) when (= cnt 0) append (loop repeat count collect intlist) when (integerp (/ cnt count)) collect (setf intlist (if (equal direction 'down) (loop for i in intlist for stp in steps when (>= (- i stp) to) collect (- i stp) else collect to) (loop for i in intlist for stp in steps when (<= (+ i stp) to) collect (+ i stp) else collect to))) else collect intlist))))) (loop repeat cycles for x in intlists collect x))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SIMPLE EXAMPLES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 9 8 7 6 7) :to 3 :direction 'down)) :join-points t) => ((9 8 7 6 7 9 8 7 6 7) (8 7 6 5 6 8 7 6 5 6) (7 6 5 4 5 7 6 5 4 5) (6 5 4 3 4 6 5 4 3 4) (5 4 3 3 3 5 4 3 3 3) (4 3 3 3 3 4 3 3 3 3) (3 3 3 3 3 3 3 3 3 3) (3 3 3 3 3 3 3 3 3 3) (3 3 3 3 3 3 3 3 3 3) (3 3 3 3 3 3 3 3 3 3)) (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 9 8 7 6 7) :count 2 :to 5 :direction 'down)) :join-points t) => ((9 8 7 6 7 9 8 7 6 7) (9 8 7 6 7 9 8 7 6 7) (8 7 6 5 6 8 7 6 5 6) (8 7 6 5 6 8 7 6 5 6) (7 6 5 5 5 7 6 5 5 5) (7 6 5 5 5 7 6 5 5 5) (6 5 5 5 5 6 5 5 5 5) (6 5 5 5 5 6 5 5 5 5) (5 5 5 5 5 5 5 5 5 5) (5 5 5 5 5 5 5 5 5 5)) (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 9 8 7 6 7) :to 15 :direction 'up)) :join-points t) => ((9 8 7 6 7 9 8 7 6 7) (10 9 8 7 8 10 9 8 7 8) (11 10 9 8 9 11 10 9 8 9) (12 11 10 9 10 12 11 10 9 10) (13 12 11 10 11 13 12 11 10 11) (14 13 12 11 12 14 13 12 11 12) (15 14 13 12 13 15 14 13 12 13) (15 15 14 13 14 15 15 14 13 14) (15 15 15 14 15 15 15 15 14 15) (15 15 15 15 15 15 15 15 15 15)) (list-plot (flatten (count-up/down 200 '(9 8 7 6 7 9 8 7 6 7) :count 2 :to 15 :direction 'up)) :join-points t) => ((9 8 7 6 7 9 8 7 6 7) (9 8 7 6 7 9 8 7 6 7) (10 9 8 7 8 10 9 8 7 8) (10 9 8 7 8 10 9 8 7 8) (11 10 9 8 9 11 10 9 8 9) (11 10 9 8 9 11 10 9 8 9) (12 11 10 9 10 12 11 10 9 10) (12 11 10 9 10 12 11 10 9 10) (13 12 11 10 11 13 12 11 10 11) (13 12 11 10 11 13 12 11 10 11) (14 13 12 11 12 14 13 12 11 12) (14 13 12 11 12 14 13 12 11 12) (15 14 13 12 13 15 14 13 12 13) (15 14 13 12 13 15 14 13 12 13) (15 15 14 13 14 15 15 14 13 14) (15 15 14 13 14 15 15 14 13 14) (15 15 15 14 15 15 15 15 14 15) (15 15 15 14 15 15 15 15 14 15) (15 15 15 15 15 15 15 15 15 15) (15 15 15 15 15 15 15 15 15 15)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; MORE COMPLEX/INTERESTING EXAMPLES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; horizontal means every cycle has a new step-value (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 15 8 7 6 7) :steps '(1 2 1 1 1 1 1 1 1 1) :type 'horizontal :to 2)) :join-points t) => ((9 8 7 6 7 15 8 7 6 7) (8 7 6 5 6 14 7 6 5 6) (6 5 4 3 4 12 5 4 3 4) (5 4 3 2 3 11 4 3 2 3) (4 3 2 2 2 10 3 2 2 2) (3 2 2 2 2 9 2 2 2 2) (2 2 2 2 2 8 2 2 2 2) (2 2 2 2 2 7 2 2 2 2) (2 2 2 2 2 6 2 2 2 2) (2 2 2 2 2 5 2 2 2 2)) ;; vertical means every value has its individual step (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 30 8 7 6 7) :steps '(1 2 1 1 1 5 1 1 1 1) :type 'vertical :to 2)) :join-points t) => ((9 8 7 6 7 30 8 7 6 7) (8 6 6 5 6 25 7 6 5 6) (7 4 5 4 5 20 6 5 4 5) (6 2 4 3 4 15 5 4 3 4) (5 2 3 2 3 10 4 3 2 3) (4 2 2 2 2 5 3 2 2 2) (3 2 2 2 2 2 2 2 2 2) (2 2 2 2 2 2 2 2 2 2) (2 2 2 2 2 2 2 2 2 2) (2 2 2 2 2 2 2 2 2 2)) (list-plot (flatten (count-up/down 100 '(9 8 7 6 7 30 8 7 6 7) :steps '(1 2 1 3 1 5 3 1 2 1) :type 'vertical :to 1)) :join-points t)  
    could be extended: would be nice if the END-VALUE (:to)  would/could be also "in between" the start values... start '(6 7 5 1 2 3 9 19)  => :to 4  => values incf, and decf to 4
  5. Thanks
    loopyc reacted to AM in count-up/down   
    a less flexible version but with nicer output/usage...
    greetings
     
    (defun round-to (number precision &optional (what #'round)) (let ((div (expt 10 precision))) (/ (funcall what (* number div)) div))) ;;; (defun incf/decf-alist (n alist &key (steps '(1 2)) (end 1)) (let ((span (round-to (/ n (length alist)) 0))) (progn (setf alist (loop for start in alist for step in (if (< (length steps) (length alist)) (filter-first (length alist) (loop repeat (length alist) append steps)) steps) when (> start end) collect (loop for i from start downto end by step collect i) else collect (loop for i from start to end by step collect i))) (setf alist (loop for i in alist collect (append i (gen-repeat (- span (length i)) end)))) (loop repeat (length (car alist)) for cnt = 0 then (incf cnt) collect (loop for i in alist collect (nth cnt i)))))) (list-plot (flatten (incf/decf-alist 90 '(9 8 7 1 7 30 8 7 6 1) :steps '(1 2 1 3 1 5 3 1 2 1) :end 11)) :join-points t) =>((9 8 7 1 7 30 8 7 6 1) (10 10 8 4 8 25 11 8 8 2) (11 11 9 7 9 20 11 9 10 3) (11 11 10 10 10 15 11 10 11 4) (11 11 11 11 11 11 11 11 11 5) (11 11 11 11 11 11 11 11 11 6) (11 11 11 11 11 11 11 11 11 7) (11 11 11 11 11 11 11 11 11 8) (11 11 11 11 11 11 11 11 11 9))
     
  6. Thanks
    loopyc reacted to AM in replace-articulation-of-a-length   
    if you like to change the articulation of specific lengths
     
    (defun replace-articulation-of-a-length (omnseq length/articulation-map) (loop for i in (single-events (flatten omnseq)) when (length-restp (car i)) collect i else append (omn-replace :articulation (cadr (assoc (car (omn :length i)) length/articulation-map)) i))) (setf omn-seq '(s c4 ffff ord e ord e ord s ord e. ord s ord q ord q q q q)) (replace-articulation-of-a-length omn-seq '((1/16 mute) (2/16 pizz) (3/16 arco))) => (s c4 ffff mute e c4 ffff pizz e c4 ffff pizz s c4 ffff mute e. c4 ffff arco s c4 ffff mute q c4 ffff ord q c4 ffff q c4 ffff q c4 ffff q c4 ffff)  
  7. Thanks
    loopyc reacted to AM in replace-velocity-of-a-length   
    if you like to change dynamics/velocity of specific lengths
     
    (defun replace-velocity-of-a-length (omnseq length/velocity-map) (loop for i in (single-events (flatten omnseq)) when (length-restp (car i)) collect i else append (omn-replace :velocity (cadr (assoc (car (omn :length i)) length/velocity-map)) i))) (setf omn-seq '(s c4 ffff e e s e. s q q q q q)) (replace-velocity-of-a-length omn-seq '((1/16 mp) (2/16 pp) (3/16 ppp))) => (s c4 mp e c4 pp e c4 pp s c4 mp e. c4 ppp s c4 mp q c4 ffff q c4 ffff q c4 ffff q c4 ffff q c4 ffff)  
  8. Like
    loopyc got a reaction from Stephane Boussuge in Theme and development example   
    Your "pedagogical examples" ALWAYS worked through and well-appreciated here Stephane, thank you ;-)
  9. Thanks
    loopyc reacted to Stephane Boussuge in Theme and development example   
    Here's a Theme and development example (also more generally, song construction example).
    It is the start of one of my composition but i give it here as a pedagogical example.
    Happy reading.
     
    ;;;--------------------------------------------------------- ;;; Parameters ;;;--------------------------------------------------------- ;;; BASIC MATERIAL ;;; PERIOD 1 (setf violin-1 '(#|1|# (s g5 mf leg a5 leg fs5 leg f5 q gs5) #|2|# (e gs5 stacc b5 stacc a5 stacc g5 stacc) #|3|# (h eb5 tr1) #|4|# (q f5 -) #|5|# (h gs5 tr1) #|6|# (s a5 leg b5 leg bb5 leg fs5 q a5) #|7|# (s c6 leg bb5 leg fs5 leg f5 q a5) #|8|# (s e5 leg cs5 leg bb4 leg gs4 q b4) )) (setf viola-1 '(#|1|# (q c5 mf -) #|2|# (q c5 -) #|3|# (q bb4 -) #|4|# (e fs4 stacc eb4 stacc e4 stacc cs4 stacc) #|5|# (s e4 leg d4 leg cs4 leg e4 q f4) #|6|# (q fs4 -) #|7|# (q f4 -) #|8|# (h e4 tr1) )) (setf cello-1 '(#|1|# (h g3 mf tr1) #|2|# (s g3 leg fs3 leg cs3 leg c3 q bb2) #|3|# (s a2 leg d3 leg db3 leg c3 leg q g2) #|4|# (h eb2 tr1) #|5|# (q f2 -) #|6|# (h f2 tr1) #|7|# (h bb2 tr1) #|8|# (q a2 -) )) ;;; PERIOD 2 (setf violin-2 '(#|1|# (e g4 stacc g4 stacc a4 stacc cs5 stacc) #|2|# (h c5 tr1) #|3|# (s b4 leg bb4 leg eb5 leg eb5 leg q fs5) #|4|# (h g5 tr1) #|5|# (h b5 tr1) #|6|# (h d6 tr1) #|7|# (q d6 -) #|8|# (h f6 tr1) )) (setf viola-2 '(#|1|# (q c3 -) #|2|# (q c3 -) #|3|# (q d3 -) #|4|# (e e3 stacc gs3 stacc a3 stacc gs3 stacc) #|5|# (h gs3 tr1) #|6|# (q g3 -) #|7|# (q g3 -) #|8|# (e b3 stacc d4 stacc e4 stacc e4 stacc) )) (setf cello-2 '(#|1|# (q g3 -) #|2|# (q g3 -) #|3|# (q eb3 -) #|4|# (e g3 stacc eb3 stacc g3 stacc gs3 stacc) #|5|# (h d3 tr1) #|6|# (q eb3 -) #|7|# (q g3 -) #|8|# (e c4 stacc fs3 stacc gs3 stacc d3 stacc) )) ;;; INTRO1 (setf violin-i1 (omn-replace :velocity '((pp)) (omn-replace :articulation'- (gen-trim 4 (length-adjust 4/4 (length-augmentation 4 violin-1)))))) (setf viola-i1 (omn-replace :velocity '((pp)) (omn-replace :articulation '- (gen-trim 4 (length-adjust 4/4 (length-augmentation 4 viola-1)))))) (setf cello-i1 (omn-replace :velocity '((pp)) (omn-replace :articulation '- (gen-trim 4 (length-adjust 4/4 (length-augmentation 4 cello-1)))))) ;;; DEVELOPMENT 1 (setf violin-d1a (pitch-transpose-repeat '(2 4) (find-bar '(1 2) violin-1))) (setf viola-d1a (pitch-transpose-repeat '(2 4) (find-bar '(1 2) viola-1))) (setf cello-d1a (pitch-transpose-repeat '(2 4) (find-bar '(1 2) cello-1))) (setf violin-d1b (pitch-transpose-repeat '(1 -2) (pitch-invert (find-bar '(1 2) violin-1)))) (setf viola-d1b (pitch-transpose-repeat '(1 -2) (pitch-invert (find-bar '(1 2) viola-1)))) (setf cello-d1b (pitch-transpose-repeat '(1 -2) (pitch-invert (find-bar '(1 2) cello-1)))) (setf violin-d1c (pitch-variant (rnd-order violin-1 :list t))) (setf viola-d1c (pitch-variant (rnd-order viola-1 :list t))) (setf cello-d1c (pitch-variant (rnd-order cello-1 :list t))) (setf violin-d1 (assemble-seq violin-d1a violin-d1b violin-d1c)) (setf viola-d1 (assemble-seq viola-d1a viola-d1b viola-d1c)) (setf cello-d1 (assemble-seq cello-d1a cello-d1b cello-d1c)) ;;; SCORE ASSEMBLY (setf violin (assemble-seq violin-i1 violin-1 violin-2 violin-d1 )) (setf viola (assemble-seq viola-i1 viola-1 viola-2 viola-d1 )) (setf cello (assemble-seq cello-i1 cello-1 cello-2 cello-d1 )) ;;; TIME SIGNATURE (setf ts (get-time-signature violin)) ;;;--------------------------------------------------------- ;;; Score and Layout ;;;--------------------------------------------------------- (def-score string-trio (:title "Trio" :composer "S.Boussuge" :copyright "Copyright © 2018 s.boussuge" :key-signature 'chromatic :time-signature ts :tempo 100 :layout (string-trio-layout 'violin 'viola 'cello)) (violin :omn violin :channel 1 :sound 'gm :program 'violin :volume 100 :pan 34 :controllers (91 '(48)) ) (viola :omn viola :channel 2 :sound 'gm :program 'viola :volume 90 :pan 64 :controllers (91 '(60)) ) (cello :omn cello :channel 3 :sound 'gm :program 'cello :volume 90 :pan 94 :controllers (91 '(60)) ) ) S.B
  10. Thanks
    loopyc reacted to AM in rnd-complete-seq   
    ;; a function which fills up a sequence randomly - max-length = length sequence ;; (regardless of the number of cycles) (defun rnd-complete-seq (n &key sequence (step 1) seed (sort '<) (exclude nil) (append-excluded nil)) (let* ((testseq) (sequence (if (null exclude) sequence (filter-remove exclude sequence))) (sequence (loop repeat (length sequence) with sequence = (loop repeat n with seq = '() do (setf seq (append (rnd-unique step sequence :seed seed) seq)) do (setf sequence (filter-remove seq sequence)) collect seq) for i in (if (equal sort '<) (sort-asc sequence) (sort-desc sequence)) collect i))) (if (null append-excluded) sequence (progn (cond ((pitchp (first (car (last sequence)))) (setf testseq (pitch-to-midi sequence))) ((velocityp (first (car (last sequence)))) (setf testseq (get-velocity sequence))) (t (setf testseq sequence))) (if (< (first (car (last testseq))) (second (car (last testseq)))) (list sequence (sort-asc (append exclude (car (last sequence))))) (list sequence (sort-desc (append exclude (car (last sequence)))))))))) ;;; EXAMPLES (rnd-complete-seq 8 :sequence (expand-tonality '(b3 messiaen-mode6))) => ((b3) (b3 a4) (b3 a4 as4) (b3 f4 a4 as4) (b3 e4 f4 a4 as4) (b3 cs4 e4 f4 a4 as4) (b3 cs4 ds4 e4 f4 a4 as4) (b3 cs4 ds4 e4 f4 g4 a4 as4)) ;or => ((as4) (e4 as4) (e4 f4 as4) (cs4 e4 f4 as4) (cs4 e4 f4 g4 as4) (b3 cs4 e4 f4 g4 as4) (b3 cs4 ds4 e4 f4 g4 as4) (b3 cs4 ds4 e4 f4 g4 a4 as4)) ;or .... (rnd-complete-seq 5 :sequence '(0 1 2 3 4 5 6 7 8 9 10 11 12)) => ((1) (1 7) (0 1 7) (0 1 7 9) (0 1 7 9 11)) ;or => ((0) (0 1) (0 1 11) (0 1 6 11) (0 1 6 11 12)) ;or .... (rnd-complete-seq 5 :step 2 :sequence '(0 1 2 3 4 5 6 7 8 9 10 11 12)) => ((1 7) (0 1 7 8) (0 1 5 7 8 12) (0 1 5 7 8 9 10 12) (0 1 2 5 7 8 9 10 11 12)) (rnd-complete-seq 5 :step 2 :sequence '(0 1 2 3 4 5 6 7 8 9 10 11 12) :seed 234) => ((4 12) (3 4 11 12) (2 3 4 10 11 12) (2 3 4 5 9 10 11 12) (1 2 3 4 5 8 9 10 11 12)) (rnd-complete-seq 5 :step 2 :sequence '(0 1 2 3 4 5 6 7 8 9 10 11 12) :sort '> :seed 234) => ((12 4) (12 11 4 3) (12 11 10 4 3 2) (12 11 10 9 5 4 3 2) (12 11 10 9 8 5 4 3 2 1)) (rnd-complete-seq 5 :step 2 :sequence '(pppp ppp pp p mp mf f ff fff ffff) :sort '> :seed 234) => ((ffff p) (ffff fff p pp) (ffff fff ff p pp ppp) (ffff fff ff f mp p pp ppp) (ffff fff ff f mf mp p pp ppp pppp)) ;;; examples with EXCLUDE (rnd-complete-seq 4 :sequence '(1 2 3 4 5 6 7 8) :exclude '(1 8)) => ((5) (4 5) (2 4 5) (2 4 5 6)) (rnd-complete-seq 4 :sequence '(1 2 3 4 5 6 7 8) :exclude '(1 8) :append-excluded t) => (((7) (4 7) (4 5 7) (4 5 6 7)) (1 4 5 6 7 8)) (rnd-complete-seq 4 :sequence '(pppp ppp pp p mp mf f ff fff ffff) :exclude '(pppp ffff) :append-excluded t) => (((mf) (p mf) (ppp p mf) (ppp p mf f)) (pppp ppp p mf f ffff))  
  11. Like
    loopyc got a reaction from Stephane Boussuge in [SOLVED] Idea for a Rhythmic Set Theory Function   
    Oh, you are welcome...so glad you both found it interesting/useful :)
     
    I have recently been rediscovering it's potentials using MIDI 'Learn'...connecting the 'rotation', pitch values, etc to external LFO's (I use Numerology 4 Pro) makes for some interesting morphing rhythm studies ;-)
     
     
    ...
  12. Like
    loopyc got a reaction from Stephane Boussuge in Brin d'Or   
    Lovely piece Stephane ;-)
     
    Fibonacci and Kandinsky, 'these are a few of my favorite things' :)
     
    ...
  13. Thanks
    loopyc got a reaction from JulioHerrlein in [SOLVED] Idea for a Rhythmic Set Theory Function   
    Oh, you are welcome...so glad you both found it interesting/useful :)
     
    I have recently been rediscovering it's potentials using MIDI 'Learn'...connecting the 'rotation', pitch values, etc to external LFO's (I use Numerology 4 Pro) makes for some interesting morphing rhythm studies ;-)
     
     
    ...
  14. Like
    loopyc reacted to Stephane Boussuge in Brin d'Or   
    Here's a short piece for violin solo and Strings ensemble with Fibonacci based harmony.
    Full score attached to this post fully commented but in French 🙂
     

     
    SB.
     
    BrinD'or-V04.opmo
  15. Thanks
    loopyc reacted to lviklund in [SOLVED] Idea for a Rhythmic Set Theory Function   
    Loopyc,
    Thank's for pointing to this beatyful app. Just what I have been looking for 🙂
     
    /Lasse
  16. Thanks
    loopyc reacted to JulioHerrlein in [SOLVED] Idea for a Rhythmic Set Theory Function   
    Thanks a lot!   Great article and ideas. 
    Best, 
    Julio 
  17. Thanks
    loopyc got a reaction from JulioHerrlein in [SOLVED] Idea for a Rhythmic Set Theory Function   
    Hey Julio,
     
    I was revisiting some old interests and remembered your post...have you come across these particular related presentations and software?
     
    https://theconversation.com/how-a-little-mathematics-can-help-create-some-beautiful-music-61812
    http://www.dynamictonality.com/xronomorph.htm
    ...
  18. Like
    loopyc got a reaction from opmo in [SOLVED] Idea for a Rhythmic Set Theory Function   
    Hey Julio,
     
    I was revisiting some old interests and remembered your post...have you come across these particular related presentations and software?
     
    https://theconversation.com/how-a-little-mathematics-can-help-create-some-beautiful-music-61812
    http://www.dynamictonality.com/xronomorph.htm
    ...
  19. Thanks
    loopyc reacted to opmo in Slonimsky Stuff HELP   
    I think this could be done.
  20. Like
    loopyc reacted to JulioHerrlein in Slonimsky Stuff HELP   
    Some sieve values:
     
    PATT #53 (7 -1)
    PATT #59 (8 -1 -1)
    PATT #77 (13 -4 -2 -1)
    PATT #80 (-1 7)
    PATT #85 (-2 1 7)
    PATT #99 (-1 3 4)
    PATT #181 (1 3)
    PATT #186 (5 -1)
    PATT #295 (-1 6)
     
     
     

  21. Like
    loopyc reacted to JulioHerrlein in Slonimsky Stuff HELP   
    After we figure out the pattern sequence, gen-sive or make-scale do the job.
    added 1 minute later PATT # 1
    (make-scale 'c4 12 :alt '(1 5)) This is why I love Opusmodus !
    Best !!
    Julio
  22. Like
    loopyc reacted to JulioHerrlein in Slonimsky Stuff HELP   
    Dear Friends,
    Thank you all for replying !
     
    What I had in mind was not a replication of the book itself, like a database but, instead,
    a kind of generative way for doing the same kind of symmetrical patterns.
    Of course, this way, we could not retrieve the exact number of the pattern as in the book edition.
    Actually, the patterns could be generated with a few informations:
     
    1) The principal tones (the division of the octave). This could be specified as a keyword argument in the end of the Function, like
    :tritone   :ditone  :sesquitone  :wt  :st   :quadritone  :sesquiquadritone  etc, etc...
     
    2) The way the pattern is constructed, i.e., the combination of inter/ultra/infrapolation, as the figure bellow:
     

     
    3) The ambitus of the pattern, i.e., how many octaves/times the pattern will rise up through the range.
    For example, Pattern #1 could spread all over a wide range as the figure below:
     

     
    or just in the C4-C5 ambitus, like this:

     
    4) The restriction of the AMBITUS could make  some patterns based on larger divisions of the octave, wrap around
    inside the ambitus determined, acting as a kind of Sieve, filtering the pitches.
     
    Just some ideas...
     
    All the best !
    Julio
  23. Like
    loopyc reacted to opmo in Opusmodus with sound synthesis package (CLM)   
    Since some time we are working on implementing Bill's Schottstaedt 'Synthesis package CLM' into Opusmodus.
    As expected we make the CLM working with OMN form sequence or with single parameters - example below.
     
    The score is using partials from The Bells of the Campanile: La Marangona.
    Below you will find an audio file of the score which is rendered each time you make evaluation.
     
    Best wishes to all,
    Janusz
    ;; --------------------------------------------------------- ;; MARANGONA ;; --------------------------------------------------------- ;; Parameters (defparameter count 50) (setf partials1 (library 'marangona-partials 'partials nil :random 50)) (setf partials2 (library 'marangona-partials 'partials nil :random 50)) (setf partials3 (library 'marangona-partials 'partials nil :random 50)) (setf partials4 (library 'marangona-partials 'partials nil :random 50)) (setf par1 (rnd-sample count (partial :freq (flatten partials1)))) (setf par2 (rnd-sample count (partial :freq (flatten partials2)))) (setf par3 (rnd-sample count (partial :freq (flatten partials3)))) (setf par4 (rnd-sample count (partial :freq (flatten partials4)))) (defparameter freq1 (gen-divide (rnd-sample count '(2 3 4 5)) par1)) (defparameter freq2 (gen-divide (rnd-sample count '(1 2 3 4 5)) par2)) (defparameter freq3 (gen-divide (rnd-sample count '(1 2 3 1 4 5)) par3)) (defparameter freq4 (gen-divide (rnd-sample count '(1 2 3 1 4 5)) par3)) (defparameter len1 (list (length-span 42 (rnd-sample count '(w h q w))))) (defparameter len2 (list (length-span 42 (rnd-sample count '(d h h))))) (defparameter len3 (list (length-span 42 (rnd-sample count '(h. w q))))) (defparameter len4 (list (length-span 42 (rnd-sample count '(d d h))))) (do-timeline '( len1 (---xxx-xx- ---xxx---- --x--xx--- ---x------ x-) len2 (---xxx-xx- ---xx-x--- --x--xx--- ---x------ x-) len3 (---xxx-xx- ---xx--x-- --x--xx--- ---x------ --) len4 (---xxx-xx- ---xx---x- --x--xx--- ---x------ --) ) '(gen-pause x) :time '(w)) (defparameter dur1 (omn :length (flatten len1))) (defparameter dur2 (omn :length (flatten len2))) (defparameter dur3 (omn :length (flatten len3))) (defparameter dur4 (omn :length (flatten len4))) (defparameter amp1 (rnd-number count 0.05 0.43)) (defparameter amp2 (rnd-number count 0.05 0.43)) (defparameter amp3 (rnd-number count 0.05 0.43)) (defparameter amp4 (rnd-number count 0.05 0.43)) (defparameter env '((0 0 40 .1000 60 .2000 75 .4000 82 1 90 1 100 0) (0 0 60 .1000 80 .2000 90 .4000 95 1 100 0) (0 0 10 1 16 0 32 .1000 50 1 56 0 60 0 90 .3000 100 0) (0 0 30 1 56 0 60 0 90 .3000 100 0) (0 0 50 1 80 .3000 100 0) (0 0 40 .1000 60 .2000 75 .4000 82 1 90 1 100 0) (0 0 10 1 32 .1000 50 1 90 .3000 100 0) (0 0 60 .1000 80 .3000 95 1 100 0) (0 0 80 .1000 90 1 100 0))) ;; --------------------------------------------------------- ;; Score (with-sound (:play nil :reverb jc-reverb :scaled-to .7 :statistics t :channels 2 :output "marangona-series") (fm-violin-synth dur1 freq1 amp1 :degree (rnd-number count 45 85) :fm-index (rnd-number count 0.10 1.0) :reverb-amount 0.30 :noise-amount (rnd-number count 0.00 0.004) :amp-env (rnd-sample count env) :fm1-rat (rnd-number count 0.00 6.718) :fm2-rat (rnd-number count 0.00 4.414) :fm3-rat (rnd-number count 0.00 1.141) :glissando-amount (rnd-number count 0.00 0.8) ) (fm-violin-synth dur2 freq2 amp2 :degree (rnd-number count 45 85) :fm-index (rnd-number count 0.10 1.0) :reverb-amount 0.30 :noise-amount (rnd-number count 0.00 0.004) :amp-env (rnd-sample count env) :fm1-rat (rnd-number count 0.00 4.718) :fm2-rat (rnd-number count 0.00 6.414) :fm3-rat (rnd-number count 0.00 1.141) :glissando-amount (rnd-number count 0.00 0.8) ) (fm-violin-synth dur3 freq3 amp3 :degree (rnd-number count 45 85) :fm-index (rnd-number count 0.10 1.0) :reverb-amount 0.30 :noise-amount (rnd-number count 0.00 0.004) :amp-env (rnd-sample count env) :fm1-rat (rnd-number count 0.00 1.718) :fm2-rat (rnd-number count 0.00 4.414) :fm3-rat (rnd-number count 0.00 6.141) :glissando-amount (rnd-number count 0.00 0.8) ) (fm-violin-synth dur4 freq4 amp4 :degree (rnd-number count 45 85) :fm-index (rnd-number count 0.10 1.0) :reverb-amount 0.30 :noise-amount (rnd-number count 0.00 0.004) :amp-env (rnd-sample count env) :fm1-rat (rnd-number count 0.00 4.718) :fm2-rat (rnd-number count 0.00 6.414) :fm3-rat (rnd-number count 0.00 1.141) :glissando-amount (rnd-number count 0.00 0.8) ) )  
    Score with omn-form sequence:
    (with-sound (:play nil :channels 2 :reverb jc-reverb :scaled-to .6 :statistics t :output "quartet") (fm-violin-omn vn1 :reverb-amount 0.20 :bpm 44) (fm-violin-omn vn2 :reverb-amount 0.20 :bpm 44) (fm-violin-omn va :reverb-amount 0.20 :bpm 44) (fm-violin-omn vc :reverb-amount 0.20 :bpm 44) )  
       
  24. Like
    loopyc reacted to torstenanders in Updated library of many custom Opusmodus functions   
    > I got just four 16th notes.
     
    This function allows for various controls that you did not use – Of course this function also allows for plain sequences of 1/16-notes, when you select its arguments accordingly 🙂   I am interested in CAC as a means of control on a higher level instead of some automatic "magic".
     
    You might want to run the examples below in Opusmodus to get music notation outputs, which are likely more easy to read than the OMN expressions, but nevertheless I provide the OMN expressions for completeness as well.
     
    The argument position (3rd argument) controls the kind of rhythmic cell that you get, see the doc for details. Here is an example where different rhythmic cells are returned. Note that by default all returned cells carry potentially a durational accent. 
     
    (gen-karnatic-cell 4 4 '(0 4 3 2 1 0))
    => ((1/4) (1/16 1/16 1/16 1/16) (1/8 1/16 1/16) (1/8 1/8) (3/16 1/16) (1/4))
     
    Now, if you use the same positions but different gati or jathi settings then you get a somewhat similar rhythm in that different gati/jathi. Below I slightly adapted the positions to make the results even more similar. 
     
    (gen-karnatic-cell 4 5 '(0 6 3 2 1 0))
    => ((5/16) (1/16 1/16 1/16 1/16 1/16) (3/16 1/16 1/16) (3/16 1/8) (1/4 1/16) (5/16))
     
    You can, of course, use these in a different time signature (e.g., the tala of your choice).
     
    (omn-to-time-signature (gen-karnatic-cell 4 5 '(0 6 3 2 1 0)) '(4 4))
    => ((q c4 tie s s s s s s e. s s s tie) (e c4 c4 q s q tie s))
     
    If you want to keep track of where the accents are located, you could mark them before this transformation (the function articulate-phrase is defined below this post). You could then manually later revise the notation to instead you the beam-breaking that Reina recommends. 
     
    (omn-to-time-signature 
     (articulate-phrase (gen-karnatic-cell 4 5 '(0 6 3 2 1 0))
                        :accent 'marc)
    '(4 4))
    => ((q c4 tie+marc s marc s marc s s s s e. marc s s s tie+marc) (e c4 c4 q marc s q tie+marc s marc))
     
    After the changed jathi above, here is a different gati. Results are more similar, because the underlying data is the same with different gati but the same jathi. Here is an example with quintuplets. 
     
    (gen-karnatic-cell 5 4 '(0 4 3 2 1 0))
    => ((1/5) (1/20 1/20 1/20 1/20) (1/10 1/20 1/20) (1/10 1/10) (3/20 1/20) (1/5))
     
    Here is the same with triplets -- exactly the same, only slower. 
     
    (gen-karnatic-cell 3 4 '(0 4 3 2 1 0))
    => ((1/3) (1/12 1/12 1/12 1/12) (1/6 1/12 1/12) (1/6 1/6) (1/4 1/12) (1/3))

    You can also change the jathi (or even gati) on the fly in a phrase. The given pattern is then 'cycled through'.
     
    (gen-karnatic-cell 4 '(5 5 3 3) '(0 6 3 2 1 0))
    => ((5/16) (1/16 1/16 1/16 1/16 1/16) (1/16 1/16 1/16) (1/16 1/16 1/16) (1/4 1/16) (5/16))

    You can also randomise your position
     
    (gen-karnatic-cell 4 5 '(0 1 ? ? 0))
    => ((5/16) (1/4 1/16) (3/16 1/8) (3/16 1/16 1/16) (5/16))

    And I did not even start discussing the other parameters yet. For example, you can set whether or not cells start with a durational accent (not a karnatic concept, but very useful notion for Western ears when dealing with rhythm). 
     
    (gen-karnatic-cell 4 5 '(3 3 3 3) :accented? '(T nil nil T))
    => ((3/16 1/16 1/16) (1/16 3/16 1/16) (1/16 3/16 1/16) (3/16 1/16 1/16))
     
    You can filter in various ways want kind of rhythm you want, e.g., set the minimum or maximum number of notes per cell. 
     
    (gen-karnatic-cell 4 5 '(? ? ? ?) :min-number '(3 3 3 3) :seed 1)
    =>((1/8 1/8 1/16) (3/16 1/16 1/16) (1/16 1/16 1/16 1/16 1/16) (1/8 1/8 1/16)) 
     
    EDIT: Oops, that are is seemingly not fully working as expected.
     
    I stop here and refer you do the documentation for more details: there are several more arguments that I did not even mention yet. I know that my documentation is rather concise and not a textbook, but it briefly discusses every detail. I said from the beginning, I wrote this for myself, so you might want to first spend a bit of time with the doc 🙂
     
    As you hopefully can see, this function alone allows for a rather rich world of rhythm with rather precise control that allows varying some rhythmic idea in various ways. I am interested here in clearly perceivable rhythmic similarities, e.g., between rhythms in different gati and jathi combinations in the Western tradition of thematic variation.  
     
    Of course, you can also process the result further in various ways. E.g., I am adding ties after long notes and/or subdivide short notes to increase the rhythmic contrast, and I am turning certain notes into rests...
     
    Best,
    Torsten
     
    (defun articulate-phrase (sequence &key (accent 'marc))
      "Add articulations to phrase for more clear rhythmic accents, e.g, an accent on every first beat.
      
      NOTE: This function assumes that `sequence' is a purely rhythmic OMN expression with only length values and perhaps ties. However, a sequence with (constant) pitches is returned, because certain Opusmodus functions do not support an OMN sequence without pitches.
      Examples:
      (articulate-phrase '((h h) (q q q q tie) (q q q q) (-q q) (q q q q)) :accent 'marc)
      => ((h marc h) (q marc q q q tie) (q q q q) (-q q) (q marc q q q))
      "
      (cons 
       ;; First bar
       ;;; NOTE: code repetition...
       (let ((bar1 (first sequence)))
         (if (length-notep (first bar1))
           (if (and (= (count-notes bar1) 1)
                    (eql (first (last bar1)) 'tie))
             (tu:replace-element (merge-articulations (list accent 'tie)) 1 bar1)
             (tu:insert-after bar1 0 accent))
           bar1))
       ;; other bars
       (loop :for (bar1 bar2) :on sequence :while bar2
         ;;; NOTE: code repetition
         :collect (if (and (length-notep (first bar2))
                           (not (eql (first (last bar1)) 'tie)))
                    (if (and (= (count-notes bar2) 1)
                             (eql (first (last bar2)) 'tie))
                      (tu:replace-element (merge-articulations (list accent 'tie)) 1 bar2)
                      (tu:insert-after bar2 0 accent))
                    bar2))))
     
  25. Like
    loopyc reacted to opmo in Notating and auditioning irregular time signature   
    In the next update we will get more snippet user preferences.
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy