Android app for automatic music composition
Abstract
In this contribution, we present an Android App that generates music automatically replicating a specific contemporary genre, specifically rock music. The composition system is based on the analysis of a set of songs of the desired genre. The analysis results the automatic composition algorithm requires are exported to a JSON file that can be readily imported and parsed. The Android App developed creates a symbolic representation of the music generated for drums, bass and rhythm guitar that can be exported to a MIDI file or audio waveform. The evaluation results show that the automatic compositions generated are not distinguished amongst other excerpts created by human composers.
Full text
ANDROID APP FOR AUTOMATIC MUSIC COMPOSITION Marina S. Nieto Ana M. Barbancho Isabel Barbancho Lorenzo J. Tard´ on ATIC Research Group, Dpto. Ingenier´ ıa de Comunicaciones, E.T.S.I. Telecomunicaci´ on, Universidad de M´ alaga, Andaluc´ ıa Tech, Campus Universitario de Teatinos s/n, 29071, M´ alaga, Spain [email protected], [email protected], [email protected], [email protected] ABSTRACT In this contribution, we present an Android App that generates music automatically replicating a specific contemporary genre, specifically rock music. The composition system is based on the analysis of a set of songs of the desired genre. The analysis results the automatic composition algorithm requires are exported to a JSON file that can be readily imported and parsed. The Android App developed creates a symbolic representation of the music generated for drums, bass and rhythm guitar that can be exported to a MIDI file or audio waveform. The evaluation results show that the automatic compositions generated are not distinguished amongst other excerpts created by human composers. 1. INTRODUCTION Since the beginning of the computer area, there has been a growing interest on the creation of art by machines. Many musicians and composers have used mathematical methods and sets of rules to create musical pieces, in fact, algorithmic composition could be defined as the employment of a set of rules that combines musical elements to form a music piece [1], [2], [3]. In this contribution, we use a probabilistic model for the characterization of music learned from music samples [2]. After the musical model is learned, a music compositor that follows the rules in [2] is implemented for Android devices. Our compositor generates new rock music excerpts with three different instruments: drums, bass and rhythmic guitar. 2. SYSTEM DESCRIPTION The structure of the Android App for automatic music composition developed is shown in Fig. 1. In this figure, it can be seen that the developed system cosists of two different parts: analysis and pattern creation stage and composition system. The first one was implemented in Matlab and the second one for Android devices in order to create a mobile application. c Marina S. Nieto, Ana M. Barbancho, Isabel Barbancho, Lorenzo J. Tard´ on. Licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0). Attribution: Marina S. Nieto, Ana M. Barbancho, Isabel Barbancho, Lorenzo J. Tard´ on. “Android App for automatic music composition”, 19th International Society for Music Information Retrieval Conference, Paris, France, 2018. Training Dataset Analysis and Pattern Creation Composition system Parameters selected by the user Output Song JSON file Figure 1. Automatic music composition scheme. 2.1 Analysis and pattern creation Among the different possible musical genres, rock was selected. The input of the analysis and pattern segmentation subsystem is a dataset with 25 songs belonging to the classical rock music genre. Each song in the dataset, is characterized by three MIDI files, one for each of the instruments considered in the automatic music composer (drums, bass and rhythm guitar). The analysis and pattern discovery is carried out by implementing a specific tool in Matlab which is a modification to the one described in [2], to include chord patterns. Chord patterns are needed in order to compose music for drums and rhythm guitar. Fig. 2 shows a schematic of the analysis and pattern creation subsystem. Training Dataset Rests inclusion Bar segmentation JSON file PatternDatabase Rhythmic patterns Pitch patterns Chord patterns Figure 2. Analysis and pattern creation subsystem. Three different types of patterns are learned, with each individual pattern corresponding to a bar: rhythmic patterns: duration of the notes in beats; pitch patterns: pitch contour information; and chord patterns: notes sounding simultaneously for each of the rhythmic figures. Chord patterns constitute a new addition with respect to the approach in [2]. It must be said that drums are considered not
tuned instruments and the chord patterns for drums sound at each beat. 2.2 Composition system The composition system first performs the selection of the rhythmic structures. The rhythmic structures last four bars and they are randomly selected between among the following: AAAA, ABAB, ABBA, AABB, AABC, ABCA and ABCD. The length of final compositions are a combination of these four-bar structures. Once the general rhythmic structures are defined, the track of each instrument is generated. Each instrument is treated in a slightly different way due to the differences between drums, bass and rhythmic guitar. In all instrument, first rhythmic, pitch and chord patterns are selected. The selections are made in a probabilistic way [2] with the following particularities for each instrument: •Drum track generation: since drums are not tuned instruments, chords are simply mapped into a drum kit. •Bass track generation: the pitch is corrected in order to fit the melody to the chord progression generated. •Rhythmic guitar track generation: pitch and chord are corrected in order to fit guitar and bass. 3. ANDROID APP INTERFACE The main screen of the developed application is presented in Fig. 4. This screen shows the user options: the user can select the instrument(s) to include in the composition: drums, bass, guitar; key: major or minor; tempo in bpm, from 110 to 150 bpm); and composition length: 4 bars or complete song with the structure shown in 3. Once the composition parameters are selected, the user must press the button write song. After the song is composed, it can be played in the phone or exported via e-mail (MIDI file) or WhatsApp (*.wav file). Introduction (4 bars) Verse (8 bars) Chorus (8 bars) Verse (8 bars) Chorus (8 bars) Figure 3. Song structure. 4. SYSTEM EVALUATION A survey has been designed to evaluate the quality of the automatic composer. The survey includes three questions, for each question, three different music excerpts are considered: two of them are extracted from popular rock songs and the remaining one was composed by the application described. The participants are requested to identify the excerpts that in their opinion was created by an automatic composition algorithm. A fourth possible choice is allowed: ”I don’t know”. The survey also inquires whether the subjects recognized any of the songs and, in such case, identify them in order to evaluate if the participants musical knowledge affected their answers. A total of 97 people answered the survey; the results are shown in Table 1. As it can be seen from the results, in Figure 4. Android App for music composition. Identification No Identification Question 1 47.42 % 52.58 % Question 2 37.11 % 62.89 % Question 3 17.53 % 82.47 % Total 34.02 %65.98 % Table 1. Survey results. the first question almost half of the participants identified the automatic composer; when we reviewed the answers regarding the recognition of the excerpts, several participants indicated that they recognized one of the samples included in that question, which is consistent with the results obtained. 5. CONCLUSIONS An automatic music composition App has been presented. This App generates rock music and includes drum, bass and rhythmic guitar. In the next months it will be published in the Google Play Store. A subjective evaluation shows that the excerpts created are not distinguished amongst others created by human composers. 6. ACKNOWLEDGEMENTS This work has been funded by the Ministerio de Economa y Competitividad of the Spanish Government under Project No. TIN2016-75866-C3-2-R. The work has been done at Universidad de Mlaga, Campus de Excelencia Internacional Andaluca Tech. 7. REFERENCES [1] D. Cope. Algorithmic composition [re]defined. In Panel Discussion in ICMC Proceedings, pages 23–25, 1993. [2] C. Roig, L.J. Tardon, I. Barbancho, and A.M. Barbancho. Automatic melody composition based on a probabilistic model of music style and harmonic rules. Knowledge-Based Systems, (71):419–434, 2014. [3] C. Roig, L.J. Tardon, I. Barbancho, and A.M. Barbancho. A non-homogeneous beat-based harmony markov model. Knowledge-Based Systems, (142):85–94, 2018.