DESIGNING A SIMPLE NEURAL COMPOSER

August 6, 2017 | Autor: Nikos Kofidis | Categoria: Neural Network, IT Value, Back Propagation Algorithm, Random Numbers
Share Embed


Descrição do Produto

DESIGNING A SIMPLE NEURAL COMPOSER Nikos Kofidis1, Efthymios Kotsialos2, Athanasios Margaris3 and Manos Roumeliotis4 Department of Applied Informatics, University of Macedonia Egnatias 156 Str, GR 540 06 Thessaloniki, Hellas 1

email: [email protected], 2email: [email protected], 3email: [email protected], 4email: [email protected]

Abstract: This paper describes the design of a neural network, which has the ability to produce a sequence of chords obeying the main rules of the harmony of classical music. Specifically, when the network’s input layer is fed with a chord, its output layer produces an acceptable chord of the same scale. The input signal consists of four digits. Three of them are used for the binary representation of the chords. The fourth one takes values in the interval [0,1] and plays the role of a direction pointer. Its value determines the next chord in the sequence. The network’s output consists of six neurons and produces a decoded binary output. The network is trained by the Back Propagation algorithm. During the recall phase, the network is at first stimulated by the tonic chord of the scale and continues working due to the feedback of the output chord to the input layer. The direction pointer neuron of the input layer is fed by random numbers, thus contributing to the enrichment of the resulting harmony. Keywords: Neural Networks, music, composition, back-propagation algorithm. 1. INTRODUCTION Both pattern recognition of musical structures and composition techniques have been approached by researchers who have successfully used a variety of neural structures as analysis or composition tools. Bharucha J.J. and Todd M.P [1] make use of neural networks (supervised and competitive learning) to simulate the musical structure of tonal pieces. Scarborough D. L., Miller O. B., Jones A. J [10], attempt tonal analysis of musical pieces designing proper neural structures. Sano H., Jenkins B. K.[9], constructed a neural network that models pitch Perception while Laden B., Keefe H. D [7] have worked with neural networks on the topic of pitch perception and chord classification. Gjerdingen Robert O [2] has experimented with ‘ART’ networks’ ability, based on Grossberg’s[3,4,5] adaptive resonance theory, to categorize complex musical patterns of pieces written in classic period. Todd Peter [11] set up a sequential neural network to produce melodic structures while Kohonen Teuvo, Laine Pauli, Tirts Kalev, and Torkkola Kari [6] constructed networks that store a number of composition rules in order to produce a useful tool for musical composition. Lewis J.P [8] used supervised and reinforcement learning techniques to produce a sequence of notes and chords as an output of carefully designed neural structure. The main task of the current work is the design of a neural network that can simulate simple composition procedures established by the composers of classical music. Specifically, the network should be able to produce a sequence of chords strictly limited by some of the basic rules of the classical harmony. The following table presents the most often-used acceptable chord sequences.

Table 1.1 Acceptable Chord Sequences Starting Chord

Following Chord I

I II III IV V VI

II x

III

x

IV x

V x x

VI x x

x x

x

x x

x

x x

In all cases there is more than one direction to be followed during the evolution of the harmonic event. One of them, not always the same, should be selected at each step of the evolution. A human composer uses his musical instinct to control the harmonic stuff while a neural network needs quantitative criteria to go on. To overcome this difficulty the network is provided with a direction factor ‘d’ that takes values in the interval [0,1]. Table 1.2 presents the values of the direction factor for each acceptable chord sequence. Table 1.2 Direction Factors Starting Chord

Following Chord I

I II III IV V VI

II

III

0-0.3 0-0.5

IV

V

VI

0.5-0.7

0.7-1 0.4-1

0.3-0.5 0-0.4

0.5-1 0-0.4

0.5-1

0.4-1 0-0.2

0-0.5

0.2-0.5 0.5-1

During the training phase, the direction factor is selected in such a way as to provide the system with all the necessary information. During the recall phase a generator of random numbers gives the proper values to the direction factor. This contributes to the enrichment of the resulting harmonic event. Although the neural network cannot replace a human composer, it could be a very useful tool of exploring new ways to set up the musical stuff. 2. THE NEURAL NETWORK Several neural structures and signal encoding techniques have been tried out during this work. The best neural structure and signal encoding are presented here. Fig.2.1 shows the neural network that simulates the simple composer described in the previous section. It consists of three layers, the input, the hidden and the output layer.

Output Layer (Linear) Hidden Layer (tanh)

Full Connection

Full Connection

Input Layer

Fig.2.1: Neural network that simulates a simple composer The input layer contains four neurons. The first three of them are fed with the encoded chord while the fourth one is fed with the direction factor. Table 2.1 presents the input and output encoding of the chords. Table 2.1: Input and output encoding of the chords Chord Input encoding Output encoding 000 100000 I 111 010000 II 001 001000 III 110 000100 IV 011 000010 V 100 000001 VI The hidden layer contains four neurons, which apply the “tanh” transfer function to their inputs. It is fully connected to the input and output layers. The output layer consists of six linear neurons. The output vector has the form of a six digit binary number as presented in table 2.1. The network is trained using the Back Propagation training algorithm. After the completion of network’s training, the testing phase is activated, during which the network is provided with unknown data and its response is checked. Since there are no unknown chords the only unknown element is the direction factor. As presented in the following the variation of this factor does not influence the response of the system. The training and testing parameters of the network are presented in table 2.2. Table 2.2: Parameters of the network Type of network Hidden layers Training algorithm Learning rate Momentum Range of initial weight space Data set used for training Epoch (training batch) Maximum number of iterations Data set used for testing

Three layer feed far forward network One consisting of three neurons which apply the ‘tanh’ transfer function Back propagation 0.1 0.85 [-0.1,0.1] 684 vector pairs 1 30000 epochs 684 vector pairs

3.RESULTS AND DISCUSSION The network described in the previous section was successfully trained after 30000 epochs. It should be pointed out that the average response of the network is not relevant in this case. The network has to be 100% successful because even one chord out of order destroys the overall harmonic structure. Thus, every input-output pair was thoroughly checked during the test phase. Provided that a digit greater (less) than 0.5 is equivalent to ‘1’ (‘0’) it was very easy to distinguish the ‘ones’ and ‘zeros’ in the output layer. Additionally, the components (digits) of the actual output were very near to ‘1’ or ‘0’ since the RMS error of the training set was less than ‘0.005’. During the recall phase the network is supposed to produce a sequence of chords without any external influence. The function of the system presented in fig.2.2 is summarized in the following. 1. The network is fired with the tonal chord (I) of a scale. The direction factor is given a random initial value created by a random number generator. 2. The output is decoded and sent to the audio equipment. 3. The decoded output is encoded by the input encoder and sent to the input layer together with a new random number. 4. The steps 2 and 3 are repeated for a predefined number of cycles.

6

Output decoder Random Number Generator

Input encoder 3

Audio equipment

Fig.3.1: Recall phase of the network The random number generator retains the non-periodic structure of the sequence of chords since the direction factor does not permit the system to follow the same path at every turn. Thus, it contributes to a relatively rich harmonic structure.

5. CONCLUSIONS The neural composer described in this work is a simple but effective simulation of the composition process. It does not take into consideration complex harmonic structures or chord relationships. As an experimental work it is based in a few basic ideas governing the classical harmonic system. In future research the simulation of more complex systems may lead to more powerful tools. Although the connection of music and intelligent systems is interesting and mind stimulating and may lead to unpredictable research paths, artificial intelligence products should not be considered as real composers but as powerful tools in the hands of any talented musician. REFERENCES 1. Bharucha J.J., Todd M.P. (1989). «Modeling the Perception of Tonal Structure with Neural Nets», Computer Music Journal, Vol. 13 No 4. 2. Gjerdingen Robert O. (1989). «Using Connectionist Models to Explore Complex Musical Patterns», Computer Music Journal, Vol. 13 No 3. 3. Grossberg S. (1978), «A Theory of Human Memory: Self-recognition and Performance of of Sensory Motor Codes, Maps and Plans». In R. Rosen and F Snell, eds. Progress in Theoretical Biology, vol.5.New York: Academic Press. Reprinted in Grossberg 1982. 4. Grossberg S. (1982) «studies of mind and Brain: Neural Principles of Learning, Perception, Development and Motor Control». Boston: Reidel/Cluwer. 5. Grossberg S. (1987), «Competitive Learning: From Interactive Activation to Adaptive Resonance». Cognitive Science 11:23-63 6. Kohonen Teuvo, Laine Pauli, Tirts Kalev, and Torkkola Kari (1991). «A Nonheuristic Automatic Composing Method», Music and Connectionism edited by P.M.Todd and D.G.Loy (1989), «A Connectionists’ Approach To Algorithmic Composition» Computer music journal, vol.13 No.4The MIT Press Cambridge, Massachusetts London, England. 7. Laden B., Keefe H. D. “The Representation of Pitch in a Neural Net Model of Chord Classification”, Computer Music Journal, Vol. 13, No 4, 1989. 8. Lewis J.P. (1991). «Creation by Refinement and the Problem of Algorithmic Music Composition», Music and Connectionism edited by P.M.Todd and D.G.Loy, The MIT Press Cambridge, Massachusetts London, England. 9. Sano H., Jenkins B. K., “A neural network model for Pitch Perception”, Computer Music Journal, Vol. 13, No 3, 1989. 10.Scarborough D. L., Miller O. B., Jones A. J., “Connectionist Models for Tonal Analysis”, Computer Music Journal, Vol. 13, No 3, 1989. 11.Todd Peter (1989). «A Connectionist Approach To Algorithmic Composition», Computer Music Journal, Vol. 13 No 4.

Lihat lebih banyak...

Comentários

Copyright © 2017 DADOSPDF Inc.