A Transformational Approach to Harmony Improvisation
Year: 2020 Authors: Meirav Amram; Etan Fisher; Shai Gul; Uzi Vishne
Core claim
A transformational, UTT-enhanced Markov decision model can improvise or recompose chord progressions while balancing average harmony and entropy.
Topics
harmony improvisation, Markov decision system, uniform triadic transformations, entropy optimization
Domains
group theory, Markov processes, semidirect product, entropy, music theory, algorithmic composition, computer music, robotic musicianship
Methods
interval-based transformations, first-order Markov model, decision parameter optimization, sequence matching
Media
triads, chord progressions, musical examples, audio-based guitar robot
Paper text
The text below is the locally extracted OCR/Markdown version of the paper. Raw PDF files remain local and are not published here.
A Transformational Approach to Harmony Improvisation
Meirav Amram^{1}, Etan Fisher ^{2}, Shai Gul ^{3} and Uzi Vishne ^{4}
^{1} Dept. of Mathematics, SCE College of Engineering, Israel; ^{2} Dept. of Mechanical Engineering, SCE College of Engineering, Israel; ^{3} Dept. of Applied Mathematics, Holon Institute of Technology, Israel; ^{4} Dept. of Mathematics, Bar Ilan University, Israel
Abstract
This paper introduces a transformational approach to harmony improvisation within the framework of a Markov decision system. Group theory provides the mathematical background of the transformational approach. While chord progressions are the acceptable basis for harmony composition using Markov models, the transformational approach is interval-based. The capabilities and limitations of the transformational approach are demonstrated and discussed, then enhanced using a UTT-based approach. A decision system optimizes the balance between compatibility, represented by average harmony, and variety, represented by entropy. Musical examples are presented, including sequence matching that demonstrates consistency and sensitivity to the decision parameters.
Introduction
The algorithm presented in this paper was developed for an ongoing research project involving audio-based synchronization of guitar playing robots. The interactive goal of the robotic system is to follow a given chord progression, played by a human musician, then modify it and develop it in an improvisational environment [8]. This demanded maximizing improvisation capabilities given a relatively short chord progression. A transformational approach was considered due to its firm mathematical basis and potential to expand improvisational capabilities.
Transformational music theory involves analysis, characterization and formulation of transformations in musical composition [10]. Hook [9] suggested a generalized formulation that includes transformations between major and minor triads. This formulation is termed the uniform triadic transformation (UTT), which addresses the transformation on major or minor triads separately, and will prove to be a key element of the transformational improvisation approach presented herewith. It is important to acknowledge that transformational music theory is atonal in nature. However, a certain degree of atonality would be acceptable or even necessary within any musical improvisation or composition tool. Chuan and Chew [5] presented a method of harmonization that uses neo-Riemannian transformations. Harmonization based on harmonic relations within tonal interval space appears in [4].
Markov processes have been applied to music for over almost a century, being versatile and easy to implement [1, 12, 7]. In [2], the factor oracle is the structure around which a Markov-based improvisation algorithm is based, and addresses harmony, rhythm, melody, and style. An interval-based approach is suggested for expanding the scope of improvisation. The harmony improvisation algorithm presented below is interval-based and combines compatibility and variety, through optimization of average source probability and a given factor of entropy, which are added to the system based on a first order Markov process.
Theoretical Background
In this section we describe triads and their operations in the language and notation provided by group theory, and as defined in [9].
The major triad with root , which is the relative shift in terms of semi-tones, is composed of three tones, . As represent the same tone as , the respective intervals within the triad are , with the third entry 5 being the distance from to . Similarly, the minor triad with root is composed of the three tones , inducing the intervals .
Definition 1.
A triad is represented by the ordered pair , where is the root of the triad, expressed as an integer (mod 12); and is a sign representing its mode ( for major, for minor). For example, represents C major, or C+, while represents G# minor, or G#-.
We denote the set of 24 major and minor triads by . We may define a binary operation on , by
(1)
Recall that a group is a mathematical structure consisting of a set of elements endowed with a binary operation , satisfying certain axioms. The group is abelian if . For example, with addition modulo 12 is an abelian group. The number of elements is the order of the group. The order of an element in the group is the minimal for which equals the identity element (where is repeated operation with ). The order of an element always divides the order of group.
Theorem 2.
The set forms an abelian group (isomorphic to ).
Since the group is abelian, we refer to the operation as “addition”. The inverse in this group is given by .
The transformational between triads, as defined in [9] is
Definition 3.
Given and , the transposition level (mod 12) is the interval between the roots, and the sign factor is the change in sign, following usual multiplication of signs. The -interval is the ordered pair , where and are the transposition level and sign factor, respectively. The -interval is, therefore, the triadic transformation between and (namely the unique element of one would add to to obtain ).
A uniform triadic transformation (UTT) is an operation on the group , shifting major triads in one way, and minor triads in another way. A UTT is denoted by , where is the sign factor, is the transposition level given a major triad, and is the transposition level given a minor triad. By definition, the UTT moves the triad to the triad , where the new mode (i.e., major or minor) is ; and the new root is (namely if and if ). For more on this unified notation see Sections 1,2 in [9]. Although the details are not needed in the sequel, the UTTs form a group of order 288, isomorphic to a semidirect product with respect to the switching action. The maximal order of elements in this group is 24.
3.4 Improvisation Method
The improvisation method is based on an extended Markov process, given a desired musical chord (triad) progression to be improvised upon. The method takes into account two competing factors:
- Compatibility: The outcome is musical-theoretically coherent with the initial progression. This property will be measured in terms of average probability.
- Variety: For the same initial progression on which the system is required to improvise, several possible outcomes are appropriate. This property will be measured in terms of entropy.
A Transformational Approach to Harmony Improvisation
Denote by the initial progression or database. Let be the distribution of triadic transformations between consecutive pairs of triads in .
A new distribution is defined that maximizes a linear combination of compatibility and variety. Let be a (discrete) distribution on , that is a positive function such that
Definition 4. The average probability of (with respect to ) is
This is the expectancy of viewed as a random variable, with respect to the distribution .
Definition 5. The entropy of is
(Shannon’s entropy is a classical measure to the deviation of from a uniform distribution; indeed the entropy is maximized when is the uniform distribution).
The average favors repeating the most common triadic transformations of . On the other hand, the entropy favors a uniform distribution. To balance the two competing effects, what we propose is to let the distribution maximize the function
where the parameters are fixed (and satisfy and ).
In the next subsection we give an explicit formula for the distribution that maximizes the target function. This formula will be applied for the proposed transformational system.
The optimal distribution
Let be the space of distributions on . We are interested in the values of for , which maximizes the target function from (5). Write for the probability that assigns to (keeping in mind the space of 24 triads).
Rewrite (5) as follows:
where denotes the number of possible states (triads of transformations). We seek to find a maximum for on the space , namely under the constraint .
Define the Lagrange function as follows:
Lagrange’s method for optimization under constraints shows that the vector that maximizes the target function is:
Amram et al.
Figure 1: Output probability vector, , given average transition probabilities, , for increasing values of .
Figure (1) shows two example rows of the average probability matrix and the effect of the optimal distribution on the respective rows of the output probability matrix. Notice that for , , the transition with highest probability will always be chosen. As decreases and increases, the transition probability flattens out into a uniform distribution.
Demonstration and Examples
Markov-based harmony composition analyzes chord progressions and creates a probability matrix accordingly. Extending this method to the transformations between chords allows for compositional diversity. The UTT-based method distinguishes between transformations after major chords and transformations after minor chords, and requires two probability matrices. A MATLAB library was written for creating new progressions given a single chord (triad) sequence. A short progression is used to explain the methods. The methods are then applied to a well-known chord progression. Readers are encouraged to use a musical instrument or musical software to listen to the examples. Consider the two bar progression in Figure (2).
Figure 2: Two bar progression
The triads on the stave represent the chords rather than actual voice-leading. Below the musical stave is the triadic notation of the progression, where is A- and so forth. Below the triads, slightly indented, are the triadic transformations. For example, the triadic transformation between and is . Repetition has been added to demonstrate transition after the progression has ended. The triadic transformation between the G+ triad at the end of the progression, , and the A- triad at the beginning of
A Transformational Approach to Harmony Improvisation
the progression, is . For demonstration purposes, and without loss of generality, the new progressions in this section were chosen to be eight bars long, with the first triad and transformation kept at their original values.
Transformational approach
The probability matrix for the transformations within the progression appears in Table (1).
| (3, -) | (4, -) | (2, -) | |
|---|---|---|---|
| (3, -) | 0 | 0.5 | 0.5 |
| (4, -) | 1 | 0 | 0 |
| (2, -) | 1 | 0 | 0 |
Table 1: Average transition probability - transformations
The transformational approach can expand the possibilities for new progressions, given the same input progression. The transformation appears twice in the original progression, reducing the average probability matrix dimension. The first row of the average transition probability matrix indicates that after a transformation, there is an equal probability of a transformation or a transformation.
A possible output progression, given a high value of (and a low value of ), appears in Figure (3).
Figure 3: Output progression, high .
The first two bars are identical to the original progression. However, the choice of transformation between triads and , represented by the transformation , or transformation between triads and , represented by , adds the (or, D-) and (or, F+) triads to the list of possible triadic outputs. As the entropy parameter is increased, the possibility of the original transformations appearing in a different order gradually increases, adding more triads to the possible output. For example, choosing and yielded the progression in (Figure (4)).
Figure 4: Output example,
After the first two bars, which happen to be identical to the original progression, the transformation leads to B- rather than to A-. B- leads to , following the original transformation; but then,
Amram et al.
a transformation is chosen by the decision system, which causes a possibly unwanted change. The UTT-based approach reduces or eliminates the probability of such changes.
UTT-based approach
Using this approach, during the analysis stage of the original input progression, two separate probability matrices are calculated. The first is for transformations given major triads and the second is for transformations given minor triads. For the above progression, the transformational probability matrices are:
| Minor Triad | Major Triad | ||
|---|---|---|---|
| (3, -) | (4, -) (2, -) | ||
| (4, -) | {1} | (3, -) | {0.5 0.5} |
| (2, -) | {1} |
Table 2: Average transition probability matrices given major and minor triads - UTT-based approach
Given a minor triad, which occurs in this example after either a or a transformation, the output transformation is always . Given a major triad, the inverse occurs. The major triads in the example follow a transformation, and the output transformation will be either or , with equal probability. Output results are, in this case, independent of the values of and . Possible output progressions include the original progression and the first output progression of the transformational method displayed above.
Figure 5: Output example using the UTT-based method.
In Figure (5) each minor triad is followed by a transformation, and each major triad is followed by transformation. This progression may be described by the UTT .
Hello, Goodbye (chorus) - The Beatles The chorus of the Beatles’ song ‘Hello, Goodbye’ (Figure (6)) is characterized by a harmonic progression with a descending bass line, and is simplified here to be represented by triads.
Given the transformational approach, the transformations and that have a very specific role in the original sequence, would begin to appear with increasing probability as decreases. Furthermore, the transformation occurring after the only minor triad in the sequence, would have a very different effect if placed after a major triad. This may result in a very atonal output chord progression. A more subtle example appears in Figure 7. An example output of the transformational method given appears in Figure 7. This example can be seen as the original sequence transposed two and a half tones upwards but beginning with the third bar of the sequence. However, the last chord is D- rather than D+. A similar result was produced using the UTT-based method, this time with the D+ in place.
In order to demonstrate the consistency of the methods and the relative advantage of the UTT-based method, sequence matching is used. Sequence matching is an essential tool in the fields of bio-informatics and genetics and is also used as a method for comparing musical compositions [11, 6]. The decision method
A Transformational Approach to Harmony Improvisation
Figure 6: Chorus of ‘Hello, Goodbye’ by The Beatles.
Figure 7: Transformational output example given
was applied to the transformations of a given progression, for both the transformational approach and the UTT-based approach, and 0 < \mu_{1} < 1 ( 1 > \mu_{2} > 0 ). A thousand new progressions of the same length were created and compared to the original progressions of transformations and of the triads of the original progression.
Figure (8) shows the maximal matching of the transformations chosen (left graph) and the respective output triads (right graph). In this example, the UTT-based approach succeeds in recreating the original progression for all values of until just below 1. The transformational approach succeeds in recreating the original progression for values above approximately . However, when is very close to 1, the results deteriorate. This follows the fact that near , the (single) transformation with the highest probability is chosen, preventing the new progression from recreating the original progression (see Figure (1)).
Conclusion
An interval-based approach to chord-based harmony improvisation was suggested within the framework of a Markov-based decision system. The system optimizes the balance between compatibility, represented by average harmony, and variety, represented by entropy. Results show that the interval-based approach can be effectively used to improvise upon, or recompose, a given chord progression. The UTT-based approach was shown to improve the results. The decision method presented in this paper is not limited to chords or triads and may be applied to algorithmic composition of melody, rhythm, and possibly other parameters. Interval-based approaches may be extended to include more chord types as well as melody or rhythm.
Amram et al.
Figure 8: Maximal sequence matching of transformations (left) and triads (right).
References
[1] C. Ames. “The Markov Process as a Compositional Model: A survey and tutorial.” Leonardo, vol. 22, no. 2, 1989, pp. 175-187. [2] G. Assayag and S. Dubnov. “Using Factor Oracles for Machine Improvisation.” Soft Computing, vol. 8, no. 2, 2004, pp. 604-610. [3] I. Bica, Z. Zhai, R. Hu and M. H. Melnyk. “Sound Signature Detection by Probability Density Function of Normalized Amplitudes”, Bridges Conference Proceedings, Linz, Austria, Aug. 16-20, 2019, pp. 287-294. [4] G. Bernardes. “Conchord: An Application for Generating Musical Harmony by Navigating in a Perceptually Motivated Tonal Interval Space.” Proceedings of the 11th International Symposium on Computer Music Modeling and Retrieval (CMMR), Plymouth, UK, June 16-19, 2015, pp. 243-260. [5] C. H. Chuan and E. Chew. “Generating and Evaluating Musical Harmonizations that Emulate Style.” Computer Music Journal, vol. 35, no. 4, 2011, pp. 64-82. [6] S. Cunningham, V. Grout and H. Bergen. “Mozart to Metallica: A Comparison of Musical Sequences and Similarities.” Conference on Computer Applications in Industry and Engineering (CAINE), 2005. [7] D.J. Fernández and F. Vico. “AI Methods in Algorithmic Composition: A comprehensive survey.” Journal of Artificial Intelligence Research, 48, 2013, 513-582. [8] Y. Garcia, E. Fisher and J. Mendez. “Positioning for a Guitar Playing Robot Using a Single Image.” ICR2016, Herzliya, Israel, 2016. [9] J. Hook. “Uniform Triadic Transformations.” Journal of Music Theory, vol. 46, no. 1/2, 2002, pp. 57-126. [10] D. Lewin. Generalized Musical Intervals and Transformations. Yale University Press, 1987. [11] M. Mongeau and D. Sankoff. “Comparison of Musical Sequences.” Computers and the Humanities, vol. 24, no. 3, 1990, pp. 161–175. [12] G. Nierhaus. Algorithmic Composition: paradigms of automated music generation. Springer, 2009.