Introduction
The nature of human creativity is studied even less than the nature of intelligence. Nevertheless, machine creativity, as a direction in artificial intelligence, exists. It poses the problem of writing computer music, literary and pictorial works, and the creation of realistic images is already widely used in the cinema and gaming industry. The systems created allow for the production of specific images that are easily perceived by a person, which is especially useful for intuitive knowledge, the verification of which in a formal form requires considerable mental effort [
1 ].
Under the cat you will find a brief overview of the subject area, the suggested approach to writing music using a computer and a little math.
How it was
The development of electronic computing technology in the early stages led to its “invasion” of music. Already in the 50s, using the very first computers, scientists made attempts to synthesize music: compose a melody or arrange it with artificial timbres. This is how algorithmic music appeared, the principle of which was proposed as far back as 1206 by Guido Marzano, and later used by V. A. Mozart to automate the composition of the minuets — writing music according to random numbers. K. Shannon, R. Zaripov, Y. Xenakis and others were engaged in machine creativity.
In the fall of 2005, at the University of California (Berkeley, USA), a student orchestra performed the Mozart's Forty-second Symphony. Of course, the listeners knew that Mozart wrote forty-one symphonies, but this fact did not prevent them from listening to charming music, which, however, according to the statements of a number of critics, lacked something elusive, typical of the melodies of the great composer. And no wonder: the 42nd symphony was composed by the EMI computer program (“Experiments with Musical Intellect” - Experiments in Musical Intelligence). The program was created by composer and programmer David Cope at the same time. Over the past few years, EMI has generated “new works” by Bach, Beethoven, Brahms, Chopin and Scott Joplin [
2 ].
At the moment, there are two main directions in algorithmic music:
- the creation by computer of new works that can, in a sense, compete with works of art created by man;
- modeling known styles of musical works to study the laws and principles of the construction of these works, their forms, structures, as well as for experiments on their perception in psychophysiological studies.
The music generation algorithms use two polar approaches based on the use of deterministic or stochastic procedures. Deterministic procedures generate musical events (for example, notes) by performing fixed compositional tasks not related to a random selection. Stochastic procedures generate musical events according to probability tables, which establish the probability of occurrence of these events [
3 ].
Why do we need some kind of collaboration?
The algorithms for generating music within each approach have their own advantages and disadvantages. For example, the melody generation algorithm based on Markov chains uses statistical information and reflects the pitch, but it cannot generate an adequate rhythmic melody.
This paper proposes a collaborative approach based on the use of several algorithms by their composition. The idea of ​​building an algorithmic composition is not new. It first appeared in the framework of solving the pattern recognition problem and consisted in combining several algorithms into a composition under the assumption that the errors of these algorithms are mutually compensated.
')
Who is who
The formulation of the problem of algorithmic composition was formalized by Yu.I. Zhuravlev in the following form. It is required to construct an algorithm
a: X → Y , where
X is the space of objects;
Y - many answers. Along with the sets
X and
Y, an auxiliary set
R , called the estimate space, is introduced. We consider algorithms that have the form of a superposition a (x) = C (b (x)), where the function
b: X → R is called an algorithmic operator, the function
C: R → Y is the decision rule. An algorithmic composition made up of algorithmic operators
b t : X → R, the corrective operation
F: R T → R and the decision rule
C: R → Y is the algorithm a: X → Y of the form [
4 ]:

And generation here and?
As you can see, this approach is applicable to the recognition of input data, but the music generation algorithms do not recognize anything, but synthesize a new one. Therefore, we will try to reduce the task of generating musical events (notes) to the problem of classification or recognition.
Each of the existing algorithms is aimed at creating a chain of notes of a certain duration and pitch. But it is enough to change the internal logic of the algorithm so that the generated notes come from outside (for example, random note generators), and the algorithm gives an estimate if it could synthesize the note received at the input in its current state. Thus, the generation task is reduced to the recognition problem.
Collaborative approach
The input of the algorithms
b 1 (x) and
b 2 (x) will be given pairs of values ​​from the set
X = {(note 1 , duration 1 ) ... (note 12 , duration 1 ), (note 1 , duration N ) ... (note 1 , duration N )} , obtained randomly.
The evaluation space is
R = {0, 1} , where
1 is a sign of suitable input data,
0 is a sign of inappropriate data. Any algorithm
b i (x) forms a pair of estimates
(R N , R D ) , where
R H is the note score,
R D is the duration score.
As a corrective operation, we consider a simple vote [
4 ], i.e.

For the introduced estimate space
R and the algorithms
b 1 (x) and
b 2 (x), the corrective operation
F has the following form:

We define the decision rule as follows

The rule translates the space of estimates of
R into a set of answers
Y. The set of answers
Y = {M 1 , M 2 } divides the input data into two classes:
M 1 is a suitable pair for a melody (note, duration) and
M 2 is an unsuitable pair.
Thus, the following algorithmic composition is obtained:

Area of ​​expertise
We define the competence domain of the algorithm
b 1 (x) as the pitch, and the algorithm
b 2 (x) as rhythmic. The algorithm
b 1 (x) cannot estimate a pair
(note, duration) from the rhythmic side, as well as the algorithm
b 2 (x) - from the pitch. Let us assume the following assumption: any algorithm
b i (x) that is incompetent in a certain area always evaluates data from this area as appropriate. In other words, the estimate of
R 1 for the algorithm
b 1 (x) is equal to
(R H , 1) , the estimate of
R 2 for the algorithm
b 2 (x) is equal to
(1, R D ) .
Instead of conclusion
In general, the proposed collaborative approach can be extended to a wider variety of algorithms. Moreover, the algorithms can form not only the estimates of
0 or
1 , but also use the entire interval
[0; 1] , as the probability of occurrence of the input pair. In addition, each algorithm can be weighed, which will allow you to select the most significant estimates. For example, when modeling the style of a composer, the more priority are the estimates obtained from a neural network trained in a certain set of works by this composer.
Bibliography
- Rodzin, S.I. Artificial Intelligence. - Taganrog: Publishing house TTI SFU, 2009. - 200 p.
- Sharov, K.S. Composer’s Machines and Sensual Perception of Musical Creativity / K.S. Sharov // Materials of the International Scientific Conference (November 6-7, 2009) - Moscow: Modern Notebooks. - 2009. - 240 p.
- asmir.info/lib/compmus.htm
- Zhuravlev, Yu. I. On the algebraic approach to solving recognition problems or classification / Yu.I. Zhuravlev // Problems of Cybernetics. - 1978. - V. 33. - P. 5–68.