<<

Development of Agents for Creating Melodies and Investigation of Interaction between the Agents

Hidefumi Ohmura1, Takuro Shibayama2, Keiji Hirata3 and Satoshi Tojo4 1Department of Information Sciences, Tokyo University of Science, 2641 Yamazaki, Noda-shi, Chiba, Japan 2Department of Information Systems and Design, Tokyo Denki University, Ishizaka, Hatoyama-cho, Hikigun, Saitama, Japan 3Department of Complex and Intelligent Systems, Future University Hakodate, 116-2, Kamedanakano-cho, Hakodate-shi, Hokkaido, Japan 4Graduate School of Information Science, Japan Advanced Institute of Science and Technology, 1-1 Asahidai, Nomi-shi, Ishikawa, Japan

Keywords: Music, Melody, Lattice Space.

Abstract: In this study, we attempted to construct computational musical theory by creating musical structure using physical features of sound without relying on the existing musical theory. Subsequently, we developed an agent system to create melodies. The agents can select the next note ( sound timing and a pitch) depending on the lattice spaces consisting of physical relationships (ratios) and probabilities. Further, we improve the agents which are interacting with each other in the system, and the system outputs various sounds such as music. We confirmed that the system could create structures of musical theory, such as mode, scale, and rhythm. The advantages and disadvantages of the lattice spaces are discovered.

1 INTRODUCTION ing the hypothesis. Next, we show the agent system creating melodies, and how agents interact with each Most human beings can hum and whistle melodies in other. Subsequently, we describe the system with an improvisational way in their daily lives. This gen- agents and the operation of the system. Finally, we eration of melodies is considered a beneficial human discuss music as the output of the system. quality for surviving in society (Jordania, 2010). In- terestingly, children can also hum melodies without music education. 2 MUSICAL FEATURES We considered how they create melodies and de- veloped an agent system creating melodies (Ohmura 2.1 Hypothesis of Creating Melodies et al., 2018). The system can provide computational musical structures such as musical scale and mode in It is typical for a musically educated person to eas- because we adopted lattice spaces de- ily select the next pitch and next sound timing of ap- pending on the physical relationships of sounds to the propriateness of a present note. However, the ques- system. tion arises as to why both adults and children with- In this study, we aim to improve the agent sys- out musical education can hum or whistle melodies. tem including the three agents that interact with each We generate the following hypothesis regarding the other. We herein detail the basic elements of the pre- selection of the next note except in the case of recol- vious system in creating melodies, and demonstrate lecting a melody. “They select purely a note of physi- the improved features. Subsequently, we discuss the cal proximity to the present note.” Physical proximity outputs from the system as the music is created by the includes two elements. The first element is the rela- interactions between agents. tionship between the sound timings of notes. The sec- First, we propose a hypothesis on how humans ond element is the relationship between the pitches of create melodies such as humming and whistling, and notes. We considered how they create the melodies demonstrate the physical features of sounds underly- and developed an agent system creating melodies

307

Ohmura, H., Shibayama, T., Hirata, K. and Tojo, S. Development of Agents for Creating Melodies and Investigation of Interaction between the Agents. DOI: 10.5220/0007702303070314 In Proceedings of the 11th International Conference on Agents and Artificial Intelligence (ICAART 2019), pages 307-314 ISBN: 978-989-758-350-6 Copyright 2019 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved

HAMT 2019 - Special Session on Human-centric Applications of Multi-agent Technologies

based on the hypothesis(Ohmura et al., 2018). In this and are defined by the relationship between the fre- section, we explain their relationships and detail the quencies. theories of musical expectation to demonstrate how A relationship of 1:2 creates an interval of a per- an agent selects a note. fect , and a relationship of 1:3 creates an inter- val of a perfect fifteenth, which is two . The 2.2 Relationships between Pulses (Note relationship of 2:3 and 3:2 are combined duple and Values) triple frequencies (see Figure 2). This pattern is called a perfect fifth. The relationships of 3:4 and 4:3 are combined triple and quadruple (see Figure 2). This In music, an iteration is an important primitive pat- pattern is called a , which is a consonant tern, and a pulse is the most primitive element in a interval following a perfect fifth. rhythm. For example, when a listener hears two pulses (whose relationship is 1:2), he/she may feel a duple 880Hz 990Hz meter (see Figure 1). When a relationship is 1:3, a (A5) ! 4/3 ! 3/2 (B5) listener may perceive a triple meter. ! 3/4 ! 2/3 Next, we consider 2:3 and 3:2 ratios combining 660Hz duple and triple meters. These relationships provide ! 1/2 ! 2 ! 1/2 ! 2 (E5) the listener with a polyrhythm. A listener perceives ! 3/2 ! 4/3 one basic pulse as an upbeat, and another as a down- ! 2/3 ! 3/4 beat. In the cases of 3:4 and 4:3, a listener perceives a polyrhythm consisting of triple and quadruple meters. 440Hz 495Hz (A4) (B4)

Figure 2: Relationships between pitch (intervals). The Pythagorean scale (and principle of the Sanfen × 2 × 1/2 Sunyi) involve only the relationships of duples and × 3 × 3 triples. However, depending on temperament, some intervals are imprecise. × 1/3 × 1/3 In the case of intervals, a quintuple is important. × 1/2 × 2 In particular, in a relationship between three pitches, a 3:4:5 creates a consonance code, called a major triad. A relationship consisting of a double, triple, and quin- tuple creates intonation. In this study, however, we Figure 1: Relationships between pulses (note values). employ only the double and triple for a simple and Actual music consists of many pulses. A listener per- easy operation. ceives the strongest or most-frequent pulse as the me- ter of the music, and less-frequent pulses as weak 2.4 Theories of Musical Expectation beats and up beats. Monophony, however, lacks beats, such that a listener at times may not perceive any me- We attempted to control the musical expectations ter. This is true in the melodies of humming. based on the theories of musical expectations (Ohmura et al., 2016). Here, we introduce these theo- ries that provide how an agent selects the next note. 2.3 Relationships between Pitches Meyer demonstrated that the deviations in ex- (Intervals) pectations arouse emotions when listening to music (Meyer, 1956). This concept is based on Dewey’s In music, patterns consisting of pitches are important. theory, according to which conflict causes emotions These patterns are explained in musical theories of (Dewey, 1894). The deviation from the listeners’ ex- temperament (how to determine the frequency of each pectation when listening to music arises from a par- note) and mode (which notes to use). The value of tial or complete disregard of rules that were accepted a pitch depends on the vibrational frequency of air. in advance. This indicates an increase in contingency Real sound consists of multiple frequencies, and we because of augmented uncertainties. These uncertain- perceive the lowest frequency as the pitch, also called ties present a commonality with complexity in the as the fundamental frequency. As with rhythm, the optimal complexity model (Berlyne, 1971) that illus- patterns of two pitches are called musical intervals, trates the relationship between complexity and hedo-

308 Development of Agents for Creating Melodies and Investigation of Interaction between the Agents

nic values (Figure 3). This commonality suggests the culate the next note with probability density func- existence of a relationship between uncertainty and tions. In the next section, we describe how the agent emotion. Comparing sounds in our everyday life and selects the next note with probability density func- their relationships reveals interesting viewpoints. We tions. shall survey the points in Figure 3. At Position 1 , the complexity is relatively low. A listener can easily pre- dict the features of the sound, and a prediction event 3 AN AGENT CREATING is likely to arise in the proposed system. For example, the pure tick-tock beat of a clock not only sounds bor- MELODIES ing, but also causes displeasure in listeners. Indeed, some clock users cannot sleep with this sound. Po- To create a melody, the proposed agent selects a sound sition 2 has a higher complexity than Position 1 , timing, and subsequently selects a pitch. These ac- thus eliciting pleasure in the listener. The listener tions are based on the relationships as shown in 2.2 can predict the next sound, and recognize both real- and 2.3. The selections depend on the probabilities izations and deviations from expectation at that posi- that are built on the theory of musical expectation. In tion. Listeners may regard sounds as musical, because this section, we introduce the theory of musical ex- the sounds comprise rules as well as deviations from pectation, and explain an agent-creating melody. the rules at this position. Different levels of complex- ity exist in each musical genre. Rhythms, children’s 3.1 Lattice Spaces with Duple and songs, and folk songs have lower complexities than Triple Relationships pop music, for example. Therefore, a wide range of sounds are under this position. Position 3 exhibits an We provide a lattice space for rhythm that consists of appreciably high complexity. In this case, a listener ratios of 1:2 and 1:3 (see Figure 4). The unit in this cannot predict the next sound and can only recognize lattice space is beats per minute (bpm). In this fig- deviations from expectations. Free jazz and contem- ure, 72 bpm is the basic frequency of the pulse, which porary music are comparatively new genres that can is located in the middle of the figure. The x-axis in- be considered in this context. These styles of mu- dicates triple relationships, and the y-axis duple rela- sic are unpleasant for some listeners. Non-musical tionships. Each point of intersection is the frequency sounds such as the noise from a crowd at a sports field of a pulse. In this figure, symbols of musical notes are may belong to Position 3 . According to Berlyne, the depicted; a quarter note is 72 bpm. relationship between complexity and emotion adapts to the listener’s experiences (the dotted line in Figure 3). That is, music at Position 3 elicits the pleasure of highly experienced listeners. They may feel displea- 32bpm96bpm 288bpm 864bpm 2592bpm sure from the music at Position 2 . A listener who has experienced a large amount of music may discover the 16bpm48bpm 144bpm 432bpm 1296bpm complexity in music. 2 8bpm24bpm 72bpm 216bpm 648bpm !

" ! 4bpm12bpm 36bpm 108bpm 324bpm Experience !

2bpm6bpm 18bpm 54bpm 162pm Hedonic value Hedonic Complexity ! !" !" ! 3

Figure 4: Lattice space for musical values with duple and triple relationships. Figure 3: Optimal complexity model (modified from (Berlyne, 1971)). When a listener is musically experienced, Next, we provide a lattice space for intervals that con- his or her function moves to more/less complex. sists of ratios of 1:2 and 1:3 (see Figure 5). The x- axis indicates triple relationships, and the y-axis du- As we regard complexities as uncertainty, we can cal- ple relationships. Each point of intersection is the

309 HAMT 2019 - Special Session on Human-centric Applications of Multi-agent Technologies

frequency of a note. In this figure, 440 Hz is a ba- sic frequency that is located in the middle of the fig- 6257.8Hz ! 7040Hz ! 7920Hz ! G8 A8 B8 4171.9Hz ! 4693.3Hz ! 5280Hz ! 5940Hz ! ure. Each frequency value is rounded. Although each C8 D8 E8 "8 3128.9Hz ! 3520Hz ! 3960Hz ! point of intersection indicates a letter notation with 4/3 ! G7 A7 B7 3/2 ! × 2085.9Hz ! 2346.7Hz ! 2640Hz ! 2970Hz ! × a frequency, the farther the point from the base fre- C7 D7 E7 G"7 1564.4Hz ! 1760Hz ! 1980Hz ! G6 A6 B6 quency (in this case 440 Hz), the larger is the error 1043.0Hz ! 1173.3Hz ! 1320Hz ! 1485Hz ! C6 D6 E6 G"6 based on the Pythagorean comma. 782.2Hz ! 880Hz ! 990Hz ! G5 A5 B5 660Hz ! 742.5Hz ! ! 521.1Hz ! 586.7Hz ! C5 D5 E5 G"5 2 391.1Hz ! 440Hz ! 495Hz ! × G4 A4 B4 260.7Hz ! 293.3Hz ! 330Hz ! 371.3Hz ! C4 D4 E4 G"4 521.1Hz ! 1564.4Hz !4693.3Hz ! 195.6Hz ! 220Hz ! 247.5Hz ! C5 G6 D8 G3 A3 B3 130.4Hz ! 146.7Hz ! 165Hz ! 185.6Hz ! C3 D3 E3 G"3 97.8Hz 110Hz ! 123.8Hz ! 260.7Hz ! 782.2Hz ! 2346.7Hz ! 7040Hz ! ! G2 A2 B2 C4 G5 D7 A8 65.2Hz ! 73.3Hz ! 82.5Hz ! 92.8Hz ! C2 D2 E2 G"2 48.9Hz ! 55Hz ! 260.7Hz ! 130.4Hz ! 391.1Hz ! 1173.3Hz ! 3520Hz ! G1 A1 B1 36.7Hz 41.3Hz ! 46.4Hz ! C3 G4 D6 A7 32.6Hz ! ! C1 D1 E1 G"1 24.4Hz ! 22.5Hz ! 260.7Hz ! G0 A0 B0 65.2Hz ! 195.6Hz ! 586.7Hz ! 1760Hz ! 5280Hz ! 16.3Hz ! 18.3Hz ! 20.6Hz ! 23.2Hz ! C2 G3 D5 A6 E8 C0 D0 E1 G"0

32.6Hz ! 97.8Hz ! 293.3Hz ! 880Hz ! 2640Hz ! 7920Hz ! 9/8 ! C1 G2 D4 A5 E7 B8 × !

2 16.3Hz ! 48.9Hz ! 146.7Hz ! 440Hz ! 1320Hz ! 3960Hz ! Figure 6: Lattice space of slanted Figure 5.

× C0 G1 D3 A4 E6 B7

24.4 ! 73.3Hz ! 220Hz ! 660Hz ! 1980Hz ! 5940Hz ! G0 D2 A3 E5 B6 G"8

412Hz ! 618.1Hz ! 927.1Hz ! 1390.6Hz !2085.9Hz !3128.9Hz !4693.3Hz ! 36.7Hz ! 110Hz ! 330Hz ! 990Hz ! 2970Hz ! A"5 "5 "6 F6 C7 G7 D8 D1 A2 E4 B5 G"7 309Hz ! 463.5Hz ! 695.3Hz ! 1043Hz ! 1564.4Hz !2346.7Hz ! 3520Hz ! 18.3Hz ! 55Hz ! 165Hz ! 495Hz ! 1485Hz ! E"4 B"5 F5 C6 G6 D7 A7 D0 A1 E3 B4 G"6 231.8Hz ! 347.7Hz ! 521.1Hz ! 782.2Hz ! 1173.3Hz ! 1760Hz ! 2640Hz ! 22.5Hz ! 82.5Hz ! 247.5 ! 742.5Hz ! B"4 F4 C5 G5 D6 A6 E7 A0 E2 B3 G"5 173.8Hz ! 260.7Hz ! 391.1Hz ! 586.7Hz ! 880Hz ! 1320Hz ! 1980Hz ! F3 C4 G4 D5 A5 E6 B6

41.3Hz ! 123.8 ! 371.3Hz ! ! E1 B2 G"4 130.4Hz ! 195.6Hz ! 293.3Hz ! 440Hz ! 660Hz ! 990Hz ! 1485Hz ! 4/3 C3 G3 D4 A4 E5 B5 G"6 × 3 ! × 97.8Hz ! 146.7Hz ! 220Hz ! 330Hz ! 495Hz ! 742.5Hz ! 1113.8Hz ! G2 D3 A3 E4 B4 G"5 "6 Figure 5: Lattice space for pitches with duple and triple 73.3Hz ! 110Hz ! 165Hz ! 247.5Hz ! 371.3Hz ! 556.9Hz ! 835.3Hz ! relationships. D2 A2 E3 B3 G"4 D"5 A"5

55Hz ! 82.5Hz ! 123.8Hz ! 185.6Hz ! 278.4Hz ! 417.7Hz ! 626.5Hz ! In the lattice space of Figure 5, the distance between A1 E2 B2 G"3 D"4 A"4 E"5 one frequency and another of close value is long. 41.3Hz ! 260.7Hz ! 92.8Hz ! 139.2Hz ! 208.8Hz ! 313.2Hz ! 469.9Hz ! Thus, the lattice space of Figure 5 is slanted as in Fig- E1 B1 G"2 D"3 A"3 E"4 B"4 ure 6. This will be useful in setting the parameters. Unfortunately, in the spaces of x-axis (×9/8) and × 3/2 ! y-axis (×2), each note does not intersect at right an- gles. Therefore, we create a space of x-axis (×3/2) Figure 7: Lattice space of rotated Figure 6. and y-axis (×4/3) as shown in Figure 7).

1 (x,y) = 3.2 Probability Density Functions p 2 2πσxσy 1 − ρ  2 1 (x − µx) × exp − 2 2 The proposed agent uses the probabilities at points 2(1 − ρ ) σx of intersection using a probability density function. 2 ! In this study, we employ a two-dimensional Gaus- (x − µx)(y − µy) (y − µy) − 2ρ + 2 sian function for the probability density function. The σxσy σy function is represented as follows:

310 Development of Agents for Creating Melodies and Investigation of Interaction between the Agents

This equation describes a two-dimensional normal 4 IMPLEMENTATION distribution with mean µ and variance σ2 in each axis. ρ means the coefficient of correlation between values We implemented the proposed agent using HTML on the x- and y-axis. Assigning values to x and y, the and JavaScript for a music generation system1. We probabilities are calculated from µx, µy, σx, σy, and ρ. confirmed the operation of the system in the lat- Adjusting σ, the shape of the function changes as est version of Google Chrome. An agent creates a shown in Figure 8. melody line. The system outputs up to three melody lines because the system includes three agents. Users !

! can control various settings including the parameters of the probability density functions for pitches and Increasing σ!

probability rhythm. probability The system contains the lattice space for pitches ! !

3/2) 3/2) such as those shown in Figure 7, and the lattice space × ×

3 ( 3 ( × × for musical values such as those in Figure 4. × 2 (× 4/3)! × 2 (× 4/3) ! These lattice spaces contain probability density Figure 8: Shapes of the function depening on σ. functions. The controllable parameters of the func- tions are the mean (µx, µy), variance (σx, σy), and cor- In the lattice space of pitch, when we apply a mix- relation (ρ). Furthermore, users can also control the ture distribution to a probability density function, the parameters of the subfunctions. The parameters of a model expresses musical modes such as major and subfunction includes a weight (w), which is the ra- minor (Ohmura et al., 2016). tio of a subfunction to a primary function. When the The agent selects a pulse based on the probabili- weight (w) is 0, the subfunction is ignored. When the ties of the lattice space for the musical values at each independent flag is true, users can control the param- step. When the selecting pulse is the timing of sound, eters of three functions on each lattice space. Mean- the agent selects a pitch based on the probabilities of while, if it is false, users can control the parameters of the lattice space for pitches. The default cycle of steps a function because the agents use a common function is 25 ms, which is the pulse of the least frequency in on each lattice space. the lattice space for musical values. When the following flag is true, it implies that the functions of the lattice space of the pitch is to be up- 3.3 Features of Multiagent System dated. We did not implement this workings in the lat- tice space of value because the mean is converged on The agents have functions of the lattice space for mu- the high-frequency pulses. sical values and the lattice space of the pitch. When When the rotation flag for each lattice space is multiple agents exist on each lattice space, we con- true, each µ is rotated any given degree counter- sider two modes: (i) they use a common function, and clockwise about µ of the primary function of the first (ii) they use an independent function. The system pro- melody line. vides each mode. We explain the flow of execution through the pro- In the independence mode of the system, each gram. When users push a play button, the program agents Gaussian functions are probability density executes iterative processing as follows: functions. The relationships between the agents are calculated from the parameters of the functions on 1. Select a pulse from the lattice of value notes ac- each lattice space. The relationship rules are deter- cording to the probability density function. mined by calculating the values. The changing pa- 2. Is the timing of the pulse hitting a note? rameters based on the rules can provide the interac- yes: Select a pitch from the lattice of pitches ac- tions between agents. Herein, we define the distances cording to the probability density function and and degrees between the average (µ) as the relation- output it. ships between agents. We rotate the functions coun- terclockwise about µ of the primary function of the no: Do nothing. first melody line. We regard the transformations of 3. Is it the step of rotation? the outputs as interactions between agents. yes: Rotate each µ on any given degree counter- When the agents follow the hypothesis faithfully, clockwise about µ of the primary function of selecting purely a physically proximate note to the the first melody line. present note, the system must update the methods of their functions with the present note. The system pro- 1https://sites.google.com/site/hidefumiohmura/home/ vides that as the following mode. program/icaart2019

311 HAMT 2019 - Special Session on Human-centric Applications of Multi-agent Technologies

no: Do nothing. agents. Users can control the value of a rotated circle 4. Is the following flag true? (number of steps) for a pitch with a slider. Each func- tion of the lattice space for pitch rotates every value. yes: Update µ of the lattice space of the pitch with Users can control the value of angular delta (degree) the position of the present note. for pitch with a slider. The value is limited from 0 no: Do nothing. to 360. The direction of positive rotation is counter- 5. Go to 1 as the next step clockwise. The value of 180 means an opposite side. The iterative processing executes at intervals ac- Similarly, users can control the parameters of the lat- cording to the tempo whose initial value is 2592 bpm. tice space for musical values with sliders. 4.1.3 Pitch Control Panel 4.1 System Operating Instructions At [pitch control] (Figure 10), users can control the The operation screen consists of four panels: sound parameters of each probability density function for control panel, rotation control, pitch control panel, pitches of melody lines using sliders. Each value of and note value control panel. Herein, we provide a the probability density function is shown in the up- step-by-step explanation on their usage. per right [pitch cells]. The values of the melody lines 4.1.1 Sound Control Panel are shown in different colors: The first line is cyan, the second line is magenta, and the third line is yel- At [sound control] (Figure 9), users can control the low. A darker colour indicates a higher value. Cells play/stop, volume, tempo, duration, waveform, and representing less than 20 Hz and greater than 22050 melody lines of the outputs. The header of the op- Hz are blacked out because the system cannot out- eration screen includes a play/stop button. The val- put these pitches. The initial values of the means are ues of volume, tempo, and duration are controlled set to 440 Hz (A). Using buttons at the bottom in the by the sliders. The tempo value indicates the pro- [pitch cells], each probability density function is set gram cycle time in bpm. The duration value is the as visible or invisible. The operations of the melody length of time of each note. By controlling this value, lines are independent. Using the upper left buttons, melodies show articulations as staccato and tenuto. the users select an operating melody line. The param- With the waveform selector, users can select from eters of the primary function are controlled by sliders “sin,” “square,” “sawtooth,” and “triangle.” moreover, at the [Main-function Settings]. The parameters of the users can select “bongo” and “” as actual sound subfunction are controlled by the sliders at the [sub- source samples. Although each pitch is calculated by function settings]. During system execution, the se- a duple and triple, the pitches of the bongo and pi- lected pitches are shown at the bottom right [circle of ano are defined by 12 equal temperaments. Moreover, fifth]. Therefore, users can confirm the output pitches the [sound control] includes a preset selector that pro- in real time. vides each setting for discussion.

Figure 9: Sound control panel and interaction control panel.

4.1.2 Interaction Control Panel

At the [interaction control panel] (Figure 9), when users change over to the independence mode, fol- lowing mode, and rotation states with the indepen- dence button, following button, Rot.Pitch button, and Rot.Value button. The header of the operation screen Figure 10: Pitch control panel. also includes the Rot.Pitch button and Rot.Value but- ton. Users can set the interaction parameters between

312 Development of Agents for Creating Melodies and Investigation of Interaction between the Agents

4.1.4 Note Value Control Panel function in the lattice space of the pitches are com- paratively low values, and the means are set near A. At [note value control] (Figure 11), users can con- Depending on the settings, the system outputs A, E, trol the parameters of each probability density func- D, B, and G frequently. tion for the note values of the melody lines using slid- The output sounds include melodies of the pen- ers. Each value of the probability density function tatonic scale, which are used in the folk songs of is shown in the upper right [note value cells]. As is Scotland, East Asia, and other areas. The rhythms the case with [pitch control], the values of the melody of [humming (a melody line)] resemble duples or lines are shown in different colours: the first line is quadruples. The rhythms of [humming (three melody cyan, the second line is magenta, and the third line lines)] resemble music in six-eight time. is yellow. A darker colour indicates a higher value. Using ρ, users can obtain the various shapes of the Using the buttons at the bottom in the [note value function. For example, when ρ is set as 0.5 in the lat- cells], each probability density function is set as vis- tice of the pitches, dispersion occurs from the lower ible or invisible. The operations of the melody lines right to upper left. If a user can control ρ freely, the are independent, as in the case with [pitch control]. system does not require transformation from Figure 5 During system execution, the selected note values are to Figure 6 or 7. However, Figure 6 and 7 are bet- shown at the bottom right [pulses]. Therefore, users ter because users can control the important relation- can confirm the output pulses of the note values in ships between notes such as a perfect fifth and a per- real time. The pulses can be zoomed using buttons fect fourth. In this system, as shown in Figure 7, it is and displayed on a log scale using a toggle button. easy to calculate next note because of the intersection at right angles. However, the controlling parameters in Figure 7 are more difficult than those in Figure 6 because we are accustomed to using the relationships of 1:2. The previous presets used only the primary func- tion in the lattice space of the pitch. Therefore, the outputs sound like melodies of the . Herein, we discuss the presets using two functions in the lattice space of the pitch. In the [positive mode], the variance in the primary function is a compara- tively low value, and the variance in the subfunction is higher than that of the primary function. Moreover, the mean of the subfunction moves to the bottom right from the mean of the primary function. The outputs sound like melodies of the Ionian or . Meanwhile, in the [negative mode], the mean of the subfunction is set opposite to the values of the [pos- itive mode]. The other parameters of the [negative mode] are the same as those of the [positive mode]. The outputs sound like melodies of the Aeolian or . Figure 11: Note value control panel. The previous two presets are symmetrical. [Ro- tated sample1] provides the sounds of positive modes and negative modes, alternately using half-turns. In 5 DISCUSSION music theory, the transformation is called relative keys. [Rotated sample2] provides some effects of ro- We prepared the example settings of the parameters tated angles. Initially, the subfunctions are set at the as presets and discuss them herein. lower left of the primary function. The angular vari- As for the hypothesis, when lower values of σ ation is 45 degrees In the lattice space of the pitches, exist comparatively, the outputs resemble humming a relationship to a right cell means an upper perfect melodies. [Humming (a melody line)] provides only fifth, a relationship to a left cell means a lower per- one melody line such as a humming melody. Further, fect fourth, a relationship to an upper cell means an [humming (three melody lines)] provides music with upper perfect fourth, and a relationship to a lower cell three humming melody lines. The variances of the means a lower perfect fifth. That is, a direction to the

313 HAMT 2019 - Special Session on Human-centric Applications of Multi-agent Technologies

lower right provides positive modes, and a direction posium on Traditional Polyphony (Tbilisi), pages 41– to the upper left provides negative modes. Directions 49. to the upper right and lower left provide octaves. Meyer, L. B. (1956). Emotion and meaning in music. Uni- [Okinawa ¡=¿ Miyako-bushi] provides sounds versity of Chicago Press. such as Okinawa (Ryukyuan) music and Japanese tra- Ohmura, H., Shibayama, T., and Hamano, T. (2016). Gener- ditional music alternately. Interestingly, they are sym- ative music system with quantitative controllers based on expectation for pitch and rhythm structure. Pro- metric about the mean of the primary function. ceeding of The Eighth International Conference on [Following a line] provides only one melody line Knowledge and Systems Engineering (KSE2016). such as a humming melody. [Following three lines] Ohmura, H., Shibayama, T., Hirata, K., and Tojo, S. (2018). provides music with three humming melody lines. Music generation system based on a human instinc- When the system activates for a long time, these out- tive creativity. Proceedings of Computer Simulation puts sound like transposes increasingly. However, of Musical Creativity (CSMC2018). these transposes are slightly exponential because the updates of means depend only on the present note. The updates may need to bypass more sounded notes. As can be heard from the presets, the system out- puts not only simple melodies (such as humming and whistling), but also melodies with musical elements such as scale, mode, rhythm, and metrical structure. These outputs reveal that the musical mode and scale are not discrete but continuous, and that rhythm struc- tures without sequences exist such as musical scores. Moreover, some of them are symmetrical.

6 CONCLUSION

In this study, we demonstrated an agent system to generate three melodies that were based on the rela- tionships between the physical features of notes. Fur- ther, we proposed the interactions between agents. We confirmed that the system could create structures of musical theories, such as mode, scale, and rhythm. We discovered the advantages and disadvantages of the lattice spaces. As future work, we will investigate more interaction patterns between agents, and update the lattice spaces.

ACKNOWLEDGEMENTS

This work was supported by JSPS KAKENHI Grant Numbers JP17K12808 and JP16H01744.

REFERENCES

Berlyne, D. E. (1971). Aesthetics and psychobiology. Ap- pleton Century Crofts. Dewey, J. (1894). The theory of emotion: I: Emotional atti- tude. Psychological Review, 1(6):553–569. Jordania, J. (2010). Music and emotions: humming in hu- man prehistory. Proceedings of the International Sym-

314