CN109671416A - Music rhythm generation method, device and user terminal based on enhancing study - Google Patents
Music rhythm generation method, device and user terminal based on enhancing study Download PDFInfo
- Publication number
- CN109671416A CN109671416A CN201811578602.XA CN201811578602A CN109671416A CN 109671416 A CN109671416 A CN 109671416A CN 201811578602 A CN201811578602 A CN 201811578602A CN 109671416 A CN109671416 A CN 109671416A
- Authority
- CN
- China
- Prior art keywords
- track
- music rhythm
- midi file
- module
- target midi
- 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
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/0008—Associated control or indicating means
- G10H1/0025—Automatic or semi-automatic music composition, e.g. producing random music, applying rules from music theory or modifying a musical piece
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2210/00—Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
- G10H2210/101—Music Composition or musical creation; Tools or processes therefor
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2210/00—Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
- G10H2210/101—Music Composition or musical creation; Tools or processes therefor
- G10H2210/105—Composing aid, e.g. for supporting creation, edition or modification of a piece of music
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2210/00—Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
- G10H2210/101—Music Composition or musical creation; Tools or processes therefor
- G10H2210/111—Automatic composing, i.e. using predefined musical rules
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2210/00—Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
- G10H2210/341—Rhythm pattern selection, synthesis or composition
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2210/00—Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
- G10H2210/375—Tempo or beat alterations; Music timing control
- G10H2210/391—Automatic tempo adjustment, correction or control
Abstract
The invention discloses a kind of music rhythm generation method, device and user terminals based on enhancing study, are related to field of computer technology.This method comprises: obtaining multiple target MIDI files;Structuring processing is carried out to multiple target MIDI files;The track of each target MIDI file is processed into the data sequence comprising pitch and duration;Data sequence classify according to modal tonality;Corresponding label is arranged to sorted each data sequence according to the attribute of track;It is trained based on enhancing learning algorithm according to the classification of data sequence, obtains multiple Q_table models;Music rhythm is generated according to multiple Q_table models and the modal tonality being selected.Method, apparatus disclosed by the invention and user terminal can automatically generate music rhythm, melody can be made more to have hommization, can also be individually created numbered musical notation and rhythm, more flexible, as long as and increase sample, it can itself iteration and optimization.
Description
Technical field
The present invention relates to field of computer technology, more particularly, to a kind of music rhythm generation side based on enhancing study
Method, device and user terminal.
Background technique
Musical composition is that one kind is highly difficult, relies on the senior thought activity of mankind's burst inspiration, needs to follow stringent
Rule, such as beat, power, it means that creation music, which is one, to follow the beaten track, and seek the arduous of new meaning again
Labour only has sensitive feeling to pitch, beat etc., and the high only a few people of thought active degree can be competent at music and create
's.
It improves with the development of science and technology, also gradually starts to apply using computer art music, create sound using computer
It is happy, the mankind can be greatly reduced and carry out the workload of musical composition, and be expected to generate and shake off the novel music of conventional thought constraint, even if
The music generated with computer can't be compared with the musician of the mankind, but machine works can provide candidate or primary for the mankind
Works are more easier composer's creation, therefore have boundless application scenarios using computer art music.
Currently, computer art music frequently with mode be using LSTM and GNN algorithm, the melody generated is mechanical
Change, and optimization cannot be updated at any time.
Summary of the invention
In view of this, a kind of based on the music rhythm generation method, the dress that enhance study it is an object of the invention to propose
It sets and user terminal, to improve the above problem.
To achieve the goals above, the present invention adopts the following technical scheme:
In a first aspect, the embodiment of the invention provides a kind of music rhythm generation method based on enhancing study, the side
Method includes:
Obtain multiple target MIDI files;
Structuring processing is carried out to the multiple target MIDI file;
The track of each target MIDI file is processed into the data sequence comprising pitch and duration;
Classified according to modal tonality to all data sequences;
Corresponding label is arranged to sorted each data sequence according to the attribute of track, the attribute includes track
At least one of speed, beat and instrument type;
It is trained, is obtained more respectively according to the classification and the corresponding label of data sequence based on enhancing learning algorithm
A Q_table model stores each execution in each Q_table model and acts corresponding return;
Music rhythm is generated according to the multiple Q_table model and the modal tonality being selected, wherein the music rotation
Return corresponding to each movement is total in rule and/or average value is higher than preset return threshold value.
Music rhythm generation method as described above based on enhancing study, it is optionally, described to obtain multiple target MIDI
File, comprising:
Multiple initial MIDI files are obtained from the server;
The multiple initial MIDI file is screened, the multiple target MIDI file is obtained.
Music rhythm generation method as described above based on enhancing study, optionally, the method also includes:
The multiple target MIDI file is classified according to style, emotion, theme, scene four dimensions;
It is described that structuring processing is carried out to the multiple target MIDI file, comprising:
By the note alignment in each track in sorted the multiple target MIDI file.
Music rhythm generation method as described above based on enhancing study, optionally, according to the attribute of track to point
Each data sequence after class is arranged before corresponding label, the method also includes:
Extract the track in the melody of each target MIDI file;
It is 0 by the pitchmark of the blank spaces between note;
Filter the overlapping note in each track.
Second aspect, the embodiment of the invention provides a kind of music rhythm generating means based on enhancing study, the bases
Include: in the music rhythm generating means of enhancing study
Module is obtained, for obtaining multiple target MIDI files;
Structuring processing module, for carrying out structuring processing to the multiple target MIDI file;
Data processing module, for the track of each target MIDI file to be processed into the number comprising pitch and duration
According to sequence;
Categorization module, for being classified according to modal tonality to all data sequences;
Label model, it is described for corresponding label to be arranged to sorted each data sequence according to the attribute of track
Attribute includes at least one of speed, beat and instrument type of track;
Training module, for based on enhancing learning algorithm according to the classification of data sequence and the corresponding label respectively into
Row training, obtains multiple Q_table models, and each execution is stored in each Q_table model and acts corresponding return;
Generation module, for generating music rhythm according to the multiple Q_table model and the modal tonality being selected,
In, return corresponding to each movement is total in the music rhythm and/or average value is higher than preset return threshold value.
Music rhythm generating means as described above based on enhancing study, optionally, the acquisition module includes:
Acquisition submodule, for obtaining multiple initial MIDI files from the server;
Submodule is screened, for screening to the multiple initial MIDI file, obtains the multiple target MIDI text
Part.
As described above based on enhancing study music rhythm generating means, optionally, the categorization module be also used to by
The multiple target MIDI file is classified according to style, emotion, theme, scene four dimensions;
The structuring processing module is used for will be in each track in sorted the multiple target MIDI file
Note alignment.
Music rhythm generating means as described above based on enhancing study, optionally, the music rotation based on enhancing study
Restrain generating means further include:
Extraction module, the track in melody for extracting each target MIDI file;
Blank spaces processing module, for being 0 by the pitchmark of the blank spaces between note;
Filtering module, for filtering the overlapping note in each track.
The third aspect, the embodiment of the invention provides a kind of user terminal, the user terminal includes:
Memory;
Processor;And
Based on the music rhythm generating means of enhancing study, the music rhythm generating means installation based on enhancing study
It is described based on enhancing study in the memory and including the software function mould group that one or more is executed by the processor
Music rhythm generating means include:
Module is obtained, for obtaining multiple target MIDI files;
Structuring processing module, for carrying out structuring processing to the multiple target MIDI file;
Data processing module, for the track of each target MIDI file to be processed into the number comprising pitch and duration
According to sequence;
Categorization module, for being classified according to modal tonality to all data sequences;
Label model, it is described for corresponding label to be arranged to sorted each data sequence according to the attribute of track
Attribute includes at least one of speed, beat and instrument type of track;
Training module, for based on enhancing learning algorithm according to the classification of data sequence and the corresponding label respectively into
Row training, obtains multiple Q_table models, and each execution is stored in each Q_table model and acts corresponding return;
Generation module, for generating music rhythm according to the multiple Q_table model and the modal tonality being selected,
In, return corresponding to each movement is total in the music rhythm and/or average value is higher than preset return threshold value.
Compared with prior art, the beneficial effects of the present invention are:
Music rhythm generation method, device and user terminal provided by the invention based on enhancing study can automatically generate sound
Happy melody is learnt using enhancing, melody can be made more to have hommization, can also be individually created numbered musical notation and rhythm, cleverer
It is living, as long as and increase sample, it can itself iteration and optimization.
Detailed description of the invention
Fig. 1 is the application environment schematic diagram that present pre-ferred embodiments provide.
Fig. 2 is the block diagram for the user terminal that present pre-ferred embodiments provide.
Fig. 3 is the flow chart for the music rhythm generation method based on enhancing study that present pre-ferred embodiments provide.
Fig. 4 is the schematic diagram for the training Q_table model that present pre-ferred embodiments provide.
Fig. 5 is the schematic diagram for the enhancing learning algorithm that present pre-ferred embodiments provide.
Fig. 6 is the schematic diagram for the generation music rhythm that present pre-ferred embodiments provide.
Fig. 7 is that the functional module for the music rhythm generating means based on enhancing study that present pre-ferred embodiments provide is shown
It is intended to.
Fig. 8 is the functional block diagram that module is obtained in Fig. 7.
Description of symbols: 100- user terminal;Music rhythm generating means of the 110- based on enhancing study;111- is obtained
Module;1111- acquisition submodule;1112- screens submodule;112- structuring processing module;113- data processing module;114-
Categorization module;115- label model;116- training module;117- generation module;118- extraction module;119- filtering module;
1191- blank spaces processing module;120- memory;130- storage control;140- processor;150- Peripheral Interface;160-
Input-output unit;170- display unit;200- server;300- network.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.The present invention being usually described and illustrated herein in the accompanying drawings is implemented
The component of example can be arranged and be designed with a variety of different configurations.
Therefore, the detailed description of the embodiment of the present invention provided in the accompanying drawings is not intended to limit below claimed
The scope of the present invention, but be merely representative of selected embodiment of the invention.Based on the embodiments of the present invention, this field is common
Technical staff's every other embodiment obtained without creative efforts belongs to the model that the present invention protects
It encloses.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.
Term " first ", " second ", " third " etc. are only used for distinguishing description, are not understood to indicate or imply relatively heavy
The property wanted.
As shown in Figure 1, being that the server 200 that present pre-ferred embodiments provide shows with what user terminal 100 interacted
It is intended to, the server 200 is by network 300 and one or more communication connections of user terminal 100 to carry out data friendship
Mutually.The server 200 can be network server, database server etc., and the network 300 can be wired or wireless net
Network, the user terminal 100 can be PC (personal computer, PC), tablet computer, smart phone, individual
Digital assistants (personal d igital assistant, PDA) etc..
As shown in Fig. 2, be a kind of block diagram of user terminal 100, the user terminal 100 include including
Music rhythm generating means 110, memory 120, storage control 130, processor 140, Peripheral Interface based on enhancing study
150, input-output unit 160, display unit 170.
The memory 120, processor 140, Peripheral Interface 150, input-output unit 160, is shown storage control 130
Show that each element of unit 170 is directly or indirectly electrically connected between each other, to realize the transmission or interaction of data.For example, these
Element can be realized by one or more communication bus or signal wire be electrically connected between each other.The sound based on enhancing study
Happy melody generating means 110 include that at least one can be stored in the memory in the form of software or firmware (firmware)
In 120 or the software function module that is solidificated in the operating system (operating system, OS) of the electronic equipment 100.
The processor 140 is for executing the executable module stored in memory 120, such as the music rotation based on enhancing study
The software function module or computer program that rule generating means 110 include.
Wherein, memory 120 may be, but not limited to, random access memory (Random Access Memory,
RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only
Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM),
Electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc..
Wherein, memory 120 is for storing program, and the processor 140 executes described program after receiving and executing instruction, aforementioned
Method performed by the user terminal 100 that the stream process that any embodiment of the embodiment of the present invention discloses defines can be applied to handle
In device 140, or realized by processor 140.
Processor 140 may be a kind of IC chip, the processing capacity with signal.Above-mentioned processor 140 can
To be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit
(Network Processor, abbreviation NP) etc., can also be digital signal processor (DSP), specific integrated circuit (ASIC),
Ready-made programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hard
Part component.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.General processor
It can be microprocessor or the processor be also possible to any conventional processor etc..
Various input/output devices are couple processor 140 and memory 120 by the Peripheral Interface 150.Some
In embodiment, Peripheral Interface 150, processor 140 and storage control 130 can be realized in one single chip.Other one
In a little examples, they can be realized by independent chip respectively.
Input-output unit 160 is used to be supplied to the interaction that user input data realizes user and the user terminal 100.
The input-output unit 160 may be, but not limited to, mouse and keyboard etc..
Display unit 170 provides an interactive interface (such as user's operation circle between the user terminal 100 and user
Face) or for display image data give user reference.In the present embodiment, the display unit 170 can be liquid crystal display
Or touch control display.It can be the capacitance type touch control screen or resistance of support single-point and multi-point touch operation if touch control display
Formula touch screen etc..Single-point and multi-point touch operation is supported to refer to that touch control display can sense on the touch control display one
Or at multiple positions simultaneously generate touch control operation, and the touch control operation that this is sensed transfer to processor 140 carry out calculate and
Processing.
Referring to Fig. 3, being that the music shown in Fig. 2 based on enhancing study that is applied to that present pre-ferred embodiments provide is revolved
Restrain the flow chart of the music rhythm generation method based on enhancing study of generating means 110.It below will be to specific stream shown in Fig. 3
Journey is described in detail.
Step S101 obtains multiple target MIDI files.
Method provided by the invention is applied to user terminal 100, before generating music rhythm, user terminal 100 first
Multiple initial MIDI files are obtained as music file sample from server 200.Then user terminal 100 is multiple to what is got
Initial MIDI file is screened, and when being screened, choosing note, the lines flow smoothly, and note lines registration is lower than preset value
Initial MIDI file, obtains multiple target MIDI files.
Step S102 classifies multiple target MIDI files according to style, emotion, theme, scene four dimensions.
Different music are corresponding with different-style, emotion, theme, scene etc., therefore after obtaining target MIDI file, user
Target MIDI file can be used for pair according to style, emotion, theme, scene etc. to 100 typing of user terminal by the user of terminal 100
The sort operation instruction that target MIDI file is classified, user terminal 100 will according to the instruction of the sort operation of user's typing
Multiple target MIDI files are classified according to style, emotion, theme, scene four dimensions.
For example, style can be divided into rock and roll, prevalence, folk rhyme etc., emotion can be divided into pleasure, anger, sorrow, happiness etc., and theme can be divided into love
Feelings, friendship etc., scene can be divided into the scenes such as birthday, marriage.
Step S103 carries out structuring processing to multiple target MIDI files.
Specifically, user terminal 100 (will revolve the note in each track in sorted multiple target MIDI files
Rule, accompaniment) it is aligned.For example, melody is more slightly longer than accompanying, then that a part in melody than accompanying slightly longer can be deleted.And
Very irregular track is then directly deleted.By to multiple target MIDI file amounts of progress, it is ensured that target MIDI text
Part specification can be used.
The track of each target MIDI file is processed into the data sequence comprising pitch and duration by step S104.
After carrying out structuring processing to multiple target MIDI files, user terminal 100 extracts each target MIDI file
Melody in track.And by each target MIDI text after the track in the melody for extracting each target MIDI file
The track of part is processed into the data sequence comprising pitch and duration, so as to subsequent carry out calculation process.
The duration is also referred to as note value or value, when being used to express the relative durations between each note in music score
Between.One complete note is equal to two minims, is equal to four crotchets, eight quavers, 16 16 partials
Symbol, 32 demisemiquavers.
Further, after the track in the melody for extracting each target MIDI file, the user terminal 100 may be used also
It is 0 by the pitchmark of the blank spaces between note, and the overlapping note in each track is filtered.
In the embodiment of the present invention, pitch (pitch) is similar with duration (time_value) structure sequence as follows:
[(pitch1,time_value1),(pitch2,time_value2)…].Pitch and duration structure sequence element
Between meet former melody note and put in order, the representation note of pitch duration herein, pitch Hourly Value Sequence indicates track, but sound
The expression of symbol and track is without being limited thereto.
Step S105 classifies to all data sequences according to modal tonality.
In traditional music theory, reasonably organized together by several sounds, and one is constituted centered on some sound
System is mode, and the property of mode, feature are tonality.By the track of each target MIDI file be processed into comprising pitch and when
After the data sequence of value, user terminal 100 classify to all data sequences according to modal tonality.
For example, all data sequences are carried out classification and A-G tune pair by all data sequences according to A-G tune
7 major class answered.It further, can also be further according to big tune, the ditty (such as C, which stealthily substitutes, includes c major and C ditty) of each tune
It is fine to divide.
Corresponding label is arranged to sorted each data sequence according to the attribute of track in step S106.
The attribute of track include it is at least one of in speed, beat and instrument type, in the embodiment of the present invention, track
Attribute speed, beat and instrument type.It should be understood that the attribute of track can also be set in other some embodiments
The one of which being set in speed, beat and instrument type or two kinds.
Step S107 is trained based on enhancing learning algorithm according to the classification and corresponding label of data sequence respectively,
Obtain multiple Q_table models.
After data sequence is classified according to modal tonality, user terminal 100 is according to enhancing learning algorithm according to data
The classification of sequence and corresponding label, are respectively trained different classes of data sequence respectively, obtain and data sequence
The corresponding multiple Q_table models of classification.
Wherein, each execution is stored in each Q_table model acts corresponding return.In the embodiment of the present invention,
Current note is exactly a movement to next note, and the return different according to different action definitions of user terminal 100 is defining
When the return of movement, the number that same movement occurs in the track according to corresponding to data sequence of user terminal 100 defines different
Return, act appearance number it is higher illustrate that the number that uses is more, the rotation of the movement (current note to next note)
Rule is relatively more interesting to listen to, therefore the return defined is also higher.
In the embodiment of the present invention, enhancing study basic principle formula are as follows: Q (s, a)=r (s, a)+γ * maxQ (s', a'),
Wherein s indicates state, and a expression movement, (s a) indicates totally return the estimation obtained to movement a under state s to Q, this is specially
Indicate that (s, a), the return immediately that r is acted thus, γ is discount factor to Q, wherein 0≤γ < 1 using Q_value in benefit.
As shown in figure 4, being the schematic diagram of trained Q_table model, Q_table model records the list item of Q_value, i.e., public
(s, a), the Ssatus in figure are the s in formula to Q in formula, and Action is a in formula.
According to enhancing Learning Principle, in the embodiment of the present invention, including enhancing learning algorithm Q_learning and depth are used
Nitrification enhancement DQN, enhancing learning algorithm are as shown in Figure 5.Wherein, Agent is the intelligent body that training process generates melody, is held
Row generates melody and operates, and the sequence of melody pitch and duration structure indicates, according in Environment (melody Rating Model)
Condition responsive one movement of return generates first note according to constraint, if contained in sequence when in sequence without note
Note then adds a note according to constraint condition, if value is the threshold values being arranged according to enhancing study basic principle formula,
The note is exported to Environment, form is as follows:
(pithch,time_value)。
Wherein constraint condition are as follows: 0 < pitche < 127;1<time_value<127;Q(s,a)>value.
Environment locating for Environment:Agent, is equivalent to the model of melody judge, and model combines music theory and knows
Know and a large amount of music raw datas obtain, receives Agent and be transmitted through to act, and execute the movement in a model, herein in original
Have and add the pitch duration structure in pitch duration structure sequence, obtained current state Status is as follows, according to Rating Model
(return) Reward that scores current state is obtained, and the two is output to Agent:
[…(pithch,time_value)]。
Action:Agent is output to the movement of Environment, is single pitch duration structure.
Reward:Environment feeds back to the scoring of Agent.
Status:Environment executes the state after Action.
Step S108 generates music rhythm according to multiple Q_table models and the modal tonality being selected.
Multiple Q_table models corresponding with data sequence classification are obtained, the user of user terminal 100 can be according to this
Multiple Q_table models generate music.Specifically, a kind of modal tonality may be selected in user, and selects the quantity of note, then
User terminal 100 is generated according to model corresponding with the modal tonality in the modal tonality and multiple Q_table models selected
One section of note quantity with by the equal music rhythm of selection note quantity.When generating music rhythm, the music rhythm of the generation
It need to meet in music rhythm that return corresponding to each movement is total and/or average value is higher than preset return threshold value, so ensure to give birth to
At music rhythm meet modal tonality and tempo variation, and have ornamental value.
Further, in the embodiment of the present invention, the user of user terminal 100 also be may be selected corresponding to music rhythm to be generated
Style, emotion, theme, scene or speed, beat, the parameters such as musical instrument.When generating music rhythm, user terminal 100 is gone back
Corresponding music rhythm can be generated in conjunction with the parameter of user's selection.
Fig. 6 shows the schematic diagram of the process of the generation music rhythm of present pre-ferred embodiments offer, as shown in fig. 6,
The process of music rhythm is generated as shown in fig. 6, state Status and Action are input in Q_table model,
Q_value is obtained, according to the higher Action of Q_value under the threshold values selection state of setting, randomness can be added, allows and generates mould
Block has exploration.
Referring to Fig. 7, being the music rhythm generating means 110 based on enhancing study that present pre-ferred embodiments provide
The functional block diagram, the music rhythm generating means 110 based on enhancing study include obtaining module 111, at structuring
Reason module 112, categorization module 114, label model 115, training module 116, generation module 117, mentions data processing module 113
Modulus block 118, filtering module 119 and blank spaces processing module 1191.
Module 111 is obtained to be used to obtain multiple target MIDI files from the server 200.
Referring to Fig. 8, the acquisition module 111 includes acquisition submodule 1111 and screening submodule 1112.
Acquisition submodule 1111 is used to obtain multiple initial MIDI files from server 200.
Screening submodule 1112 obtains multiple target MIDI files for screening to multiple initial MIDI files.
It should be understood that the acquisition module 111 can be used for executing above-mentioned step S101.
The categorization module 114 is used for multiple target MIDI files according to style, emotion, theme, scene four dimensions
Classify.
It should be understood that the categorization module 114 can be used for executing above-mentioned step S102.
The structuring processing module 112 is used to carry out structuring processing to the multiple target MIDI file.
It should be understood that the structuring processing module 112 can be used for executing above-mentioned step S103.
The data processing module 113 be used for by the track of each target MIDI file be processed into comprising pitch and when
The data sequence of value.
It should be understood that the data processing module 113 can be used for executing above-mentioned step S104.
The extraction module 118 is used to extract the track in the melody of each target MIDI file.
The filtering module 119 is used to filter the overlapping note in each track.
The blank spaces processing module 1191 is used to the pitchmark of the blank spaces between note be 0.
The categorization module 114 classify to all data sequences according to modal tonality.
It should be understood that the categorization module 114 can be also used for executing above-mentioned step S105.
The label model 115 is used for the attribute according to track to sorted each corresponding mark of data sequence setting
Label.
It should be understood that the label model 115 can be also used for executing above-mentioned step S106.
The training module 116 is used to be trained respectively based on enhancing learning algorithm according to the classification of data sequence, obtains
To multiple Q_table models, each execution is stored in each Q_table model and acts corresponding return.
It should be understood that the training module 116 can be used for executing above-mentioned step S107.
The generation module 117 is used to generate music rhythm according to multiple Q_table models and the modal tonality being selected.
It should be understood that the generation module 117 can be used for executing above-mentioned step S108.
In conclusion music rhythm generation method, device and the user terminal energy provided by the invention based on enhancing study
It is enough to be screened to obtain multiple target MIDI files according to the multiple initial MIDI files got from server, and to multiple mesh
The processing of mark MIDI file structureization is the note (melody, accompaniment) in each track to be aligned and delete very irregular
The track of each target MIDI file is processed into comprising pitch and duration by track with ensuring target MIDI filespec, can be used
Data sequence after classified according to modal tonality, be then based on enhancing learning algorithm according to data sequence classification respectively into
Row training, obtains multiple Q_table models, can be according to multiple Q_table models and the mode being selected when generating music
Tonality automatically generates music rhythm and meets modal tonality and tempo variation, and has ornamental value music rhythm.It is provided by the invention
Music rhythm generation method, device and user terminal based on enhancing study can automatically generate music rhythm, be learnt using enhancing,
It can make melody that more there is hommization, numbered musical notation and rhythm can also be individually created, it is more flexible, as long as and increasing music text
Itself iteration and optimization can be realized in part sample.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through
Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, flow chart and block diagram in attached drawing
Show the device of multiple embodiments according to the present invention, the architectural framework in the cards of method and computer program product,
Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code
Part, a part of the module, section or code, which includes that one or more is for implementing the specified logical function, to be held
Row instruction.It should also be noted that function marked in the box can also be to be different from some implementations as replacement
The sequence marked in attached drawing occurs.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes
It can execute in the opposite order, this depends on the function involved.It is also noted that every in block diagram and or flow chart
The combination of box in a box and block diagram and or flow chart can use the dedicated base for executing defined function or movement
It realizes, or can realize using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each functional module in each embodiment of the present invention can integrate one independent portion of formation together
Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module
It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.It needs
Illustrate, herein, relational terms such as first and second and the like be used merely to by an entity or operation with
Another entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this realities
The relationship or sequence on border.Moreover, the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability
Contain, so that the process, method, article or equipment for including a series of elements not only includes those elements, but also including
Other elements that are not explicitly listed, or further include for elements inherent to such a process, method, article, or device.
In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element
Process, method, article or equipment in there is also other identical elements.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should also be noted that similar label and letter exist
Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing
It is further defined and explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.
Claims (9)
1. a kind of music rhythm generation method based on enhancing study, which is characterized in that the described method includes:
Obtain multiple target MIDI files;
Structuring processing is carried out to the multiple target MIDI file;
The track of each target MIDI file is processed into the data sequence comprising pitch and duration;
All data sequences classify according to modal tonality;
Corresponding label is arranged to sorted each data sequence according to the attribute of track, the attribute includes the speed of track
At least one of degree, beat and instrument type;
It is trained respectively based on enhancing learning algorithm according to the classification and the corresponding label of data sequence, obtains multiple Q_
Table model stores each execution in each Q_table model and acts corresponding return;
Music rhythm is generated according to the multiple Q_table model and the modal tonality being selected, wherein in the music rhythm
Return corresponding to each movement is total and/or average value is higher than preset return threshold value.
2. the music rhythm generation method according to claim 1 based on enhancing study, which is characterized in that the acquisition is more
A target MIDI file, comprising:
Multiple initial MIDI files are obtained from the server;
The multiple initial MIDI file is screened, the multiple target MIDI file is obtained.
3. the music rhythm generation method according to claim 1 based on enhancing study, which is characterized in that the method is also
Include:
The multiple target MIDI file is classified according to style, emotion, theme, scene four dimensions;
It is described that structuring processing is carried out to the multiple target MIDI file, comprising:
By the note alignment in each track in sorted the multiple target MIDI file.
4. the music rhythm generation method according to claim 1 based on enhancing study, which is characterized in that according to track
Attribute corresponding label is arranged to sorted each data sequence before, the method also includes:
Extract the track in the melody of each target MIDI file;
It is 0 by the pitchmark of the blank spaces between note;
Filter the overlapping note in each track.
5. a kind of music rhythm generating means based on enhancing study, the music rhythm generating means packet based on enhancing study
It includes:
Module is obtained, multiple target MIDI files are obtained;
Structuring processing module, for carrying out structuring processing to the multiple target MIDI file;
Data processing module, for the track of each target MIDI file to be processed into the data sequence comprising pitch and duration
Column;
Categorization module, for being classified according to modal tonality to all data sequences;
Label model, for corresponding label, the attribute to be arranged to sorted each data sequence according to the attribute of track
At least one of speed, beat and instrument type including track;
Training module, for being instructed respectively based on enhancing learning algorithm according to the classification and the corresponding label of data sequence
Practice, obtain multiple Q_table models, each execution is stored in each Q_table model and acts corresponding return;
Generation module, for generating music rhythm according to the multiple Q_table model and the modal tonality being selected, wherein
Return corresponding to each movement is total in the music rhythm and/or average value is higher than preset return threshold value.
6. the music rhythm generating means according to claim 5 based on enhancing study, which is characterized in that the acquisition mould
Block includes:
Acquisition submodule, for obtaining multiple initial MIDI files from the server;
It screens submodule and obtains the multiple target MIDI file for screening to the multiple initial MIDI file.
7. the music rhythm generating means according to claim 5 based on enhancing study, which is characterized in that the classification mould
Block is also used to classify the multiple target MIDI file according to style, emotion, theme, scene four dimensions;
The structuring processing module is used for the note in each track in sorted the multiple target MIDI file
Alignment.
8. the music rhythm generating means according to claim 5 based on enhancing study, which is characterized in that further include:
Extraction module, the track in melody for extracting each target MIDI file;
Blank spaces processing module, for being 0 by the pitchmark of the blank spaces between note;
Filtering module, for filtering the overlapping note in each track.
9. a kind of user terminal, which is characterized in that the user terminal includes:
Memory;
Processor;And
Based on the music rhythm generating means of enhancing study, the music rhythm generating means based on enhancing study are installed on institute
It states in memory and including the software function mould group that one or more is executed by the processor, the sound based on enhancing study
Happy melody generating means include:
Module is obtained, for obtaining multiple target MIDI files;
Structuring processing module, for carrying out structuring processing to the multiple target MIDI file;
Data processing module, for the track of each target MIDI file to be processed into the data sequence comprising pitch and duration
Column;
Categorization module, for being classified according to modal tonality to all data sequences;
Label model, for corresponding label, the attribute to be arranged to sorted each data sequence according to the attribute of track
At least one of speed, beat and instrument type including track;
Training module obtains multiple Q_ for being trained respectively based on enhancing learning algorithm according to the classification of data sequence
Table model stores each execution in each Q_table model and acts corresponding return;
Generation module, for generating music rhythm according to the multiple Q_table model and the modal tonality being selected, wherein
Return corresponding to each movement is total in the music rhythm and/or average value is higher than preset return threshold value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811578602.XA CN109671416B (en) | 2018-12-24 | 2018-12-24 | Music melody generation method and device based on reinforcement learning and user terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811578602.XA CN109671416B (en) | 2018-12-24 | 2018-12-24 | Music melody generation method and device based on reinforcement learning and user terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109671416A true CN109671416A (en) | 2019-04-23 |
CN109671416B CN109671416B (en) | 2023-07-21 |
Family
ID=66145969
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811578602.XA Active CN109671416B (en) | 2018-12-24 | 2018-12-24 | Music melody generation method and device based on reinforcement learning and user terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109671416B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110085263A (en) * | 2019-04-28 | 2019-08-02 | 东华大学 | A kind of classification of music emotion and machine composing method |
CN110517655A (en) * | 2019-08-28 | 2019-11-29 | 广州艾颂智能科技有限公司 | A kind of melody generation method and system |
CN111274891A (en) * | 2020-01-14 | 2020-06-12 | 成都嗨翻屋科技有限公司 | Method and system for extracting pitches and corresponding lyrics for numbered musical notation images |
CN111782576A (en) * | 2020-07-07 | 2020-10-16 | 北京字节跳动网络技术有限公司 | Background music generation method and device, readable medium and electronic equipment |
CN113035162A (en) * | 2021-03-22 | 2021-06-25 | 平安科技(深圳)有限公司 | National music generation method, device, equipment and storage medium |
CN113066458A (en) * | 2021-03-17 | 2021-07-02 | 平安科技(深圳)有限公司 | Melody generation method, device and equipment based on LISP-like chain data and storage medium |
CN113077770A (en) * | 2021-03-22 | 2021-07-06 | 平安科技(深圳)有限公司 | Fole generation method, device, equipment and storage medium |
CN113192472A (en) * | 2021-04-29 | 2021-07-30 | 北京灵动音科技有限公司 | Information processing method, information processing device, electronic equipment and storage medium |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101667170A (en) * | 2008-09-05 | 2010-03-10 | 索尼株式会社 | Computation apparatus and method, quantization apparatus and method, audio encoding apparatus and method, and program |
CN101800046A (en) * | 2010-01-11 | 2010-08-11 | 北京中星微电子有限公司 | Method and device for generating MIDI music according to notes |
US20140052282A1 (en) * | 2012-08-17 | 2014-02-20 | Be Labs, Llc | Music generator |
US20140301573A1 (en) * | 2013-04-09 | 2014-10-09 | Score Music Interactive Limited | System and method for generating an audio file |
US9275347B1 (en) * | 2015-10-09 | 2016-03-01 | AlpacaDB, Inc. | Online content classifier which updates a classification score based on a count of labeled data classified by machine deep learning |
CN106652655A (en) * | 2015-10-29 | 2017-05-10 | 施政 | Musical instrument capable of audio track replacement |
CN106875929A (en) * | 2015-12-14 | 2017-06-20 | 中国科学院深圳先进技术研究院 | A kind of music rhythm method for transformation and system |
US9799312B1 (en) * | 2016-06-10 | 2017-10-24 | International Business Machines Corporation | Composing music using foresight and planning |
US20180137845A1 (en) * | 2015-06-02 | 2018-05-17 | Sublime Binary Limited | Music Generation Tool |
CN108597535A (en) * | 2018-03-29 | 2018-09-28 | 华南理工大学 | A kind of MIDI piano music genre classification methods of fusion accompaniment |
CN108806657A (en) * | 2018-06-05 | 2018-11-13 | 平安科技(深圳)有限公司 | Music model training, musical composition method, apparatus, terminal and storage medium |
-
2018
- 2018-12-24 CN CN201811578602.XA patent/CN109671416B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101667170A (en) * | 2008-09-05 | 2010-03-10 | 索尼株式会社 | Computation apparatus and method, quantization apparatus and method, audio encoding apparatus and method, and program |
CN101800046A (en) * | 2010-01-11 | 2010-08-11 | 北京中星微电子有限公司 | Method and device for generating MIDI music according to notes |
US20140052282A1 (en) * | 2012-08-17 | 2014-02-20 | Be Labs, Llc | Music generator |
US20140301573A1 (en) * | 2013-04-09 | 2014-10-09 | Score Music Interactive Limited | System and method for generating an audio file |
US20180137845A1 (en) * | 2015-06-02 | 2018-05-17 | Sublime Binary Limited | Music Generation Tool |
US9275347B1 (en) * | 2015-10-09 | 2016-03-01 | AlpacaDB, Inc. | Online content classifier which updates a classification score based on a count of labeled data classified by machine deep learning |
CN106652655A (en) * | 2015-10-29 | 2017-05-10 | 施政 | Musical instrument capable of audio track replacement |
CN106875929A (en) * | 2015-12-14 | 2017-06-20 | 中国科学院深圳先进技术研究院 | A kind of music rhythm method for transformation and system |
US9799312B1 (en) * | 2016-06-10 | 2017-10-24 | International Business Machines Corporation | Composing music using foresight and planning |
CN108597535A (en) * | 2018-03-29 | 2018-09-28 | 华南理工大学 | A kind of MIDI piano music genre classification methods of fusion accompaniment |
CN108806657A (en) * | 2018-06-05 | 2018-11-13 | 平安科技(深圳)有限公司 | Music model training, musical composition method, apparatus, terminal and storage medium |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110085263A (en) * | 2019-04-28 | 2019-08-02 | 东华大学 | A kind of classification of music emotion and machine composing method |
CN110085263B (en) * | 2019-04-28 | 2021-08-06 | 东华大学 | Music emotion classification and machine composition method |
CN110517655A (en) * | 2019-08-28 | 2019-11-29 | 广州艾颂智能科技有限公司 | A kind of melody generation method and system |
CN110517655B (en) * | 2019-08-28 | 2023-03-14 | 广州艾颂智能科技有限公司 | Melody generation method and system |
CN111274891A (en) * | 2020-01-14 | 2020-06-12 | 成都嗨翻屋科技有限公司 | Method and system for extracting pitches and corresponding lyrics for numbered musical notation images |
CN111782576A (en) * | 2020-07-07 | 2020-10-16 | 北京字节跳动网络技术有限公司 | Background music generation method and device, readable medium and electronic equipment |
CN113066458A (en) * | 2021-03-17 | 2021-07-02 | 平安科技(深圳)有限公司 | Melody generation method, device and equipment based on LISP-like chain data and storage medium |
CN113035162A (en) * | 2021-03-22 | 2021-06-25 | 平安科技(深圳)有限公司 | National music generation method, device, equipment and storage medium |
CN113077770A (en) * | 2021-03-22 | 2021-07-06 | 平安科技(深圳)有限公司 | Fole generation method, device, equipment and storage medium |
CN113077770B (en) * | 2021-03-22 | 2024-03-05 | 平安科技(深圳)有限公司 | Buddha music generation method, device, equipment and storage medium |
CN113192472A (en) * | 2021-04-29 | 2021-07-30 | 北京灵动音科技有限公司 | Information processing method, information processing device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109671416B (en) | 2023-07-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109671416A (en) | Music rhythm generation method, device and user terminal based on enhancing study | |
Windsor et al. | Music and affordances | |
CN109166564A (en) | For the method, apparatus and computer readable storage medium of lyrics text generation melody | |
US11969656B2 (en) | Dynamic music creation in gaming | |
Davis et al. | Generating music from literature | |
JP6459378B2 (en) | Problem management apparatus and problem management program | |
CN104346147A (en) | Method and device for editing rhythm points of music games | |
Volk et al. | Towards modelling variation in music as foundation for similarity | |
Frieler et al. | Is it the song and not the singer? Hit song prediction using structural features of melodies | |
CN109448697A (en) | Poem melody generation method, electronic device and computer readable storage medium | |
Macchiusi | " Knowing is Seeing:" The Digital Audio Workstation and the Visualization of Sound | |
Juhász | Analysis of melody roots in Hungarian folk music using self-organizing maps with adaptively weighted dynamic time warping | |
Slater | Timbre and Non‐radical Didacticism in the Streets' A Grand Don't Come for Free: a Poetic‐Ecological Model | |
Rönnberg | Classification of heavy metal subgenres with machine learning | |
Turnbull | Design and development of a semantic music discovery engine | |
He et al. | Automatic generation algorithm analysis of dance movements based on music–action association | |
Widmer et al. | Automatic recognition of famous artists by machine | |
Hall et al. | A model of large-scale thematic structure | |
Sköld | Visual Representation of Musical Rhythm in Relation to Music Technology Interfaces-an Overview | |
Chen | Interactive music composition with the CFE framework | |
Lansdown et al. | Machine Learning for Music Genre Classification | |
Sinha | Artificial composition: an experiment on Indian music | |
EP4207180A1 (en) | Information processing method, information processing program, and information processing device | |
De Poli et al. | Toward an action based metaphor for gestural interaction with musical contents | |
Paz et al. | Live Coding Machine Learning: Finding the Moments of Intervention in Autonomous Processes |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20230627 Address after: Room 1210, 12 / F, unit 1, building 1, No. 722, middle section of Yizhou Avenue, high tech Zone, Chengdu, Sichuan 610000 Applicant after: Chengdu potential Artificial Intelligence Technology Co.,Ltd. Address before: 610000 Huayang Avenue Section 117 and 119, Huayang Street, Tianfu New District, Chengdu City, Sichuan Province Applicant before: CHENGDU HIFIVE TECHNOLOGY Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |