By Stephane Boussuge
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) )