To Contents

General Introduction to Melody Generator II

Aim

In spite of its name, the generation of tonal melodies is not the principal aim of Melody Generator II. Its goal is scientific: to establish our understanding of tonal music by developing an artificial music generator and evaluating the well-formednes and 'quality' of the melodies it yields.

For this purpose, Melody Generator II incorporates a large amount of knowledge about tonal music, collected in theoretical and experimental research, which forms the basis for the construction of tonal melodies.

Melody Generator II differs from systems that help users to create melodies by providing a platform for generating music that assists the user to obey the rules of tonal music (e.g. non-chord tone resolution, voice leading, motive development). These systems basically constrain the selection of tones and chords but the actual selection is still made by the user. Melody Generator II carries out the complete process of melody construction, although the user can edit the result in various ways.

Methodological Foundation

See also: D.J. Povel. (2010). Melody Generator: A device for algorithmic music construction. Journal of Software Engineering and Applications, 3, 683-695. show

Music theory has yielded a huge amount of insights in the structure, organization and functioning of music. Experimental research in music cognition in the last 3 or 4 decades also contributed a notable amount of knowledge regarding the perception and production of music. Because of the methods used to gain insight in its subject, the knowledge collected in the two fields differ greatly in scope, substance and reliability. Music theory has spawned concepts, notions, ideas, and theories concerning virtually all aspects of music, but since music theory has no firm criterion to decide about the justness of their claims there are many controversies and conflicting opinions.

Experimental research, on the other hand has a firm criterion to decide about the validity of the proposed ideas and hypotheses: experimental evidence. But the constraints of the experimental method often leads to a piecemeal approach of the topic and consequently rather simplistic notions. Attempts to simulate aspects of the process of music perception by means of computational modeling (e.g. meter induction, harmony induction, segmentation, coding, etc.), by psychologists and researchers in AI (artificial intelligence), has build a bridge between the disciplines of music theory and experimental research in the sense that selected aspects of music theory are formalized in the models from which testable hypotheses are derived, thus opening up the findings in music theory to scientific investigation.

The approach adopted here is based on the consideration that it should be instructive and revealing to develop a music generation system based on the presently available knowledge (collected in theoretical work and experimental research). The leading rational behind such a system is that if we truly understand music we should be able to recreate it from its basic elements (sounds differing in frequency and duration), at least in some elementary fashion. The advantage of this approach, as compared to that of the experimental method, is that it investigates all factors in a coherent, comprehensive way. The main advantages of the approach are thus twofold: 1) the need for comprehensiveness (all aspects of music have to be taken into account) and 2) the need for precision (enforced by the fact that the model is implemented as a computer algorithm). For the researcher this is a most attractive way to investigate music, by moving between the most abstract and the most concrete ends on the continuum of music description.

Theoretical Foundation

Here I introduce the main principles, proceeding from abstract to concrete. First I introduce the basic assumptions and notions very concisely, which are later elaborated in more detail.

Introduction

Melody Generator II is based on the following assumptions
  1. Tonal music is conceived within the context of time and pitch
  1. Time is configured by meter (which imposes constraints)
  2. Pitch is configured by key and harmony (which imposes constraints)
  1. Within that context tone sequences are generated using construction rules that relate to the (hierarchical) organization of the tones into parts and of parts into larger parts etc., relating to concepts such as motives, phrases, repetition and variation, skeleton, structural and ornamental tones etc.
  2. Tonal music is completely rule governed. Although it is often claimed that music only becomes interesting by deviating from the rules, I assume that these deviations are also rule governed. This assumption is based on the consideration that a tone sequence is only perceived as a melody if the listener is able to discover the relations between the pitches, all pitches, in the input.
What the program really does is simulate the process by which someone whistles a tune. To accomplish that, we need to understand what a tonal melody is. In essence, a melody is a psychological phenomenon: it is the result of a perceptual process. For that reason, a substantial part of Melody Generator II is based upon insights collected in music perception research. This research has shown that in order to make an internal representation of a musical input, a listener must first discover the context (meter, key, and underlying harmony), and recover the structural regularities in the tone sequence which are then used to develop a mental description. Another most relevant finding is that once a listener has identified the key of a piece, the pitches and chords are perceived as elements of a highly organized system of dependency relations acquired by listening to examples of tonal music and stored in long term memory. These relations are experienced as attractions between the notes and between the chords that largely determine the artistic significance of a piece of music.
So, if we are able to specify the constraints imposed by the tonal context (meter, key and harmony), to comprehend the operation of the construction rules, and if we succeed to implement those within one program, we should be able to generate tonal melodies.

Melody Perception (draft)

As indicated above, a melody is essentially the result of a perceptual process. As we want to understand the nature of a melody, we need to understand the process by which a perceiver ‘creates’ a melody given an input of pitches. This section describes this process.
Basically, the process of melody perception consists of two phases:
  1. Discovering the tonal context: meter, key, and harmony, and representing the input in that context
  2. Describe the input in terms of the context

Phase 1

In the first phase, the listener recovers the meter and the key of the input which provides an interpretive context needed for further processing. It should be recognized that meter-finding and key-finding are continuous processes: because music perception is an incremental process the meter and key must be updated constantly.

Meter. Meter is a mental temporal frame allowing the specification of the temporal structure of the pitches. It could be seen as a temporal ruler. Meter assigns metrical accents to the notes in a rhythm determined by the metrical weight of the different positions in the meter. More.

Key. The key, is a mental frame specifying the relationships among the elements of tonal music: tones and chords. These relationships are subjectively experienced as expectations for specific tones and chords. More.

Harmony. Tonal melodies are based on a harmonic progression. As a result, in order to perceive a tonal melody, a listener has to identify the underlying harmonic progression which is then used as a frame to represent the notes within the current harmony. The notes in a melody are thus interpreted in a hierarchical fashion: as a pitch within a harmony within a key. This hierarchical frame determines the expectations for future tones in a rather complicated fashion. More (here link with p. 13 ff from Perception The Theory.doc). More.

Tonal expectations. An example may clarify the idea: consider the tone sequence C5 E5 G5 F5 D5 B4 A4 (the digit indicates the octave, C4 is middle C on the piano) from a study by Cuddy et al. (1981). This sequence was judged as a rather poor melody. This may have been caused by the fact that some tonal expectations created by the sequence were not met, i.e. the sequence was considered ‘unfinished’. Indeed, by merely adding the notes B4 C5 at the end, the sequence C5 E5 G5 F5 D5 B4 A4 B4 C5, is now judged a good melody. This can be understood as the result of a harmonic interpretation on the part of the listener which assumes that the first three notes C5 E5 G5 evoke the Tonic in the key of C-major, while the notes G5 F5 D5 B4 are recognized as V7. It is well-known that a V7 chord creates an expectation for elements of the Tonic chord (I), in particular for the tonic note C itself. The A4 note following the V7 fragment clearly does not fit the expectation. The two added notes B4 and C5 do two different things: the B ‘anchors’ the non-chord tone A4 to the chord-tone B4 (and thereby to the underlying harmony V7), and the note C5 resolves the expectation by the chord tones of the V7 chord, especially that of B4.

Summarizing phase 1. The above concise description of a fundamental aspect of the processing of tonal music can be summarized as follows: the finding and activation of a frame of reference consisting of a meter and a harmonic progression (within a key) that provides the musical context on which the pitches in the input are mapped. This mapping results in the assignment of a metrical position (including a metrical weight) to the pitches and in the assignment of a tonal function to the pitches thereby defining them as a chord-tone or non-chord tones. Moreover the tones, depending on their position in the harmonic frame create specific tonal expectations anticipating fulfillment.
In a study in which participants imitated by singing a simple Russian folksong, Sloboda & Parker (1985) found that the imitations contained many errors, but that those errors always fitted the underlying metrical and harmonic frame of the melody. This is a very interesting finding, because it indicates the relevance of finding the interpretive context in the process of music perception. It might even suggest that the finding of the interpretative context and the appreciation of the concomitant tonal characteristics (e.g. the creation and resolution of expectations) attraction of the elements within that context is the core of music perception, rather than retaining all surface detail. This leads to the question: do we actually hear pitches when we listen to music or do we only hear their musical function as expressed in the following quote:
Hearing music does not mean hearing tones, but hearing, in the tones and through them, the places where they sound in the seven-tone system.” Zuckerkandl, V. (1956, p. 35). More.

Remember that music is an artistic product and that the main function of listening to music is to somehow enjoy it, not to reproduce it.

Here I will later describe the consequences for music generation: the constraints imposed by meter on rhythm (metrical stability), key (diatonic and chromatic tones, chords) and harmony (harmonic progression, chord tones vs. non-chord tones, constraints with respect to the placement and resolution of non-chord tones, the resolution of tonal expectations…)

Phase 2

Tonal melodies are characterized by a hierarchical organization consisting of motives, phrases, and sections which are connected in some logical way. Typical organizing principles are repetition, variation and ornamentation (Schoenberg, 1967; Bamberger, 2000). Here we examine what role these structural aspects may play in listening to music.

First we should mention that it is not clear to what extent the average music listener actually processes the structural aspects of a melody. Remember that normal listening to music does not require the creation of a mental representation (in contrast with listening to a conversation). However, it is clear that most people are capable to reproduce a melody, which means that they made a reproducible memory trace.

Research in human perception has revealed that serial stimuli (series of notes, digits, figures) are perceived in terms of their structural regularities (that is why the phone number 666 555 4444 is easier to remember than 453 275 3671).

At present the two main theories of the mental representation of tonal music are those of Lerdahl & Jackendoff (1983) and Deutsch & Feroe (1981).

The basic idea of Lerdahl & Jackendoff (1983) is that the listener“… attempts to organize all the pitch events into a single coherent structure, such that they are heard in a hierarchy of relative importance”  p. 106. More.

Deutsch & Feroe (1981), proposed a theory for the representation of pitch sequences (in tonal music) in terms of operations on an alphabet (e.g. a scale). More.

Here, again we must emphasize that music perception is an incremental process and that the aim (for the normal listener) is not to arrive at a complete representation of the input, but to make sense of the input on a rather local level (i. e. within a limited time-window). More

Problems of Phase 2: to what extent is the music actually mentally represented. To what extent does a listener distinguish structural and ornamental aspects.

Here I will later describe the consequences for melody generation. First it should be realized that in order to create a melody one needs a ‘Plan’ that specifies a number of aspects (irrespective of the role of these features in perception)


For more information click the i buttons on the interface

Design principles

Melody Generator II is based on the following principles

References

The notions presented here are based on the following articles, among others:

Bamberger, J. (2000). Developing musical intuitions. New York: Oxford University Press.
Bharucha, J. J. (1984). Anchoring effects in music: The resolution of dissonance. Cognitive Psychology, 16, 485-518.
Krumhansl, C. L., (1990). Cognitive Foundations of Musical Pitch. New York: Oxford University Press.
Lerdahl, F., & Jackendoff, R. (1983). A generative theory of tonal music. Cambridge, MA: M.I.T. Press.
Povel, D. J., & Essens, P. J. (1985). Perception of temporal patterns. Music Perception, 2, 411 - 441.
Povel, D. J., & Jansen, E. (2001). Perceptual mechanisms in music processing. Music Perception, 19, 169-198.
Povel, D. J., & Jansen, E. (2002). Harmonic factors in the perception of tonal melodies. Music Perception, 20, 51 - 85.
Povel, D.J. (2010). Melody Generator: A device for algorithmic music construction. Journal of Software Engineering and Applications, 3, 683-695. download
Schoenberg, A. (1967). Fundamentals of musical composition. London: Faber and Faber.
Zuckerkandl, V. (1973/1956). Sound and Symbol. Princeton University Press.

For a more complete list click here.

TheoreticalIntro1.html (last update 16.10.2010)
Created in SeaMonkey
© D.J. Povel, 2010

To Contents