CN110516103A - Song rhythm generation method, equipment, storage medium and device based on classifier - Google Patents
Song rhythm generation method, equipment, storage medium and device based on classifier Download PDFInfo
- Publication number
- CN110516103A CN110516103A CN201910720248.8A CN201910720248A CN110516103A CN 110516103 A CN110516103 A CN 110516103A CN 201910720248 A CN201910720248 A CN 201910720248A CN 110516103 A CN110516103 A CN 110516103A
- Authority
- CN
- China
- Prior art keywords
- lyrics
- rhythm
- classifier
- song rhythm
- song
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/60—Information retrieval; Database structures therefor; File system structures therefor of audio data
- G06F16/63—Querying
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/60—Information retrieval; Database structures therefor; File system structures therefor of audio data
- G06F16/65—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/60—Information retrieval; Database structures therefor; File system structures therefor of audio data
- G06F16/68—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/683—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
- G06F16/685—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using automatically derived transcript of audio data, e.g. lyrics
Abstract
The invention discloses a kind of song rhythm generation method, equipment, storage medium and device based on classifier extracts the first sentence lyrics this method comprises: obtaining lyrics text to be processed from lyrics text to be processed;The selection target line corresponding with the first sentence lyrics from the statistical matrix that default song rhythm generates model;The initial position played according to target line according to the determining first literal of preset rules;Lyrics characteristic information is extracted from lyrics text to be processed;Model is generated by default song rhythm according to lyrics characteristic information and carries out note prediction, obtains the corresponding target note duration of each lyrics in lyrics text to be processed;Song rhythm corresponding with lyrics text to be processed is generated according to initial position and target note duration.Based on artificial intelligence, model adaptation is generated by default song rhythm according to the lyrics and generates reasonable music rhythm, not by the constraint of lyrics length and bout length, there is good adaptability.
Description
Technical field
The present invention relates to the technical field of artificial intelligence more particularly to a kind of song rhythm generation sides based on classifier
Method, equipment, storage medium and device.
Background technique
Rhythm is one of important component of music, and quality directly influences the expressive force of music, the type of rhythm
It is various, and have being associated with for highly significant with music style.Compared with absolute music, song is with its public polynary characteristic certainly
Acting in bent field has the meaning different from absolute music, not only needs to consider the good of its melody during song creation
It is bad, while to consider the combination of melody and the lyrics, presently existing automatic composition technology is concentrated mainly on melody generation
Part, it is in contrast more insufficient for the research of the part of rhythm generation, low efficiency, of poor quality, rhythm and song are created automatically
Word combines bad.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill
Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of song rhythm generation method, equipment, storage Jie based on classifier
Matter and device, it is intended to solve the bad technical problem of the quality of automatic creation of song in the prior art.
To achieve the above object, the present invention provides a kind of song rhythm generation method based on classifier, described to be based on dividing
The song rhythm generation method of class device the following steps are included:
Lyrics text to be processed is obtained, extracts the first sentence lyrics from the lyrics text to be processed;
The selection target line corresponding with the first sentence lyrics from the statistical matrix that default song rhythm generates model;
The initial position played according to the target line according to the determining first literal of preset rules;
Lyrics characteristic information is extracted from the lyrics text to be processed;
Model is generated by the default song rhythm according to the lyrics characteristic information and carries out note prediction, described in acquisition
The corresponding target note duration of each lyrics in lyrics text to be processed;
Song corresponding with the lyrics text to be processed is generated according to the initial position and the target note duration
Rhythm.
Preferably, the initial position played according to the target line according to the determining first literal of preset rules, comprising:
Obtain the probability of each element in the target line;
It is random to generate a control parameter, the control parameter is matched with each probability respectively;
Using the corresponding element of the probability of successful match as object element;
Obtain the initial position that the rhythm position of the object element is played as first literal.
Preferably, the selection from the statistical matrix that default song rhythm generates model is corresponding with the first sentence lyrics
Target line, comprising:
The first number of words of the first sentence lyrics is obtained, and obtains default song rhythm and generates each row in the statistical matrix of model
Corresponding second number of words;
First number of words is matched with each second number of words respectively;
The corresponding row of the second number of words that successful match is selected from the statistical matrix that default song rhythm generates model, as
Target line corresponding with the first sentence lyrics.
Preferably, described to obtain lyrics text to be processed, before extracting the first sentence lyrics in the lyrics text to be processed,
The song rhythm generation method based on classifier further include:
Obtain training sample set;
Random Forest model is trained according to each music samples in the training sample set, obtains default song
Rhythm generates model.
Preferably, each music samples according in the training sample set are trained Random Forest model,
It obtains default song rhythm and generates model, comprising:
Each music samples in the training sample set are pre-processed, pretreatment music samples are obtained;
Characteristic statistics are carried out to the pretreatment music samples, obtain the corresponding different type of the pretreatment music samples
Characteristic information;
The conversion of floating number form is carried out to the characteristic information, obtains the converting characteristic information of floating number form;
Random Forest model is trained according to the converting characteristic information, default song rhythm is obtained and generates model.
Preferably, each music samples in the training sample set pre-process, and obtain pretreatment music
Sample, comprising:
Obtain the lyrics quantity of each music samples in the training sample set;
The melody part of each music samples is extracted, and counts the note quantity of each melody part;
Judge whether the lyrics quantity is equal to the note quantity;
If the lyrics are in varying numbers to traverse all rhythm notes in the melody part in the note quantity,
Search the rhythm note without lyrics information;
The rhythm note without lyrics information found is incorporated on the previous rhythm note for having lyrics information,
Obtain pretreatment music samples.
Preferably, described that Random Forest model is trained according to the converting characteristic information, obtain default song section
Play generation model, comprising:
Sentence characteristics information is extracted from the converting characteristic information;
According to the starting position of the sentence of the sentence characteristics Information Statistics difference number of words, and the starting position is recorded
For statistical matrix;
Believe the information in the converting characteristic information other than the sentence characteristics information as sample lyrics feature
Breath;
Random Forest model is trained according to the sample lyrics characteristic information and the statistical matrix, is preset
Song rhythm generates model.
In addition, to achieve the above object, the present invention also proposes a kind of song rhythm generating device based on classifier, described
Song rhythm generating device based on classifier includes memory, processor and is stored on the memory and can be at the place
The song rhythm based on classifier run on reason device generates program, and the song rhythm based on classifier generates program configuration
For the step of realizing the song rhythm generation method based on classifier as described above.
In addition, to achieve the above object, the present invention also proposes a kind of storage medium, it is stored with and is based on the storage medium
The song rhythm of classifier generates program, and the song rhythm based on classifier is generated when program is executed by processor and realized such as
The step of song rhythm generation method based on classifier described above.
In addition, to achieve the above object, the present invention also proposes a kind of song rhythm generating means based on classifier, described
Song rhythm generating means based on classifier include:
Extraction module extracts the first sentence lyrics from the lyrics text to be processed for obtaining lyrics text to be processed;
Selecting module, it is corresponding with the first sentence lyrics for being selected from the statistical matrix that default song rhythm generates model
Target line;
Determining module, the initial position for being played according to the target line according to the determining first literal of preset rules;
The extraction module is also used to extract lyrics characteristic information from the lyrics text to be processed;
Note prediction module is carried out for generating model by the default song rhythm according to the lyrics characteristic information
Note prediction, obtains the corresponding target note duration of each lyrics in the lyrics text to be processed;
Generation module, for being generated and the lyrics text to be processed according to the initial position and the target note duration
This corresponding song rhythm.
In the present invention, by acquisition lyrics text to be processed, the first sentence lyrics are extracted from the lyrics text to be processed, from
Default song rhythm generates in the statistical matrix of model selection target line corresponding with the first sentence lyrics, according to the target line
The initial position that first literal is played is determined according to preset rules, is based on artificial intelligence, is generated according to the lyrics by default song rhythm
Model adaptation determines the initial position that first literal is played, and not by the constraint of lyrics length and bout length, has good suitable
Ying Xing;Lyrics characteristic information is extracted from the lyrics text to be processed, is passed through according to the lyrics characteristic information described default
Song rhythm generates model and carries out note prediction, when obtaining the corresponding target note of each lyrics in the lyrics text to be processed
Value generates song rhythm corresponding with the lyrics text to be processed according to the initial position and the target note duration,
Model adaptation is generated by default song rhythm according to the lyrics and generates reasonable music rhythm, is applicable to different-style music
The generation of rhythm has good scalability.
Detailed description of the invention
Fig. 1 is the song rhythm generating device based on classifier for the hardware running environment that the embodiment of the present invention is related to
Structural schematic diagram;
Fig. 2 is that the present invention is based on the flow diagrams of the song rhythm generation method first embodiment of classifier;
Fig. 3 is that the present invention is based on the flow diagrams of the song rhythm generation method second embodiment of classifier;
Fig. 4 is that the present invention is based on the flow diagrams of the song rhythm generation method 3rd embodiment of classifier;
Fig. 5 is that the present invention is based on the structural block diagrams of the song rhythm generating means first embodiment of classifier.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the song rhythm based on classifier for the hardware running environment that the embodiment of the present invention is related to
Generating device structural schematic diagram.
As shown in Figure 1, being somebody's turn to do the song rhythm generating device based on classifier may include: processor 1001, such as center
Processor (Central Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004 are deposited
Reservoir 1005.Wherein, communication bus 1002 is for realizing the connection communication between these components.User interface 1003 may include
Display screen (Display), optional user interface 1003 can also include standard wireline interface and wireless interface, and user is connect
The wireline interface of mouth 1003 can be USB interface in the present invention.Network interface 1004 optionally may include that the wired of standard connects
Mouth, wireless interface (such as Wireless Fidelity (WIreless-FIdelity, WI-FI) interface).Memory 1005 can be high speed with
Machine accesses memory (Random Access Memory, RAM) memory, is also possible to stable memory (Non-
Volatile Memory, NVM), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor
1001 storage device.
It will be understood by those skilled in the art that structure shown in Fig. 1 is not constituted to the song rhythm based on classifier
The restriction of generating device may include perhaps combining certain components or different components than illustrating more or fewer components
Arrangement.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium
Believe that module, Subscriber Interface Module SIM and the song rhythm based on classifier generate program.
In song rhythm generating device based on classifier shown in Fig. 1, after network interface 1004 is mainly used for connection
Platform server carries out data communication with the background server;User interface 1003 is mainly used for connecting user equipment;The base
The song based on classifier stored in memory 1005 is called by processor 1001 in the song rhythm generating device of classifier
Bent rhythm generates program, and executes the song rhythm generation method provided in an embodiment of the present invention based on classifier.
Based on above-mentioned hardware configuration, propose that the present invention is based on the embodiments of the song rhythm generation method of classifier.
It is that the present invention is based on the signals of the process of the song rhythm generation method first embodiment of classifier referring to Fig. 2, Fig. 2
Figure proposes that the present invention is based on the song rhythm generation method first embodiments of classifier.
In the first embodiment, the song rhythm generation method based on classifier the following steps are included:
Step S10: obtaining lyrics text to be processed, extracts the first sentence lyrics from the lyrics text to be processed.
It should be understood that the executing subject of the present embodiment is the song rhythm generating device based on classifier, wherein
The song rhythm generating device based on classifier can be the electronic equipments such as PC or server.The lyrics to be processed
Text is one section of given lyrics text W={ W1, W2 ..., Wc }, and wherein c indicates the sentence quantity in lyrics text.It can incite somebody to action
The lyrics text to be processed is split, and multiple sentences are split into, and is extracted sequentially in time from multiple sentences of fractionation
The first sentence lyrics.Note stream S can be obtained, for storing the rhythm sequences generated by initializing note stream;It can be by initial
Change time parameter, time parameter d is obtained, for the time in synchronous recording note stream.
Step S20: the selection mesh corresponding with the first sentence lyrics from the statistical matrix that default song rhythm generates model
Mark row.
It will be appreciated that the sentence number of words d of the statistics first sentence lyrics, the default song rhythm generate the statistics of model
Each behavior row corresponding from different number of words lyrics sentences in matrix, according to the number of words d of the sentence lyrics from the song
Specified row H [d], i.e., mesh corresponding with the sentence number of words of the first sentence lyrics are selected in the statistical matrix H of rhythm generation model
Mark row.
Step S30: the initial position played according to the target line according to the determining first literal of preset rules.
It should be noted that determining the starting position that first literal is played according to the target line H [d], the preset rules can
To be randomly generated a control parameter r, determine that first literal plays the position of beginning according to probability interval locating for the control parameter r
It sets.Specifically: the control parameter r is matched with the probability of each element in the target line, by the probability of successful match
The initial position that corresponding rhythm position is played as the first literal, that is, update the value of the time parameter d.
Step S40: lyrics characteristic information is extracted from the lyrics text to be processed.
It should be understood that the lyrics characteristic information includes location information, cadence information and the statistical information of the lyrics, it is described
The location information of the lyrics include the lyrics be in current sentence which word, whether in the first trifle, whether be head in sentence
Word and whether be tail word in sentence, the cadence information of the lyrics includes time signature, and the statistical information of the lyrics includes current
Eight partials in sentence before tritone quantity, current location in sentence before semiquaver quantity, current location in sentence before position
Accord with quantity, four points of dotted note quantity, current locations in sentence before crotchet quantity, current location in sentence before current location
Prolong before eight points of dotted note quantity, current locations in sentence before minim quantity and current location in sentence for four points in preceding sentence
Other note quantity.
Step S50: generating model by the default song rhythm according to the lyrics characteristic information and carry out note prediction,
Obtain the corresponding target note duration of each lyrics in the lyrics text to be processed.
In the concrete realization, a large amount of music samples are obtained, the lyrics characteristic information of the music samples are extracted, by big
The lyrics characteristic information of amount music samples is trained Random Forest model, obtains default song rhythm and generates model.
The lyrics characteristic information input default song rhythm so as to extract from the lyrics text to be processed generates
Model, automatic Prediction go out the corresponding target note duration of each lyrics in the lyrics text to be processed.
Step S60: it is generated and the lyrics text pair to be processed according to the initial position and the target note duration
The song rhythm answered.
It will be appreciated that the target note duration of generation is added in the note stream S, and when updating described
Between parameter value d, judge whether the lyrics in the lyrics text to be processed all export corresponding target note duration, if do not had
Have and proceed to the last one lyrics, execute step S40, until all lyrics in the lyrics text to be processed have it is corresponding
Target note duration, when all lyrics in the lyrics text to be processed all generate corresponding target note duration, according to
The target note duration of each lyrics is added in the note stream by the initial position, and updates the time parameter d, is obtained
Song rhythm corresponding with the lyrics text to be processed.
In the present embodiment, by acquisition lyrics text to be processed, the first sentence lyrics are extracted from the lyrics text to be processed,
The selection target line corresponding with the first sentence lyrics from the statistical matrix that default song rhythm generates model, according to the target
Row determines the initial position that first literal is played according to preset rules, is based on artificial intelligence, raw by default song rhythm according to the lyrics
The initial position that first literal is played is determined at model adaptation, not by the constraint of lyrics length and bout length, is had good
Adaptability;Lyrics characteristic information is extracted from the lyrics text to be processed, is passed through according to the lyrics characteristic information described pre-
If song rhythm generates model and carries out note prediction, the corresponding target note of each lyrics in the lyrics text to be processed is obtained
Duration generates song section corresponding with the lyrics text to be processed according to the initial position and the target note duration
It plays, model adaptation is generated by default song rhythm according to the lyrics and generates reasonable music rhythm, is applicable to different-style
The generation of music rhythm has good scalability.
It is that the present invention is based on the signals of the process of the song rhythm generation method second embodiment of classifier referring to Fig. 3, Fig. 3
Figure is based on above-mentioned first embodiment shown in Fig. 2, and it is real to propose that the present invention is based on the second of the song rhythm generation method of classifier
Apply example.
In a second embodiment, the step S30, comprising:
Step S301: the probability of each element in the target line is obtained.
It should be understood that the characteristics of utilizing multiple one strong classifier of Weak Classifier decision making in Random Forest model,
Model is generated to generate a reliable rhythm by the specific different decision-tree model of feature construction in analysis music, i.e.,
The default song rhythm generates model.The training stage of model is generated in the default song rhythm, by the sentence of music samples
Subcharacter information is counted, and is obtained and is recorded the statistical matrix that sentence starting position under number of words type and different numbers of words occurs in first sentence
H, then line by line in randomization statistical matrix H every a line all parameters.Then model can be generated from the default song rhythm
Statistical matrix H in obtain the probability of each element in the target line.
Step S302: it is random to generate a control parameter, the control parameter is matched with each probability respectively.
It will be appreciated that the value range of the probability of each element in the target line is obtained first, in the value range
Interior random the control parameter r, the control parameter r that generate is a random chance, by the control parameter r and the target line
The probability of middle each element is matched respectively, corresponding Probability Region can be arranged in the probability of each element in the target line in advance
Between, the control parameter r is compared with each probability interval respectively, to realize matching.
Step S303: using the corresponding element of the probability of successful match as object element.
It should be noted that corresponding probability interval is arranged in the probability of each element in the target line in advance, it will be described
Control parameter r is compared with each probability interval respectively, if the control parameter r is in a certain probability interval, assert described in
Control parameter probability match success corresponding with the probability interval then obtains described in the corresponding element conduct of probability of successful match
Object element.
Step S304: the initial position that the rhythm position of the object element is played as first literal is obtained.
In the concrete realization, the training stage of model is generated in the default song rhythm, the sentence of music samples is special
Reference breath is counted, and is obtained and is recorded the statistical matrix H that sentence starting position under number of words type and different numbers of words occurs in first sentence, from
The rhythm position of the object element is obtained in the target line of the statistical matrix H, and is risen as what first literal was played
Beginning position, the i.e. value of renewal time parameter d.
In the present embodiment, the step S20, comprising:
The first number of words of the first sentence lyrics is obtained, and obtains default song rhythm and generates each row in the statistical matrix of model
Corresponding second number of words;
First number of words is matched with each second number of words respectively;
The corresponding row of the second number of words that successful match is selected from the statistical matrix that default song rhythm generates model, as
Target line corresponding with the first sentence lyrics.
It should be understood that the default song rhythm generates each behavior and different number of words lyrics sentences in the statistical matrix of model
The corresponding row of son counts and obtains the first number of words of the first sentence lyrics, and obtains default song rhythm and generate model
Corresponding second number of words of each row in statistical matrix, by the way that first number of words is compared with each second number of words respectively,
If the two number of words is consistent, successful match is assert.
It will be appreciated that selecting the second number of words pair of successful match from the statistical matrix that default song rhythm generates model
The row answered obtains the corresponding specified row H [d] of the first number of words d of the first sentence lyrics, as with the first sentence lyrics
Corresponding target line.
It is random to generate a control parameter by obtaining the probability of each element in the target line in the present embodiment, it will be described
Control parameter is matched with each probability respectively, using the corresponding element of the probability of successful match as object element, is obtained
The initial position that the rhythm position of the object element is played as first literal determines first literal based on the control parameter generated at random
The initial position played, so that the song rhythm generated is not single, it is more various, there is good adaptability.
It is that the present invention is based on the signals of the process of the song rhythm generation method 3rd embodiment of classifier referring to Fig. 4, Fig. 4
Figure is based on above-mentioned second embodiment shown in Fig. 3, proposes that the present invention is based on the third of the song rhythm generation method of classifier realities
Apply example.
In the third embodiment, before the step S10, further includes:
Step S01: training sample set is obtained.
It should be understood that including a large amount of music samples in the training sample set, by special in analysis music samples
The different decision-tree model of fixed feature construction generates model to generate a reliable song rhythm.The training sample set
Conjunction T=T1, T2 ... and Ti..., TN } it is musical instrument digital interface (the Musical Instrument with lyrics information
Digital Interface, abbreviation MIDI) file content, N is the integer more than or equal to 1, is indicated in the training sample set
Music samples quantity.
Step S02: being trained Random Forest model according to each music samples in the training sample set, obtains
Default song rhythm generates model.
It will be appreciated that i is more than or equal to 1 and less than or equal to N's for any one music samples Ti therein
Integer, U={ u1, u2 ..., ua } indicate music samples in lyrics information, a indicate the lyrics quantity, V=v1, v2 ...,
Vb } indicate music samples in melody part cadence information, b indicate melody part in note quantity.To the training
Each music samples carry out signature analysis in sample set, count the different types of characteristic information of each music samples, the spy
Reference breath includes sentence information, location information, cadence information and statistical information.According to the different types of feature of each music samples
Information is trained Random Forest model, obtains default song rhythm and generates model.
In the present embodiment, the step S02, comprising:
Each music samples in the training sample set are pre-processed, pretreatment music samples are obtained;
Characteristic statistics are carried out to the pretreatment music samples, obtain the corresponding different type of the pretreatment music samples
Characteristic information;
The conversion of floating number form is carried out to the characteristic information, obtains the converting characteristic information of floating number form;
Random Forest model is trained according to the converting characteristic information, default song rhythm is obtained and generates model.
It should be noted that in the training process, need to be carried out to each of training sample set music samples
Pretreatment, specifically: need to guarantee the training sample set in the process that the default song rhythm generates model constructing
Each note can correspond to a lyrics in the melody part of music samples in conjunction, therefore firstly the need of detection music samples
Whether the quantity b of note equal in the quantity a and melody part of the lyrics in the middle, if in music samples the lyrics quantity a
It is equal with the quantity b of note in melody part, then characteristic information statistics is carried out each described music samples, otherwise, time
All notes in the cadence information V of melody part in music samples are gone through, the rhythm note without lyrics information is searched, and
By without the rhythm note of lyrics information be merged into it is previous have on the corresponding rhythm of the lyrics, then execute described in each
Music samples carry out the step of characteristic information statistics.In the present embodiment, each music in the training sample set
Sample is pre-processed, and obtains pretreatment music samples, comprising: obtain the song of each music samples in the training sample set
Word quantity;The melody part of each music samples is extracted, and counts the note quantity of each melody part;Judge the song
Whether word quantity is equal to the note quantity;If the lyrics are in varying numbers in the note quantity, the melody sound is traversed
All rhythm notes in portion search the rhythm note without lyrics information;The sound without lyrics information that will be found
Tally used in ancient times as credentials or a warrant, which is played, to be incorporated on the previous rhythm note for having lyrics information, and pretreatment music samples are obtained.
In the concrete realization, it unites according to the feature of characteristic information as shown in Table 1 below to each music samples
Meter, obtains different types of feature situation.
Table 1
It should be understood that due to requiring feature all to input with the type of floating number in decision-tree model, for upper
The form that the characteristic information stated needs to be translated into floating number can apply it in model, to the characteristic information
The conversion of floating number form is carried out, judgement whether in features described above is all indicated with the form of floating number, for sample time signature
It is recorded in the form of A*10+B, wherein forThe mark pattern of time signature in music, so that the conversion for obtaining floating number form is special
Reference breath.
It will be appreciated that carrying out following two-part operation after obtaining the converting characteristic information of all music samples:
First part's operation is statistics sentence characteristics information, the sentence characteristics packet from the converting characteristic information
Include whether headed by sentence, the number of words in sentence and first sentence starting position, obtain recording first sentence occur number of words type vector O=o1,
O2 ..., on_h }, and under different number of words sentence starting position statistical matrix H (n_h, n_w), wherein n_h indicates music sample
The categorical measure of the first sentence of different numbers of words in this, n_w indicate that beat locations different in music samples, H [i, j] indicate all music
Number of words is O [i] and claps the quantity of the sentence started in jth in sample, then every a line in randomization matrix H line by line
All parameters, to obtain the statistical matrix.
Second part operation is using remaining feature in addition to sentence characteristics as sample lyrics characteristic information, the sample song
Word characteristic information includes location information, cadence information and statistical information.By the sample lyrics characteristic information be used for it is described with
Machine forest model is trained, and note duration corresponding to the current lyrics is used for the foundation of decision tree building.In training process
In, several music samples are randomly choosed from all music samples for constructing different decision trees as primary generates building
Process repeats the process until constructing the final song rhythm generates model.It is described to turn according in the present embodiment
It changes characteristic information to be trained Random Forest model, obtains default song rhythm and generate model, comprising: from the converting characteristic
Sentence characteristics information is extracted in information;According to the starting position of the sentence of the sentence characteristics Information Statistics difference number of words, and will
The starting position is recorded as statistical matrix;By the information in the converting characteristic information other than the sentence characteristics information
As sample lyrics characteristic information;Random Forest model is carried out according to the sample lyrics characteristic information and the statistical matrix
Training obtains default song rhythm and generates model.
In the present embodiment, by obtaining training sample set, according to each music samples pair in the training sample set
Random Forest model is trained, and is obtained default song rhythm and is generated model, to pass through the default song section according to the lyrics
Generation model, the reasonable music rhythm of adaptive generation are played, and is not had good by the constraint of lyrics length and bout length
Good adaptability, can be used for the generation of different-style music rhythm, be realized by using the training sample set of specific style, tool
There is good scalability.
In addition, the embodiment of the present invention also proposes a kind of storage medium, it is stored on the storage medium based on classifier
Song rhythm generates program, and the song rhythm based on classifier is generated when program is executed by processor and realized as described above
The song rhythm generation method based on classifier the step of.
In addition, the embodiment of the present invention also proposes a kind of song rhythm generating means based on classifier, described referring to Fig. 5
Song rhythm generating means based on classifier include:
Extraction module 10 extracts the first sentence lyrics from the lyrics text to be processed for obtaining lyrics text to be processed.
It should be understood that the lyrics text to be processed is one section of given lyrics text W={ W1, W2 ..., Wc },
Middle c indicates the sentence quantity in lyrics text.The lyrics text to be processed can be split, split into multiple sentences,
Extract the first sentence lyrics sequentially in time from multiple sentences of fractionation.Note stream can be obtained by initializing note stream
S, for storing the rhythm sequences generated;Time parameter d can be obtained by initialization time parameter, be used for synchronous recording note
Time in stream.
Selecting module 20, for the selection from the statistical matrix that default song rhythm generates model and the first sentence lyrics pair
The target line answered.
It will be appreciated that the sentence number of words d of the statistics first sentence lyrics, the default song rhythm generate the statistics of model
Each behavior row corresponding from different number of words lyrics sentences in matrix, according to the number of words d of the sentence lyrics from the song
Specified row H [d], i.e., mesh corresponding with the sentence number of words of the first sentence lyrics are selected in the statistical matrix H of rhythm generation model
Mark row.
Determining module 30, the initial position for being played according to the target line according to the determining first literal of preset rules.
It should be noted that determining the starting position that first literal is played according to the target line H [d], the preset rules can
To be randomly generated a control parameter r, determine that first literal plays the position of beginning according to probability interval locating for the control parameter r
It sets.Specifically: the control parameter r is matched with the probability of each element in the target line, by the probability of successful match
The initial position that corresponding rhythm position is played as the first literal, that is, update the value of the time parameter d.
The extraction module 10 is also used to extract lyrics characteristic information from the lyrics text to be processed.
It should be understood that the lyrics characteristic information includes location information, cadence information and the statistical information of the lyrics, it is described
The location information of the lyrics include the lyrics be in current sentence which word, whether in the first trifle, whether be head in sentence
Word and whether be tail word in sentence, the cadence information of the lyrics includes time signature, and the statistical information of the lyrics includes current
Eight partials in sentence before tritone quantity, current location in sentence before semiquaver quantity, current location in sentence before position
Accord with quantity, four points of dotted note quantity, current locations in sentence before crotchet quantity, current location in sentence before current location
Prolong before eight points of dotted note quantity, current locations in sentence before minim quantity and current location in sentence for four points in preceding sentence
Other note quantity.
Note prediction module 40, for according to the lyrics characteristic information by the default song rhythm generation model into
The prediction of row note, obtains the corresponding target note duration of each lyrics in the lyrics text to be processed.
In the concrete realization, a large amount of music samples are obtained, the lyrics characteristic information of the music samples are extracted, by big
The lyrics characteristic information of amount music samples is trained Random Forest model, obtains default song rhythm and generates model.
The lyrics characteristic information input default song rhythm so as to extract from the lyrics text to be processed generates
Model, automatic Prediction go out the corresponding target note duration of each lyrics in the lyrics text to be processed.
Generation module 50, for being generated and the lyrics to be processed according to the initial position and the target note duration
The corresponding song rhythm of text.
It will be appreciated that the target note duration of generation is added in the note stream S, and when updating described
Between parameter value d, judge whether the lyrics in the lyrics text to be processed all export corresponding target note duration, if do not had
Have and proceed to the last one lyrics, execute step S40, until all lyrics in the lyrics text to be processed have it is corresponding
Target note duration, when all lyrics in the lyrics text to be processed all generate corresponding target note duration, according to
The target note duration of each lyrics is added in the note stream by the initial position, and updates the time parameter d, is obtained
Song rhythm corresponding with the lyrics text to be processed.
In the present embodiment, by acquisition lyrics text to be processed, the first sentence lyrics are extracted from the lyrics text to be processed,
The selection target line corresponding with the first sentence lyrics from the statistical matrix that default song rhythm generates model, according to the target
Row determines the initial position that first literal is played according to preset rules, is based on artificial intelligence, raw by default song rhythm according to the lyrics
The initial position that first literal is played is determined at model adaptation, not by the constraint of lyrics length and bout length, is had good
Adaptability;Lyrics characteristic information is extracted from the lyrics text to be processed, is passed through according to the lyrics characteristic information described pre-
If song rhythm generates model and carries out note prediction, the corresponding target note of each lyrics in the lyrics text to be processed is obtained
Duration generates song section corresponding with the lyrics text to be processed according to the initial position and the target note duration
It plays, model adaptation is generated by default song rhythm according to the lyrics and generates reasonable music rhythm, is applicable to different-style
The generation of music rhythm has good scalability.
In one embodiment, the song rhythm generating means based on classifier further include:
Module is obtained, for obtaining the probability of each element in the target line;
Matching module carries out the control parameter for generating a control parameter at random with each probability respectively
Match;
The determining module 30 is also used to using the corresponding element of the probability of successful match as object element;
The acquisition module is also used to obtain the initial position that the rhythm position of the object element is played as first literal.
In one embodiment, the acquisition module is also used to obtain the first number of words of the first sentence lyrics, and obtains default
Song rhythm generates corresponding second number of words of each row in the statistical matrix of model;
The matching module is also used to respectively match first number of words with each second number of words;
The selecting module 20 is also used to select successful match from the statistical matrix that default song rhythm generates model
The corresponding row of second number of words, as target line corresponding with the first sentence lyrics.
In one embodiment, the song rhythm generating means based on classifier further include:
The acquisition module, is also used to obtain training sample set;
Training module, for being instructed according to each music samples in the training sample set to Random Forest model
Practice, obtains default song rhythm and generate model.
In one embodiment, the training module is also used to carry out each music samples in the training sample set
Pretreatment obtains pretreatment music samples;Characteristic statistics are carried out to the pretreatment music samples, obtain the pretreatment music
The corresponding different types of characteristic information of sample;The conversion of floating number form is carried out to the characteristic information, obtains floating number form
Converting characteristic information;Random Forest model is trained according to the converting characteristic information, it is raw to obtain default song rhythm
At model.
In one embodiment, the training module is also used to obtain each music samples in the training sample set
Lyrics quantity;The melody part of each music samples is extracted, and counts the note quantity of each melody part;Described in judgement
Whether lyrics quantity is equal to the note quantity;If the lyrics are in varying numbers in the note quantity, the melody is traversed
All rhythm notes in part search the rhythm note without lyrics information;It will find without lyrics information
Rhythm note is incorporated on the previous rhythm note for having lyrics information, obtains pretreatment music samples.
In one embodiment, the training module is also used to extract sentence characteristics information from the converting characteristic information;
According to the starting position of the sentence of the sentence characteristics Information Statistics difference number of words, and the starting position is recorded as statistical moment
Battle array;Using the information in the converting characteristic information other than the sentence characteristics information as sample lyrics characteristic information;Root
Random Forest model is trained according to the sample lyrics characteristic information and the statistical matrix, it is raw to obtain default song rhythm
At model.
The other embodiments or specific implementation of song rhythm generating means of the present invention based on classifier can join
According to above-mentioned each method embodiment, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.If listing equipment for drying
Unit claim in, several in these devices, which can be, to be embodied by the same item of hardware.Word first,
Second and the use of third etc. do not indicate any sequence, can be mark by these word explanations.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
(such as read-only memory mirror image (Read Only Memory image, ROM)/random access memory (Random Access
Memory, RAM), magnetic disk, CD) in, including some instructions are used so that terminal device (can be mobile phone, computer,
Server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of song rhythm generation method based on classifier, which is characterized in that the song rhythm based on classifier is raw
At method the following steps are included:
Lyrics text to be processed is obtained, extracts the first sentence lyrics from the lyrics text to be processed;
The selection target line corresponding with the first sentence lyrics from the statistical matrix that default song rhythm generates model;
The initial position played according to the target line according to the determining first literal of preset rules;
Lyrics characteristic information is extracted from the lyrics text to be processed;
Model is generated by the default song rhythm according to the lyrics characteristic information and carries out note prediction, is obtained described wait locate
Manage the corresponding target note duration of each lyrics in lyrics text;
Song rhythm corresponding with the lyrics text to be processed is generated according to the initial position and the target note duration.
2. the song rhythm generation method based on classifier as described in claim 1, which is characterized in that described according to the mesh
Mark row determines the initial position that first literal is played according to preset rules, comprising:
Obtain the probability of each element in the target line;
It is random to generate a control parameter, the control parameter is matched with each probability respectively;
Using the corresponding element of the probability of successful match as object element;
Obtain the initial position that the rhythm position of the object element is played as first literal.
3. the song rhythm generation method based on classifier as described in claim 1, which is characterized in that described from default song
Rhythm generates the target line corresponding with the first sentence lyrics of selection in the statistical matrix of model, comprising:
The first number of words of the first sentence lyrics is obtained, and it is corresponding to obtain each row in the statistical matrix for presetting song rhythm generation model
The second number of words;
First number of words is matched with each second number of words respectively;
From default song rhythm generate model statistical matrix in select successful match the corresponding row of the second number of words, as with institute
State the corresponding target line of the first sentence lyrics.
4. the song rhythm generation method as claimed in any one of claims 1-3 based on classifier, which is characterized in that described
Lyrics text to be processed is obtained, before extracting the first sentence lyrics in the lyrics text to be processed, the song based on classifier
Bent rhythm generation method further include:
Obtain training sample set;
Random Forest model is trained according to each music samples in the training sample set, obtains default song rhythm
Generate model.
5. the song rhythm generation method based on classifier as claimed in claim 4, which is characterized in that described according to the instruction
Each music samples practiced in sample set are trained Random Forest model, obtain default song rhythm and generate model, comprising:
Each music samples in the training sample set are pre-processed, pretreatment music samples are obtained;
Characteristic statistics are carried out to the pretreatment music samples, obtain the corresponding different types of spy of the pretreatment music samples
Reference breath;
The conversion of floating number form is carried out to the characteristic information, obtains the converting characteristic information of floating number form;
Random Forest model is trained according to the converting characteristic information, default song rhythm is obtained and generates model.
6. the song rhythm generation method based on classifier as claimed in claim 5, which is characterized in that described to the training
Each music samples in sample set are pre-processed, and pretreatment music samples are obtained, comprising:
Obtain the lyrics quantity of each music samples in the training sample set;
The melody part of each music samples is extracted, and counts the note quantity of each melody part;
Judge whether the lyrics quantity is equal to the note quantity;
If the lyrics are in varying numbers to traverse all rhythm notes in the melody part in the note quantity, search
Without the rhythm note of lyrics information;
The rhythm note without lyrics information found is incorporated on the previous rhythm note for having lyrics information, is obtained
Pre-process music samples.
7. the song rhythm generation method based on classifier as claimed in claim 5, which is characterized in that described to turn according to
It changes characteristic information to be trained Random Forest model, obtains default song rhythm and generate model, comprising:
Sentence characteristics information is extracted from the converting characteristic information;
According to the starting position of the sentence of the sentence characteristics Information Statistics difference number of words, and the starting position is recorded as uniting
Count matrix;
Using the information in the converting characteristic information other than the sentence characteristics information as sample lyrics characteristic information;
Random Forest model is trained according to the sample lyrics characteristic information and the statistical matrix, obtains default song
Rhythm generates model.
8. a kind of song rhythm generating device based on classifier, which is characterized in that the song rhythm based on classifier is raw
Forming apparatus include: memory, processor and be stored on the memory and can run on the processor based on classification
The song rhythm of device generates program, and the song rhythm based on classifier is generated when program is executed by the processor and realized such as
The step of song rhythm generation method described in any one of claims 1 to 7 based on classifier.
9. a kind of storage medium, which is characterized in that be stored with the song rhythm based on classifier on the storage medium and generate journey
Sequence, the song rhythm based on classifier are generated when program is executed by processor and are realized such as any one of claims 1 to 7 institute
The step of song rhythm generation method based on classifier stated.
10. a kind of song rhythm generating means based on classifier, which is characterized in that the song rhythm based on classifier is raw
Include: at device
Extraction module extracts the first sentence lyrics from the lyrics text to be processed for obtaining lyrics text to be processed;
Selecting module, for the selection mesh corresponding with the first sentence lyrics from the statistical matrix that default song rhythm generates model
Mark row;
Determining module, the initial position for being played according to the target line according to the determining first literal of preset rules;
The extraction module is also used to extract lyrics characteristic information from the lyrics text to be processed;
Note prediction module carries out note for generating model by the default song rhythm according to the lyrics characteristic information
Prediction obtains the corresponding target note duration of each lyrics in the lyrics text to be processed;
Generation module, for being generated and the lyrics text pair to be processed according to the initial position and the target note duration
The song rhythm answered.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910720248.8A CN110516103B (en) | 2019-08-02 | 2019-08-02 | Song rhythm generation method, device, storage medium and apparatus based on classifier |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910720248.8A CN110516103B (en) | 2019-08-02 | 2019-08-02 | Song rhythm generation method, device, storage medium and apparatus based on classifier |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110516103A true CN110516103A (en) | 2019-11-29 |
CN110516103B CN110516103B (en) | 2022-10-14 |
Family
ID=68625187
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910720248.8A Active CN110516103B (en) | 2019-08-02 | 2019-08-02 | Song rhythm generation method, device, storage medium and apparatus based on classifier |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110516103B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111445897A (en) * | 2020-03-23 | 2020-07-24 | 北京字节跳动网络技术有限公司 | Song generation method and device, readable medium and electronic equipment |
CN116343723A (en) * | 2023-03-17 | 2023-06-27 | 广州趣研网络科技有限公司 | Melody generation method and device, storage medium and computer equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105788589A (en) * | 2016-05-04 | 2016-07-20 | 腾讯科技(深圳)有限公司 | Audio data processing method and device |
JP2016157086A (en) * | 2015-02-26 | 2016-09-01 | パイオニア株式会社 | Lyrics voice output device, lyrics voice output method, and program |
CN107871012A (en) * | 2017-11-22 | 2018-04-03 | 广州酷狗计算机科技有限公司 | Audio-frequency processing method, device, storage medium and terminal |
CN109166564A (en) * | 2018-07-19 | 2019-01-08 | 平安科技(深圳)有限公司 | For the method, apparatus and computer readable storage medium of lyrics text generation melody |
CN109841202A (en) * | 2019-01-04 | 2019-06-04 | 平安科技(深圳)有限公司 | Rhythm generation method, device and terminal device based on speech synthesis |
CN109979497A (en) * | 2017-12-28 | 2019-07-05 | 阿里巴巴集团控股有限公司 | Generation method, device and system and the data processing and playback of songs method of song |
-
2019
- 2019-08-02 CN CN201910720248.8A patent/CN110516103B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016157086A (en) * | 2015-02-26 | 2016-09-01 | パイオニア株式会社 | Lyrics voice output device, lyrics voice output method, and program |
CN105788589A (en) * | 2016-05-04 | 2016-07-20 | 腾讯科技(深圳)有限公司 | Audio data processing method and device |
CN107871012A (en) * | 2017-11-22 | 2018-04-03 | 广州酷狗计算机科技有限公司 | Audio-frequency processing method, device, storage medium and terminal |
CN109979497A (en) * | 2017-12-28 | 2019-07-05 | 阿里巴巴集团控股有限公司 | Generation method, device and system and the data processing and playback of songs method of song |
CN109166564A (en) * | 2018-07-19 | 2019-01-08 | 平安科技(深圳)有限公司 | For the method, apparatus and computer readable storage medium of lyrics text generation melody |
CN109841202A (en) * | 2019-01-04 | 2019-06-04 | 平安科技(深圳)有限公司 | Rhythm generation method, device and terminal device based on speech synthesis |
Non-Patent Citations (1)
Title |
---|
吴昊等: "改进的BPM音频节奏特征提取算法研究", 《兰州文理学院学报(自然科学版)》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111445897A (en) * | 2020-03-23 | 2020-07-24 | 北京字节跳动网络技术有限公司 | Song generation method and device, readable medium and electronic equipment |
CN116343723A (en) * | 2023-03-17 | 2023-06-27 | 广州趣研网络科技有限公司 | Melody generation method and device, storage medium and computer equipment |
CN116343723B (en) * | 2023-03-17 | 2024-02-06 | 广州趣研网络科技有限公司 | Melody generation method and device, storage medium and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN110516103B (en) | 2022-10-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10657934B1 (en) | Enhancements for musical composition applications | |
US8566258B2 (en) | Markovian-sequence generator and new methods of generating Markovian sequences | |
CN109166564A (en) | For the method, apparatus and computer readable storage medium of lyrics text generation melody | |
CN111512359A (en) | Modular automatic music production server | |
CN109144610B (en) | Audio playing method and device, electronic device and computer readable storage medium | |
US20140080606A1 (en) | Methods and systems for generating a scenario of a game on the basis of a piece of music | |
CN108806657A (en) | Music model training, musical composition method, apparatus, terminal and storage medium | |
CN106652655B (en) | A kind of musical instrument of track replacement | |
CN109346043B (en) | Music generation method and device based on generation countermeasure network | |
CN109346045A (en) | Counterpoint generation method and device based on long neural network in short-term | |
US11024276B1 (en) | Method of creating musical compositions and other symbolic sequences by artificial intelligence | |
CN104836919B (en) | A kind of method and system played emulation guitar and realize mobile terminal unblock | |
CN110516103A (en) | Song rhythm generation method, equipment, storage medium and device based on classifier | |
CN106898345A (en) | Phoneme synthesizing method and speech synthetic device | |
CN108231066A (en) | Speech recognition system and method thereof and vocabulary establishing method | |
CN103680486A (en) | Performance information processing apparatus and performance information processing method | |
JP2002169804A (en) | System and method for simulated conversation, and information storage medium | |
CN109887524A (en) | A kind of singing marking method, device, computer equipment and storage medium | |
CN110517656A (en) | Lyrics rhythm generation method, equipment, storage medium and device | |
KR101062632B1 (en) | How to play rhythm | |
Setragno et al. | Feature-based characterization of violin timbre | |
Tuohy et al. | An evolved neural network/hc hybrid for tablature creation in ga-based guitar arranging | |
CN111276113A (en) | Method and device for generating key time data based on audio | |
CN116343720B (en) | Multi-sound part music score note grouping method, system, medium and computer | |
US11609948B2 (en) | Music streaming, playlist creation and streaming architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |