A Transformational Approach for Musical Variation

This article is associated with a broad research addressing musical variation, whose main objective is the systematization of the analysis through the elaboration of an original analytical model. A new version of this model proposes a formal approach based on principles of the transformational theory. The present article is focused in the notion of variation isolated from a contextual framework (that is, out of temporal perspectives), setting the basis for further explorations. .Some original concepts, like derivative work, derivative space, attributes, among others, provide means for measurement of similarity relations between referential and derived musical ideas, as well as graphic representation for these relationships.


Introduction
This paper integrates a broad research on musical variation intended basically to systematize the analysis of organically-constructed musical pieces. Since 2011 a model for derivative analysis (identified by the acronym MDA) has been developed through the elaboration of original premises, concepts, terminology, and the incorporation of methodological tools and strategies. The practical application of this model in a number of analytical studies since then has led to important improvements and route corrections, aiming the ideals of formalization, efficiency, and comprehensiveness. 1 The research's main general theoretical framework is centered on the principles of Grundgestalt (normally translated as "basic shape") and developing variation, both created by Arnold Schoenberg, being associated with an organicist conception of musical creation, based on gradual derivation and intense economy of means. These concepts are among the most powerful and far-reaching of Schoenberg's formulations on the compositional domain forming a theoretical complex which has become an important academic subject in the last decades. 2 A problematic issue normally faced by analysts is how to describe and label properly processes of developing variation and their outcomes (i.e., the variants created during these processes) in a sufficiently precise, concise, and systematic manner. This difficulty is due mainly to the indefinite ways in which variation techniques can creatively be used by a composer, considering not only "canonic" operations (like inversion, augmentation, etc.), but also hybrid types or even purely idiosyncratic forms of transformation, fruit of contextual situations and of the composer's own invention. On the other hand, there is a considerable, inherent margin of subjectivity in the task of the interpretation of derivative relations.
The main motivation for the creation of MDA was precisely the search for minimizing the subjectivity of thematic-motivic analysis through the elaboration of a system sufficiently provided of consistent conceptual and methodological tools, in a process that has been gradually consolidated along the last years.
The current version of the model proposes to correlate the notion of variation to some basic principles of the transformational theory. Under this perspective, variation can be considered as a special action which, when applied to a given object (as a musical motive), produces a transformed, but related version of that object. This lies in accordance with Steve Rings, for whom the emphasis in transformations "is on the relationships between musical entities, not on the entities as isolated monads. Transformational theory thematizes such relationships and seeks to sensitize the analyst to them" (RINGS, 2011, p.10, italics in the original). 1 For some theoretical formulations and analytical applications, see MAYR (2018), MAYR; ALMADA (2016, 2017a, 2017b), ALMADA (2011ALMADA ( , 2013ALMADA ( , 2015ALMADA ( , 2016ALMADA ( , 2017ALMADA ( , 2019.
By exploring this this new approach, I am mainly interested in two aspects: (1) the nature of the relationships between a musical idea of reference and its possible transformed versions (aiming specifically at similarity relations); and (2) the manners in which these transformations can be implemented, which leads to a process of formalization inspired by the ideas of David Lewin (1987) and some of his followers. 3 The present paper is focused on the first of these aspects, introducing basic concepts, terminology, and spatial representation, as well as an initial, simple methodological approach for measurement of similarity of musical variants (here limited only to situations with tonal contexts, and compatible cardinalities). More complex alternatives and a detailed discussion about the formal implementation of transformational operations will be addressed in future studies.

Basic definitions
A referential musical unity P (stands for "parent") is a short melodic sequence, relatively complete in itself, in which pitch and temporal structures play a special role. 4 Let these structures be classified as the primary domains of P. The harmonic context (not necessarily tonal) in which P is (explicitly or not) inserted is considered its secondary domain. 5 Figure 1 presents a simple instance of P (this example will be used as reference along the article). In the present context, variation (V) is a generic function that, when applied to P yields a related idea C ("child"), i.e., a (someway) transformed version of P. Let us assume that P and C are two members of the set which contains a conceptually infinite number of possible musical ideas. C is then said as derived from P, or a variant of it, or even that it is a derived idea from the referential P. The adjective "generic" that qualifies the noun 3 As for example, Edward Gollin (2000), Darin Hoskinson (2006), and Steven Rings (2011). 4 Informally, it is possible to associate the concept of referential idea with the common notion of motive. This is also similar to Schoenberg's definition of musical idea: "A musical idea (…), though consisting of melody, rhythm, and harmony, is neither one nor the other alone, but all three together" (SCHOENBERG, 1984, p.288).

5
Evidently, the model could also include other secondary domains, like timbre, dynamics, texture, etc., which would contribute to increase largely its complexity. Aiming at simplicity and concision, I opted therefore to select only harmonic context in this category. The notion of domains can be associated with the concept of (primary and secondary) parameters, proposed by Leonard Meyer (1989).
"function" in the definition of V reflects both assumptions that P is in some way transformed by the action of V (i.e., it does not matter yet how) 6 and that C, the output of this transformation, is (also in some way) related to the input P. In other words, V generically represents all possible manners in which P can be transformed into C. 7 Algebraically, it is then possible to express C in function of P: The syntactic, ordered interaction of the three elements, P, V, and C will be from now on referred as derivative work.

Derivative space
A derivative work is basically qualified according to the derivative impact that it causes on the referential idea P. 8 Alternatively, it is possible to consider the derivative impact directly associated with the amount of similarity/divergence of C in relation to P, which is expressed by the relation of similarity between both musical ideas. 9 Five basic types are considered: 1. Identity: when C is identical to P (or, in other words, the transformational action of V has no impact in the domains of P); 10 2. High similarity (or, conversely, low divergence); 3. Medium similarity (or medium divergence); 4. Low similarity (or high divergence); 5. Null similarity (total divergence).
Given this, the action V can be considered as resulting from the opposition of two basic tendencies (or "forces"), intrinsic to the transformational process of P into C: similarity (or coherence, or even invariance) and divergence (or contrast, or variance). The co-relations between them can be viewed as forming a dynamic system, plotted as geometric vectors (Figure 2).

6
The specific manifestations of V are formalized as transformational operations. For more details about this aspect of the theory, see ALMADA (2019   7 Put another way, V can be seen as forming a set that congregates all possible transformations of P.
8 An objective measurement of derivative impact is something not addressed in the current of the model, due to the amount of variables which could be involved in this issue. An adequate treatment of this aspect is planned for future investigation.

9
The quantitative aspect of this relation is discussed in section 3.

10
In practical terms, this category can also encompass cases not as trivial as the complete identity, like, for example, changes of register, instrumentation, dynamics, etc. Because the domains related to these aspects are not here considered, such sorts of transformation will be classified as identity relations. P. 378 de 577 Carlos de Lemos Almada In this graphical representation of a derivative work, the horizontal, left-to-right axis was arbitrated as corresponding to the dimension of "divergence", and the vertical, topdown axis to "similarity". 11 P and C are spatially represented by two points situated in the plan and V is a vector that connects them. Thus, V can be decomposed into two orthogonal vector components, Vx (representing "pure" divergence) and Vy ("pure" similarity).
I propose a refinement of this system by establishing a value of 1.00 for both the maximum similarity (or else, identity) and maximum divergence between P and C, resulting in a isosceles-right triangle plotted in a Cartesian plan and defined by the coordinates of its three vertices (see Figure 3): P, representing the referential idea, at the origin (0,0); Q, positioned at the horizontal/divergence limit (1,0); and R, at the vertical/ similarity limit (0,-1). The area delimited by these points is called the derivative space (DS) of the referential idea P.  Resulting from arbitrary choices, both axes and orientations could be exchanged in alternative spatial configurations. P. 379 de 577

Carlos de Lemos Almada
As shown in Figure 4, vector V will reach C always on the edge QR in a point (x, x-1). Angles α and β are then associated with the derivative impact caused by V in P: the greater is α, the lesser is the divergence between P and C (and, conversely, the greater will be the similarity between them). The opposite applies to angle β. If α = /4, then |Vy| = 1 and |Vx| = 0 (total divergence, type 5), and if α = 0, then |Vx| = 1 and |Vy| = 0 (identity, type 1). Excluding these extreme cases, any other possible derivative situation (in any combination of similarity/divergence relation), at least conceptually, will lie in a continuum of real values along the edge QR. Figure 5 proposes a segmentation of the derivative space into bands of similarity. Each band is obtained from an angular clockwise increment of /8 radians (or 22.5 degrees) over the previous onebeginning with the horizontal axis, which represents total divergence/null similarity, and closing with the identity relation (vertical axis).

Attributes
The domains, primary and secondary, are composed by internal, mutually complementary entities, named attributes. Essentially, attributes correspond to abstract descriptors of structural aspects of a musical fragment, and are in MDA formatted as numeric sequences.
The pitch domain has five attributes ( Figure 6): p1: pitch sequence, expressed in midi pitches; 12 p2: pitch-class sequence (or p1 under modulo 12); p3: intervallic sequence (the arithmetic differences between contiguous elements of p1); p4: melodic contour (the basic outline of the melody); 13 p5: ambit (the difference between the first and the last element of p1). 14 Figure 6: Pitch attributes of a referential idea P. Angle brackets indicate ordered content.
Minus signals preceding integers in p3 and p5 indicate descending intervals.

12
Midi-pitch convention uses integers for representing equally-tempered pitches, considering 0 as C-1 (and 60 the middle C), and the unity as one semitone.

13
Melodic contour (p4), the most abstract of the pitch attributes, is related to the concept coined by Robert Morris (1987), which is intended to describe the relative movements of a melodic line, i.e., the eventual alternance of "ups" and "downs", disregarding the specific intervallic distances. Melodic contours can be expressed graphically or algebraically (representation that is here adopted), the latter as a vector, in which "0" represents the lowest point of a melody with n notes and n-1 (in case of no repetitions) the highest, with the remaining notes assigned to intermediary numeration, according to the topography of the line (unlike what is done for the remaining attributes, I decided to preserve Morris's notation for p4 , in which the numbers are sequenced without separation by commas).

14
This attribute is intended to capture the abstract notion that musical ideas can be related by shared intervallic limits, even if their contents sharply differ.
At first glance, one could consider unnecessary to maintain all five attributes as descriptors of the pitch information, since some of them seem to be mutually redundant (notably p1, p2, and p3). Why not, instead, just to select the most specific, and precise of them, p1, for this purpose? As a matter of fact, however, the five attributes do not describe exactly the same things. The strategy of considering all of them as integrated, correlated descriptors allows for the system to formally capture some subtle transformations between related musical ideas that otherwise would pass unnoticed. 15 The following examples help to clarify this aspect, considering five cases of variants. Three of them (C1, C2, and C3) can be considered as "archetypal variations": change of register, transpositions (chromatic and diatonic), and inversion (Figure 7.). 16 Figure 7: Five pitch variants from P: by octave displacements (C1), chromatic transposition (C2), literal inversion (C3), free change of notes, but keeping the original melodic contour (C4), and free change of contour, but keeping the original ambit. 15 In a very detailed study about musical expectations by a listener, David Huron (2006, p.374) lists absolute pitch, pitch-class, intervals, contour, among others aspects, as complementary mental representations of pitch, which seems to be a solid support for my argument. The comparison between attributes is a central aspect in this book, and will be examined in the next section of this article.

16
It is important to highlight that just the pitch domain is here in question. Rhythmic and metric dimensions (related, respect ively, to durational and contextual aspects) are therefore considered fixed, as non-relevant parameters for this case.
None of the five variants shares with P the exact content of attribute p1 (mismatches are indicated as underlined numbers). Their relations of similarity with P are though evidenced by other attributes: pitch-class sequence in C1 (a simple case of octave displacement of two events), intervallic configuration 17 in C2 (chromatic transposition to a major third higher), metric contour in C4 (a more distant variation which shares with the referential form only the basic melodic outline), and intervallic ambit in C5 (a still more abstract relation with P, supported just by the maintenance of the distance between initial and final pitch events). On the other hand, C3 has none coincident attribute in relation to P. This suggests mistakenly that is a remote variant, contradicting the general intuition. In the next section I will return to some of these cases, examining them in more details.
The temporal domain is formed by four attributes (Figure 8): 18 t1: durational sequence, expressed in multiples of the temporal unity (sixteenth note as default); 19 t2: sequence of inter-onset intervals; 20 t3: metric contour; 21 t4: durational span (the sum of the durations, including eventual internal rests). Figure 9 presents some temporal archetypal variations, demonstrating the importance of taking the four attributes together also in this domain. In the first case, resulted from a simple shortening of some durations, attributes t1 mismatch, but the identity of 17 The identities of melodic contour (p4) and ambit (p5) are a consequent result when two intervallic sequence correspond exactly.

18
As it can be observed, there are isomorphic relations between some of the pitch and temporal attributes: p1and t1; p3 and t2; p4 and t3; p5 and t4. Attribute p2 (pitch-class sequence) is the only pitch sequence that has no correspondence in the temporal domain.

19
Evidently, other units can be considered according to contextual conditions. 20 Concept created by David Temperley (2001). An inter-onset interval (IOI) is the distance measured between the onsets of two rhythmic contiguous events, disregarding their durations. In this manner, a rhythm formed by two eight notes, for example, has the same IOI than another formed by a two sixteenth separated by a sixteenth rest.

21
The determination of the metric contour is analogous to what is done in melodic contours. In the metric case, "0" represents the event in the weakest position, "1" the next, and so on until the strongest event, resulting also in an algebraic vector (in order to express the correlations with the melodic contour, t3 is also notated without separating commas). For a detailed description of the concept of metric contour and of the algorithm used for calculate it, see MAYR; ALMADA (2017a). both t2 and t3 evidence the strong similarity that exist between P and C1. The almost opposite happens with C2, in which the rhythmic configuration is metrically displaced by one quarter note: while t1, t2, and t4 are perfectly preserved, the metric contour is completely modified. 22 The last two variants (C3 and C4), in spite of not presenting any matching of the respective four attributes, are very close to P, since they result, respectively, from the canonic operations of augmentation and diminution. In fact, the proximity between variants and the referential unity in both cases is depicted only indirectly, through the relation between the temporal spans (t4): doubled (in C3) and halved (in C4), an aspect that must be taken into account in the calculation of similarity in the temporal domain. Harmonic information related to P and C (either explicitly or implicitly) is depicted as an algebraic vector, formed by five attributes: 23

22
Undoubtedly, C2 is the variant that most diverges from P. As a matter of fact, metric displacement is a largely employed technique of variation (notably, by Brahms), which can be due both to economy (with the preservation of the rhythmic configuration) and the contrast that results from the presentation of the idea in a different metric context.

23
It is important to mention at this point that the current version of the model addresses uniquely tonal contexts. Alternative types of pitch organization (modal, atonal, serial, etc.) require adaptations concerning the harmonic domain. For the sake of space, a discussion about these possibilities will not be pursued in the present article. h1: referred to the key (expressed as a pitch class); h2: referred to mode (by convention, 0 = major mode and 1 = minor mode); h3: referred to chordal quality (expressed as a code number between 0 and 9see the adopted conventions in Table 2  The harmonic accompaniment of P (see again Figure 1) is tonally centered in C major. Its first four events are harmonized by a C major triad in first inversion, and the last one by a second-inversion dominant seventh rooted in G. Therefore, there are for P two different harmonic vectors (that incidentally share the same low-level harmonic information, referred to key and mode), the first one associated with events 1 to 4 (labeled as h 1-4 ) and the second with event 5 (h 5 ). They are formatted as follows: h 1-4 = <0, 0, 0, 0, 4> (to be read as "first-inversion of C major triad inside the key of C major"). h 5 = <0, 0, 4, 7, 2> (to be read as "second-inversion of G7 chord inside the key of C major").
As done previously for the primary domains of pitch and time, Figure 10 shows four cases of archetypal harmonic variations (I am assuming here that the key signatures of the examples unambiguously inform their respective tonal contexts): chromatic modulation (C1); diatonic chordal change (C2), with the substitution of C major triad (contextualized as the tonic I) by E minor triad (iii); modal interchange (C3); and a simple inversion of the original chord (C4). Each situation presents a different configuration of the harmonic vector.

24
Since the remaining eight categories encompass the majority of chordal qualities in usage in common-practice music, it seems unnecessary to specify additional possible types. The multidimensional nature of a musical idea, expressed by the set of domains/ attributes, can be better displayed in the format of a matrix (identified with the letter M). While the number of rows of M is fixed in twelve (corresponding to the complete set of attributes, encompassing primary and secondary domains), the number of columns varies according to the total of events present in the referential idea. 25 The first four 25 In other words, there is a one-to-one correspondence between events and columns of M. Thus, the matrix of attributes related to the exemplified case of P has dimensions 12 x 5. P. 386 de 577 Carlos de Lemos Almada rows are related to the pitch domain: p1, p2, and p4 occupy respectively rows 1, 2, and 4. Since p3 is a sequence of differences between pitches, it always has one element less than p1, p2, and p4. So, by convention, it is positioned in the third row, with the ambit (p5), formed by a unique element, occupying the last cell. 26 The following three rows refer to the temporal domain, t1, (t2 + t4), and t3. The third section of M (rows 8-12), related to the harmonic domain, is filled rather vertically than horizontally, according to the correspondences between events and harmonic contexts. Figure 11 depicts the structure of the matrix of attributes of the referential idea P. A matrix of attributes can then be considered as an algebraic equivalent of a given musical idea which it is related to (at least concerning pitch, temporal, and harmonic information).

Measurement of similarity
An important aspect of MDA is the possibility of measurement of similarity between referential and derived ideas. This is systematically accomplished through the interaction of concepts and premises that were so far introduced, in combination with the treatment for similarity evaluation that is proposed in the book The Geometry of Musical Rhythm, by Gottfried Toussaint (2013). In his chapter 33, Toussaint subdivides the methods for measurement of similarity between objects (not necessarily musical ones) into two basic categories:

26
A similar strategy is used in the temporal domain, considering in this case attributes t2 and t4. P. 387 de 577 Carlos de Lemos Almada feature-based methods and transformation-based methods. In feature-based methods, objects are compared in terms of the number of traits they have in common. In transformation-based approaches, similarity is measured by how little effort is required to transform one object to another. (TOUSSAINT, 2013, p.249, italics in the original).
Touissant then describes five transformational approaches, commenting their advantages under the standpoint of his objectives: Hamming distance, swap distance, directed-swap distance, many-to-many assignment distance, and edit distance. Because he is especially interested in comparing rhythms with either equal or different numbers of onsets and/or pulses (that is, with different cardinalities, according to the present terminology), his focus is concentrated on the most robust of them, the edit distance approach, also called Levenshtein distance. 27 Basically, this method counts "the minimum number of edits (or mutations) necessary to convert one sequence to the other" (TOUS-SAINT, 2013, p.252, italics in the original). 28 Three types of operations are considered: insertion, deletion, and substitution. Toussaint exemplifies the application of the method in the transformation of the word "WAITER" into "WINE", which have different "cardinalities" (respectively, 6 and 4). The process involves two stages: (1) deletion of letters "A" and "R": "WAITER" → "WITE"; and (2) substitution of "T" by "N": "WITE" → "WINE". 29 Figure  12 proposes a graphic representation of this example, adapted to the MDA's terminology.  According to Toussaint (2013, p. 253) this is due to "its inventor, Vladimir Levenshtein (1935Levenshtein ( -2017, the father of Russian information theory".

28
Although other possible methods for measurement of similarity could also be considered (Euclidean distance, for example), edit distance was the one with the best results and that was most suitable for the necessary adaptations in the creation of the algorithms.

29
As one can perceive in Toussaint's example, his method takes into account only that a replacement has been applied, not what has been replaced (or included). In this manner, the substitution of T by N would be the same (in terms of computational "distance") if T is replaced by, say, D. Although adopting this basic scheme of edition types in a global, abstract level, in practice MDA operates in a quite different manner, since the precise discrimination of the content of the forms which are examined plays a central role in the measurement algorithms.
Due to a strong alliance of simplicity and efficiency, the edit distance is an ideal candidate for measurement of similarity between two related musical ideas in MDA. I adopt here a somewhat modified version of the method, adapting it in order to deal with the structural particularities of the matrix of attributes. Considering a referential unity P and a possible variant of it, C, our adapted edition-distance approach basically counts the number of editions which are necessary to transform the matrix of attributes of P into the matrix of attributes of C. However, there is an important difference in relation to Toussaint's description: since the matrices are multidimensional structures, involving musical attributes of distinct natures and meanings, the editions will be differently weighted, depending on the rows considered (this will be detailed in the due time). In the present article I will consider uniquely the simplest situation of derivative work, namely when P and C have the same cardinality. 30

General information
Assuming that P and C have compatible cardinalities, the transformational types "deletion" and "insertion" are here out of question: only substitutions are applied in the mapping of P into C. In other words, the elements present in P's and C's matrices are always one-to-one related, and the "distance" between two corresponding elements will be measured as the "interval" (broadly, in David Lewin's sense) between them. 31 Figure 13 presents a general idea of the method. Since the number of events of P and C is necessarily the same, their matrices of attributes are also equally formatted (say, with m rows and n columns). This means that a given element of the matrix of P (P i,j ) will be related to one of the matrix of C positioned at same coordinates (C i,j ) and the "distance" between them (δ) will be proportionally equivalent to the abstract difference of their contents. Thus, δ will be null if both elements are equal (implying total similarity in the respective locus), and will have any positive value (depending on the magnitude of the interval) if they are different. As a convention aiming at a rapid visualization, let us indicate non-equal elements in C inside gray cells, as depicted in Figure 13 (this will be used in further examples).

30
The more complex cases, involving distinct cardinalities, will properly be addressed in a future study.

31
The specific conditions of this sort of measurement will be properly formalized ahead.

A Transformational Approach for Musical Variation
ORFEU, v.5, n.3, dezembro de 2020 P. 389 de 577 Carlos de Lemos Almada A necessary function of the algorithm for measurement of similarity of P and C is to establish distinct weights for the differences between elements, according to the relevance of the musical descriptors associated. Not surprisingly, the assignment of weights is decisive aspect of the algorithm but, at the same time, a considerably complex task involving multiple possibilities. In fact, the values that will be here adopted result from a relatively long empirical process, combining the try-and-error method with a number of intuitive assumptions.
Aiming the simplification of the process, the matrices are subdivided into sections associated with the three domains, pitch, time, and harmony, and will be examined separately.

Measurement of similarity in the pitch domain
Initially, it is necessary to delimit the section of the respective matrices of attributes that will be worked out. Thus, define P p and C p as sub-matrices corresponding to the first four rows of the matrices of attributes, referential (P) and variant (C). Let us generically identify these structures as matrices of pitch attributes.
The similarity between P p and C p is measured considering five vectors, each one associated with one of the five attributes: • v1: vector associated with the pitch sequence (p1); • v2: vector associated with the pitch-class sequence (p2); • v3: vector associated with the intervallic sequence (p3 or d-p3); • v4: vector associated with the melodic contour (p4); • v5: vector associated with the ambit (p5); Vectors v1, v2, v3, and v4 have n elements, corresponding to the cardinality of P p and C p . Vector v5 is in fact a scalar, since it is always formed by a single element. The obtaining of the five vectors proceeds in a similar manner, but with some particular differences, as follows: • Vector v1 results from the absolute difference between the first row of C p and P p . Formally, v1 = |C p (1, :) -P p (1, :)| • Vector v2 results from the absolute difference between the second row of C p and P p , considering the operation of modulo 12. Formally, v2 = |mod12(C p (2, :) -P p (2, :))| • Vector v3 results from the absolute difference between the third row of C p and P p , disregarding the respective last elements (since they are related to ambit, p5). Formally, v3 = |C p (3, 1:end-1) -P p (3, 1:end-1)| • Vector v4 results from the absolute difference between the fourth row of C p and P p . Formally, v4 = |C p (4, :) -P p (4, :)| • Vector v5 results from the absolute difference between the last element of the third row of C p and P p . Formally, v5 = | C p (3, end) -P p (3, end)| After this, a five-element related structure, called pitch vector (vp), is created from the ordered sum of the elements of v1 to v4, followed by v5, such that vp = <sum(v1), sum(v2), sum(v3), sum(v4), v5> The five elements of vp are then assigned to weights, which are organized also as a five-entry vector (wp), such that wp = <15, 15, 40, 25, 5> This hierarchical disposition of values (as said above, obtained after empirical attempts) reflects the intuition that the intervallic organization of a musical motive plays a more decisive role in the characterization of its pitch structure. The abstract melodic contour occupies a second place, followed by pitch and pitch-class sequences, with the ambit becoming the lesser influence of the descriptors.
A definitive index representing the edition-distance in the pitch domain is then calculated as the dot product 32 of vectors vp and wp. Let us call this index a (provisional) pitch penalty (labeled as kp'), which is intended to express the degree of dissimilarity between P and C in the isolated domain of pitch. Formally, Equation 2: Provisional pitch penalty.
As a final measure, kp' shall be normalized inside values 0.00 (referring to maximal similarity) and 1.00 (representing maximal dissimilarity), in order to provide both coher-

32
The dot product of two vectors of equal size multiplies corresponding elements of the vectors and sum the results, returning a single number.
ence and standardization to the system, considering that analogous penalties will be also assigned to the temporal and harmonic domains. The normalized pitch penalty (kp) is obtained from the formula Equation 3: Normalized pitch penalty (first version).
Where kp' is the provisional pitch penalty, kp min and kp max are, respectively, the minimal and maximal pitch penalties. Assuming kp min = 0.00, Equation 3 is reduced to While it is almost trivial to establish a relation of maximal similarity between two objects (formalized in the present proposal when the matrix of pitch attributes of C is a copy of that of P), the determination of a "maximally contrasting" structure in relation to a referential one is a considerably problematic task. Obviously, contrast is not an absolute quality. Likewise, the idea of a clear-cut border separating similar objects from entirely dissimilar ones is almost nonsense. As a matter of fact, we can talk about (conceptually) infinite possibilities for contrasting motives, in also infinite gradations of dissimilarity. From this, it is easy to conclude that many and many objects can be considered as perfectly contrasting in relation to a given reference. In other words, the pitch configuration we need as "maximally" dissimilar for the normalization process can be realized in any way provided it contrasts sufficiently in respect to the referential material. 33 Given this, Figure 14 proposes a possible "maximally-contrasting" pitch configuration related to the musical idea of Figure 1, depicting also the stages for calculation of the pitch penalty, in this case corresponding to a maximum value (labeled, therefore, as kp max ). Since only the domain of pitch is here in question, both ideas are musically notated as open-headed notes, disregarding their respective rhythmic-metric contexts. The figure also depicts the calculation of pitch penalty. The algorithm can be tested now with three of the cases of archetypal variation of pitch domain presented in Figure 7: C1, C2, and C5. Let label the first variant of P p as C1 p , reproduced in Figure 15 as a pitch abstraction. Before continuing, some reflection shall be made considering the particularity of this case. As previously introduced, this variant was created by simple changing of register of two pitches of P p : the second one (E 4 ), sent an octave higher to E 5 , and the fourth (A 4 ), transposed an octave lower to A 3 . Intuitively, these are very superficial transformations, an assumption that is perfectly captured by the null values of v2 (which deals with pitch classes). However, these simple changes disturb profoundly the intervallic vector, v3, which is incidentally the most weighted in the algorithm, resulting into a disproportionally high penalty, distorting the perception of similarity between referential and variant ideas. This leads to an adjustment of the algorithm, in order to enable it to treat similar situations in a more realistic manner. It is formulated as a rule (other similar rules will be eventually added in further stages): Adjustment rule #1 (pitch domain): Any "12" inside v3 shall be reduced to one third (i.e., to "4"). 34 Formally, if v3 = <x, y, …, 12, …, z>, then v3 = <x, y, …, 4, …, z>.
The application of rule #1 in the calculation of the pitch penalty for C1p results into a more appropriate, lower value: kp = 0.28.
The second variant C2 p results from a chromatic transposition of P p by four ascending semitones, as shown in Figure 16). Accordingly, only the original pitch and pitch-class sequences are transformed. The choice of this rate of reduction results from empirical tests for adjusting the algorithm to many different cases. The same argumentation can be extended to the following adjustment rules.
In spite of the lower value obtained for kp (corresponding to the intuition that both ideas are closely related), another adjustment in the algorithm becomes necessary, preventing from eventual incoherence. Such argument can be easily understood if we consider that chromatic transpositions by different number of semitones will produce (in some cases, sharply) different values of penalties, when the algorithm is applied. This goes against the scientific knowledge 35 that argues that distinct levels of transposition should affect equality (and in a very low rate) the evaluation of similarity. As an illustration of this distortion, consider two different ascending-chromatic transpositions of P p , by one and nine semitones. The application of the algorithm in both cases will result for kp, respectively, 0.04 and 0.33, a difference of more than 1000%. Given this, a new adjustment rule must be proposed: Adjustment rule #2 (pitch domain): If v1 and v2 are formed by the replication of a unique number, substitute its eventual occurrences by "2" (in both vectors), not mattering the magnitude of the original number. Formally, if v1 = <x, x, …, x> and v2 = <y, y, …, y>, then v1 = v2 = <2, 2, …, 2> In the case of C2 p , since v1 = <4, 4, 4, 4, 4>, it shall be replaced by v1 = <2, 2, 2, 2, 2>, just like v2 (this procedure will be adopted from now on for any possible transposition, that become, therefore, completely equivalent). Consequently, the pitch penalty of C2 p is updated to 0.07.
Lastly, Figure 17 depicts the calculation of pitch penalty for C5 p , which keeps only the ambit as common attribute with the referential material.

35
See, for example, Huron (2006). Figure 17: Calculation of pitch penalty in the comparison between Pp and C5p.
As done before, the entries of the vectors v1 to v3 are summed and the results, together with the scalar v4, are ordered into a structure called temporal vector (vt), such that vt = <sum(v1), sum(v2), sum(v3), v4> A four-entry vector of weights, calibrated for the temporal characteristics is then established as wt = <15 45 30 10> This reflects the intuition that the intervals between onsets (IOIs) are the most decisive factor in the definition of a rhythm, followed by its metric localization. According to the current conception, duration and temporal span are only secondary descriptors.
Like the case of pitch, a provisional penalty for temporal domain (denoted as kt') is calculated as the dot product of vt and wt. And once again, for a matter of coherence, kt' must be normalized, which requires a minimal and maximal value for temporal penalty. Since ktmin (corresponding to an exact copy of a rhythmic configuration) can be settled as convention to zero, the normalized temporal penalty (kt) will result from the division of kt' and a (possible) maximal value (kt max ). As discussed in the last section, since the process of measurement of similarity involves always objects which are someway related, for this purpose it would suffice only to conceive a rhythmic configuration profoundly contrasting in relation to P t (among many possible alternatives), as that depicted in Figure 18. As a test for the algorithm for measuring temporal similarity I select the second and the third of the four variants introduced in Figure 9 (here denoted as C2 t and C3 t ).
Variant C2 t is a perfect copy of P t , only metrically dislocated by one eight-note ( Figure 19). However, this simple transformation is responsible for a establishing a medium dissimilarity in relation to P t , evidencing the decisive importance of meter in rhythmic characterization. Variant C3 t , compared to P t in Figure 20, presents an exact duplication of the original durations (an augmentation in compositional jargon). The high value obtained for penalty is quite counter-intuitive, since in this case durational and IOI proportions are kept unaltered. Indeed, the parenthood between a given rhythmic configuration and its augmented version (the same would be applicable to the reverse case, i.e., diminution) is easily perceived, everything else being constant. A third point of interest concerns the odd discrepancy between the metric contours of P t and C3 t , also contrary what would be expected (since durational proportions are strictly maintained). P. 400 de 577 Carlos de Lemos Almada Let us examine firstly this last issue. As a matter of fact, the discrepancy of C3t's metric contour is only apparent: because the durations were duplicated, it would be also necessary to consider the duplication of the metric contour, in other words, treat the variant in hypermetrical terms. 36 That is, the segment shall be considered as a unity, in this case formed by two 4/4 measures (or, alternatively, one 8/4 measure). From this, the metric contour of C3 t should be rewritten as <41302>, thus mapping the original contour. This obviously impacts the calculation of the corresponding temporal penalty, which is then updated: kt ≈ 0.82.
Allying this to the question of the high (and discrepant) values of dissimilarity of both variants, a new adjustment rule (with three stages) must be formulated, in order to improve the algorithm. Applying this rule to the algorithm, the penalties of C3t is recalculated to a more realistic value: kt ≈0.23.

Measurement of similarity in the harmonic domain
Due to the particular structure of the harmonic section of the matrix of attributes, the algorithm for measurement of harmonic similarity between two musical ideas presents some differences in relation to those constructed for pitch and time. Firstly, there is just one vector (and not five or four, as in the pitch and temporal domains), called harmonic vector (vh), designed to measure "distances" between attributes of parent and child. Moreover, contrarily to those, it does not express numeric differences, but rather relations of congruence and divergence between harmonies, by the use of binary notation (1 = divergence / 0 = congruence) and mapping any entry of vh to one harmonic attribute (i.e., h1 to h5). In this manner, a perfect copy of a harmonic context would be represented by vector vh = <0, 0, 0, 0, 0>.

37
Like in the case of the adjustment rules, the weights of vector wh were obtained after a long phase of tests. Evidently, these are not at all fixed values. Eventual modifications either in the weight distribution or values can be made in the future, if necessary.
As done before, the provisional harmonic penalty (kp') is calculated as the dot product of vh and wh. Likewise, the normalized harmonic penalty (kp) is equal to the division of kh' by the maximal possible harmonic penalty (kh max ). However, contrarily to what was applied to the other algorithms, since vh is a binary vector, it is not necessary to elaborate a hypothetical contrasting example for the calculation of kh max , considering that a maximally-divergent harmony will be obligatorily expressed as vh = <1, 1, 1, 1, 1>. Consequently, kh max = <1, 1, 1, 1, 1> . <45, 25, 15, 10, 5> = 45 + 25 + 10 + 5 = 100.
Let us now test the algorithm with the isolated harmonic variants presented in Figure 10, reproduced in Figure 21 with the calculation of the respective harmonic penalties. Another difference in relation to the remaining algorithms concerns the fact that commonly more than one event of a given musical idea has the same harmonic context (as in the case of Figure 1). This means that a replicated harmonic context in, say four events, will necessarily replicate the harmonic penalty four times. In fact, the harmonic penalty for a musical idea as a whole will then be calculated as the arithmetic mean of the individual penalties. 38

38
Due to their relative simplicity and similar structure, the three algorithms above presented can be computationally implemented without much effort. This initiative provides a lot of agility and efficiency in the calculation of the respective penalties. P. 403 de 577 Carlos de Lemos Almada

Global similarity between musical ideas
After obtaining the penalties concerned to the three individual domains by the respective algorithms, a global measure of the dissimilarity k between two related musical ideas can be yielded. This is made through a weighted combination of the three values (kp, kt, and kh), as disposed in Equation 5. The distribution of weights attempts to capture two intuitions: firstly, the strong prominence of the primary domains (pitch and time) in face of the secondary harmony (85% vs 15%), and secondarily, the relative greater permeability of pitch structures to variation in comparison with rhythmic/metric configurations. 39 Three examples will provide adequate understanding of the process of determination of a global penalty in real musical situations. Figure 22 presents three possible variants of a referential idea P, considering transformations that affect indistinctly elements of the pitch, temporal, and harmonic domains. The cases can be informally described as follows: C1presents slight modifications in pitch and temporal structures. A secondary dominant (V/V, chord label D 7 ) is inserted as preparation for the last chord; C2the rhythmic configuration of P is preserved, but the melodic arc is freely expanded, with the harmony transposed to D minor; C3here a more substantial modification is in the temporal structure. The penultimate pitch is chromatically flexed. The harmonic context is kept unaltered.
The next three figures compares P with the variants, depicting also for each case the respective individual and global penalties (for practical reasons, it is assumed that the process was now computationally automatized; therefore, only the final results are provided, omitting all subjacent calculations).

39
For some support for these arguments under a cognitive perspective, see DOWLING (1978) and McADAMS and MATZKIN (2001).

Spatial representation of similarity relations
With these data and recalling to the derivative space's model of section 2.1, it is also possible to plot similarity relations between musical ideas, a very attractive perspective to be developed in the future with analytical purposes. Figure 26 reproduces the graph of the Figure 4, substituting the variable x by the penalty for dissimilarity k. For this, the calculated penalty value is associated with the horizontal projection (now expressing coordinate k) of point C. 40 Since the vertical projection is function of k (i.e., f(k) = k -1), point C's coordinates are then properly established. The angle →, which is related to what I will call the derivative inclination of point C, is easily obtained through trigonometry (Equation 6): 41 Equation 6: Angle α in function of k.  Table 4: Coordinates of points C1-3, with respective angles α and β (rounded values) and degrees of similarity with P. 40 This association is supported by the fact that the penalty represents ultimately the amount of divergence between referential and derived ideas.

Carlos de Lemos Almada
The plotting of the three points in the derivative space of P is depicted in Figure 27.

Concluding remarks
This article introduced an original conception addressing systematical analysis of musical variation under a transformational approach, and isolated from any temporal/ contextual perspective. Basic concepts and methodological procedures presented in the study focused on the nature of the relationships between referential and derived ideas. The notions of domains and attributes made possible the elaboration of algorithms for quantification of similarity relations, through calculation of specific penalties, which in turn were used for graphical representation of these relations, plotted on the derivative space of the referential idea. It is noteworthy to add that the system has a great potential for computational implementation, leading to automatization of the processes of calculation of penalties and plotting of similarity relationships.
As previously stated, the essential goal of the present paper is to introduce a new version of the analytical model, considering exclusively its most basic elements and some simple analytical applications. More complex situations (like non-tonal contexts and comparison of structures with different cardinalities) will be properly examined in future studies. An approach addressing the specific manifestations of function V, formally denoted as transformational operations, is described in a recently published article (ALMADA, 2019), which complements the present study.
The investigation of variation across time (that is, contextualized), deeply grounded on Schoenbergian principles of developing variation and Grundgestalt and involving proper theoretical/methodological apparatus, represents the natural continuation of the research, which is intended to provide the model of a comprehensive and dynamic perspective concerning real-music situations.