CN105374347B - A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm - Google Patents

A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm Download PDF

Info

Publication number
CN105374347B
CN105374347B CN201510604881.2A CN201510604881A CN105374347B CN 105374347 B CN105374347 B CN 105374347B CN 201510604881 A CN201510604881 A CN 201510604881A CN 105374347 B CN105374347 B CN 105374347B
Authority
CN
China
Prior art keywords
jiangnan
ditty
melody
trifle
fitness function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201510604881.2A
Other languages
Chinese (zh)
Other versions
CN105374347A (en
Inventor
王鑫
王永滨
吕志胜
李樱
吴林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Communication University of China
Original Assignee
Communication University of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Communication University of China filed Critical Communication University of China
Priority to CN201510604881.2A priority Critical patent/CN105374347B/en
Publication of CN105374347A publication Critical patent/CN105374347A/en
Application granted granted Critical
Publication of CN105374347B publication Critical patent/CN105374347B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Auxiliary Devices For Music (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

The method for the Jiangnan ditty area of computer aided composition based on hybrid algorithm that the invention discloses a kind of, specific steps include establishing Jiangnan ditty SoundBreeze Clubtunes library, the key rule established Jiangnan ditty composition knowledge base, formulate genetic algorithm, extracting the initial population of genetic algorithm and generate Jiangnan ditty melody, 94 first Jiangnan ditty SoundBreeze Clubtunes libraries are established, characteristic parameter extraction is used for.The present invention defines coding rule, genetic operator and fitness function by knowledge base, mechanism is judged using fitness function, to realize the automatic music composing function of Jiangnan ditty computer, the knowledge base of Jiangnan ditty is used to establish the fitness function in genetic algorithm, it both can be to avoid the complexity of interactive genetic algorithm, the accuracy of fitness function is also substantially increased, to improve the accuracy of entire area of computer aided compositing system.

Description

A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm
Technical field
The present invention relates to computer application technology, specifically a kind of Jiangnan ditty computer aided manufacturing based on hybrid algorithm The method for helping composition.
Background technique
With application of the computer technology on musical composition, Computer Music is come into being.Computer Music is as one The emerging subject of door, the cognition that main purpose is appliance computer to imitate people to music carry out auxiliary creation and design. Area of computer aided composition problem is explored on the one hand it will be seen that and simulating composer in being engaged in this particular procedure of musical composition The mode of thinking;On the other hand, the difference that the compositing system developed based on area of computer aided composition investigative technique is created The musical works of form can play the useful supplement to composer.
Area of computer aided composition technology is in external relative maturity at present, and main algorithm includes Markov from the point of view of summarizing (Markov) conversion table (or Markov chain), the knowledge base system in Algorithmic Composition research, the music syntax, artificial neural network Network technology and genetic algorithm.
Markov (Markov) conversion table is just as a function.Its independent variable is current note, and functional value is then It is next a possibility that note occur.For a certain specific (such as a certain composer or a certain period) style musical works into Row is collected and statistics, so that it may construct corresponding conversion table.The algorithm presently, there are the problem of be difficult judgement generate music Quality, still there is gap between the entire music of standard in the segment furthermore generated at random.
The Algorithmic Composition of rule-based knowledge base system is that one kind naturally selects, especially defined perfect The built-in formwork erection type in field is either introduced especially true when clearly structure or rule.Its major advantage is: they have clear Reasoning, and can make explanations for the selection of behavior.The shortcomings that algorithm is that the foundation of knowledge elicitation mechanism is not only difficult but also expense When, the music more standardized is easy to summarize rule, but for impromptu changeable melody, is difficult to find specification.
As language has the syntax, music is also to have the music syntax.It, can using the music syntax in conjunction with the method for statistics With the probability distribution of the various music events (such as interval, rhythm) in matching (or capture) existing works, and these can be based on Feature generates the works of similar style.But the algorithm is difficult the music of impromptu creation to find categorical grammar, and then very Hardly possible carries out the decomposition and recombination of note, generates new music.
In terms of perception and cognition, artificial neural network can be practised from a template set middle school, to avoid needing to rule Formalization then.Especially recurrent neural network can successfully obtain the surface structure that a melody passes through sentence, and to obtain in this way Based on the knowledge taken, new melody is produced.But melody generated lacks the global continuity of music, i.e., it can not be obtained Take higher musical features.It is, in principle, that artificial neural network technology be usually particularly suited for analysis musical works without It is creation.
Genetic algorithm is the computation model of the biological evolution process of the Darwinian heredity selection of simulation and natural selection, is one The method that kind passes through simulation natural evolution process searches optimal solution.Genetic algorithm developed using fitness function candidate (dyeing Body), to obtain approximate optimal solution.But in the research wrirted music automatically using genetic algorithm, fitness function is in fact It is difficult accurate definition.Then occur allowing people that fitness function is replaced directly to assess a kind of method of chromosome, that is, hand over The genetic algorithm IGA of mutual formula.However the validity of interactive genetic algorithm is poor at present, user must hear all possible potential Solution, can just make the assessment with generality.
In conclusion the advantages of various composition algorithms respectively have its own and there are the problem of.Establish a kind of hybrid algorithm Area of computer aided compositing system can maximize favourable factors and minimize unfavourable ones, and carry out area of computer aided composition in the most optimal way.Further, since domestic It starts late about computer composing systematic research, there is no the mature Algorithmic Compositions for being directed to China National music at present Technology.Therefore it existing Algorithmic Composition technology will integrate, be applied in the analysis and creation of China National music in the world, And it is very necessary that foundation, which has the computer composing system of oneself national characters,.
Summary of the invention
The purpose of the present invention is to provide a kind of fitness function accuracy height, the river easy to use based on hybrid algorithm The method of southern ditty area of computer aided composition, to solve the problems mentioned in the above background technology.
To achieve the above object, the invention provides the following technical scheme:
A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm, the specific steps are as follows:
(1) it establishes Jiangnan ditty SoundBreeze Clubtunes library: establishing 94 first Jiangnan ditty SoundBreeze Clubtunes libraries, mentioned for characteristic parameter It takes;
(2) it establishes Jiangnan ditty composition knowledge base: extracting acoustic feature and melody characteristics, establish knowledge base, Formulation for genetic algorithm key technology;
(3) it formulates the key rule of genetic algorithm: calculation of characteristic parameters and melody characteristics is carried out to Jiangnan ditty material village, often used in village names Statistical analysis, according to the feature of extraction formulate genetic algorithm coding rule, genetic operator and fitness function;
(4) it extracts the initial population of genetic algorithm: according to the mode and speed of user's selection, being selected from material database corresponding Melody, and extract initial population of the first trifle of melody as genetic algorithm;
(5) it generates Jiangnan ditty melody: by calculating fitness function, starting the heredity for being selected, being intersected and being made a variation It calculates, the condition by successive ignition until reaching termination, then carries out the genetic computation of next trifle, ultimately generate 12 trifles The melody of Jiangnan ditty.
As a further solution of the present invention: the mode in the step (4) is G requisition, the A plumage reconciliation C mode of ancient Chinese music, speed respectively It spends quick at a slow speed in respectively.
As a further solution of the present invention: when establishing ditty composition knowledge base in Jiangnan in the step (2), respectively The acoustical characteristic parameters and melody characteristics parameter for extracting Jiangnan ditty are built, and the side that acoustical characteristic parameters use time-frequency to calculate is extracted Method extracts 11 characteristic parameters relevant to tone color, pitch tunefulness, and used Fourier transform length is when calculating frequency spectrum 8192 sampled points, frequency resolution 5.38Hz, 75% overlapping, obtained frequency spectrum are linear amplitude spectrum, are used The method of TrueEnvelope calculates signal waveform envelope, and all acoustical characteristic parameters are frame average value, and window is when frame 0.05s, half is overlapped;Melody characteristics parameter is obtained by the method for statistical analysis, and melody characteristics parameter totally 7, including special Melody is advanced, rhythm and interval, the statistical probability calculation formula of melody characteristics parameter are as follows:
As a further solution of the present invention: the fitness function in the step (3) is carried out in two steps, first to generation Each trifle judged, then to entire melody carry out fitness function judge, the following institute of the fitness function of trifle Show:
(formula 2),
Wherein i indicates i-th of trifle, and j indicates that j-th of note in i-th of trifle, N indicate the number of note in trifle, M indicates the melodic interval number of interval amount >=48 in the trifle;
The fitness function of entire melody is as follows:
As further scheme of the invention: generating the melody of Jiangnan ditty in the step (5) using genetic algorithm When, initial population is 10, using trifle as iteration unit, sets trifle next round iteration of the fitness function score less than 4 points Give up, generates the Jiangnan ditty melody of 12 trifles, judged using the fitness function of entire melody, by highest scoring Melody is considered as the melody of generation.
Compared with prior art, the beneficial effects of the present invention are:
The present invention defines coding rule, genetic operator and fitness function by knowledge base, utilizes fitness letter The knowledge base of Jiangnan ditty is used to establish by number judge mechanism to realize the automatic music composing function of Jiangnan ditty computer Fitness function in genetic algorithm both can also substantially increase fitness letter to avoid the complexity of interactive genetic algorithm Several accuracy, to improve the accuracy of entire area of computer aided compositing system.
Detailed description of the invention
Fig. 1 is flow diagram of the invention.
Fig. 2 is the flow diagram that fitness function is established in the present invention.
Fig. 3 be the G requisition that embodiment 1 generates in the present invention, in Jiangnan ditty melody spectrogram at a slow speed.
Specific embodiment
The technical solution of the patent is explained in further detail With reference to embodiment.
A kind of method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm referring to FIG. 1-2, specific steps are such as Under:
(1) it establishes Jiangnan ditty SoundBreeze Clubtunes library: establishing 94 first Jiangnan ditty SoundBreeze Clubtunes libraries, mentioned for characteristic parameter It takes;
(2) it establishes Jiangnan ditty composition knowledge base: extracting acoustic feature and melody characteristics, establish knowledge base, Formulation for genetic algorithm key technology;
(3) it formulates the key rule of genetic algorithm: calculation of characteristic parameters and melody characteristics is carried out to Jiangnan ditty material database Statistical analysis, according to the feature of extraction formulate genetic algorithm coding rule, genetic operator and fitness function;
(4) it extracts the initial population of genetic algorithm: according to the mode and speed of user's selection, being selected from material database corresponding Melody, and extract initial population of the first trifle of melody as genetic algorithm;
(5) it generates Jiangnan ditty melody: by calculating fitness function, starting the heredity for being selected, being intersected and being made a variation It calculates, the condition by successive ignition until reaching termination, then carries out the genetic computation of next trifle, ultimately generate 12 trifles The melody of Jiangnan ditty.
When establishing Jiangnan ditty SoundBreeze Clubtunes library, establish the material database of 94 first Jiangnan ditties, audio format include MIDI and Two class of Wave format, midi format are used to extract melody characteristics, and Wave format is used to extract acoustical characteristic parameters, in the material database Altogether include three classes mode, be G requisition, the A plumage reconciliation C mode of ancient Chinese music respectively, play speed from 50bpm to 160bpm, be limited with 90bpm, Will be less than 90bpm speed be defined as at a slow speed, the speed higher than 90bpm be defined as in quickly.
It is described when establishing Jiangnan ditty composition knowledge base, the acoustical characteristic parameters and rotation of Jiangnan ditty are extracted respectively Rule characteristic parameter is built, and the method that acoustical characteristic parameters use time-frequency to calculate is extracted, and is extracted and tone color, pitch tunefulness relevant 11 A characteristic parameter, as shown in table 1:
The acoustical characteristic parameters that table 1 calculates
Used Fourier transform length is 8192 sampled points when calculating frequency spectrum, frequency resolution 5.38Hz, 75% overlapping, obtained frequency spectrum are linear amplitude spectrum, and signal waveform envelope, institute are calculated using the method for TrueEnvelope Having acoustical characteristic parameters is frame average value, and window is 0.05s when frame, and half is overlapped.
Melody characteristics parameter is obtained by the method for statistical analysis, and melody characteristics parameter totally 7, including special melody row Into, rhythm and interval, melody characteristics rule are established by ratio shared by each melody characteristics in the first Jiangnan ditties of statistics 94 The statistical probability calculation formula in then library, melody characteristics parameter is as follows:
The melody characteristics parameter of calculating is as shown in table 2:
The melody characteristics parameter of 2 Jiangnan ditty of table
Serial number Melody characteristics parameter
1 Music speed
2 Mode
3 Note duration
4 Special rhythm
5 Characteristic revolves method-interval vector
6 The interval amount of melodic interval
7 Melody terminates rotation method
Steps are as follows for the calculating of genetic algorithm generation Jiangnan ditty:
1, it sets initial population: after system obtains user demand, selecting qualified pleasure at random in material database automatically Song, and the first trifle of melody is extracted as initial population, using existing period, rather than computer random generates Period, purpose allow compositing system to search optimal solution faster, and the iteration unit of genetic algorithm is trifle, in this way can be as far as possible Holding it is completely happy think, Population in Genetic Algorithms is set as 10.
2, setting genetic algorithm encoding rule: coding rule is set according to knowledge base, coding rule is to each sound Symbol is encoded, including duration, pitch and power.
(1) note duration: being that 1 bat carries out duration coding according to 4 dieresis, as shown in table 3:
The coding rule of 3 duration of table
(2) note pitch: pitch includes three octaves altogether, is small character group, one group of small character and two groups of small character respectively.With small character The pitch of group c is set as 0, and the encoded radio of lingering sound is using a semitone as resolution ratio incremented by successively 1, the coding rule of pitch such as table 4 It is shown:
The coding rule of 4 pitch of table
(3) note intensity: 2/4 intensity of the bat comprising sound is strong beat and weak beat, and the dynamics of rest is 0, the dynamics of strong beat It is 127, the dynamics of weak beat is 100.
3, set genetic operator mode: genetic operator includes selection, intersects and make a variation.
(1) selection operator: algorithm of tournament selection algorithm is used.
(2) crossover operator: a length of one melody section clapped is intersected when in trifle, crossover probability 0.6.Random selection Two trifles, calculate the duration of each trifle note, and accumulation duration is crossover location when being equal to 1.
(3) mutation operator: mutation operator includes interval variation, and note division and note merge three kinds of variations.According to trifle It makes a variation, and is carried out according to 30% probability, is i.e. 3 trifle variations of random selection, 1 trifle carry out sound in 10 trifles Cheng Bianyi, 1 trifle carry out note merging, and last 1 trifle carries out note division, which note becomes in some specific trifle It is different, in addition to head and the tail note it is constant it is different other than, other note random variations:
A, interval makes a variation: changing the pitch of some note, to influence the front and back interval value of the note.Interval variation occurs When, the probability for changing front and back interval is as shown in table 5 below.
The random number of [0,1] is generated, if random digit is in 5 generating new interval interval in [0,0.947] Chosen in note, if random digit in (0.947,0.973], the sound of interval interval≤5 and rear interval interval > 5 before generation It is chosen in symbol;If random digit in (0.973,0.999], interval interval > 5 and the note of rear interval interval≤5 before generation Middle selection;If random digit in (0.999,1], selected in the note of interval interval > 5 and rear interval interval > 5 before generation It takes.If occurred in some section without qualified note, variation directly terminates.
The probability distribution of 5 interval of table variation
B, note divides: a length of 0.5,1,2 note when a note being split into two notes, and only being made a variation.If A length of 0.5 when note, duration of a sound variation allocation plan is as shown in table 6, interval relation generating probability such as 7 institute of table between two notes Show:
Duration of a sound combined scheme when a length of 0.5 when 6 note of table
Wherein the data of the first row indicate the ratio of shared note duration.
Interval relation generating probability between 7 two notes of table
If a length of 1 or 2 when note, duration of a sound variation allocation plan is as shown in table 8, the interval relation between two notes Generating probability is referring still to table 7.
Duration of a sound combined scheme when a length of 1 or 2 when 8 note of table
C, note merges: two notes are merged into a sound, the when appearance of combined note duration and original two sounds Together, steps are as follows: the two sounds are replaced with random note, when a length of the two sounds duration summation, the pitch selection of note It is carried out according to such as lower probability: the first row expression pitch, the coding of the second row expression pitch, the probability that third behavior occurs, still It is randomly selected using the method that interval makes a variation.
9 note of table merges allocation plan
4, set fitness function: fitness function is carried out in two steps, and is judged first each trifle of generation, when After all 12 trifles all generate, the judge of fitness function is then carried out to entire melody, the fitness function of trifle is as follows It is shown:
(formula 2),
Wherein i indicates i-th of trifle, and j indicates that j-th of note in i-th of trifle, N indicate the number of note in trifle, M indicates the melodic interval number of interval amount >=48 in the trifle;
A, Pitch: for detecting each note occurred: being occurred according to the different pitch notes obtained in composition rule Probability, the fitness function of different pitches can be indicated with Pitch (i), as shown in table 10:
10 note pitch function table of table
B, Duration: the duration occurred for detecting each note: according to the different durations obtained in composition rule The probability that note occurs, can indicate the fitness function of different durations with Pitch (i), as shown in table 11:
11 note duration function table of table
C, Interval1: indicate the assessment of melodic interval in trifle: the melodic interval interval of Jiangnan ditty is all largely Less than 7, so if interval interval between two neighboring sound is greater than 7, it is too big to be considered as interval, does not meet the rotation of Jiangnan ditty Restrain Partial Feature.Jiangnan ditty occupies whole 88% or so in 0,2,3 interval interval traveling mode, in addition the sound occasionally having It is divided between journey and is divided into pure five degree of 7 between 5 pure fourth journey and jumps into, these interval intervals occupy altogether about 93%.Therefore The fitness function of Interval1 is such as shown in (formula 3):
Wherein a indicates value of the interval interval less than 4 in a certain trifle, and b indicates the value that interval interval is equal to 4 or 5, c table Show other interval intervals.So when interval interval is more less than 4 value, then this functional value is bigger.
D, the evaluation function for the characteristic interval vector that Melody3: three sounds are constituted, Melody3 is special in trifle The interval vectors of 3 sounds find out, therefore before calculating Melody3, first do and determine: a length of 2 bat or 1 when 3 sounds are constituted The special interval vector clapped is picked out, and if there is no interval vector, does not then calculate Melody3 directly, what three sounds were constituted The evaluation function of characteristic interval vector is as shown in table 12:
The interval vector evaluation function that 12 3 sounds of table are constituted
Condition Melody3
Pi+2> Pi+1> Pi 0.6
Pi+2< Pi+1< Pi 0.92
Pi+2=Pi+1≠Pi 0.08
Pi+1=Pi≠Pi+2 0.86
Pi=Pi+1=Pi+2 0.17
(Pi+2-Pi+1)(Pi+1-Pi) < 0 and | Pi+2-Pi+1|=| (Pi+1-Pi)|≠0 1
E, the evaluation function for the characteristic interval vector that Melody4: four sounds are constituted: as Melody3, the letter is being calculated First do and determine before number, by when a length of 2 clap or the 1 special interval vector clapped is found out, the characteristic interval vector that four sounds are constituted Evaluation function it is as shown in table 13:
The interval vector evaluation function that 13 4 sounds of table are constituted
F, Rhythm: the evaluation function of characteristic rhythm: from the point of view of contained rhythm, mainly include two major classes, one A length of 2 clap when class is rhythm, and another kind of is that rhythm is clapped for 1.Therefore rhythm type function will be divided into two parts into Row calculates, and one is Rhythm1 (a length of 1 rhythm clapped when calculating) function, the other is (a length of 2 clap Rhythm2 when calculating Rhythm) function, rhythm Rhythm2 evaluation function is as shown in table 14:
14 rhythm Rhythm2 evaluation function of table
In this table, D1Indicate the duration coding of first sound level in a certain trifle, D2When indicating this second sound level of trifle Value coding, N indicate the note quantity of this rhythm, and rhythm Rhythm1 evaluation function is as shown in Table 15:
15 rhythm Rhythm1 evaluation function of table
In this table, D1Indicate the duration coding of first sound level in a certain trifle, D2When indicating this second sound level of trifle Value coding, N indicate the note quantity in this rhythm.
The fitness function of whole melody:
(formula 4)
G, Interval2 indicates the judge of small internode melodic interval
According to composition rule before, the judge of small internode melodic interval is as shown in table 16:
Table 16Interval2 evaluation function
When generating the melody of Jiangnan ditty using genetic algorithm, initial population is 10, using trifle as iteration unit, setting Trifle next round iteration of the fitness function score less than 4 points is given up, and the Jiangnan ditty melody of 12 trifles is generated, using entire The fitness function of melody is judged, and the melody of highest scoring is considered as to the melody of generation.
Embodiment 1
Referring to Fig. 3, a kind of method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm, specific steps are such as Under:
(1) generation of initial music population: user first selects mode and speed, for example, selection G requisition formula and at a slow speed. After system receives the demand of user, the 10 song materials for meeting the condition are selected at random in SoundBreeze Clubtunes library, and by every head First trifle of SoundBreeze Clubtunes is as initial population;
(2) it generates Jiangnan ditty knowledge base: extracting the characteristic parameter of Jiangnan ditty, generate knowledge base.Feature Parameter includes 11 acoustic features by calculating acquisition and 7 melody characteristics based on statistics, is the coding of genetic algorithm Rule, fitness function and genetic operator provide algorithm foundation;
(3) formulate the coding rule of music: coding rule is encoded to each note, including duration, pitch and strong It is weak.Coding rule of all coding rules all referring to midi format.It is that 1 bat carries out duration volume that note duration, which is according to 4 dieresis, Code;The pitch of Jiangnan ditty includes three octaves altogether, is small character group, one group of small character and two groups of small character respectively, with the sound of small character group c Height is set as 0, and the encoded radio of lingering sound as resolution ratio incremented by successively 1 or successively decreases 1 using a semitone;Note intensity includes strong beat and weak It claps, the dynamics for setting strong beat is 127, and the dynamics of weak beat is 100, and the dynamics of rest is 0.
(4) setting of fitness function: the generation of fitness function is based primarily upon the composition knowledge base of Jiangnan ditty It proposes.The judge of fitness function in two steps, first iteration each trifle when only calculate the fitness letter of each trifle Number, fitness function and judge since the trifle second from the bottom of melody will have special end to revolve method, for the trifle The function of other trifles slightly has difference;After all 12 trifles all generate, the fitness function of entire melody is calculated.It is relevant Fitness function function calculates as follows:
1) fitness function
(formula 1)
Wherein i indicates i-th of trifle, and j indicates that j-th of note in i-th of trifle, N indicate the number of note in trifle, M indicates the melodic interval number of interval amount >=48 in the trifle.
The musical features judged in fitness function have the pitch of note, duration, interval relation, 3 sounds characteristic rotation method, The characteristic rotation method and characteristic rhythm of 4 sounds.
2) fitness function of trifle second from the bottom
(formula 5),
Fitness function increases the requirement to rotation method is terminated, it is desirable that the interval of the trifle most latter two sound and mode keynote Interval is less than 5;
3) fitness function of melody:
The fitness function of entire melody increases the judge of the interval relation between trifle;
(5) setting of genetic operator: genetic operator includes selection, intersects and make a variation.Selection operator uses algorithm of tournament selection Algorithm;The algorithm of crossover operator is that a length of one melody section clapped is intersected when being directed in trifle, crossover probability 0.6;Variation Operator includes interval variation, and note division and note merge three kinds, mutation probability 0.3.
(6) generate music rhythm based on genetic algorithm: genetic iteration is carried out according to trifle, is selected initial population Then the operation selected, intersect and made a variation is judged newly-generated trifle with fitness function, fitness function score is set Trifle next round iteration less than 4 points is given up, and the Jiangnan ditty melody of 12 trifles is ultimately generated, using the adaptation of entire melody Degree function is judged, and the melody of highest scoring is considered as to the melody of generation.
(7) Jiangnan ditty area of computer aided compositing system is completed according to above scheme, first to Jiangnan ditty material database Carrying out the extraction and calculating of characteristic parameter, feature mainly includes pitch, duration, interval, characteristic rotation method and characteristic rhythm, and by This generates the composition knowledge base of Jiangnan ditty.Secondly according to knowledge base, the coding rule of genetic algorithm is set, heredity Operator and fitness function.Then the demand according to user to melody is generated, calls corresponding melody, and generate from material database Initial population.Finally pass through genetic algorithm successive ignition, generates the melody of the Jiangnan ditty of 12 trifles.
Utilize the method in the present embodiment, it is assumed that user wish to generate G requisition, in Jiangnan ditty melody at a slow speed, pass through Computer calculates, and the melody of generation is as shown in Figure 3.
The experimental results showed that the fitness function of setting genetic algorithm is removed based on Jiangnan ditty knowledge base, it can be compared with Good guarantee generates the characteristics of melody meets Jiangnan ditty, such as the melody of generation is five-tone scale, major second and minor third Based on melody is grading, four kinds of scale formula, circulating type, fixed-point type and winding type characteristic rotation methods are contained, are formed with regular rhythm Based on melody.
The present invention mixes two kinds of algorithms of genetic algorithm and knowledge base, first according to the musical features of Jiangnan ditty and Melody characteristics are extracted tone color, pitch, interval, characteristic rotation method and characteristic using the method for calculation of characteristic parameters and statistical analysis The features such as rhythm summarize the composition knowledge base of Jiangnan ditty, and thus establish the fitness function of genetic algorithm, compile Code rule and genetic operator, greatly improve the accuracy of fitness function, the preferable melody for generating Jiangnan ditty.
The present invention defines coding rule, genetic operator and fitness function by knowledge base, utilizes fitness letter The knowledge base of Jiangnan ditty is used to establish by number judge mechanism to realize the automatic music composing function of Jiangnan ditty computer Fitness function in genetic algorithm both can also substantially increase fitness letter to avoid the complexity of interactive genetic algorithm Several accuracy, to improve the accuracy of entire area of computer aided compositing system.
The preferred embodiment of the patent is described in detail above, but this patent is not limited to above-mentioned embodiment party Formula within the knowledge of one of ordinary skill in the art can also be under the premise of not departing from this patent objective Various changes can be made.

Claims (5)

1. a kind of method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm, which is characterized in that specific step is as follows:
(1) it establishes Jiangnan ditty SoundBreeze Clubtunes library: establishing 94 first Jiangnan ditty SoundBreeze Clubtunes libraries, be used for characteristic parameter extraction;
(2) it establishes Jiangnan ditty composition knowledge base: extracting acoustic feature and melody characteristics, establish knowledge base, be used for The formulation of genetic algorithm key technology;
(3) it formulates the key rule of genetic algorithm: carrying out the system of calculation of characteristic parameters and melody characteristics to Jiangnan ditty material database Meter analysis, coding rule, genetic operator and the fitness function of genetic algorithm are formulated according to the feature of extraction;
(4) it extracts the initial population of genetic algorithm: according to the mode and speed of user's selection, selecting corresponding rotation from material database Rule, and extract initial population of the first trifle of melody as genetic algorithm;
(5) it generates Jiangnan ditty melody: by calculating fitness function, starting the genetic computation for being selected, being intersected and being made a variation, Condition by successive ignition until reaching termination, then the genetic computation of next trifle is carried out, ultimately generate the Jiangnan of 12 trifles The melody of ditty.
2. the method for the Jiangnan ditty area of computer aided composition according to claim 1 based on hybrid algorithm, feature exist That G requisition, A plumage reconcile the C mode of ancient Chinese music respectively in, the mode in the step (4), speed be respectively at a slow speed and in quickly.
3. the method for the Jiangnan ditty area of computer aided composition according to claim 1 based on hybrid algorithm, feature exist In, established in the step (2) Jiangnan ditty composition knowledge base when, respectively extract Jiangnan ditty acoustical characteristic parameters and Melody characteristics parameter extracts the method that acoustical characteristic parameters use time-frequency to calculate, and extracts and tone color, pitch tunefulness relevant 11 A characteristic parameter, used Fourier transform length is 8192 sampled points when calculating frequency spectrum, frequency resolution 5.38Hz, 75% overlapping, obtained frequency spectrum are linear amplitude spectrum, and signal waveform envelope, institute are calculated using the method for TrueEnvelope Having acoustical characteristic parameters is frame average value, and window is 0.05s when frame, and half is overlapped;The side that melody characteristics parameter passes through statistical analysis Method obtains, melody characteristics parameter totally 7, general including special melody traveling, rhythm and interval, the statistics of melody characteristics parameter Rate calculation formula is as follows:
4. the method for the Jiangnan ditty area of computer aided composition according to claim 1 based on hybrid algorithm, feature exist In the fitness function in the step (3) is carried out in two steps, and is judged first each trifle of generation, then to whole A melody carries out the judge of fitness function, and the fitness function of trifle is as follows:
Wherein i indicates i-th of trifle, and j indicates that j-th of note in i-th of trifle, N indicate the number of note in trifle, m table Show the melodic interval number of interval amount >=48 in the trifle;Pitch: for detecting each note occurred;Duration: it uses In the duration for detecting each note appearance;Interval1: the assessment of melodic interval in trifle is indicated;Interval2: it indicates small The judge of internode melodic interval;The evaluation function for the characteristic interval vector that Melody3: three sounds are constituted;Melody4: four sounds The evaluation function of the characteristic interval vector of composition;Rhythm: the evaluation function of characteristic rhythm;
The fitness function of entire melody is as follows:
5. the method for the Jiangnan ditty area of computer aided composition according to claim 1 based on hybrid algorithm, feature exist In when generating the melody of Jiangnan ditty using genetic algorithm in the step (5), initial population is 10, using trifle as iteration Unit, setting trifle next round iteration of the fitness function score less than 4 points are given up, and the Jiangnan ditty rotation of 12 trifles is generated Rule, is judged using the fitness function of entire melody, the melody of highest scoring is considered as to the melody of generation.
CN201510604881.2A 2015-09-22 2015-09-22 A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm Expired - Fee Related CN105374347B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510604881.2A CN105374347B (en) 2015-09-22 2015-09-22 A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510604881.2A CN105374347B (en) 2015-09-22 2015-09-22 A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm

Publications (2)

Publication Number Publication Date
CN105374347A CN105374347A (en) 2016-03-02
CN105374347B true CN105374347B (en) 2019-07-23

Family

ID=55376479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510604881.2A Expired - Fee Related CN105374347B (en) 2015-09-22 2015-09-22 A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm

Country Status (1)

Country Link
CN (1) CN105374347B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107045867B (en) * 2017-03-22 2020-06-02 科大讯飞股份有限公司 Automatic composition method and device and terminal equipment
CN109326270A (en) * 2018-09-18 2019-02-12 平安科技(深圳)有限公司 Generation method, terminal device and the medium of audio file
CN109215626A (en) * 2018-10-26 2019-01-15 广东电网有限责任公司 A method of it wrirtes music from action word
CN109903744B (en) * 2019-01-28 2022-03-11 平安科技(深圳)有限公司 Melody generation method, melody generation device, computer-readable storage medium, and computer apparatus
CN110517655B (en) * 2019-08-28 2023-03-14 广州艾颂智能科技有限公司 Melody generation method and system
CN111613198B (en) * 2020-05-12 2023-09-08 浙江大学 Rhythm type identification method and application of MIDI
CN115721830A (en) * 2021-08-25 2023-03-03 安徽华米健康科技有限公司 Method and device for generating sleep-aid music, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0722163A2 (en) * 1990-11-20 1996-07-17 Yamaha Corporation Electronic musical apparatus
US6362409B1 (en) * 1998-12-02 2002-03-26 Imms, Inc. Customizable software-based digital wavetable synthesizer
CN101727892A (en) * 2009-12-03 2010-06-09 北京中星微电子有限公司 Method and device for generating reverberation model
CN102063292A (en) * 2009-11-18 2011-05-18 华为技术有限公司 Harmony compiling method and device
CN103631758A (en) * 2013-11-21 2014-03-12 陕西理工学院 Method for solving non-linear programming and absolute value equation through improved harmony search algorithm

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0722163A2 (en) * 1990-11-20 1996-07-17 Yamaha Corporation Electronic musical apparatus
US6362409B1 (en) * 1998-12-02 2002-03-26 Imms, Inc. Customizable software-based digital wavetable synthesizer
CN102063292A (en) * 2009-11-18 2011-05-18 华为技术有限公司 Harmony compiling method and device
CN101727892A (en) * 2009-12-03 2010-06-09 北京中星微电子有限公司 Method and device for generating reverberation model
CN103631758A (en) * 2013-11-21 2014-03-12 陕西理工学院 Method for solving non-linear programming and absolute value equation through improved harmony search algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Design of Adaptive Fuzzy Logic Controller Based on Linguistic-Hedge Concepts and Genetic Algorithms;Bin-Da Liu et al;《IEEE TRANSACTIONS ON SYSTEMS》;20010228;全文

Also Published As

Publication number Publication date
CN105374347A (en) 2016-03-02

Similar Documents

Publication Publication Date Title
CN105374347B (en) A method of the Jiangnan ditty area of computer aided composition based on hybrid algorithm
CN106652984B (en) Method for automatically composing songs by using computer
Krumhansl et al. Melodic expectation in Finnish spiritual folk hymns: Convergence of statistical, behavioral, and computational approaches
CN103823867B (en) Humming type music retrieval method and system based on note modeling
US7250567B2 (en) Automatic musical composition classification device and method
Kirke et al. A survey of computer systems for expressive music performance
Barbancho et al. Automatic transcription of guitar chords and fingering from audio
CN111583891B (en) Automatic musical note vector composing system and method based on context information
CN104395953A (en) Evaluation of beats, chords and downbeats from a musical audio signal
CN103456295B (en) Sing synthetic middle base frequency parameters and generate method and system
CN110120212A (en) Piano auxiliary compositing system and method based on user&#39;s demonstration audio genre
CN113763913B (en) Music score generating method, electronic equipment and readable storage medium
Gupta et al. Automatic leaderboard: Evaluation of singing quality without a standard reference
Mazurowski Computer models for algorithmic music composition
Hoover et al. Generating musical accompaniment through functional scaffolding
Nikolaidis et al. Playing with the masters: A model for improvisatory musical interaction between robots and humans
Marsden Automatic Derivation of Musical Structure: A Tool for Research on Schenkerian Analysis.
CN104766602A (en) Fundamental synthesis parameter generation method and system in singing synthesis system
CN101710367A (en) Computer composing method based on Schoenberg twelve-tone system
CN113096624A (en) Method, device, equipment and storage medium for automatically creating symphony music
Liang et al. Research on generating xi'an drum music based on generative adversarial network
CN101692974B (en) Music ability testing system for electronic cochlea implant persons
CN104464702A (en) Chord accompany generation method based on genetic algorithm
CN110211553A (en) A kind of music generating method based on change neighborhood search and masking effect
Hastuti et al. Gamelan composer: a rule-based interactive melody generator for Gamelan music

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190723

Termination date: 20210922