A Study on Digital Analysis of Bach's “Two-Part Inventions”

7
Research Article A Study on Digital Analysis of Bach’s (Two-Part Inventions) Xiao-Yi Song 1 and Dong-Run Huang 2 1 Xiamen Academy of Arts and Design, Fuzhou University, 41th Hall of Dongping Shanzhuang, Room 602, Siming Area, Xiamen 361000, China 2 School of Soſtware, Xiamen University, 25th Hall of Bikaner Yuan, Room 1802, Binjiang, Hangzhou, Zhejiang 310051, China Correspondence should be addressed to Xiao-Yi Song; [email protected] Received 16 June 2014; Accepted 29 August 2014 Academic Editor: Teen-Hang Meen Copyright © 2015 X.-Y. Song and D.-R. Huang. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. In the field of music composition, creating polyphony is relatively one of the most difficult parts. Among them, the basis of multivoice polyphonic composition is two-part counterpoint. e main purpose of this paper is, through the computer technology, conducting a series of studies on “Two-Part Inventions” of Bach, a Baroque polyphony master. Based on digitalization, visualization and mathematical methods, data mining algorithm has been applied to identify bipartite characteristics and rules of counterpoint polyphony. We hope that the conclusions drawn from the article could be applied to the digital creation of polyphony. 1. Introduction 1.1. Patterns. In the process of composition, the composer will always follow inspirations and then proceed according to a certain mode. Various types of patterns and rules are available in music works, the audience’s understandings on music can be expressed in a formalized way through a series of rules [1, 2]. ese rules enables the audience to generate hearing expectation, which exists in different dimensions such as melody, rhythm, and harmony, and produces different patterns and pieces on the basis of constant changes in basic elements [1, 2]. Fractal geometry originated in the nineteenth century. Fractal sets are the geometry of chaos. It is an important branch in modern mathematics. Some famous mathematicians discovered the existence of a special structure and morphology with study on continuous nondifferentiable curves. 1.2. Our Works. is paper applied the MATLAB tool to visualize MIDI music data and observed and unveiled pattern features of polyphonic music with intuitive techniques. We emphasized our analysis on the No. 1 to No. 5, No. 6, No. 8, No. 13, and No. 14 of Two-Part Inventions (Johann Sebastian Bach). Experimental analyses were made in terms of the pitch and the tone, and the application of these patterns and rules in computerized digital music composition was discussed in the end. 2. Experiments 2.1. Preparations. e pitch is a very important element in the music; the audiences are very sensitive to changes in the pitch, and they are capable of feeling only 0.5% of change [1, 2]. Constant change in the pitch is reflected in the process of music, and the interval of change between pitches is very important in Western music system. We retrieved information from a MIDI file [3] and only utilized partial information in order to simplify the process. We defined a matrix M as M = { }, (1) where is the start tempo, is continuing tempo, is the pitch, and is the pitch interval; that is, = +1 . (2) 2.2. Pitch Intervals and Statistics. is paper conducted statistics and analysis on semitone spaces of adjacent pitches in Bach’s works, and results were shown in Table 1. It is clearly Hindawi Publishing Corporation Mathematical Problems in Engineering Volume 2015, Article ID 560926, 6 pages http://dx.doi.org/10.1155/2015/560926

Transcript of A Study on Digital Analysis of Bach's “Two-Part Inventions”

Research ArticleA Study on Digital Analysis of Bachrsquos (Two-Part Inventions)

Xiao-Yi Song1 and Dong-Run Huang2

1Xiamen Academy of Arts and Design Fuzhou University 41th Hall of Dongping Shanzhuang Room 602Siming Area Xiamen 361000 China2School of Software Xiamen University 25th Hall of Bikaner Yuan Room 1802 Binjiang Hangzhou Zhejiang 310051 China

Correspondence should be addressed to Xiao-Yi Song xysong2014qqcom

Received 16 June 2014 Accepted 29 August 2014

Academic Editor Teen-Hang Meen

Copyright copy 2015 X-Y Song and D-R HuangThis is an open access article distributed under the Creative Commons AttributionLicense which permits unrestricted use distribution and reproduction in any medium provided the original work is properlycited

In the field of music composition creating polyphony is relatively one of the most difficult parts Among them the basis ofmultivoice polyphonic composition is two-part counterpointThemain purpose of this paper is through the computer technologyconducting a series of studies on ldquoTwo-Part Inventionsrdquo of Bach a Baroque polyphonymaster Based on digitalization visualizationand mathematical methods data mining algorithm has been applied to identify bipartite characteristics and rules of counterpointpolyphony We hope that the conclusions drawn from the article could be applied to the digital creation of polyphony

1 Introduction

11 Patterns In the process of composition the composerwill always follow inspirations and then proceed accordingto a certain mode Various types of patterns and rulesare available in music works the audiencersquos understandingson music can be expressed in a formalized way througha series of rules [1 2] These rules enables the audienceto generate hearing expectation which exists in differentdimensions such as melody rhythm and harmony andproduces different patterns and pieces on the basis of constantchanges in basic elements [1 2] Fractal geometry originatedin the nineteenth century Fractal sets are the geometry ofchaos It is an important branch in modern mathematicsSome famous mathematicians discovered the existence of aspecial structure and morphology with study on continuousnondifferentiable curves

12 Our Works This paper applied the MATLAB tool tovisualizeMIDImusic data and observed and unveiled patternfeatures of polyphonic music with intuitive techniques Weemphasized our analysis on the No 1 to No 5 No 6 No 8No 13 and No 14 of Two-Part Inventions (Johann SebastianBach) Experimental analyses weremade in terms of the pitchand the tone and the application of these patterns and rules

in computerized digital music composition was discussed inthe end

2 Experiments

21 Preparations The pitch is a very important elementin the music the audiences are very sensitive to changesin the pitch and they are capable of feeling only 05 ofchange [1 2] Constant change in the pitch is reflected in theprocess of music and the interval of change between pitchesis very important in Western music system We retrievedinformation from a MIDI file [3] and only utilized partialinformation in order to simplify the process We defined amatrixM as

M = 119863119894 119878119894 119875119894 119879119894 (1)

where 119878119894is the start tempo 119863

119894is continuing tempo 119875

119894is the

pitch and 119879119894is the pitch interval that is

119879119894= 119875119894+1minus 119875119894 (2)

22 Pitch Intervals and Statistics This paper conductedstatistics and analysis on semitone spaces of adjacent pitchesin Bachrsquos works and results were shown in Table 1 It is clearly

Hindawi Publishing CorporationMathematical Problems in EngineeringVolume 2015 Article ID 560926 6 pageshttpdxdoiorg1011552015560926

2 Mathematical Problems in Engineering

Table 1 Statistics of semitone spaces of adjacent pitches in Bachrsquos inventions (intervals bigger than 12 ignored) unit

Works Intervals1 2 3 4 5 6 7 8 9 10 11 12

No 14 0003 0177 0358 0119 0058 007 0034 0068 0034 0034 0014 0003No 13 0007 009 008 0368 014 0067 0054 0107 0033 0043 0003 0003No 8 0003 02 0278 0119 0078 0034 0027 006 0054 0047 004 0003No 6 0013 0294 0343 0125 0086 0043 0013 0013 0013 0017 001 0003No 5 0005 026 0455 013 0059 0026 0005 0003 001 002 0008 0015No 4 0025 0249 05 0036 0018 0025 0007 0029 0014 004 0043 0011No 3 0036 0266 0409 0084 0033 0055 0026 0007 0018 0026 0036 0004No 2 0039 0296 04 0056 0028 009 001 0014 0017 0023 0014 0011No 1 0016 0234 0413 0163 007 0028 0004 002 0016 001 0016 0008

seen that 1 2 and 3 semitones represent the largest propor-tion of semitone spaces in the nine works of Bach understudy Effects of melodic interval and harmonic interval aresimilar and they arouse different psychological feelings likeharmonic interval does and let people have expectationsthus developing continuously from music thoughts We candefine a simple rule for composition in accordance with thestatistics

when a music event sequence 119873 is given theproportion of semitone space between119873

119894+1and119873

119894

at 1 2 and 3 should be greater than 70 (Rule I)in the development of119873 (Rule I)

23 Melody Intervals In addition to overall statistics on thistype of interval spaces we also want to understand specificlaws of changes in pitch interval during the marching processof the melody We defined a set S each element of S is a datapair ⟨119864

119894119864119895⟩ representing that the pitch interval 119879

119894between

MIDI note event 119894 and 119894 + 1 on a voice part 1198751is equal to

pitch interval 1198791015840119894between 119875

2MIDI note event 119895 and 119895 + 1

on the other voice part namely 119879119894= 119879

1015840

119894 We mapped the

pitch interval withMATLAB drawing tool and the results areshown in Figure 1

The following characteristics can be concluded by ana-lyzing the above diagram continuous circle lines occur inthe linear system (slope 1) a small starting piece repeatedlyoccurs at different positions in the second voice part Wecan see according to transitive relation that lots of repetitivepieces occur on single parts and by mapping the distributiondiagram we can also find out that such pieces are occurringrepeatedly in one voice part

With further analysis of the music data we know thatthe piece in the slope of Figure 1 maps to the note event asshown inTable 2What is interesting is that the repeated pieceis imitated differently Some are imitated partly while somefully As shown in the original music staff in Figure 2 we cansee that a piece of different event notes follows the repeatedpiece They have different ostinato which gives the listener asense of change

It can be found from Table 3 that repeated intervalpieces represent a very large proportion in Bachrsquos two-partinventions and most of them (except No 4) are at least 50

0 50 100 150 200 250 3000

50

100

150

200

250

The first part notesrsquo event

The s

econ

d pa

rt n

otes

rsquo eve

nt

Figure 1 Equal pitch interval distribution diagram on two voiceparts of Bachrsquos inventions No 1 Horizontal and vertical ordinatesrepresent the two voice partsrsquo MIDI note event sequence numbersthe small circles in the coordinates mean that pitch intervals of twovoice parts are the same

Table 2 Repeated piece sequence Each line is respectively the startnote and end note event number of first voice part and the start noteand end note event number of the second

First part startnote

First part endnote

Second partstart note

Second part endnote

1 6 10 151 6 33 381 7 1 71 8 64 711 9 52 60

During further analyses we were aware that such repeatedpieces occurred at different starting points of the pitch andsuch repeat occurred at different tonalitiesTherefore we candefine a new rule

when given a particular pitch interval sequence119872 to form a complete repertoire of music eventsequence 119873 sequence 119875

1 119875

119896can be used to

make the pitch interval sequence119872 repeat 119896 timesin 119873 with 119875

1being the starting pitch every time

(Rule II)

Mathematical Problems in Engineering 3

Table 3 Total proportion of note events in repeated piece in Bachrsquos Two-Part Inventions First represents the first voice part and Secondstands for the second voice part unit

Part WorksNo 1 No 2 No 3 No 4 No 5 No 6 No 8 No 13 No 14

First 5639 8338 4659 2810 9024 4906 5973 4192 5236Second 5237 7877 5616 2822 8606 4612 6110 3195 5136

FirstThird

Second Fourth

Figure 2 The original music staff piece The blue slope refers to themusic sentence and the red refers to repeated music piece

0 100 200 3000

5

10

15

20

25

Beats piece based on 1 beat

Key

Figure 3 Tonality distribution diagram of Bachrsquos Two-Part Inven-tions No 1 based on 1 beat per piece (when 119887 = 1) Vertical axisrepresents the tonality 1 to 12 correspond to majors extending fromMajor B to Major C and 13 to 24 correspond to minors extendingfromMinor C to Minor B

24 Tonality As regards researches on tonality a great manyresearchers have put forward plenty of models to describechanges in the tonality Krumhansl proposed an algorithmto measure the music data and to determine perceivabletonality [1 2 4] on the basis of relevance with the attributedata of major and minor tonality measured by experienceKrumhanslrsquos algorithm is called K-Finding algorithm whichis used to find out the main tonality of a piece of musicThe method has shown great accuracy in measuring classicalmusic such as Bachrsquos works In our experiment we applyKrumhanslrsquos K-Finding algorithm to analyze the change lawof tonal characteristics of creative music in Bachrsquos inventionswhich we are going to study

M signifies the matrix of simplified music eventminimum 119896 was calculated from the first note event1198781119863111987511198791 in sequence making the total duration from

Table 4 Rising and falling keys of various tonalities (Major)

Major Rising or FallingMajor CMajor F Falling BFalling Major B Falling B Falling EFalling Major E Falling B Falling E and Falling AFalling Major A Falling B Falling E Falling A and Falling D

Falling Major D Falling B Falling E L Falling A Falling D andFalling G

Falling Major G Falling B Falling E Falling A Falling D FallingG and Falling C

Major B Rising F Rising C Rising G Rising D andRising A

Major E Rising F Rising C Rising G and Rising DMajor A Rising F Rising C and Rising GMajor D Rising F Rising CMajor G Rising F

Table 5 Rising and falling keys of various tonalities (Minor)

Relative minor Rising or FallingMinor A Rising GMinor D Falling B Rising CMinor G Falling B Falling E and Rising FMinor C Falling E Falling AMinor F Falling B Falling A and Falling DFalling Minor B Falling B Falling E Falling D and Falling G

Falling Minor E Falling B Falling E Falling A Falling G andFalling C

Rising Minor G Rising C Rising G Rising D Rising A andHeavy Rising F

Rising Minor C Rising F Rising C Rising G Rising D andRising B

Rising Minor F Rising F Rising C Rising G and Rising EMinor B Rising F Rising C and Rising AMinor E Rising F Rising D

the first note event to the 119896th note event119863 = 1198891+1198892+sdot sdot sdot+119889

119896

119863 gt 119887 tempos (119887 is user defined value) Then we applied theK-Finding algorithm to analyze the tonality key ofM

1sdot sdot sdotM119896

in this piece and repeated the above-mentioned process withthe second note event in M as the first music note to getthe second piece until all note events were measured in thisway we could obtain a set of music piece tonal change dataWe used a visual method to map out the data as shown

4 Mathematical Problems in Engineering

0 100 200 3000

5

10

15

20

25

Beats piece based on 1 beat

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

25

Beats piece based on 2 beatsKe

y

Key

Key

0 100 200 3000

5

10

15

20

25

Beats piece based on 3 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 4 beats

0 100 200 3000

5

10

15

20

25

Beats piece based on 5 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 6 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 7 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 8 beats

Figure 4 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 1ndash8)

0 100 200 3000

5

10

15

20

25

Beats piece based on 9 beats

Key

0

5

10

15

20

25

0

5

10

15

20

25

0

5

10

15

20

25

Key

Key

Key

0

5

10

15

20

25

Key

0

5

10

15

20

25

Key

Key

Key

0 100 200 300Beats piece based on 10 beats

0 100 200 300Beats piece based on 11 beats

0 100 200 300Beats piece based on 12 beats

0 100 200 3000

5

10

15

20

25

Beats piece based on 13 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 14 beats0 100 200 300

Beats piece based on 20 beats0 100 200 300

Beats piece based on 25 beats

Figure 5 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 9ndash25)

in Figures 3 4 5 and 6 data distribution of Bachrsquos Two-PartInventions No 1

It can be concluded that melodies converge on severaldifferent tonalities when rhythm lengths of benchmark piecesare different According to the data collected although Inven-tion No 1 is a Major C piece its piece tonality is constantlychanging in relation to the tonality of the whole work

In order to further analyze the change rule of the tonalitywe use Tables 4 and 5 to illustrate the relationship betweenchanging pieces and the tonality

We used the piece tonality distribution diagram to ana-lyze the characteristics of a music piecersquos changes in tonalityunder the Krumhansl model and the results are shown inTable 6

Mathematical Problems in Engineering 5

0 100 200 3000

5

10

15

20

Beats piece based on 30 beats

Key

Key

Key

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 35 beats0 100 200 300Beats piece based on 40 beats

0 100 200 300Beats piece based on 45 beats

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 50 beats0 100 200 300Beats piece based on 55 beats

0 100 200 300Beats piece based on 60 beats

0 100 200 3000

5

10

15

20

Beats piece based on 65 beats

Figure 6 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 30ndash65)

Table 6 Tonality changes in pieces of Bachrsquos Two-Part Inventions(based onKrumhanslrsquosmodel)The spaces listed in the third columnare minimum interval spaces of the piecersquos tonalities after the majorand relative minor formed loops in which the relative minor andmajor connect together and the first column connects to last columnin Tables 4 and 5

Works Main tonalities SpacesNumber 1 Major C Major G Minor D and Minor E 1

Number 2 Minor G Rising Major A Minor c andMajor C 2

Number 3 Major A Minor B and Major D 1Number 4 Minor D Minor A and Major C 2

Number 5 Rising Major D Minor F and RisingMajor G 1

Number 6 Major B Major E 1Number 8 Major F Major C Minor D and Major A 1Number 13 Minor E Major C and Minor A 1

Number 14 Rising Major F Rising Major A andMajor D 2

It can be concluded from Table 6 that whenever there aretonality changes normally a tonality with minimum risingor falling values adjacent to the given main tonality will beselected for change purpose In line with the above analyseswe can develop a new rule

when composing a complete music event sequence119873119873may consist of 119896music sequences and whenthe piece tonality under the Krumhansl model isno more than 12 (119887 ⩾ 12) the space between

tonalities of 119896music sequences should be no morethan 2 (Rule III)

This rule is of great significance and in the case ofconnecting repeated pieces this method of tonality changemay be used to analyze possibly connected pieces

3 Discussion

In our experiment we concluded the patterns and rules inBachrsquos Two-Part Inventions which is typical of polyphonyworks and we discovered three characteristic rules (RulesIndashIII) in Bachrsquos Two-Part Inventions Nevertheless it needspointing out that these three rules only cover the pitch andthe tonality with no consideration for the rhythm melodyand harmony Studies show that global context has an effectonmusic perception [5]Williamdid a lot a lot of experimentsto study the effects on music perception of the integrationof pitch and rhythm Results show that the integration ofthe individual music parameter cannot be combined easilyThey have effects on each other after integration [6] So themodeling of music is difficult we need to study it furtherrather than applying the three rules everywhere

4 Conclusion

Computerized musical composition includes auxiliary com-position algorithm composition and worksrsquo compilationThe three rules we put forward are applicable for basic rules ofpolyphony works with styles similar to Bachrsquos in computer-ized algorithm composition these three rules can be used forassessing and selecting works with better polyphony stylesand they can be used in auxiliary computer composition to

6 Mathematical Problems in Engineering

inspire the composer with musical pieces generated fromthese rules so as to speed up the efficiency of compositionIn addition these three rules can be used for identifying thecharacteristics of existent works and for categorizing varioustypes of works

Conflict of Interests

The authors declare that they have no competing interestsregarding the publication of this paper

Authorsrsquo Contribution

All authors completed the paper together All authors readand approved the final paper

References

[1] C L Krumhansl Cognitive Foundations of Musical PitchOxford University Press New York NY USA 1990

[2] C L Krumhansl ldquoRhythm and pitch in music cognitionrdquoPsychological Bulletin vol 126 no 1 pp 159ndash179 2000

[3] C Roads The Computer Music Tutorial The MIT Press Cam-bridge Mass USA 1996

[4] P Toiviainen and C L Krumhansl ldquoMeasuring and modelingreal-time responses to music the dynamics of tonality induc-tionrdquo Perception vol 32 no 6 pp 741ndash766 2003

[5] E Bigand and M Pineau ldquoGlobal context effects on musicalexpectancyrdquo Perception amp Psychophysics vol 59 no 7 pp 1098ndash1107 1997

[6] W F Thompson ldquoSensitivity to combinations of musicalparameters pitch with duration and pitch pattern with dura-tional patternrdquo Perception amp Psychophysics vol 56 no 3 pp363ndash374 1994

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

2 Mathematical Problems in Engineering

Table 1 Statistics of semitone spaces of adjacent pitches in Bachrsquos inventions (intervals bigger than 12 ignored) unit

Works Intervals1 2 3 4 5 6 7 8 9 10 11 12

No 14 0003 0177 0358 0119 0058 007 0034 0068 0034 0034 0014 0003No 13 0007 009 008 0368 014 0067 0054 0107 0033 0043 0003 0003No 8 0003 02 0278 0119 0078 0034 0027 006 0054 0047 004 0003No 6 0013 0294 0343 0125 0086 0043 0013 0013 0013 0017 001 0003No 5 0005 026 0455 013 0059 0026 0005 0003 001 002 0008 0015No 4 0025 0249 05 0036 0018 0025 0007 0029 0014 004 0043 0011No 3 0036 0266 0409 0084 0033 0055 0026 0007 0018 0026 0036 0004No 2 0039 0296 04 0056 0028 009 001 0014 0017 0023 0014 0011No 1 0016 0234 0413 0163 007 0028 0004 002 0016 001 0016 0008

seen that 1 2 and 3 semitones represent the largest propor-tion of semitone spaces in the nine works of Bach understudy Effects of melodic interval and harmonic interval aresimilar and they arouse different psychological feelings likeharmonic interval does and let people have expectationsthus developing continuously from music thoughts We candefine a simple rule for composition in accordance with thestatistics

when a music event sequence 119873 is given theproportion of semitone space between119873

119894+1and119873

119894

at 1 2 and 3 should be greater than 70 (Rule I)in the development of119873 (Rule I)

23 Melody Intervals In addition to overall statistics on thistype of interval spaces we also want to understand specificlaws of changes in pitch interval during the marching processof the melody We defined a set S each element of S is a datapair ⟨119864

119894119864119895⟩ representing that the pitch interval 119879

119894between

MIDI note event 119894 and 119894 + 1 on a voice part 1198751is equal to

pitch interval 1198791015840119894between 119875

2MIDI note event 119895 and 119895 + 1

on the other voice part namely 119879119894= 119879

1015840

119894 We mapped the

pitch interval withMATLAB drawing tool and the results areshown in Figure 1

The following characteristics can be concluded by ana-lyzing the above diagram continuous circle lines occur inthe linear system (slope 1) a small starting piece repeatedlyoccurs at different positions in the second voice part Wecan see according to transitive relation that lots of repetitivepieces occur on single parts and by mapping the distributiondiagram we can also find out that such pieces are occurringrepeatedly in one voice part

With further analysis of the music data we know thatthe piece in the slope of Figure 1 maps to the note event asshown inTable 2What is interesting is that the repeated pieceis imitated differently Some are imitated partly while somefully As shown in the original music staff in Figure 2 we cansee that a piece of different event notes follows the repeatedpiece They have different ostinato which gives the listener asense of change

It can be found from Table 3 that repeated intervalpieces represent a very large proportion in Bachrsquos two-partinventions and most of them (except No 4) are at least 50

0 50 100 150 200 250 3000

50

100

150

200

250

The first part notesrsquo event

The s

econ

d pa

rt n

otes

rsquo eve

nt

Figure 1 Equal pitch interval distribution diagram on two voiceparts of Bachrsquos inventions No 1 Horizontal and vertical ordinatesrepresent the two voice partsrsquo MIDI note event sequence numbersthe small circles in the coordinates mean that pitch intervals of twovoice parts are the same

Table 2 Repeated piece sequence Each line is respectively the startnote and end note event number of first voice part and the start noteand end note event number of the second

First part startnote

First part endnote

Second partstart note

Second part endnote

1 6 10 151 6 33 381 7 1 71 8 64 711 9 52 60

During further analyses we were aware that such repeatedpieces occurred at different starting points of the pitch andsuch repeat occurred at different tonalitiesTherefore we candefine a new rule

when given a particular pitch interval sequence119872 to form a complete repertoire of music eventsequence 119873 sequence 119875

1 119875

119896can be used to

make the pitch interval sequence119872 repeat 119896 timesin 119873 with 119875

1being the starting pitch every time

(Rule II)

Mathematical Problems in Engineering 3

Table 3 Total proportion of note events in repeated piece in Bachrsquos Two-Part Inventions First represents the first voice part and Secondstands for the second voice part unit

Part WorksNo 1 No 2 No 3 No 4 No 5 No 6 No 8 No 13 No 14

First 5639 8338 4659 2810 9024 4906 5973 4192 5236Second 5237 7877 5616 2822 8606 4612 6110 3195 5136

FirstThird

Second Fourth

Figure 2 The original music staff piece The blue slope refers to themusic sentence and the red refers to repeated music piece

0 100 200 3000

5

10

15

20

25

Beats piece based on 1 beat

Key

Figure 3 Tonality distribution diagram of Bachrsquos Two-Part Inven-tions No 1 based on 1 beat per piece (when 119887 = 1) Vertical axisrepresents the tonality 1 to 12 correspond to majors extending fromMajor B to Major C and 13 to 24 correspond to minors extendingfromMinor C to Minor B

24 Tonality As regards researches on tonality a great manyresearchers have put forward plenty of models to describechanges in the tonality Krumhansl proposed an algorithmto measure the music data and to determine perceivabletonality [1 2 4] on the basis of relevance with the attributedata of major and minor tonality measured by experienceKrumhanslrsquos algorithm is called K-Finding algorithm whichis used to find out the main tonality of a piece of musicThe method has shown great accuracy in measuring classicalmusic such as Bachrsquos works In our experiment we applyKrumhanslrsquos K-Finding algorithm to analyze the change lawof tonal characteristics of creative music in Bachrsquos inventionswhich we are going to study

M signifies the matrix of simplified music eventminimum 119896 was calculated from the first note event1198781119863111987511198791 in sequence making the total duration from

Table 4 Rising and falling keys of various tonalities (Major)

Major Rising or FallingMajor CMajor F Falling BFalling Major B Falling B Falling EFalling Major E Falling B Falling E and Falling AFalling Major A Falling B Falling E Falling A and Falling D

Falling Major D Falling B Falling E L Falling A Falling D andFalling G

Falling Major G Falling B Falling E Falling A Falling D FallingG and Falling C

Major B Rising F Rising C Rising G Rising D andRising A

Major E Rising F Rising C Rising G and Rising DMajor A Rising F Rising C and Rising GMajor D Rising F Rising CMajor G Rising F

Table 5 Rising and falling keys of various tonalities (Minor)

Relative minor Rising or FallingMinor A Rising GMinor D Falling B Rising CMinor G Falling B Falling E and Rising FMinor C Falling E Falling AMinor F Falling B Falling A and Falling DFalling Minor B Falling B Falling E Falling D and Falling G

Falling Minor E Falling B Falling E Falling A Falling G andFalling C

Rising Minor G Rising C Rising G Rising D Rising A andHeavy Rising F

Rising Minor C Rising F Rising C Rising G Rising D andRising B

Rising Minor F Rising F Rising C Rising G and Rising EMinor B Rising F Rising C and Rising AMinor E Rising F Rising D

the first note event to the 119896th note event119863 = 1198891+1198892+sdot sdot sdot+119889

119896

119863 gt 119887 tempos (119887 is user defined value) Then we applied theK-Finding algorithm to analyze the tonality key ofM

1sdot sdot sdotM119896

in this piece and repeated the above-mentioned process withthe second note event in M as the first music note to getthe second piece until all note events were measured in thisway we could obtain a set of music piece tonal change dataWe used a visual method to map out the data as shown

4 Mathematical Problems in Engineering

0 100 200 3000

5

10

15

20

25

Beats piece based on 1 beat

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

25

Beats piece based on 2 beatsKe

y

Key

Key

0 100 200 3000

5

10

15

20

25

Beats piece based on 3 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 4 beats

0 100 200 3000

5

10

15

20

25

Beats piece based on 5 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 6 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 7 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 8 beats

Figure 4 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 1ndash8)

0 100 200 3000

5

10

15

20

25

Beats piece based on 9 beats

Key

0

5

10

15

20

25

0

5

10

15

20

25

0

5

10

15

20

25

Key

Key

Key

0

5

10

15

20

25

Key

0

5

10

15

20

25

Key

Key

Key

0 100 200 300Beats piece based on 10 beats

0 100 200 300Beats piece based on 11 beats

0 100 200 300Beats piece based on 12 beats

0 100 200 3000

5

10

15

20

25

Beats piece based on 13 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 14 beats0 100 200 300

Beats piece based on 20 beats0 100 200 300

Beats piece based on 25 beats

Figure 5 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 9ndash25)

in Figures 3 4 5 and 6 data distribution of Bachrsquos Two-PartInventions No 1

It can be concluded that melodies converge on severaldifferent tonalities when rhythm lengths of benchmark piecesare different According to the data collected although Inven-tion No 1 is a Major C piece its piece tonality is constantlychanging in relation to the tonality of the whole work

In order to further analyze the change rule of the tonalitywe use Tables 4 and 5 to illustrate the relationship betweenchanging pieces and the tonality

We used the piece tonality distribution diagram to ana-lyze the characteristics of a music piecersquos changes in tonalityunder the Krumhansl model and the results are shown inTable 6

Mathematical Problems in Engineering 5

0 100 200 3000

5

10

15

20

Beats piece based on 30 beats

Key

Key

Key

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 35 beats0 100 200 300Beats piece based on 40 beats

0 100 200 300Beats piece based on 45 beats

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 50 beats0 100 200 300Beats piece based on 55 beats

0 100 200 300Beats piece based on 60 beats

0 100 200 3000

5

10

15

20

Beats piece based on 65 beats

Figure 6 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 30ndash65)

Table 6 Tonality changes in pieces of Bachrsquos Two-Part Inventions(based onKrumhanslrsquosmodel)The spaces listed in the third columnare minimum interval spaces of the piecersquos tonalities after the majorand relative minor formed loops in which the relative minor andmajor connect together and the first column connects to last columnin Tables 4 and 5

Works Main tonalities SpacesNumber 1 Major C Major G Minor D and Minor E 1

Number 2 Minor G Rising Major A Minor c andMajor C 2

Number 3 Major A Minor B and Major D 1Number 4 Minor D Minor A and Major C 2

Number 5 Rising Major D Minor F and RisingMajor G 1

Number 6 Major B Major E 1Number 8 Major F Major C Minor D and Major A 1Number 13 Minor E Major C and Minor A 1

Number 14 Rising Major F Rising Major A andMajor D 2

It can be concluded from Table 6 that whenever there aretonality changes normally a tonality with minimum risingor falling values adjacent to the given main tonality will beselected for change purpose In line with the above analyseswe can develop a new rule

when composing a complete music event sequence119873119873may consist of 119896music sequences and whenthe piece tonality under the Krumhansl model isno more than 12 (119887 ⩾ 12) the space between

tonalities of 119896music sequences should be no morethan 2 (Rule III)

This rule is of great significance and in the case ofconnecting repeated pieces this method of tonality changemay be used to analyze possibly connected pieces

3 Discussion

In our experiment we concluded the patterns and rules inBachrsquos Two-Part Inventions which is typical of polyphonyworks and we discovered three characteristic rules (RulesIndashIII) in Bachrsquos Two-Part Inventions Nevertheless it needspointing out that these three rules only cover the pitch andthe tonality with no consideration for the rhythm melodyand harmony Studies show that global context has an effectonmusic perception [5]Williamdid a lot a lot of experimentsto study the effects on music perception of the integrationof pitch and rhythm Results show that the integration ofthe individual music parameter cannot be combined easilyThey have effects on each other after integration [6] So themodeling of music is difficult we need to study it furtherrather than applying the three rules everywhere

4 Conclusion

Computerized musical composition includes auxiliary com-position algorithm composition and worksrsquo compilationThe three rules we put forward are applicable for basic rules ofpolyphony works with styles similar to Bachrsquos in computer-ized algorithm composition these three rules can be used forassessing and selecting works with better polyphony stylesand they can be used in auxiliary computer composition to

6 Mathematical Problems in Engineering

inspire the composer with musical pieces generated fromthese rules so as to speed up the efficiency of compositionIn addition these three rules can be used for identifying thecharacteristics of existent works and for categorizing varioustypes of works

Conflict of Interests

The authors declare that they have no competing interestsregarding the publication of this paper

Authorsrsquo Contribution

All authors completed the paper together All authors readand approved the final paper

References

[1] C L Krumhansl Cognitive Foundations of Musical PitchOxford University Press New York NY USA 1990

[2] C L Krumhansl ldquoRhythm and pitch in music cognitionrdquoPsychological Bulletin vol 126 no 1 pp 159ndash179 2000

[3] C Roads The Computer Music Tutorial The MIT Press Cam-bridge Mass USA 1996

[4] P Toiviainen and C L Krumhansl ldquoMeasuring and modelingreal-time responses to music the dynamics of tonality induc-tionrdquo Perception vol 32 no 6 pp 741ndash766 2003

[5] E Bigand and M Pineau ldquoGlobal context effects on musicalexpectancyrdquo Perception amp Psychophysics vol 59 no 7 pp 1098ndash1107 1997

[6] W F Thompson ldquoSensitivity to combinations of musicalparameters pitch with duration and pitch pattern with dura-tional patternrdquo Perception amp Psychophysics vol 56 no 3 pp363ndash374 1994

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 3

Table 3 Total proportion of note events in repeated piece in Bachrsquos Two-Part Inventions First represents the first voice part and Secondstands for the second voice part unit

Part WorksNo 1 No 2 No 3 No 4 No 5 No 6 No 8 No 13 No 14

First 5639 8338 4659 2810 9024 4906 5973 4192 5236Second 5237 7877 5616 2822 8606 4612 6110 3195 5136

FirstThird

Second Fourth

Figure 2 The original music staff piece The blue slope refers to themusic sentence and the red refers to repeated music piece

0 100 200 3000

5

10

15

20

25

Beats piece based on 1 beat

Key

Figure 3 Tonality distribution diagram of Bachrsquos Two-Part Inven-tions No 1 based on 1 beat per piece (when 119887 = 1) Vertical axisrepresents the tonality 1 to 12 correspond to majors extending fromMajor B to Major C and 13 to 24 correspond to minors extendingfromMinor C to Minor B

24 Tonality As regards researches on tonality a great manyresearchers have put forward plenty of models to describechanges in the tonality Krumhansl proposed an algorithmto measure the music data and to determine perceivabletonality [1 2 4] on the basis of relevance with the attributedata of major and minor tonality measured by experienceKrumhanslrsquos algorithm is called K-Finding algorithm whichis used to find out the main tonality of a piece of musicThe method has shown great accuracy in measuring classicalmusic such as Bachrsquos works In our experiment we applyKrumhanslrsquos K-Finding algorithm to analyze the change lawof tonal characteristics of creative music in Bachrsquos inventionswhich we are going to study

M signifies the matrix of simplified music eventminimum 119896 was calculated from the first note event1198781119863111987511198791 in sequence making the total duration from

Table 4 Rising and falling keys of various tonalities (Major)

Major Rising or FallingMajor CMajor F Falling BFalling Major B Falling B Falling EFalling Major E Falling B Falling E and Falling AFalling Major A Falling B Falling E Falling A and Falling D

Falling Major D Falling B Falling E L Falling A Falling D andFalling G

Falling Major G Falling B Falling E Falling A Falling D FallingG and Falling C

Major B Rising F Rising C Rising G Rising D andRising A

Major E Rising F Rising C Rising G and Rising DMajor A Rising F Rising C and Rising GMajor D Rising F Rising CMajor G Rising F

Table 5 Rising and falling keys of various tonalities (Minor)

Relative minor Rising or FallingMinor A Rising GMinor D Falling B Rising CMinor G Falling B Falling E and Rising FMinor C Falling E Falling AMinor F Falling B Falling A and Falling DFalling Minor B Falling B Falling E Falling D and Falling G

Falling Minor E Falling B Falling E Falling A Falling G andFalling C

Rising Minor G Rising C Rising G Rising D Rising A andHeavy Rising F

Rising Minor C Rising F Rising C Rising G Rising D andRising B

Rising Minor F Rising F Rising C Rising G and Rising EMinor B Rising F Rising C and Rising AMinor E Rising F Rising D

the first note event to the 119896th note event119863 = 1198891+1198892+sdot sdot sdot+119889

119896

119863 gt 119887 tempos (119887 is user defined value) Then we applied theK-Finding algorithm to analyze the tonality key ofM

1sdot sdot sdotM119896

in this piece and repeated the above-mentioned process withthe second note event in M as the first music note to getthe second piece until all note events were measured in thisway we could obtain a set of music piece tonal change dataWe used a visual method to map out the data as shown

4 Mathematical Problems in Engineering

0 100 200 3000

5

10

15

20

25

Beats piece based on 1 beat

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

25

Beats piece based on 2 beatsKe

y

Key

Key

0 100 200 3000

5

10

15

20

25

Beats piece based on 3 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 4 beats

0 100 200 3000

5

10

15

20

25

Beats piece based on 5 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 6 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 7 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 8 beats

Figure 4 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 1ndash8)

0 100 200 3000

5

10

15

20

25

Beats piece based on 9 beats

Key

0

5

10

15

20

25

0

5

10

15

20

25

0

5

10

15

20

25

Key

Key

Key

0

5

10

15

20

25

Key

0

5

10

15

20

25

Key

Key

Key

0 100 200 300Beats piece based on 10 beats

0 100 200 300Beats piece based on 11 beats

0 100 200 300Beats piece based on 12 beats

0 100 200 3000

5

10

15

20

25

Beats piece based on 13 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 14 beats0 100 200 300

Beats piece based on 20 beats0 100 200 300

Beats piece based on 25 beats

Figure 5 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 9ndash25)

in Figures 3 4 5 and 6 data distribution of Bachrsquos Two-PartInventions No 1

It can be concluded that melodies converge on severaldifferent tonalities when rhythm lengths of benchmark piecesare different According to the data collected although Inven-tion No 1 is a Major C piece its piece tonality is constantlychanging in relation to the tonality of the whole work

In order to further analyze the change rule of the tonalitywe use Tables 4 and 5 to illustrate the relationship betweenchanging pieces and the tonality

We used the piece tonality distribution diagram to ana-lyze the characteristics of a music piecersquos changes in tonalityunder the Krumhansl model and the results are shown inTable 6

Mathematical Problems in Engineering 5

0 100 200 3000

5

10

15

20

Beats piece based on 30 beats

Key

Key

Key

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 35 beats0 100 200 300Beats piece based on 40 beats

0 100 200 300Beats piece based on 45 beats

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 50 beats0 100 200 300Beats piece based on 55 beats

0 100 200 300Beats piece based on 60 beats

0 100 200 3000

5

10

15

20

Beats piece based on 65 beats

Figure 6 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 30ndash65)

Table 6 Tonality changes in pieces of Bachrsquos Two-Part Inventions(based onKrumhanslrsquosmodel)The spaces listed in the third columnare minimum interval spaces of the piecersquos tonalities after the majorand relative minor formed loops in which the relative minor andmajor connect together and the first column connects to last columnin Tables 4 and 5

Works Main tonalities SpacesNumber 1 Major C Major G Minor D and Minor E 1

Number 2 Minor G Rising Major A Minor c andMajor C 2

Number 3 Major A Minor B and Major D 1Number 4 Minor D Minor A and Major C 2

Number 5 Rising Major D Minor F and RisingMajor G 1

Number 6 Major B Major E 1Number 8 Major F Major C Minor D and Major A 1Number 13 Minor E Major C and Minor A 1

Number 14 Rising Major F Rising Major A andMajor D 2

It can be concluded from Table 6 that whenever there aretonality changes normally a tonality with minimum risingor falling values adjacent to the given main tonality will beselected for change purpose In line with the above analyseswe can develop a new rule

when composing a complete music event sequence119873119873may consist of 119896music sequences and whenthe piece tonality under the Krumhansl model isno more than 12 (119887 ⩾ 12) the space between

tonalities of 119896music sequences should be no morethan 2 (Rule III)

This rule is of great significance and in the case ofconnecting repeated pieces this method of tonality changemay be used to analyze possibly connected pieces

3 Discussion

In our experiment we concluded the patterns and rules inBachrsquos Two-Part Inventions which is typical of polyphonyworks and we discovered three characteristic rules (RulesIndashIII) in Bachrsquos Two-Part Inventions Nevertheless it needspointing out that these three rules only cover the pitch andthe tonality with no consideration for the rhythm melodyand harmony Studies show that global context has an effectonmusic perception [5]Williamdid a lot a lot of experimentsto study the effects on music perception of the integrationof pitch and rhythm Results show that the integration ofthe individual music parameter cannot be combined easilyThey have effects on each other after integration [6] So themodeling of music is difficult we need to study it furtherrather than applying the three rules everywhere

4 Conclusion

Computerized musical composition includes auxiliary com-position algorithm composition and worksrsquo compilationThe three rules we put forward are applicable for basic rules ofpolyphony works with styles similar to Bachrsquos in computer-ized algorithm composition these three rules can be used forassessing and selecting works with better polyphony stylesand they can be used in auxiliary computer composition to

6 Mathematical Problems in Engineering

inspire the composer with musical pieces generated fromthese rules so as to speed up the efficiency of compositionIn addition these three rules can be used for identifying thecharacteristics of existent works and for categorizing varioustypes of works

Conflict of Interests

The authors declare that they have no competing interestsregarding the publication of this paper

Authorsrsquo Contribution

All authors completed the paper together All authors readand approved the final paper

References

[1] C L Krumhansl Cognitive Foundations of Musical PitchOxford University Press New York NY USA 1990

[2] C L Krumhansl ldquoRhythm and pitch in music cognitionrdquoPsychological Bulletin vol 126 no 1 pp 159ndash179 2000

[3] C Roads The Computer Music Tutorial The MIT Press Cam-bridge Mass USA 1996

[4] P Toiviainen and C L Krumhansl ldquoMeasuring and modelingreal-time responses to music the dynamics of tonality induc-tionrdquo Perception vol 32 no 6 pp 741ndash766 2003

[5] E Bigand and M Pineau ldquoGlobal context effects on musicalexpectancyrdquo Perception amp Psychophysics vol 59 no 7 pp 1098ndash1107 1997

[6] W F Thompson ldquoSensitivity to combinations of musicalparameters pitch with duration and pitch pattern with dura-tional patternrdquo Perception amp Psychophysics vol 56 no 3 pp363ndash374 1994

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

4 Mathematical Problems in Engineering

0 100 200 3000

5

10

15

20

25

Beats piece based on 1 beat

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

25

Beats piece based on 2 beatsKe

y

Key

Key

0 100 200 3000

5

10

15

20

25

Beats piece based on 3 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 4 beats

0 100 200 3000

5

10

15

20

25

Beats piece based on 5 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 6 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 7 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 8 beats

Figure 4 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 1ndash8)

0 100 200 3000

5

10

15

20

25

Beats piece based on 9 beats

Key

0

5

10

15

20

25

0

5

10

15

20

25

0

5

10

15

20

25

Key

Key

Key

0

5

10

15

20

25

Key

0

5

10

15

20

25

Key

Key

Key

0 100 200 300Beats piece based on 10 beats

0 100 200 300Beats piece based on 11 beats

0 100 200 300Beats piece based on 12 beats

0 100 200 3000

5

10

15

20

25

Beats piece based on 13 beats0 100 200 300

0

5

10

15

20

25

Beats piece based on 14 beats0 100 200 300

Beats piece based on 20 beats0 100 200 300

Beats piece based on 25 beats

Figure 5 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 9ndash25)

in Figures 3 4 5 and 6 data distribution of Bachrsquos Two-PartInventions No 1

It can be concluded that melodies converge on severaldifferent tonalities when rhythm lengths of benchmark piecesare different According to the data collected although Inven-tion No 1 is a Major C piece its piece tonality is constantlychanging in relation to the tonality of the whole work

In order to further analyze the change rule of the tonalitywe use Tables 4 and 5 to illustrate the relationship betweenchanging pieces and the tonality

We used the piece tonality distribution diagram to ana-lyze the characteristics of a music piecersquos changes in tonalityunder the Krumhansl model and the results are shown inTable 6

Mathematical Problems in Engineering 5

0 100 200 3000

5

10

15

20

Beats piece based on 30 beats

Key

Key

Key

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 35 beats0 100 200 300Beats piece based on 40 beats

0 100 200 300Beats piece based on 45 beats

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 50 beats0 100 200 300Beats piece based on 55 beats

0 100 200 300Beats piece based on 60 beats

0 100 200 3000

5

10

15

20

Beats piece based on 65 beats

Figure 6 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 30ndash65)

Table 6 Tonality changes in pieces of Bachrsquos Two-Part Inventions(based onKrumhanslrsquosmodel)The spaces listed in the third columnare minimum interval spaces of the piecersquos tonalities after the majorand relative minor formed loops in which the relative minor andmajor connect together and the first column connects to last columnin Tables 4 and 5

Works Main tonalities SpacesNumber 1 Major C Major G Minor D and Minor E 1

Number 2 Minor G Rising Major A Minor c andMajor C 2

Number 3 Major A Minor B and Major D 1Number 4 Minor D Minor A and Major C 2

Number 5 Rising Major D Minor F and RisingMajor G 1

Number 6 Major B Major E 1Number 8 Major F Major C Minor D and Major A 1Number 13 Minor E Major C and Minor A 1

Number 14 Rising Major F Rising Major A andMajor D 2

It can be concluded from Table 6 that whenever there aretonality changes normally a tonality with minimum risingor falling values adjacent to the given main tonality will beselected for change purpose In line with the above analyseswe can develop a new rule

when composing a complete music event sequence119873119873may consist of 119896music sequences and whenthe piece tonality under the Krumhansl model isno more than 12 (119887 ⩾ 12) the space between

tonalities of 119896music sequences should be no morethan 2 (Rule III)

This rule is of great significance and in the case ofconnecting repeated pieces this method of tonality changemay be used to analyze possibly connected pieces

3 Discussion

In our experiment we concluded the patterns and rules inBachrsquos Two-Part Inventions which is typical of polyphonyworks and we discovered three characteristic rules (RulesIndashIII) in Bachrsquos Two-Part Inventions Nevertheless it needspointing out that these three rules only cover the pitch andthe tonality with no consideration for the rhythm melodyand harmony Studies show that global context has an effectonmusic perception [5]Williamdid a lot a lot of experimentsto study the effects on music perception of the integrationof pitch and rhythm Results show that the integration ofthe individual music parameter cannot be combined easilyThey have effects on each other after integration [6] So themodeling of music is difficult we need to study it furtherrather than applying the three rules everywhere

4 Conclusion

Computerized musical composition includes auxiliary com-position algorithm composition and worksrsquo compilationThe three rules we put forward are applicable for basic rules ofpolyphony works with styles similar to Bachrsquos in computer-ized algorithm composition these three rules can be used forassessing and selecting works with better polyphony stylesand they can be used in auxiliary computer composition to

6 Mathematical Problems in Engineering

inspire the composer with musical pieces generated fromthese rules so as to speed up the efficiency of compositionIn addition these three rules can be used for identifying thecharacteristics of existent works and for categorizing varioustypes of works

Conflict of Interests

The authors declare that they have no competing interestsregarding the publication of this paper

Authorsrsquo Contribution

All authors completed the paper together All authors readand approved the final paper

References

[1] C L Krumhansl Cognitive Foundations of Musical PitchOxford University Press New York NY USA 1990

[2] C L Krumhansl ldquoRhythm and pitch in music cognitionrdquoPsychological Bulletin vol 126 no 1 pp 159ndash179 2000

[3] C Roads The Computer Music Tutorial The MIT Press Cam-bridge Mass USA 1996

[4] P Toiviainen and C L Krumhansl ldquoMeasuring and modelingreal-time responses to music the dynamics of tonality induc-tionrdquo Perception vol 32 no 6 pp 741ndash766 2003

[5] E Bigand and M Pineau ldquoGlobal context effects on musicalexpectancyrdquo Perception amp Psychophysics vol 59 no 7 pp 1098ndash1107 1997

[6] W F Thompson ldquoSensitivity to combinations of musicalparameters pitch with duration and pitch pattern with dura-tional patternrdquo Perception amp Psychophysics vol 56 no 3 pp363ndash374 1994

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 5

0 100 200 3000

5

10

15

20

Beats piece based on 30 beats

Key

Key

Key

Key

Key

Key

Key

Key

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 35 beats0 100 200 300Beats piece based on 40 beats

0 100 200 300Beats piece based on 45 beats

0 100 200 3000

5

10

15

20

0

5

10

15

20

0

5

10

15

20

Beats piece based on 50 beats0 100 200 300Beats piece based on 55 beats

0 100 200 300Beats piece based on 60 beats

0 100 200 3000

5

10

15

20

Beats piece based on 65 beats

Figure 6 Summary of tonality distribution diagram for Bachrsquos Two-Part Inventions No 1 (when 119887 = 30ndash65)

Table 6 Tonality changes in pieces of Bachrsquos Two-Part Inventions(based onKrumhanslrsquosmodel)The spaces listed in the third columnare minimum interval spaces of the piecersquos tonalities after the majorand relative minor formed loops in which the relative minor andmajor connect together and the first column connects to last columnin Tables 4 and 5

Works Main tonalities SpacesNumber 1 Major C Major G Minor D and Minor E 1

Number 2 Minor G Rising Major A Minor c andMajor C 2

Number 3 Major A Minor B and Major D 1Number 4 Minor D Minor A and Major C 2

Number 5 Rising Major D Minor F and RisingMajor G 1

Number 6 Major B Major E 1Number 8 Major F Major C Minor D and Major A 1Number 13 Minor E Major C and Minor A 1

Number 14 Rising Major F Rising Major A andMajor D 2

It can be concluded from Table 6 that whenever there aretonality changes normally a tonality with minimum risingor falling values adjacent to the given main tonality will beselected for change purpose In line with the above analyseswe can develop a new rule

when composing a complete music event sequence119873119873may consist of 119896music sequences and whenthe piece tonality under the Krumhansl model isno more than 12 (119887 ⩾ 12) the space between

tonalities of 119896music sequences should be no morethan 2 (Rule III)

This rule is of great significance and in the case ofconnecting repeated pieces this method of tonality changemay be used to analyze possibly connected pieces

3 Discussion

In our experiment we concluded the patterns and rules inBachrsquos Two-Part Inventions which is typical of polyphonyworks and we discovered three characteristic rules (RulesIndashIII) in Bachrsquos Two-Part Inventions Nevertheless it needspointing out that these three rules only cover the pitch andthe tonality with no consideration for the rhythm melodyand harmony Studies show that global context has an effectonmusic perception [5]Williamdid a lot a lot of experimentsto study the effects on music perception of the integrationof pitch and rhythm Results show that the integration ofthe individual music parameter cannot be combined easilyThey have effects on each other after integration [6] So themodeling of music is difficult we need to study it furtherrather than applying the three rules everywhere

4 Conclusion

Computerized musical composition includes auxiliary com-position algorithm composition and worksrsquo compilationThe three rules we put forward are applicable for basic rules ofpolyphony works with styles similar to Bachrsquos in computer-ized algorithm composition these three rules can be used forassessing and selecting works with better polyphony stylesand they can be used in auxiliary computer composition to

6 Mathematical Problems in Engineering

inspire the composer with musical pieces generated fromthese rules so as to speed up the efficiency of compositionIn addition these three rules can be used for identifying thecharacteristics of existent works and for categorizing varioustypes of works

Conflict of Interests

The authors declare that they have no competing interestsregarding the publication of this paper

Authorsrsquo Contribution

All authors completed the paper together All authors readand approved the final paper

References

[1] C L Krumhansl Cognitive Foundations of Musical PitchOxford University Press New York NY USA 1990

[2] C L Krumhansl ldquoRhythm and pitch in music cognitionrdquoPsychological Bulletin vol 126 no 1 pp 159ndash179 2000

[3] C Roads The Computer Music Tutorial The MIT Press Cam-bridge Mass USA 1996

[4] P Toiviainen and C L Krumhansl ldquoMeasuring and modelingreal-time responses to music the dynamics of tonality induc-tionrdquo Perception vol 32 no 6 pp 741ndash766 2003

[5] E Bigand and M Pineau ldquoGlobal context effects on musicalexpectancyrdquo Perception amp Psychophysics vol 59 no 7 pp 1098ndash1107 1997

[6] W F Thompson ldquoSensitivity to combinations of musicalparameters pitch with duration and pitch pattern with dura-tional patternrdquo Perception amp Psychophysics vol 56 no 3 pp363ndash374 1994

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

6 Mathematical Problems in Engineering

inspire the composer with musical pieces generated fromthese rules so as to speed up the efficiency of compositionIn addition these three rules can be used for identifying thecharacteristics of existent works and for categorizing varioustypes of works

Conflict of Interests

The authors declare that they have no competing interestsregarding the publication of this paper

Authorsrsquo Contribution

All authors completed the paper together All authors readand approved the final paper

References

[1] C L Krumhansl Cognitive Foundations of Musical PitchOxford University Press New York NY USA 1990

[2] C L Krumhansl ldquoRhythm and pitch in music cognitionrdquoPsychological Bulletin vol 126 no 1 pp 159ndash179 2000

[3] C Roads The Computer Music Tutorial The MIT Press Cam-bridge Mass USA 1996

[4] P Toiviainen and C L Krumhansl ldquoMeasuring and modelingreal-time responses to music the dynamics of tonality induc-tionrdquo Perception vol 32 no 6 pp 741ndash766 2003

[5] E Bigand and M Pineau ldquoGlobal context effects on musicalexpectancyrdquo Perception amp Psychophysics vol 59 no 7 pp 1098ndash1107 1997

[6] W F Thompson ldquoSensitivity to combinations of musicalparameters pitch with duration and pitch pattern with dura-tional patternrdquo Perception amp Psychophysics vol 56 no 3 pp363ndash374 1994

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of