commande : diff Morphologie2/Morphologie2\ sources/morphologie2.lisp Morphologie2.1/Morphologie2.1\ sources/morphologie2.1.lisp > ../OM-morphologie2_vs2.1.txt 208c208 < :icon 128 --- > :icon 241 225c225 < :icon 128 --- > :icon 241 262c262 < :icon 128 --- > :icon 241 279c279 < :icon 128 --- > :icon 241 297c297 < :icon 128 --- > :icon 241 310c310 < :icon 128 --- > :icon 241 328c328 < :icon 128 --- > :icon 241 348c348 < :icon 128 --- > :icon 241 371c371 < :icon 128 --- > :icon 241 376c376 < :icon 128 --- > :icon 241 410c410 < :icon 128 --- > :icon 241 477c477 < :icon 128 --- > :icon 241 574c574 < :icon 128 --- > :icon 241 618c618 < :icon 128 --- > :icon 241 763c763 < :icon 128 --- > :icon 241 771c771 < :icon 128 --- > :icon 241 778c778 < :icon 128 --- > :icon 241 790c790 < :icon 128 --- > :icon 241 865c865 < :icon 128 --- > :icon 241 871c871 < :icon 128 --- > :icon 241 891c891 < :icon 128 --- > :icon 241 1004c1004 < :icon 128 --- > :icon 241 1429c1429 < :icon 128 --- > :icon 241 1579c1579 < :icon 128 --- > :icon 241 1730c1730 < :icon 128 --- > :icon 241 1832c1832 < :icon 128 --- > :icon 241 1942c1942 < :icon 128 --- > :icon 241 2057c2057 < :icon 128 --- > :icon 241 2116c2116 < :icon 128 --- > :icon 241 2139c2139 < :icon 128 --- > :icon 241 2170c2170 < :icon 128 --- > :icon 241 2185c2185 < (om::defmethod! class-1 ((matrix t) (n integer) &optional --- > (om::defmethod! class-1 ((matrix array) (n integer) &optional 2194c2194 < :icon 128 --- > :icon 241 2289c2289,2310 < |# --- > |# > > > > (om::defmethod! class-1 ((matrix list) (n integer) &optional > (alpha? 0) > (centers nil) > (verbose "no")) > :menuins ((2 (("alpha" 1) > ("num" 0))) > (4 (("no" "no") > ("yes" "yes")))) > :initvals '(nil 2 0 'nil "no") > :icon 241 > :numouts 2 > :indoc '("matrice""nombre de classes recherches") > :doc "Clustering 'mouving-clouds' algorithm. Classify elements in matrix > of d-dimensions into n classes. The nth element in result-list corresponds > to the nth element (line) of matrix. > The classe number is arbitrary" > (class-1 (l-matrix matrix) n alpha? centers verbose)) > 2305c2326 < :icon 128 --- > :icon 241 2362c2383 < :icon 128 --- > :icon 241 2384c2405 < :icon 128 --- > :icon 241 2403a2425,2454 > > > > (om::defmethod! euclidian-d ((matrix list)) > :initvals '(nil) > :icon 241 > :indoc '("matrice") > :doc "input = matrix of coordinates of points in a d-space; > output = upper-matrix of euclidian distances." > (setf matrix (l-matrix matrix)) > (let (k temp mat-dist > (m (nth 0 (array-dimensions matrix))) > (n (nth 1 (array-dimensions matrix)))) > (setf mat-dist (make-array (list (- m 1) m))) > (dotimes (i m ) > (dotimes (j (- m (+ i 1))) > (setf k (+ j (+ i 1))) > (setf temp 0) > ;somme des differences au carr > (dotimes (l n) > (setf temp > (+ temp (expt > (- (aref matrix k l) > (aref matrix i l)) > 2)))) > (setf (aref mat-dist i k) (sqrt temp)))) > (loop for i from 0 to (1- (nth 0 (array-dimensions mat-dist))) > collect (loop for j from 0 to (1- (nth 1 (array-dimensions mat-dist))) > collect (aref mat-dist i j)) > ))) 2451c2502 < :icon 128 --- > :icon 241 2520c2571 < :icon 128 --- > :icon 241 2548c2599 < :icon 128 --- > :icon 241 2571c2622 < :icon 128 --- > :icon 241 2620c2671 < :icon 128 --- > :icon 241 2675c2726 < :icon 128 --- > :icon 241 2701c2752 < :icon 128 --- > :icon 241 2730c2781 < :icon 128 --- > :icon 241 3053c3104 < :icon 128 --- > :icon 241 3095,3156d3145 < ; < ; < ; < ;----------- < ; < #| < ; < ;by - JBS < (om::defmethod! min-flex-max ((seq list) result < &optional d-cte < ) < < :menuins ( (1 (("prim" 1) < ("prof" 2) < ("vals" 3) < ("every" 4)))) < :initvals '((6000 4000 5600 4700 4100 5900 6400 7800 7400 6300 < 6800 8300 5900) 1 nil nil nil) < :icon 128 < :indoc '("sequence a analyser" "menu format de sortie") < :doc "analyse une sequence en detectant trois formes primitives: < minima: element prcd et suivi par un lment < de valeur plus grande. < maxima: element prcd et suivi par un lment < de valeur plus petite < flex: element prcd et suivi par un lment < de valeur gale < < ex : (10 8 8 6 6 5 2 2 2 1) < OM->(pure-flex- (8 2) (6 2) (2 3)) < le premier chiffre indique la valeur rpte < et le deuxime terme de la liste indique son nombre d'occurrences. < la deuxime entre est un menu qui permet de selectionner < les informations: < prim: succession des primitives < prof: succession des primitives et profondeur en nombre d'lments de < chaque primitive < vals: idem que prof + valeur correspondant chaque primitive < every: idem que vals + position de chaque primitive" < < (cond (( < < < < ; < ; < ;--------------- < ; < ; < (om::defmethod! sempre-su ((lista list)) < < (let* ((ris nil) < (calcolo (om::x->dx lista)) < (calcolone (dolist (y calcolo (apply '+ (nreverse ris))) < (if (> (signum y) 0) < (push 1 ris))))) < < ris)) < < |# < < 3168c3157 < :icon 128 --- > :icon 241 3216c3205 < :icon 128 --- > :icon 241 3253c3242 < :icon 128 --- > :icon 241 3286c3275 < :icon 128 --- > :icon 241 3331c3320 < :icon 128 --- > :icon 241 3341c3330 < :icon 128 --- > :icon 241 3357c3346 < :icon 128 --- > :icon 241 3399c3388 < :icon 128 --- > :icon 241 3500c3489 < :icon 128 --- > :icon 241 3530c3519 < :icon 128 --- > :icon 241 3550c3539 < :icon 128 --- > :icon 241 3571c3560 < :icon 128 --- > :icon 241 3596c3585 < :icon 128 --- > :icon 241 3620c3609 < :icon 128 --- > :icon 241 3641c3630 < :icon 128 --- > :icon 241 3675c3664 < :icon 128 --- > :icon 241 3705c3694 < :icon 128 --- > :icon 241 3737c3726 < :icon 128 --- > :icon 241 3811c3800 < :icon 128 --- > :icon 241 3894c3883 < :icon 128 --- > :icon 241 3922c3911 < :icon 128 --- > :icon 241 3934a3924,3926 > (defmethod resemblance-match ((A number) (B number)) > (if (= A B) 1 0)) > 3962,3964c3954,3956 < ("dif" "dif")))) < :icon 128 < :indoc '("Sequence A""Sequence B" "Weight of occurences" "Weight of place" "Resemblance or Difference") --- > ("diss" "diss")))) > :icon 241 > :indoc '("Sequence A""Sequence B" "Weight of occurences" "Weight of place" "Resemblance or distance") 3975c3967 < (if (equalp "dif" diff) --- > (if (equalp "diss" diff) 4035c4027 < :icon 128 --- > :icon 241 4052c4044 < :icon 128 --- > :icon 241 4069c4061 < :icon 128 --- > :icon 241 4091c4083 < :icon 128 --- > :icon 241 4106c4098 < :icon 128 --- > :icon 241 4130c4122 < :icon 128 --- > :icon 241 4144c4136 < :icon 128 --- > :icon 241 4178c4170 < :icon 128 --- > :icon 241 4203c4195 < :icon 128 --- > :icon 241 4221c4213 < :icon 128 --- > :icon 241 4237c4229 < :icon 128 --- > :icon 241 4263c4255 < :icon 128 --- > :icon 241 4328c4320 < :icon 128 --- > :icon 241 4375c4367 < :icon 128 --- > :icon 241 4389c4381 < :icon 128 --- > :icon 241 4441c4433 < :icon 128 --- > :icon 241 4470c4462 < :icon 128 --- > :icon 241 4489c4481 < :icon 128 --- > :icon 241 4538c4530 < :icon 128 --- > :icon 241 4554c4546 < :icon 128 --- > :icon 241 4569c4561 < :icon 128 --- > :icon 241 4591c4583 < :icon 128 --- > :icon 241 4609c4601 < :icon 128 --- > :icon 241 4630c4622 < :icon 128 --- > :icon 241 4657c4649 < :icon 128 --- > :icon 241 4676c4668 < :icon 128 --- > :icon 241 4690c4682 < :icon 128 --- > :icon 241 4711c4703 < :icon 128 --- > :icon 241 4731c4723 < :icon 128 --- > :icon 241 4750c4742 < :icon 128 --- > :icon 241 4768c4760 < :icon 128 --- > :icon 241 4790c4782 < :icon 128 --- > :icon 241 4808c4800 < :icon 128 --- > :icon 241 4824c4816 < :icon 128 --- > :icon 241 4836c4828 < :icon 128 --- > :icon 241 4854c4846 < :icon 128 --- > :icon 241 4866c4858 < :icon 128 --- > :icon 241 4877c4869 < :icon 128 --- > :icon 241 4904c4896 < :icon 128 --- > :icon 241 4932c4924 < :icon 128 --- > :icon 241 5018,5019c5010,5012 < :icon 128 < :indoc '("liste de valeurs numriques""taille de la fenetre de lissage") --- > :icon 241 > :indoc '("liste de valeurs numriques""taille de la fenetre de lissage" > "type de lissage""debut du lissage""fin du lissage") 5127c5120 < :icon 128 --- > :icon 241 5142c5135 < (let ((distances (copy-list dist)) --- > (let ((distances (copy-tree dist)) 5162c5155 < (reverse Aretes))) --- > (remove 'nil (reverse Aretes)))) 5228c5221 < :icon 128 --- > :icon 241 5268c5261 < :icon 128 --- > :icon 241 5295c5288 < :icon 128 --- > :icon 241 5301c5294 < :icon 128 --- > :icon 241 5382d5374 < #|Jacopo 5387d5378 < |# 5653c5644 < :icon 128 --- > :icon 241 5663c5654 < :icon 128 --- > :icon 241 5665a5657 > 5938c5930 < :icon 128 --- > :icon 241 6033,6199d6024 < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < < ;;;;;;;;;;;;;;;;; Paolo Aralla ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < < ;;;;;;;;;;;;;;;;; Morphological Analysis ;;;;;;;;;;;;;;;;;;;;;;;;;;; < < ;;;;;;;;;;;;;;;;; 2005 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < < ; CONTRASTS-LEV.1 < ; CONTRASTS-ALL-LEV < ; NEW-OLD-ANALYSIS < ; ENERGY-PROF-MORPH-ANALYSIS < < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < < ; Morphological analysis < ; A mathematical model to describe the relation between morphological structure of the message, < ; mnemonicperceptive activities and psychic response. < ; Time and memory The comprehension and interpretation processes involved during the listening, as well as during all < ; the various perceptive activities, occur in the time through mechanisms linked to the mnemonic faculties. < ; The storage and retrieval of the information in and from the memory, both temporary and permanent, are variously < ; stimulated during the perceptive act. In this process it is fundamental the sequential order, i.e. the morphological < ; organization of the events succession in the time. The morphological organization of the events chain has the function < ; to give structure to the time, and it is the memory to enable the comprehension and interpretation processes of such a structure. < ; In the musical language this structure is particularly complex, as it is the result of the combination of different < ; morphologic organization levels (melodic, rhythmic, timbric, harmonic level etc.), which are strictly interconnected. < ; This plurality of levels, along with their articulated connection, is the basis of the development of different listening < ; competencies: from the most natural and spontaneous one (where a synthetic perception of the event prevails) to the most < ; experienced one (where the distinction among the various organization levels allows to assign them weights and functions). < ; The main aim of this work is to simulate, through the algorithmic formalization, the behaviours of the mnemonic activity during < ; the reception act of the single information units (which can be, depending on the adopted analysis level, simple or complex units) < ; and to obtain indications about the psychic energy used in the reception and elaboration of the message. < ; In brief, the purpose is to study the relation between morphologic organization, perception and psychic response. < ; The musical examples quoted in this article refer, to ensure a clear and linear exposition, to the morphologic organization < ; of the pitches sequences (even if, as you will see, the implications are transversal to every music parameter). < ; It is implicit that the deepening of the assumptions we propose implies the development of a methodology able to < ; contextualize the analysis of the morphologic structures of the different parameters. < ; Anyway, the stylistic and linguistic features of the pieces analysed will suggest a hierarchical relation among the < ; music parameters, i.e. the prominence now of a certain parameter, then of another one. < < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Analysis of the Contrasts - first level ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < (om::defmethod! Contrasts-lev.1 ((sequence list)) < < "The Analysis of the Contrasts, formulated by Herv Rivire and Frederic Voisin, and implemented in the OpenMusic Morphologie Library, is a model able to describe the becoming of the form in the time. < It points out the hierarchic relation created by the temporal sequence of the events: in fact, for the mnemonic activity, each event is datum point for every following event and datum point for the previous ones. < The numerical transcription carried out through the Analysis of Contrasts describes the entry order of the events in the time. < We could define the numerical transcription created using the analysis of contrasts as morphological structure of the entry order of the events. < From this starting point it is possible to identify the presence of internal patterns and analyse their potential capacity to describe and re-establish the form in its original status. < < exemple: Contrasts-lev.1 (a d f g f) ------> (1 2 3 4 3) < " < :icon 128 < < (let* ((elements (reverse (remove-duplicates (reverse sequence)))) < (order (om::arithm-ser 1 (length elements) 1)) < (analisis-contrasts-level.1 (mapcar #' (lambda (x y) < (mapcar #' (lambda (z) (if (equalp x z) y 'nil)) < sequence)) < elements order)) < ) < (om::flat (om::mat-trans analisis-contrasts-level.1)))) < < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Analysis of the Contrasts - all levels ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < < (om::defmethod! Contrasts-all-lev ((sequence list)) < < "The Analysis of the Contrasts, formulated by Herv Rivire and Frederic Voisin, and implemented in the OpenMusic Morphologie Library, is a model able to describe the becoming of the form in the time. < It points out the hierarchic relation created by the temporal sequence of the events: in fact, for the mnemonic activity, each event is datum point for every following event and datum point for the previous ones. < The numerical transcription carried out through the Analysis of Contrasts describes the entry order of the events in the time. < We could define the numerical transcription created using the analysis of contrasts as morphological structure of the entry order of the events. < From this starting point it is possible to identify the presence of internal patterns and analyse their potential capacity to describe and re-establish the form in its original status. < < exemple: Contrasts-all-lev (a d f g f) ------> ((1 2 3 4 3) (1 2 3 2) (1 2 1) (1 2))" < :icon 128 < < (let* ((counter-sequence (om::arithm-ser (length sequence) 1 -1)) < (Contrasts-lev.1-for-all-level (mapcar #' (lambda (x) (Contrasts-lev.1 (om::last-n sequence x))) < counter-sequence)) < ) < (butlast Contrasts-lev.1-for-all-level))) < < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; OLD-NEW Analysis ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; < < < (om::defmethod! NEW-OLD-analysis ((sequence list)) < < :icon 128 < :initvals '('(a b c d e f g a b c h u i o p)) < < :doc "The analysis of contrasts, which is the function at heart of the Morphologie Library developed by Jacopo Baboni Schilingi and Frederic Voisin, identifies the occurrences within any sequence of events. < Such analysis is of quantitative type, and has considerable development potentialities towards a qualitative description of the processes that put in relation morphologic structure of the message, mnemonicperceptive activity and psychic response. < The hierarchies that the analysis of contrasts describes become qualitatively pertinent to the mnemonic activity. < We have called New/Old Analysis the function that describes the newness level of an event in relation to the context in which it appears. < The importance of such a function is crucial, because it describes from the point of view of the psychic response the different newness level of the single event in the time. < The steps to define New/Old Analysis are three: < < 1. Measurement of the distances: < it allows to quantify the local distance between the different events in relation to their first appearance in the time. < < (defun distances (sequence) < (mapcar #' (lambda (x) (x->dx x)) (Contrasts-all-lev sequence))) < < 2. Attribution of different weights to the datum points: < this step is crucial, because it strengthens the global hierarchy among the various analysis level in relation to the time parameter. < < (defun weights (sequence) < (mapcar #' (lambda (x) (apply '+ x)) < (Contrasts-all-lev sequence))) < < 3. Application of weights to the distances: < this further step is just the application of different weights - obtained considering every time one of the events as datum point (global parameter, ex. nr. 3) < - to the distances between the various contiguous events (local parameter). < < (defun Contrasts-lev.1*weights (sequence) < (mapcar #' (lambda (x y) (om* y x)) < (distances sequence) (weights sequence))) < < ;-------- < < (defun Contrasts-all-lev*weights (sequence) < (reverse (mapcar #' (lambda (xx) (apply '+ xx)) < (mat-trans (mapcar #' (lambda (x) (reverse x)) (Contrasts-lev.1*weights sequence)))))) < < A theoretical problem we have faced is the relation between the object we have analysed and the previous and following events. < Any events chain perceived as belonging to a whole and complete organism stays anyway in relation with the previous and following sequential chain. < In case of performance of a music piece, the silence acts as a frame of the structure, and, being a frame, it becomes organic element of the structure analysed. < It is worth to underline that even in case of extrapolation, like in the here quoted examples (a thematic fragment, a subject of a fugue, etc.), < the object is perceived as an unit, and therefore the silence places it in a well defined mental space. < < (x-append 'symbol-silence-start sequence 'symbol-silence-end) < " < < (let* ((sequence-whit-silence-start-end (om::x-append 'symbol-silence-start sequence 'symbol-silence-end)) < (distances (mapcar #' (lambda (x) (om::x->dx x)) (Contrasts-all-lev sequence-whit-silence-start-end))) < (weights (mapcar #' (lambda (x) (apply '+ x)) (Contrasts-all-lev sequence-whit-silence-start-end))) < (Contrasts-lev.1*weights (mapcar #' (lambda (x y) (om::om* y x)) < distances weights)) < < (Contrasts-all-lev*weights (reverse (mapcar #' (lambda (xx) (apply '+ xx)) < (om::mat-trans (mapcar #' (lambda (x) (reverse x)) Contrasts-lev.1*weights))))) < ) < (butlast Contrasts-all-lev*weights))) < < < < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; energy profile ;;;;;;;;;;; < < (om::defmethod! energy-prof-morph-analysis ((sequence list)) < < " < The step that allows to transform the New/Old Analysis function into a model able to simulate the psychic response of the perceptive act to the morphologic structure occurs using three functions. < Then, to this the three functions apply allowing to define the energy profile. < 1. In the first passage, the transformation into absolute abs value contains all the relations with reference to the first element of the chain. < At this point, the data don't represent the ageing degree of the events anymore, but they are mere distance (it doesn't matter if they are old or new, they are to be intended nearly as physical distance between the various data stored in space/memory) related to a virtual point zero (a kind of possible present) < 2. In the second passage, the use of the local derivative, implemented in OpenMusic under the name of x-->dx, the contiguous relations are again pointed out, and the distance identified in the first passage is assimilated to the energy needed to cover the contiguous distances in the space/memory < 3 - Finally, the transformation into absolute abs value, because of the transformation of the distances into energy, brings all the data back to positive values. < " < :icon 128 < < (let* ((analysis-old-new (om::x-append '0 (NEW-OLD-analysis sequence))) < (absolute-value (om::om-abs analysis-old-new)) < (local-derivative (om::x->dx absolute-value)) < (absolute-value2 (om::om-abs local-derivative)) < ) < absolute-value2)) < < ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;