Stephane Boussuge Posted April 14, 2016 Share Posted April 14, 2016 Sometimes we generate some flow of pitch and lengths that we assemble later into OMN material, It can be tiedous to add manually the articulations particularly the "leg" omn instruction, and it can sometimes be useful to have a technique for automated implementation of part of these task, who it will be always possible to edit more precisely thereafter. Below a possible technique based on the recognition and association of patterns of lengths values with articulation instructions. At first, we define a stream of lengths for our phrase: (setf len '(1/8 1/8 1/16 1/16 -1/16 1/8 1/8 1/8 1/8)) and we generate with the help of the function substitute-motif some articulations based on motivic lengths patterns. The substitute-motif will search for motives and will replace this motives by other (in that case, replace by motives of articulation instructions) If the function doesn't find some corresponding motives, it will use the :otherwise clause. (setf artic (substitute-motif '((1/8 1/8)(1/16)) '((leg -)(stacc)) len :otherwise '-)) ;=> (leg - stacc stacc - leg - leg -) We have to process this output now with the function gen-swallow for "swallow" the item corresponding to rest values. (setf artic.swallow (gen-swallow len artic)) => (leg - stacc stacc leg - leg -) Finally, we assemble all the parameters into an OMN stream with the make-omn function: (setf omn (make-omn :pitch '((c4 d4 e4 f4 g4)) :length len :velocity '((f)) :articulation artic.swallow)) Here's a complementary score example: ;;; Length defintion based on euclidean algorithm (setf basery (euclidean-rhythm (rnd-sample 16 '(16 18 24)) 4 16 '1/16 :type 2)) ;;; Apply the search and substitute process on each of the sublists ;;; with mapcar function (setf artic (mapcar (lambda(x) (substitute-motif '((1/16 1/16 1/16 1/16)(1/16 1/16 1/16)(1/16 1/16)(1/8 1/8) (1/4)(1/8) ) ;old '((leg leg leg -)(- - -)(leg -)(leg -) (stacc)(stacc) ) ;new x :otherwise '- )) basery)) ;;;Cleaning with gen-swallow (setf artic.swa (gen-swallow basery artic)) ;;; Pitch generation based on white noise (setf pch (vector-to-pitch '(g3 c5) (gen-white-noise 64))) ;;; Parameters assembly (setf p1.omn (make-omn :pitch pch :length basery :velocity '((f)) :articulation artic.swa )) ;;; Get the times signatures (setf ts (get-time-signature p1.omn)) ;;; Score definition (def-score solo ( :title "solo" :composer "S.Boussuge" :key-signature 'chromatic :time-signature ts :tempo 108 :layout (violin-layout 'violon) ) (violon :omn p1.omn :channel 1 :sound 'gm :program 'violin) ) SB. lviklund and opmo 2 Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted April 15, 2016 Share Posted April 15, 2016 Nice idea, thanks SB! I notice the function substitute-motif is not documented. Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted April 18, 2016 Share Posted April 18, 2016 Hi, Will you be adding documentation of the function substitute-motif in the next release? -Rangarajan Quote Link to comment Share on other sites More sharing options...
opmo Posted April 18, 2016 Share Posted April 18, 2016 The substitute-motif function is MOTIF-MAP now, and will be released with few other new functions later today. Quote Link to comment Share on other sites More sharing options...
opmo Posted April 19, 2016 Share Posted April 19, 2016 Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted April 19, 2016 Author Share Posted April 19, 2016 here's a small exemple of using motif-map function for the particular case of legato slurs: (setf len '((e e e e q -q e e)(q e e q s s s s e -e))) (setf art (motif-map '(((e e e e) (leg leg leg -)) ((e e) (leg -)) ((s s s s) (leg leg leg -)) ) len :otherwise '- :swallow t)) (setf phrase (make-omn :pitch (rnd-sample 24 (make-scale 'a3 18)) :length len :articulation art )) opmo 1 Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted April 19, 2016 Share Posted April 19, 2016 Very nice, thank you. -Rangarajan Quote Link to comment Share on other sites More sharing options...
torstenanders Posted March 25, 2017 Share Posted March 25, 2017 If you are reading this later, motif-map meanwhile became PATTERN-MAP. Stephane Boussuge 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.