Machine Learning in Music Generation

1BISITE Digital Innovation Hub, University of Salamanca. Edificio Multiusos I+D+i, Salamanca, Spain. 2Department of Electronics, Information and Communication, Faculty of Engineering, Osaka Institute of Technology, Osaka, Japan 3Pusat Komputeran dan Informatik, Universiti Malaysia Kelantan, Karung Berkunci 36, Pengkaan Chepa, Kota Bharu, Kelantan, Malaysia. oriental Journal of Computer Science and Technology

The different computational advances in the field of Artificial Intelligence (AI) have attracted the attention of researchers with all kinds of origins, background and motivations.From an interdisciplinary research field that sits at the intersection of the fields of AI, psychology, cognitive science, linguistics, anthropology and other human-centered sciences born the area of Computational Creativity (CC).CC can be defined as a "philosophy, science and engineering of computational systems which, by taking on particular responsibilities, exhibit behaviours that unbiased observers would deem to be creative".

Fig. 1: Computational Creativity as a transversal field
The area of Computational Creativity has recently been significantly developed with the entry of companies as important as Google, with projects such as DeepDream, a neural network that transforms images or, more recently, Magenta, the equivalent for the generation of music.
Over the last centuries, a lot of composers tried to formalize the process of music composition, publishing treaties like "The Musical Idea and the Logic, Technique and Art of its Presentation" by Schoenberg, or "Vereinfachte Harmonielehre (Simplified Harmony)" by Riemann.However, the music composition is usually influenced by many subjective factors, such as the specific style, personal preferences and above all, the musical context.Therefore, creating interesting music commonly requires years of musical training, and it also depends on the skills, feelings and mood of the composers.
Recreating such behavior through a machine challenges the field of the Artificial Intelligence, due to the complexity of the large number of factors that play a role in the composition process.Recent technological solutions have been proposed to automatically generate music, which only should capture the technical idiosyncrasies of the musical system, but also offering creative freedom and personal expression.All the proposals are based on concrete AI techniques.In this chapter, we briefly introduce the most used ones, namely, statistical learning, grammars and application of rules, and biological principles.
A first approach to generate chord progressions is by statistical learning of chord sequences from musical corpora to feed different inference algorithms such as junction tree algorithms, pattern-matching strategies or variable-order Markov models 1 .This kind of strategies make use of a memory that remembers compositions previously generated or composed by different musicians following concrete musical styles.This corpus is therefore used as the training set to learn how to create music.This technique intends to generate compositions based on a concrete musical style (such as jazz, classic or romantic music) or composer (i.e., Mozart, The Beatles, etc.). Figure shows the workflow of the statistical algorithms.

Fig. 2: Machine Learning Workflow
There are different recent approaches that make use of statistical learning.Flow Machines is a new framework which provides new ways for creating music by collaborating with human musicians, but also learning from an existing corpus.Likewise, VirtualBand is a system generates jazz compositions following the performance of a melodic instrument.GimmeDaBlues automatically generates the bass and drum parts learning from a user playing the keyboard and/or other solo instruments.
An alternative approach to statistical learning is to derive rules from music theory principles to design algorithms based on deterministic and probabilistic principles.Closely linked to this approach is the application of generative grammars to organize musical lexemes.In such cases, a large number of rules are encoded and used as the knowledge basis of the system.This approach also permits to generate music following a musical stylistic paradigm.Within this approach, we can highlight CHORAL, a notable application for the harmonization of chorales in the style of Johann Sebastian Bach.The system contains about 350 rules representing musical knowledge from multiple viewpoints of Bach's chorales, such as the chord construction, the melodic lines of the individual parts, and voice leading.
Agents can be included in this kind of technique, as its behavior can evolve from their knowledge basis 1,3 .Additionally, this knowledge can be updated along the time according to the context and the knowledge of the rest of the community, which enlarge the possibilities to create innovative music.Delgado et al., 4 proposed Inmamusys, a framework for music composition based on multiagent systems and a set of rules.Other authors proposed a system to generate music based on multiagent systems.
The use of biological or evolutionary principles and an objective function to optimize has been another recurrent strategy used in the automatic generation of chord progressions, in particular through the use of genetic algorithms.Evolutionary computing allows the creation of music following very different paradigms, like fractal music, mathematical music or program music.
In one of the first works to apply evolutionary computation to algorithmic composition, Moroni 5 proposed Vox Populi which uses genetic algorithms to evolve a population of chords by maximizing multiple musical criteria.Later on, the cellular automata was proposed, which generates music based on the physiological needs of an artificial cell.Recently, Navarro et al., 6 proposed to use an Artificial Immune System (AIS) to iteratively generate the next chord in a given sequence by optimizing an objective function.
More intelligent techniques that address the problem of the computational creativity can be found along with an overwhelming amount of excellent works that were not mentioned in this brief chapter.The authors aimed to give a small representative sample from the state-of-the art systems among the most popular methods.Future lines of research also include the presentation of a categorization of musical applications according to their functionality, architecture and/or learning process.