UDC 519.95+781
R. Kh. ZARIPOV
Submitted 1966-01-01 | RussiaRxiv: ru-196601.89477 | Translated from Russian

Abstract

Full Text

UDC 519.95+781

CYBERNETICS AND CONTROL THEORY

R. Kh. ZARIPOV

ON THE ALGORITHMIZATION OF SOLVING PROBLEMS IN HARMONY AND OF THE ANALYSIS OF HARMONIZATION

(Presented by Academician A. I. Berg on 4 June 1965)

The principles are described for constructing an algorithm for harmonizing a given melody with chords, intended for solving students’ problems in harmony. On the basis of the program implementing this algorithm, a program has been compiled for analyzing solutions to problems on the harmonization of a melody or bass with chords, in particular for finding errors in them. The present note is related to works ((^{1-3})) devoted to the modeling on an electronic computer of monophonic compositions. In ((^3)) a survey is also given of Soviet and foreign experiments in machine, in particular polyphonic, composition.

§ 1. Let for each (G) ((G = 0, 1, \ldots, 7)) there exist a number (i_G) and a set of integer values

[
\Omega_G = {\omega_{G0}, \omega_{G1}, \ldots, \omega_{G\, i_G-1}},
\tag{1}
]

where (0 < \omega_{G0} < \omega_{G1} < \ldots < \omega_{G\, i_G-1} \leq 7). Denote (\theta_{G\alpha} = [\alpha / i_G]), where ([x]) is the integer part of the number (x).

By a (G)-chord we shall mean an ordered sequence of values

[
W_{G\alpha} = 10\theta_{G\alpha} + \omega_{G\alpha}, \qquad \alpha = 0, 1, \ldots,
\tag{2}
]

where

[
\omega_{G\alpha} = \omega_{G\alpha'}, \qquad \alpha' \equiv \alpha \pmod {i_G}.
\tag{3}
]

By virtue of (3), the values (\omega_{G\alpha}) form in the (G)-chord the cyclic sequence (\Omega_G).

(\theta_{G\alpha}) corresponds to the octave number of the sound (W_{G\alpha}), and (\omega_{G\alpha}) to the basic degree of the scale. Thus, in C major, when (\omega_{G\alpha}) is equal to 1—do, 2—re, 3—mi, 4—fa, 5—sol, 6—la, 7—si. In this work we consider (G)-chords for which (i_G = 3) ((G = 1, 2, 3, 4, 5, 6)) or (i_G = 4) ((G = 0, 7)). They are, respectively, triads or seventh chords of the (G^0)-th degree, where (G^0 = G(4 - i_G) + |G - 2|(i_G - 3)). In (\Omega_G) there is always the value (\omega_{G j_0} = G^0), which we shall call the fundamental sound, or the root, of the (G)-chord. The subsequent elements (\omega_{G j_0+\sigma}), (\sigma = 1, 2, 3), are called: the third, fifth, seventh (in the case (i_G = 4)).

§ 2. An (A)-chord is an ordered combination of four sounds

[
W_0 \geq W_1 \geq W_2 \geq W_3
\tag{4}
]

(corresponding to the basic degrees of the scale (\omega_0, \omega_1, \omega_2, \omega_3)), selected from a certain (G)-chord according to definite rules. The elements, or voices, (4) are called: soprano, alto, tenor, bass. An (A)-chord, like the corresponding (G)-chord, will be called a triad when (i_G = 3), and a seventh chord when (i_G = 4).

Let us consider a method for constructing an (A)-chord from a given value of one of its sounds, namely (W_0). For each given (W_0), the (A)-chord is uniquely determined by the characteristics (G, \sigma, \rho, \theta, y).

(G) is the number of the (G)-chord from whose elements (W_{G\alpha}) the (A)-chord is formed; consequently, it is necessary that (\omega_0 \in \Omega_G).

Let (\omega_3=\omega_{G j_0+\sigma}). An (A)-chord is called basic if (\sigma=0), and an inversion of the basic (A)-chord if (\sigma\ne 0).

(\sigma) is the order of inversion of the basic (A)-chord ((\sigma=0,1,\ldots,i_G-1)); it determines the value of (\omega_3), as well as the method of doubling the sounds (\omega_i) in (4).

(\rho) is the type of disposition ((\rho=1,2)), determining close, open, or, depending on the method of doubling, mixed disposition (W_0,W_1,W_2).

(\theta) is the octave number of the element (W_3=10\theta+\omega_3) ((\theta=0,1)).

(y) ((y=0,1)) characterizes, depending on (G) and (\sigma), the method of doubling the sounds (\omega_i) of the (A)-chord.

To each set of values of the characteristics (\sigma,\rho,\theta,y) (separately for (i_G=3) and (i_G=4)) there is put into one-to-one correspondence a number (\beta=0,1,\ldots,19). Thus each triple of values (G,\beta,W_0) uniquely determines an (A)-chord, which we shall denote by (A_G^\beta). Here (W_0) is given, and (W_3=10\theta+\omega_3), where (\omega_3=\omega_{G j_0+\sigma}).

§ 3. The algorithm for constructing (W_1,W_2) from the elements of the corresponding (G)-chord is one of three (\tau)-methods, which is chosen depending on the values of (G,\sigma,y).

Direct (\tau)-method. (\tau=0). Used in constructing triads. If (W_0=W_{G\alpha_0}), then

[
W_i=W_{G\alpha_0-\rho i},\quad \text{where } i=1,2,\ \rho=1,2.
]

The disposition (W_0,W_1,W_2) for (\rho=1) will be close, and for (\rho=2)—open. Since (i_G=3), in the (A)-chord the sound (\omega_3) is always doubled.

Two (\tau)-methods with omission (\xi_G). They provide in (W_0,W_1,W_2) the omission of some basic sound (\xi_G\in\Omega_G) (preferably (\xi_G=\omega_3)) dependent on (G,\sigma), and (y); they lead not only to close or open disposition, but, for certain values of (W_0,\xi_G,y), also to mixed disposition.

(\tau=1). Used in constructing triads in the root-position (nonpassing) seventh chords (i.e., (\sigma=1)) with doubling of the prime or fifth. If (\omega_0\ne\xi_G) and (W_0=W_{G\alpha_0}), then

[
W_i=
\begin{cases}
W_{G\alpha_0-\rho i}, & \text{if } \omega_{G\alpha_0-\rho i}\ne \xi_G,\
W_{G\alpha_i-\rho i-1+2y}, & \text{if } \omega_{G\alpha_0-\rho i}= \xi_G,
\end{cases}
\quad i=1,2
]

(\tau=2). Used in constructing seventh chords. If (\omega_0\ne\xi_G) and (W_0=W_{G\alpha_0}), then (W_1) and (W_2) are determined from the relation

[
W_{i+1}\equiv W_{G\alpha_{i+1}}=
]

[

\begin{cases}
W_{G\alpha_i-\rho}, & \text{if } \omega_{G\alpha_i-k}\ne \xi_G \text{ for all } k=1,2,\ldots,\rho,\
W_{G\alpha_i-\rho-1}, & \text{if } \omega_{G\alpha_i-k}= \xi_G \text{ for at least one } k,
\end{cases}
\quad i=0,1
]

If (\xi_G=\omega_3), then the resulting seventh chord consists of 4 different sounds (\Omega_G) and is complete; otherwise, owing to the omission of (\xi_G), (\omega_3) is doubled (an incomplete seventh chord).

The described algorithm for constructing an (A)-chord from the elements of a (G)-chord ensures the prohibition, accepted in the theory of harmony, of an interval greater than an octave between adjacent sounds (W_0,W_1) or (W_1,W_2). Special cases of formation of an (A)-chord are provided for, for example, tripling the prime of a chord, etc.

§ 4. Let (W_{0\nu}) denote the sound (W_0) of the melody falling on the (\nu)-th quarter from its beginning.

Harmonization of a given melody consists in constructing, for each of its sounds (W_{0,\nu+1}), an (A)-chord (A_{\nu+1}) according to the rules for connecting (A_{\nu+1}) with (A_\nu,A_{\nu-1},\ldots).* In accordance with these voice-leading rules (see § 6), from the known values (W_{0,\nu+1}) and (A_\nu,A_{\nu-1},\ldots), from the set of possible chords (A_{1+\nu}^{G\beta}), by enumeration and evaluation of each of them one selects—

* Similarly, the harmonization of a given bass (W_3) may be considered.

one (A_{\nu+1}), the most suitable, is selected. For simplicity of exposition it is assumed that the durations of all notes in the compositions under consideration are not less than a quarter note.

§ 5. Let us consider the method of choosing the chord (A_{\nu+1}). Let ({G}{\mathrm{adm}}) be the set of admissible (G)-chords in the algorithm, and let (M), where (G \in {G}}) be the set of possible (A_{\nu+1}^{G^\beta}) for (W_{0\,\nu+1{\mathrm{adm}}); (\beta = 0, 1, \ldots, 19). The degree of suitability (admissibility) of each chord (A), taking the values (0, 1, \ldots, u_3), which correspond to the qualitative evaluations “desirable,” “permitted,” “should be avoided,” ... , “forbidden.”}^{G^\beta}) is expressed by the quality index (u_{\nu+1}^{G^\beta

In accordance with the rules, an admissible subset of (A)-chords (M_{1\,\nu+1} \subseteq M_{0\,\nu+1}) is chosen with different values (u_{\nu+1}^{G^\beta} < u_3). In the case of the unsuitability (prohibition) of a chord, the corresponding value is (u_{\nu+1}^{G^\beta} = u_3). Next, from (M_{1\,\nu+1}) a minimal subset (M_{2\,\nu+1} \subseteq M_{1\,\nu+1}) of the most suitable chords is chosen, with value

[
u_{\nu+1}^{G^\beta}=\min u_{\nu+1}^{G^\beta}.
]

Musical example with two staves labeled I and II

Fig. 1

The desired chord (A_{\nu+1}) is chosen from (M_{2\,\nu+1}) at random. If (M_{2\,\nu+1}) is the empty set ((\min u_{\nu+1}^{G^\beta}=u_3)), then (A_\nu) is rejected as unsuitable for continuing the harmonization, and the prohibiting value (u_3) is entered into the corresponding index (u_\nu^{G^\beta}). From (M_{1\nu}) another value (A_\nu) is chosen, after which the process of choosing (A_{\nu+1}) begins anew.

§ 6. In accordance with the general principles of theory (for example ((^4,^5))), the algorithm is designed for harmonizing, with chords, a major or minor melody in the form of a single-tonal period. The algorithm provides, in particular, for the following provisions and rules.

  1. Preparation and resolution of seventh chords and quartsext chords (cadential, passing, and auxiliary).

  2. Prohibition of the following kinds of voice leading: a) parallel octaves, fifths, and seconds, hidden octaves and fifths; b) crossing between voices in adjacent chords (A_\nu); c) motion by augmented intervals (second, fourth, and fifth); d) the transition of one and the same chord (or note (W_3)) from a weak beat of the measure to a strong one; e) leading the bass (W_3) by two fifths in succession in one direction and by two fourths in one direction, beginning on a strong beat.

  3. Exclusion of progressions (G_\nu, G_{\nu+1}) (or (G_\nu\sigma_\nu, G_{\nu+1}\sigma_{\nu+1})) forbidden by the norms of voice leading.

  4. Undesirability of the direct motion of all voices.

  5. Ensuring the “smoothness” (melodiousness) of the movement of the three lower voices by introducing a “local range” (see ((^3))).

§ 7. Provision is made for the possibility of specifying, from the console or by means of a special program, a set of values of the parameters ((^3)), thanks to which, from the set of all programmed means of harmonization, those are selected which are used in the given variant of the solution. For example, the set of admissible (G)-chords, the degree of “smoothness” of each voice, the rules of harmonization,

certain properties of the chord (A_\nu), etc. This makes it possible to model different levels of complexity of harmonization, which is illustrated by two examples of machine harmonization of melodies (see Fig. 1). In example I, ({G}{\mathrm{adm}}={1,4,5}), (\sigma=0) (harmonization by principal triads). In example II, ({G}={1,2,4,5,7}) for all possible values of (\sigma).}

The algorithm described has been implemented on the Ural-2 machine. The program, with working cells and constants, occupies approximately 4000 cells. The time required to solve one variant of the problem varies greatly and depends both on the melody and on the specified set of parameter values. With more stringent requirements on the quality of the harmonization, more time is spent because of the need to return repeatedly to a new choice of the chord (A_\nu), owing to the fact that the minimal set (M_{2\nu+1}) (§ 5), when choosing the current chord (A_{\nu+1}), turns out to be empty. On average this time is 3 minutes or more.

The solution of the problem is printed in the form of a sequence of encoded four-part chords (A_\nu), in columns of 4 numbers (W_{i\nu}) each, where (W_{i\nu}=10\theta_{i\nu}+\omega_{i\nu}); (i=0,1,2,3).

§ 8. The program considered has been used in compiling an examiner program for the analysis and verification of the correctness of solutions to problems of harmonizing a melody or a bass with four-part chords. The initial information is the encoded record of the solution of such a problem.

The principle of operation of this program is as follows. After determining the mode (major or minor) and other characteristics of the composition, for each given chord (A_\nu) the values (G,\sigma,\rho,\theta,y) are uniquely determined. Then, by the method of § 5, the quality (degree of suitability) of the chord (A_\nu) is evaluated. Each instance of a violation of the rules, or of the undesirability of some progression, is noted for each number (\nu), and the corresponding comment on this is printed in encoded form, with the appropriate remarks.

The possibility of specifying a set of parameter values, i.e., a list of rules whose nonobservance in the given solution is regarded as an error, makes it possible to analyze solutions of problems at different levels of complexity of harmonization. If the complexity of the chord being checked exceeds the level of complexity of harmonization provided for by the specified set of means, or if the chord is meaningless from the point of view of the program, the corresponding remark is printed.

Scientific Council
on the complex problem “Cybernetics”
under the Presidium of the Academy of Sciences of the USSR

Received
2 VI 1965

REFERENCES CITED

  1. R. Kh. Zaripov, DAN, 132, No. 6 (1960).
  2. R. Kh. Zaripov, Collection: Problems of Cybernetics, vol. 7, 1962.
  3. R. Kh. Zaripov, Collection: Problems of Cybernetics, vol. 15, 1965.
  4. N. A. Rimsky-Korsakov, Practical Textbook of Harmony, 1956.
  5. I. I. Dubovskii et al., Textbook of Harmony, 1962.

Submission history

UDC 519.95+781