Jump to content

Stephane Boussuge

Moderators
  • Posts

    1,059
  • Joined

  • Last visited

Everything posted by Stephane Boussuge

  1. Sorry, there was a mistake in this first version. here's the correct one. Apologize. SB. ;;; ============================================== ;;; 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 when (funcall test (omn-encode (first e)) length-val) append (omn-replace :pitch (gen-chord3 (list (second e)) interval-list :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 '((-17 -12 4 7)(-12 -7 5 10)) :cycle 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 :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) make-chord-if-length.lisp
  2. But indeed, i see, it is more about chord processing... Thanks for this. All the best SB.
  3. But also you need to use the :cycle t keyword. It allo you to cycle between the chords definition, because if :cycle nil (default) chords are chosen randomly. SB.
  4. i did a "default" articulation with no display in my opmo user attributes file. (add-program-attributes '(default) ) SB.
  5. 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
  6. I think you can use gen-chord3. also i have finished the function you asked in another post about a different version of add-interval-if-length. This one is make-chord-if-length and is based on gen-chord3. i'll post it here for convenience but will also post it in programming forums section. ;;; ============================================== ;;; 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) SB.
  7. Thank you for the information André. All the best Stéphane
  8. I own the 2 library and for me ConTimbre is indeed much better (much complete) than IRCAM instruments lib. SB.
  9. Hi Julio, it could be possible but a bit outside my programming capabilities, but Janusz is certainly capable to achieve this. And , as you, i would love this feature S.
  10. You can also use the Opusmodus function length-map for doing that. SB.
  11. I don't know because i am on the beta of the future Opusmodus version and on this one, i can change the background color in real time, ie. move the color cursor and color changes immediately. May be try to use the Toggle dark option in preference to see if it works. SB.
  12. Hi Andy, the seed is just a number you choose. Because it stop the random engine in a state, it allow to recover some values you generate randomly. Very useful for example for creating a random theme and call it back after or for further variations. What the seed number is to initialise the random engine in a state attached to this number. SB.
  13. 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
  14. 1. library is for accessing to a library. def-library is for the definition of a library create-library is a utility function helping for creating the content of a def-library. 2. Normally, if you put the library in the right place in the Opusmodus/Def-Libraries/Def-Library folder, you can see all of them in Opusmodus utility panel "L" (L for Library). Cheers S.B
  15. Hi Julio, you can use the parameter :time for tonality-map and harmonic-path: ;;; Classical Accompaniment Exemple ;;;--------------------------------------------------------- ;;; Parameters ;;;--------------------------------------------------------- ;;; Motif definition (setf mtf1 '((s c5 leg g5 leg e6 leg g5 c5 leg g5 leg e6 leg g5))) (setf mtf2 (pitch-transpose 4 mtf1)) (setf mtf3 '((-q e5))) (setf mtf4 '((-q g4c5))) (setf mtf5 '((q c2 -))) ;;; Chords definition (setf chords (library 'harmoprog1 'minor-4vx 'prog1)) ;;; Ostinati (setf ost1 (gen-repeat (length chords) mtf1)) (setf ost2 (gen-repeat (length chords) mtf2)) (setf ost3 (gen-repeat (length chords) mtf3)) (setf ost4 (gen-repeat (length chords) mtf4)) (setf ost5 (gen-repeat (length chords) mtf5)) ;;; Tonality-map series (setf tm-path (tonality-series chords)) ;;; HARMONIC RHYTHM CONTROL (setf harmonic-rhythm '(1/4)) ;;; Here we apply the map 'tm-path' into arpegio sequence. (setf ost1.map (tonality-map tm-path ost1 :time harmonic-rhythm)) (setf ost2.map (tonality-map tm-path ost2 :time harmonic-rhythm)) ;;; Here we apply our library chords into chord sequence. ;;; The harmonic-path preserves the voice leading. (setf ost3.map (harmonic-path chords ost3 :time harmonic-rhythm)) (setf ost4.map (harmonic-path chords ost4 :time harmonic-rhythm)) (setf ost5.map (harmonic-path chords ost5 :time harmonic-rhythm)) (setf violin1 (ambitus '(g3 c7) ost2.map)) (setf violin2 (ambitus '(g3 c6) ost1.map)) (setf viola (ambitus '(c3 e4) ost3.map)) (setf violoncello (ambitus-chord 12 (pitch-transpose -12 ost4.map))) (setf bass ost5.map) ;;;--------------------------------------------------------- ;;; Score and Layout ;;;--------------------------------------------------------- (def-score Classical-accomp (:title "Classical accompaniment example" :composer "S.Boussuge" :copyright "Copyright © 2018 s.boussuge" :key-signature 'chromatic :time-signature '((1 1 1 1) 4) :tempo 80 :layout (bracket-group (violin-layout 'violin1 :name "Violin-1") (violin-layout 'violin2 :name "Violin-2") (viola-layout 'viola) (violoncello-layout 'violoncello) (contrabass-layout 'bass) ) ) (violin1 :omn violin1 :channel 1 :sound 'gm :program 'String-Ensemble-1 :volume 100 :pan 48 :controllers (91 '(68)) ) (violin2 :omn violin2 :channel 2 :sound 'gm :program 'String-Ensemble-1 :volume 100 :pan 48 :controllers (91 '(68)) ) (viola :omn viola :channel 3 :sound 'gm :program 'String-Ensemble-1 :volume 90 :pan 64 :controllers (91 '(68)) ) (violoncello :omn violoncello :channel 4 :sound 'gm :program 'String-Ensemble-1 :volume 90 :pan 80 :controllers (91 '(68)) ) (bass :omn bass :channel 5 :sound 'gm :program 'String-Ensemble-1 :volume 90 :pan 80 :controllers (91 '(68)) ) ) Have a nice day S.
  16. A piano piece composed this year in February. SB.
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy