CN110246472A - A kind of conversion method of music style, device and terminal device - Google Patents

A kind of conversion method of music style, device and terminal device Download PDF

Info

Publication number
CN110246472A
CN110246472A CN201910385803.6A CN201910385803A CN110246472A CN 110246472 A CN110246472 A CN 110246472A CN 201910385803 A CN201910385803 A CN 201910385803A CN 110246472 A CN110246472 A CN 110246472A
Authority
CN
China
Prior art keywords
music
coding
mood
mode
target
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
Application number
CN201910385803.6A
Other languages
Chinese (zh)
Other versions
CN110246472B (en
Inventor
梅亚琦
刘奡智
王健宗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910385803.6A priority Critical patent/CN110246472B/en
Publication of CN110246472A publication Critical patent/CN110246472A/en
Application granted granted Critical
Publication of CN110246472B publication Critical patent/CN110246472B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC 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/00Details of electrophonic musical instruments
    • G10H1/0033Recording/reproducing or transmission of music for electrophonic musical instruments
    • G10H1/0041Recording/reproducing or transmission of music for electrophonic musical instruments in coded form
    • G10H1/0058Transmission between separate instruments or between individual components of a musical system
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10HELECTROPHONIC 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/00Aspects 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/325Musical pitch modification

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Electrophonic Musical Instruments (AREA)
  • Auxiliary Devices For Music (AREA)

Abstract

The present invention provides a kind of conversion method of music style, device and terminal devices, are suitable for technical field of data processing, this method comprises: obtaining the first musical instrument digital interface MIDI file about original audio data;The note element that the first MIDI file is included is parsed, and coded treatment is carried out by pitch value of the preset algorithm to note element, obtains the first coding;Obtain the coding mapping relation table of association original music mode and target music mood;Corresponding second coding of the first coding is determined based on coding mapping relation table, and processing is decoded to the second coding, to determine the pitch value of the second coding;The 2nd MIDI file of the pitch value about each second coding is generated, and target audio data are obtained according to the 2nd MIDI file.In the present invention, since user no longer needs to the music style for manually changing audio data according to the invention of oneself, it is thereby achieved that the automation of music style is converted, the flexibility and accuracy of music style migration are improved.

Description

A kind of conversion method of music style, device and terminal device
Technical field
The invention belongs to technical field of data processing more particularly to a kind of conversion method of music style, device, terminal to set Standby and computer readable storage medium.
Background technique
With the development of human material's civilization, spiritual civilization also starts to have obtained pay attention to day by day.It is prevailing in entertainment In the epoch, the technology of music field plays particularly important effect to contemporary spiritual civilization construction, and music style migrates always all It is a big rigid demand in music music field.Music style migrating technology can provide for all kinds of entertainment medias, singer or composer etc. It easily supports very much, such as: when playing the video image of the more sad painting style, the music style of the more droning sorrow of use Carry out music;When playing more celebrating video image, then switch the music style progress music for choosing more cheerful and light-hearted happiness.
However, usually, the migration of melody music style is all to be set up by user according to the invention of oneself At, accordingly, it is difficult to realize the automation migration of music style, there is lower flexibility.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of conversion method of music style, device, terminal device and calculating Machine readable storage medium storing program for executing was migrated with solving the automation migration for being difficult to realize music style in the prior art and music style The lower problem of flexibility in the presence of journey.
The first aspect of the embodiment of the present invention provides a kind of conversion method of music style, comprising:
Obtain the first musical instrument digital interface MIDI file about original audio data;
The note element that the first MIDI file is included is parsed, and by preset algorithm to the sound of the note element High level carries out coded treatment, obtains the first coding;
Obtain the coding mapping relation table of association original music mode and target music mood;
Corresponding second coding of first coding is determined based on the coding mapping relation table, and to second coding It is decoded processing, with the pitch value of determination second coding;
The 2nd MIDI file of the pitch value about each second coding is generated, and according to the 2nd MIDI file Obtain target audio data.
The second aspect of the embodiment of the present invention provides a kind of conversion equipment of music style, comprising:
First acquisition unit, for obtaining the first musical instrument digital interface MIDI file about original audio data;
Resolution unit, the note element for being included for parsing the first MIDI file, and by preset algorithm to institute The pitch value for stating note element carries out coded treatment, obtains the first coding;
Second acquisition unit, for obtaining the coding mapping relationship of association original music mode and target music mood Table;
Decoding unit, for determining corresponding second coding of first coding based on the coding mapping relation table, and Processing is decoded to second coding, with the pitch value of determination second coding;
Generation unit, for generating the 2nd MIDI file of the pitch value about each second coding, and according to institute It states the 2nd MIDI file and obtains target audio data.
The third aspect of the embodiment of the present invention provides a kind of terminal device, including memory and processor, described to deposit Reservoir is stored with the computer program that can be run on the processor, and the processor is realized when executing the computer program The step of such as conversion method of above-mentioned music mood.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the processor realizes the conversion side such as above-mentioned music mood when executing the computer program The step of method.
In the embodiment of the present invention, by obtaining the musical instrument digital interface MIDI file about original audio data, so that being System can parse digitized MIDI file, to determine each note element and sound that original audio data is included Happy mode, to realize the encoding operation to note element.By pre-establishing about correlation between all kinds of music moods Coding mapping relation table so that each music in target music mood can be automatically determined when knowing target music mood The pitch value of element generates the target MIDI file about wherein each pitch value, realizes the automation conversion of music style.? During being somebody's turn to do, since user no longer needs to the music style for manually changing audio data according to the invention of oneself, mention The high flexibility and accuracy of music style migration.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is the implementation process schematic diagram of the conversion method of music style provided in an embodiment of the present invention;
Fig. 2 be another embodiment of the present invention provides music style conversion method implementation process schematic diagram;
Fig. 3 is the implementation process schematic diagram of the conversion method for the music style that further embodiment of this invention provides;
Fig. 4 is the implementation process schematic diagram of the conversion method for the music style that further embodiment of this invention provides;
Fig. 5 is the specific implementation flow chart of the conversion method S114 of music style provided in an embodiment of the present invention;
Fig. 6 is the structural block diagram of the conversion equipment of music style provided in an embodiment of the present invention;
Fig. 7 is the schematic diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
It should be understood that although term " first ", " second " etc. are used in some embodiment of the present invention in the text Various elements are described, but these elements should not be limited by these terms.These terms are used only to an element It is distinguished with another element.For example, the first coding can be named as the second coding, and similarly, the second coding can be by It is named as the first coding, without departing from the range of various described embodiments.First coding and the second coding are all codings, but It is them is not same type of coding.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Fig. 1 shows the implementation flow chart of the conversion method of music style provided in an embodiment of the present invention, and details are as follows:
S101: the first musical instrument digital interface MIDI file about original audio data is obtained.
In the embodiment of the present invention, need to be implemented the snatch of music that music style is converted into original audio data, in particular to The speech simulation signal of the musical sound type acquired in advance.Obtain the pleasure about the original audio data in the following manner Device digital interface (Musical Instrument Digital Interface, MIDI) file: to above sound analog signal It sampled, quantified and is encoded, obtain the MIDI file about original audio data;Alternatively, passing through MIDI keyboard or device of setting the chessman on the chessboard according to the chess manual Equal tools obtain the MIDI file about original audio data, comprising: if detecting, musical composition people triggers each happy key, According to the trigger sequence of each happy key, corresponding single melody MIDI file is generated;By MIDI keyboard or set the chessman on the chessboard according to the chess manual provided by device Mating interface receives its MIDI file transmitted.
In the embodiment of the present invention, the different musical sound of several height, around a certain middle heart sound for having sense of stability, by certain It is music mood that interval relation, which organizes together and is formed by an organic system,.Different music moods has different sounds Correlation between stage structure and sound level, so that different melodies can have different style characteristics.
The music mood of original audio data is original music mode.In the embodiment of the present invention, to original audio data Before carrying out music style conversion, the music mood of the original audio data is obtained, comprising: record the ginseng of input in advance according to user Number information extracts the music mood about the original audio data from parameter information;Alternatively, passing through detection original audio data In each note element musical alphabet, determine the music mood of original audio data.Wherein, music mood includes but is not limited to 20 Four big ditties, Chinese tradition Pentatonic and Japan all save mode etc..
It illustratively, only include this five musical alphabets of C, D, E, G, A in original audio data if detecting, it is determined that its is original Music mood is Chinese tradition Pentatonic.
S102: the note element that parsing the first MIDI file is included, and by preset algorithm to the note member The pitch value of element carries out coded treatment, obtains the first coding.
In the embodiment of the present invention, the MIDI file about original audio data is traversed by preset algorithm, to detect its packet The pitch value of each note element contained, and in the array that the deposit of each pitch value is pre-established.Wherein, the sound of note element High level indicates its MIDI pitch.Above-mentioned preset algorithm is used for the corresponding relationship according to note element and MIDI pitch, exports MIDI The corresponding MIDI pitch of each note element in file.For example, if preset algorithm may is that for i in midi:pitches =i.pitch;Then for note Elements C 4, D4, E4, F4, G4, after being inputted the preset algorithm, correspondence can be exported respectively MIDI pitch be 60,62,64,65,67.
In the embodiment of the present invention, according to preset encryption algorithm, the MIDI pitch in array is handled, to generate One coding.Illustratively, each note element for being 60,62,64,65,67 for MIDI pitch, with the numerical value 12 of 12 equal temperances For modulus value, by modulus algorithm, exportable corresponding each first is encoded to ac、bc、cc、dc、ec.Modulus algorithm for example can be with It is: for arr [i] in arr:if mod (arr [i], 12)=0new_arr.push (ac) | if mod (arr [i], 12)= 2new_arr.push(bc) | if mod (arr [i], 12)=4new_arr.push (cc) | if mod (arr [i], 12)= 7new_arr.push(dc) | if mod (arr [i], 12)=9new_arr.push (ec).Wherein, arr is coded sequence, and i is The index of pitch sequence, i.e. the MIDI pitch of some note element, new_arr are the newly encoded sequence of output.
S103: the coding mapping relation table of association original music mode and target music mood is obtained.
Target music mood is wanted the music wind that the music style type obtained or current application scene are adapted to by user Lattice type.For example, if the original music mode of audio data is Chinese tradition Pentatonic, and user wants Chinese tradition five The section audio data of tone formula are converted to the audio data that Japan all saves mode, then the target music mood at current time is Japan all saves mode.
Target music mood can choose instruction according to mode that user is issued in terminal interface to determine, can also be by System is chosen automatically.
The mode of target music mood is determined to instruction is chosen based on mode, specifically, is executing turning for music mood It changes before operation, in terminal interface, shows one or more display controls.Each display control is used to identify and can be selected One music mood.If the selection for detecting that user issues any display control instructs, which is identified Music mood is determined as target music mood.
Preferably, if the target music mood detected automatically chooses the determined target music of instruction with according to mode Mode is different, then obtains priority corresponding to each detection mode, and chooses the detection mode institute of wherein highest priority The music mood matched is as target music mood.
Preferably, the detection mode of target music mood is determined to instruction is chosen based on mode, default priority is Highest priority.
Preferably, priority corresponding to above-mentioned all kinds of detection modes sets the parameters to determine according to preparatory typing.
In the embodiment of the present invention, coding mapping relation table describes the one-to-one correspondence between different music mood note elements Relationship, the coding mapping relationship between different music moods construct in advance according to music theory knowledge.For example, in c major, if sound A is encoded to corresponding to symbol Elements Cc, and need to be converted to the original audio data of c major the target audio data of the big tune of G, Then with coding acCoding with mapping relations will be redefined for ec, and encode ecIt is corresponding with note element G.
Illustratively, mode is all saved with Japan and can be with the associated coding mapping relation table of Chinese tradition Pentatonic Are as follows: ac→ar;bc→br;cc→cr;dc→dr;ec→er
The target music mood and original music mode detected according to current time, in pre-stored multiple volumes In code mapping table, determine and the target music mood and the matched coding mapping relation table of original music mode.
S104: corresponding second coding of first coding is determined based on the coding mapping relation table, and to described the Two codings are decoded processing, with the pitch value of determination second coding.
To generated in above-mentioned S103 each first coding, in the coding mapping relation table determined, search with Corresponding second coding of first coding.By the inclusion of the preset algorithm of the second coding and MIDI pitch matching relationship, output The wherein MIDI pitch of each the second coding.
S105: the 2nd MIDI file of the pitch value about each second coding is generated, and according to described second MIDI file obtains target audio data.
For the first MIDI file of original audio data, in its channel sound information, each note element is read Note-On note opens information and Note-Off note closes information.Note-On note opens information and Note-Off note closes letter The start/stop time for marking note element is ceased, so as to open information and Note-Off note pass letter based on Note-On note Breath, determines the duration of each note element.In the embodiment of the present invention, the corresponding note element of the first coding of record Note-On note opens information and Note-Off note closes information.The second coding corresponding for first coding, by this Note-On note opens information and Note-Off note closes note element binding corresponding to information and second coding.At this point, Since the MIDI pitch and note duration of the corresponding note element of the second coding can determine, according to each Second coding puts in order, and the music element of respective corresponding output is sequentially written in new the 2nd MIDI text currently created In part.
By playing out to the 2nd MIDI file of output, enable the music style of original audio data from original Music mood is converted to target music mood.
In the embodiment of the present invention, by obtaining the musical instrument digital interface MIDI file about original audio data, so that being System can parse digitized MIDI file, to determine each note element and sound that original audio data is included Happy mode, to realize the encoding operation to note element.By pre-establishing about correlation between all kinds of music moods Coding mapping relation table so that each music in target music mood can be automatically determined when knowing target music mood The pitch value of element generates the target MIDI file about wherein each pitch value, to realize the automation conversion of music style. In the process, since user no longer needs to the music style for manually changing audio data according to the invention of oneself, it mentions The high flexibility and accuracy of music style migration.
As another embodiment of the invention, on the basis of above-described embodiment, target sound is automatically determined to system The mode of happy mode is further limited.As shown in Fig. 2, before above-mentioned S103, further includes:
S106: the scene types of adaptations at current time is determined;The scene types of adaptations is for describing target audio data Application scenarios.
In the embodiment of the present invention, scene types of adaptations of the current time about target audio data is detected, scene is adapted to class Type includes but is not limited to the preset kinds such as video display, speech, outdoor sports and sleep.Scene types of adaptations is inputted by user Set the parameters to determine.
S107: if the scene types of adaptations is video display, the video image frame played in real time is obtained.
S108: the characteristic information that the video image frame is included is obtained.
S109: if the characteristic information matches with the characteristic information in any the presets list, by described the presets list Corresponding music mood is determined as the target music mood at current time.
If detecting, the scene types of adaptations at current time is video display, then it represents that target audio data application is in magic lantern Among the scene that piece plays or image plays.By preset video display platform mating interface, obtained in real time in broadcasting The video image frame of state, and it is based on image recognition algorithm, determine the various features information that current video image frame is included.It is special Reference breath includes semantic information and object type etc..
In the embodiment of the present invention, load and the matched multiple the presets lists of each music mood.Each the presets list record There is multinomial characteristic information relevant to scene type.For example, may include having football, basketball, running and movement in the presets list The characteristic information relevant to sport such as clothing.
If detected characteristic information is matched with the characteristic information in any the presets list in current video image frame, By the presets list matched music mood be determined as the target music mood at current time.
Illustratively, if in current video image frame including text informations such as " happy new year ", and such red-letter day feature Information is present in the presets list 1, then is determined as currently needing to original audio number by the 1 matched music mood of institute of the presets list According to obtained target music mood after progress music style conversion.At this point, the 1 matched music mood of institute of the presets list can be pre- It is set as more cheerful and more light-hearted music mood, such as all kinds of big tune formulas.
As another embodiment of the invention, in above-mentioned S109, if detecting spy included in video image frame Reference breath included with any the presets list characteristic information match, and music mood corresponding to the presets list for two with On, then as shown in figure 3, after above-mentioned S109, further includes:
S110: the historical usage number of each music mood corresponding to described the presets list is obtained respectively.
In the embodiment of the present invention, every time when music mood corresponding to the presets list is determined as target music mood, The historical usage number of the music mood is executed plus one is handled, and processing result is stored to tables of data.
To the video image frame that above-mentioned S109 is detected, if characteristic information included in the video image frame with appoint The characteristic information matching that one the presets list is included reads each sound corresponding with the presets list then from above-mentioned tables of data The historical usage number of happy mode.
S111: target music tune of the least music mood of the historical usage number as current time is chosen Formula, and real-time monitoring is carried out to the video image frame.
By comparing the numerical values recited of the historical usage number of each music mood, it is least to select historical usage number Target music mood of the music mood as current time.Wherein, if the least music mood of historical usage number is two More than a, then a music mood is therefrom randomly selected as target music mood.
After determining the target music mood at current time, video image frame that persistently video display platform is played into Row monitoring, to determine whether current video image frame changes relative to a upper video image frame.
S112: it if the characteristic information for monitoring that the video image frame is included changes, and changes amplitude and is less than in advance If threshold value, then target music tune of the least music mood of the historical usage number as current time is persistently applied Formula.
S113: if monitoring, the change amplitude of the characteristic information is greater than or equal to preset threshold, reacquires and becomes Music mood corresponding to the presets list is then updated to current time by the presets list that the characteristic information after more matches Target music mood.
In the embodiment of the present invention, if monitoring, current video image frame is changed relative to a upper video image frame, Obtain the characteristic information that current video image frame is included.By preset image alignment algorithm, calculate current characteristic information with The change amplitude for the characteristic information that a upper video image frame is included.If the amplitude of change is less than preset threshold, then follow the steps The holding of music mood determined by previous moment is chosen to be target music mood by S112;If the amplitude of change is greater than or equal to pre- If threshold value then returns to step S109, to judge the matched the presets list of characteristic information institute at current time, and this is preset Music mood corresponding to list is updated to the target music mood at current time.
The step realization principle that do not mention in the embodiment of the present invention is identical as the step realization principle of remaining each embodiment, Therefore it no longer repeats one by one.
It is view in scene types of adaptations by determining the scene types of adaptations of target audio data in the embodiment of the present invention In the case that frequency is demonstrated, the default column that all kinds of music moods are corresponded to come Auto-matching are detected according to the feature to video image frame Table, and music mood corresponding to the presets list that matching is obtained realizes target music mood as target music mood Automation selection, ensure that user without by hand choose target music mood, reduce operation complexity and cumbersome degree;It is logical The change amplitude for crossing the characteristic information that detection video image frame is included persistently applies original mesh when the amplitude of change is smaller Music mood is marked, the music style that background system needs continuously to change audio data is avoided, improves target audio The broadcasting continuity of data, thus also reduces the consumption of system operations resource;By redefining when the amplitude of change is larger The target music mood at current time, ensure that target music mood and practical application scene can matching degree with higher, To improve the applicability of target audio data.
As one more embodiment of the present invention, Fig. 4 shows the conversion method of music style provided in an embodiment of the present invention Implementation process.As shown in figure 4, further including step S114 before above-mentioned S103, the first MIDI file is identified Processing, with the original music mode of the determination original audio data.
Wherein, step S114 includes S1141 to S1144.The realization principle of each step is specific as follows:
S1141: the note element that parsing the first MIDI file is included, and generate and be based on each note element The first scale sequence.
In the embodiment of the present invention, the first MIDI file of the parsing music element that is included, that is, determine it includes each sound Happy element is which of 12 sound ranks note.12 sound ranks include C, C#, D, D#, E, F, F#, G, G#, A, A# and B。
According to the MIDI pitch of each music element parsed, each music element is ranked up, to obtain first Scale sequence.Wherein, the music element repeated is not included in the first scale sequence.
S1142: the second scale sequence corresponding to each preset musical mode is obtained respectively.
According to music theory knowledge it is found that each preset musical mode has corresponding scale, therefore, in the embodiment of the present invention, Based on the setting instruction being previously received, obtains and store the second scale sequence corresponding to each preset musical mode.Such as: Second scale sequence corresponding to c major are as follows: { C D E F G A B C }, the second scale sequence corresponding to the big tune of E are as follows: { E F#G#A B C#D#E}。
S1143: the similarity by comparing the first scale sequence and each second scale sequence calculates separately The statistics score of the preset musical mode corresponding to each second scale sequence.
The first scale sequence and second sound are calculated by preset algorithm to each pre-stored second scale sequence The similarity of rank sequence, and it is based on the similarity, calculate counting for preset musical mode corresponding to the second scale sequence Point.Wherein, statistics score is used to indicate the matching degree of the first scale sequence and preset musical mode, and statistics score to it is similar Degree is positively correlated.
Optionally, in order to reduce computational complexity, the similarity of above-mentioned first scale sequence and the second scale sequence is straight Connect the statistics score that output is preset musical mode corresponding with the second scale sequence.
Optionally, above by preset algorithm, the similarity of the first scale sequence and the second scale sequence, packet are calculated It includes: generating and the corresponding primary vector of the first scale sequence and secondary vector corresponding with the second scale sequence respectively;It calculates The cosine similarity of primary vector and secondary vector;It is the first scale sequence and the second scale sequence by cosine similarity output The similarity of column.
S1144: the preset musical mode of the statistics highest scoring is determined as the original music mode.
In the embodiment of the present invention, after the statistics score that each preset musical mode is calculated separately by above-mentioned S1143, screening The preset musical mode of highest scoring is counted out, then the default mode is the original music mode of original audio data.
Preferably as one embodiment of the present of invention, Fig. 5 shows turning for music style provided in an embodiment of the present invention The specific implementation flow of method S1143 is changed, details are as follows:
S11431: to each second scale sequence, by comparing the first scale sequence and the second scale sequence The similarity of column calculates the first score value of the preset musical mode corresponding with the second scale sequence.
In the embodiment of the present invention, by preset algorithm, the similarity of the first scale sequence and the second scale sequence is calculated, And the incidence relation based on the similarity Yu the first score value, determine of preset musical mode corresponding to the second scale sequence One score value.
Wherein, the incidence relation of similarity and the first score value can be specific function relationship.At this point, by that will be calculated The first scale sequence and the second scale sequence input parameter of the similarity as above-mentioned specific function, it is exportable corresponding Second score value.
S11432: the keynote element of the second scale sequence is obtained.
According to music theory knowledge, each music mood all has its corresponding keynote element.Keynote element is a music Most stable of sound in the core of mode and the music mood.For each preset musical mode, by its second music sequence In first note element be read as keynote element.
S11433: in the first scale sequence, the first of first note element and the keynote element is calculated separately Matching degree and the second matching degree for calculating tail portion note element and the keynote element.
In the embodiment of the present invention, the master of the first element and every one second scale sequence in the first scale sequence is calculated separately First matching degree of tone element.Illustratively, if the keynote of first element and one second scale sequence in the first scale sequence Element is identical, then first matching degree of the two is 1;If the master of first element and one second scale sequence in the first scale sequence Tone element is different, then first matching degree of the two is 0.
Similarly, the keynote element of the tail portion note element and every one second scale sequence in the first scale sequence is calculated separately The second matching degree.
S11434: it according to first matching degree and second matching degree, calculates corresponding with the second scale sequence Second score value of the preset musical mode, and it is based on first score value and second score value, it calculates and second sound The statistics score of the corresponding preset musical mode of rank sequence.
To the first matching degree and the second matching degree associated by every one second scale sequence, by preset algorithm to this One matching degree and the second matching degree carry out integration operation, obtain of preset musical mode corresponding to the second scale sequence Two score values.
In the embodiment of the present invention, the first score value and the second score value based on each preset musical mode calculate default sound The statistics score of happy mode.Calculation includes but is not limited to sum operation, ranking operation and all kinds of logical algorithm operations etc..
It is former under the music mood of original audio data and the matched situation of preset musical mode in the embodiment of the present invention Each music element that beginning audio data is included can be contained in scale sequence corresponding to preset musical mode, in big portion It is consistent in the case of point with music theory music principle, therefore, the first scale sequence and default sound by the first MIDI file of generation Second scale sequence of happy mode compares the similarity of the two to determine the statistics score of preset musical mode, and will count Point highest preset musical mode is identified as the original music mode of original audio data, realize to original music mode from Dynamicization detection, improves the intellectualized detection degree of music mood;Since the starting sound and ending sound of original audio data are usual Also it therefore can be matched by calculating first note element with the first of keynote element with the keynote Match of elemental composition of its music mood Degree and the second matching degree for calculating tail portion note element and keynote element, the considerations of polymorphic type can be integrated the factor it is pre- to calculate If the statistics score of music mood, thus also improve the Detection accuracy to original music mode.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Corresponding to the method for foregoing embodiments, Fig. 6 shows the conversion equipment of music style provided in an embodiment of the present invention Structural block diagram, for ease of description, only parts related to embodiments of the present invention are shown.The exemplary music style of Fig. 6 Conversion equipment can be the executing subject of the conversion method of the music style of previous embodiment offer.
Referring to Fig. 6, the conversion equipment of the music style includes:
First acquisition unit 61, for obtaining the first musical instrument digital interface MIDI file about original audio data.
Resolution unit 62, the note element for being included for parsing the first MIDI file, and pass through preset algorithm pair The pitch value of the note element carries out coded treatment, obtains the first coding.
Second acquisition unit 63, for obtaining the coding mapping relationship of association original music mode and target music mood Table.
Decoding unit 64, for determining corresponding second coding of first coding based on the coding mapping relation table, And processing is decoded to second coding, with the pitch value of determination second coding.
Generation unit 65, for generate about it is each it is described second coding pitch value the 2nd MIDI file, and according to The 2nd MIDI file obtains target audio data.
Optionally, the conversion equipment of the music style further include:
First determination unit, for determining the scene types of adaptations at current time;The scene types of adaptations is for describing The application scenarios of target audio data.
Third acquiring unit obtains the video figure played in real time if being video display for the scene types of adaptations As frame.
4th acquiring unit, the characteristic information for being included for obtaining the video image frame.
Second determination unit will if matching for the characteristic information and the characteristic information in any the presets list Music mood corresponding to described the presets list is determined as the target music mood at current time.
Optionally, if music mood corresponding to described the presets list is two or more, the conversion of the music style Device further include:
5th acquiring unit, the history for obtaining each music mood corresponding to described the presets list respectively are answered Use number.
Monitoring unit, for choosing target of the least music mood of the historical usage number as current time Music mood, and real-time monitoring is carried out to the video image frame.
Constant cell if the characteristic information for monitoring that the video image frame is included changes, and changes width Degree is less than preset threshold, then persistently applies target of the least music mood of the historical usage number as current time Music mood.
Updating unit, if for monitoring that the change amplitude of the characteristic information is greater than or equal to preset threshold, again The presets list to match with the characteristic information after change is obtained, then is updated to work as by music mood corresponding to the presets list The target music mood at preceding moment.
Optionally, the conversion equipment of the music style further include:
Recognition unit, for carrying out identifying processing to the first MIDI file, with the determination original audio data Original music mode.
Optionally, the recognition unit includes:
Parsing subunit, the note element for being included for parsing the first MIDI file, and generate and be based on each institute State the first scale sequence of note element;
Subelement is obtained, for obtaining the second scale sequence corresponding to each preset musical mode respectively;
Computation subunit, for similar to each second scale sequence by comparing the first scale sequence Degree, calculates separately the statistics score of the preset musical mode corresponding to each second scale sequence;
Subelement is determined, for the preset musical mode of the statistics highest scoring to be determined as the original music Mode.
Optionally, the computation subunit is specifically used for:
It is similar to the second scale sequence by comparing the first scale sequence to each second scale sequence Degree calculates the first score value of the preset musical mode corresponding with the second scale sequence;
Obtain the keynote element of the second scale sequence;
In the first scale sequence, calculate separately the first matching degree of first note element and the keynote element with And calculate the second matching degree of tail portion note element and the keynote element;
According to first matching degree and second matching degree, calculate corresponding with the second scale sequence described default Second score value of music mood, and it is based on first score value and second score value, it calculates and the second scale sequence pair The statistics score for the preset musical mode answered.
In the embodiment of the present invention, by obtaining the musical instrument digital interface MIDI file about original audio data, so that being System can parse digitized MIDI file, to determine each note element and sound that original audio data is included Happy mode, to realize the encoding operation to note element.By pre-establishing about correlation between all kinds of music moods Coding mapping relation table so that each music in target music mood can be automatically determined when knowing target music mood The pitch value of element generates the target MIDI file about wherein each pitch value, to realize the automation conversion of music style. In the process, since user no longer needs to the music style for manually changing audio data according to the invention of oneself, it mentions The high flexibility and accuracy of music style migration.
Fig. 7 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in fig. 7, the terminal of the embodiment is set Standby 7 include: processor 70 and memory 71, and the calculating that can be run on the processor 70 is stored in the memory 71 Machine program 72.The processor 70 realizes that the conversion method of above-mentioned each music style is implemented when executing the computer program 72 Step in example, such as step 101 shown in FIG. 1 is to 105.Alternatively, when the processor 70 executes the computer program 72 Realize the function of each module/unit in above-mentioned each Installation practice, such as the function of unit 61 to 65 shown in Fig. 6.
The terminal device 7 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The terminal device may include, but be not limited only to, processor 70, memory 71.It will be understood by those skilled in the art that Fig. 7 The only example of terminal device 7 does not constitute the restriction to terminal device 7, may include than illustrating more or fewer portions Part perhaps combines certain components or different components, such as the terminal device can also include input sending device, net Network access device, bus etc..
Alleged processor 70 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 71 can be the internal storage unit of the terminal device 7, such as the hard disk or interior of terminal device 7 It deposits.The memory 71 is also possible to the External memory equipment of the terminal device 7, such as be equipped on the terminal device 7 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 71 can also both include the storage inside list of the terminal device 7 Member also includes External memory equipment.The memory 71 is for storing needed for the computer program and the terminal device Other programs and data.The memory 71, which can be also used for temporarily storing, have been sent or data to be sent.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the essence of corresponding technical solution is departed from the spirit and scope of the technical scheme of various embodiments of the present invention, it should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of conversion method of music mood characterized by comprising
Obtain the first musical instrument digital interface MIDI file about original audio data;
The note element that the first MIDI file is included is parsed, and by preset algorithm to the pitch value of the note element Coded treatment is carried out, the first coding is obtained;
Obtain the coding mapping relation table of association original music mode and target music mood;
Corresponding second coding of first coding is determined based on the coding mapping relation table, and second coding is carried out Decoding process, with the pitch value of determination second coding;
The 2nd MIDI file of the pitch value about each second coding is generated, and is obtained according to the 2nd MIDI file Target audio data.
2. the conversion method of music mood as described in claim 1, which is characterized in that be associated with original music tune in the acquisition Before the coding mapping relation table of formula and target music mood, further includes:
Determine the scene types of adaptations at current time;The scene types of adaptations is used to describe the applied field of target audio data Scape;
If the scene types of adaptations is video display, the video image frame played in real time is obtained;
Obtain the characteristic information that the video image frame is included;
If the characteristic information matches with the characteristic information in any the presets list, by sound corresponding to described the presets list Happy mode is determined as the target music mood at current time.
3. the conversion method of music mood as claimed in claim 2, which is characterized in that if sound corresponding to described the presets list Happy mode is two or more, then the conversion method of the music mood includes:
The historical usage number of each music mood corresponding to described the presets list is obtained respectively;
Target music mood of the least music mood of the historical usage number as current time is chosen, and to described Video image frame carries out real-time monitoring;
If the characteristic information for monitoring that the video image frame is included changes, and changes amplitude and be less than preset threshold, then Persistently target music mood of the application least music mood of the historical usage number as current time;
If monitoring, the change amplitude of the characteristic information is greater than or equal to preset threshold, reacquires and the feature after change Music mood corresponding to the presets list is then updated to the target music tune at current time by the presets list that information matches Formula.
4. the conversion method of music mood as described in claim 1, which is characterized in that be associated with original music tune in the acquisition Before the coding mapping relation table of formula and target music mood, further includes:
Identifying processing is carried out to the first MIDI file, with the original music mode of the determination original audio data.
5. the conversion method of music mood as claimed in claim 4, which is characterized in that it is described to the first MIDI file into Row identifying processing, with the original music mode of the determination original audio data, comprising:
The note element that the first MIDI file is included is parsed, and generates the first scale based on each note element Sequence;
The second scale sequence corresponding to each preset musical mode is obtained respectively;
By comparing the similarity of the first scale sequence and each second scale sequence, each described the is calculated separately The statistics score of the preset musical mode corresponding to two scale sequences;
The preset musical mode of the statistics highest scoring is determined as the original music mode.
6. the conversion method of music style as claimed in claim 5, which is characterized in that described by comparing first scale The similarity of sequence and each second scale sequence calculates separately described pre- corresponding to each second scale sequence If the statistics score of music mood, comprising:
To each second scale sequence, by comparing the similarity of the first scale sequence and the second scale sequence, Calculate the first score value of the preset musical mode corresponding with the second scale sequence;
Obtain the keynote element of the second scale sequence;
In the first scale sequence, the first matching degree and meter of first note element Yu the keynote element are calculated separately Calculate the second matching degree of tail portion note element and the keynote element;
According to first matching degree and second matching degree, the preset musical corresponding with the second scale sequence is calculated Second score value of mode, and it is based on first score value and second score value, it calculates corresponding with the second scale sequence The statistics score of the preset musical mode.
7. a kind of conversion equipment of music style characterized by comprising
First acquisition unit, for obtaining the first musical instrument digital interface MIDI file about original audio data;
Resolution unit, the note element for being included for parsing the first MIDI file, and by preset algorithm to the sound The pitch value of symbol element carries out coded treatment, obtains the first coding;
Second acquisition unit, for obtaining the coding mapping relation table of association original music mode and target music mood;
Decoding unit, for determining corresponding second coding of first coding based on the coding mapping relation table, and to institute It states the second coding and is decoded processing, with the pitch value of determination second coding;
Generation unit, for generating the 2nd MIDI file of the pitch value about each second coding, and according to described the Two MIDI files obtain target audio data.
8. the conversion equipment of music style as claimed in claim 7, which is characterized in that further include:
First determination unit, for determining the scene types of adaptations at current time;The scene types of adaptations is for describing target The application scenarios of audio data;
Third acquiring unit obtains the video image frame played in real time if being video display for the scene types of adaptations;
4th acquiring unit, the characteristic information for being included for obtaining the video image frame;
Second determination unit will be described if matching for the characteristic information and the characteristic information in any the presets list Music mood corresponding to the presets list is determined as the target music mood at current time.
9. a kind of terminal device, including memory and processor, the memory, which is stored with, to be run on the processor Computer program, which is characterized in that the processor is realized when executing the computer program as claim 1 to 6 is any The step of item the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 6 of realization the method.
CN201910385803.6A 2019-05-09 2019-05-09 Music style conversion method and device and terminal equipment Active CN110246472B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910385803.6A CN110246472B (en) 2019-05-09 2019-05-09 Music style conversion method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910385803.6A CN110246472B (en) 2019-05-09 2019-05-09 Music style conversion method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN110246472A true CN110246472A (en) 2019-09-17
CN110246472B CN110246472B (en) 2024-05-24

Family

ID=67883970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910385803.6A Active CN110246472B (en) 2019-05-09 2019-05-09 Music style conversion method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN110246472B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111326131A (en) * 2020-03-03 2020-06-23 北京香侬慧语科技有限责任公司 Song conversion method, device, equipment and medium
CN112216257A (en) * 2020-09-29 2021-01-12 南方科技大学 Music style migration method, model training method, device and storage medium
CN112820255A (en) * 2020-12-30 2021-05-18 北京达佳互联信息技术有限公司 Audio processing method and device
EP3826000A1 (en) * 2019-11-21 2021-05-26 Spotify AB Automatic preparation of a new midi file
CN113539215A (en) * 2020-12-29 2021-10-22 腾讯科技(深圳)有限公司 Music style conversion method, device, equipment and storage medium
CN115273866A (en) * 2022-06-23 2022-11-01 天水师范学院 Audio conversion method, device and storage medium
CN115297108A (en) * 2022-08-11 2022-11-04 青岛美迪康数字工程有限公司 Diagnosis and treatment quality control file transmission method and device based on piano syllables

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5889224A (en) * 1996-08-06 1999-03-30 Yamaha Corporation Karaoke scoring apparatus analyzing singing voice relative to melody data
US20020134219A1 (en) * 2001-03-23 2002-09-26 Yamaha Corporation Automatic music composing apparatus and automatic music composing program
JP2005025715A (en) * 2002-11-25 2005-01-27 Matsushita Electric Ind Co Ltd Device and method for producing and reproducing short film
JP2011118218A (en) * 2009-12-04 2011-06-16 Ryukoku Univ Automatic arrangement system and automatic arrangement method
CN105810209A (en) * 2016-01-04 2016-07-27 邱子皓 Data conversion method based on mapping relation
CN108231046A (en) * 2017-12-28 2018-06-29 腾讯音乐娱乐科技(深圳)有限公司 The recognition methods of song tonality and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5889224A (en) * 1996-08-06 1999-03-30 Yamaha Corporation Karaoke scoring apparatus analyzing singing voice relative to melody data
US20020134219A1 (en) * 2001-03-23 2002-09-26 Yamaha Corporation Automatic music composing apparatus and automatic music composing program
JP2005025715A (en) * 2002-11-25 2005-01-27 Matsushita Electric Ind Co Ltd Device and method for producing and reproducing short film
JP2011118218A (en) * 2009-12-04 2011-06-16 Ryukoku Univ Automatic arrangement system and automatic arrangement method
CN105810209A (en) * 2016-01-04 2016-07-27 邱子皓 Data conversion method based on mapping relation
CN108231046A (en) * 2017-12-28 2018-06-29 腾讯音乐娱乐科技(深圳)有限公司 The recognition methods of song tonality and device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11676565B2 (en) 2019-11-21 2023-06-13 Spotify Ab Automatic preparation of a new MIDI file
EP3826000A1 (en) * 2019-11-21 2021-05-26 Spotify AB Automatic preparation of a new midi file
EP3989216A1 (en) * 2019-11-21 2022-04-27 Spotify AB Automatic preparation of a new midi file
CN111326131B (en) * 2020-03-03 2023-06-02 北京香侬慧语科技有限责任公司 Song conversion method, device, equipment and medium
CN111326131A (en) * 2020-03-03 2020-06-23 北京香侬慧语科技有限责任公司 Song conversion method, device, equipment and medium
CN112216257B (en) * 2020-09-29 2023-08-15 南方科技大学 Music style migration method, model training method, device and storage medium
CN112216257A (en) * 2020-09-29 2021-01-12 南方科技大学 Music style migration method, model training method, device and storage medium
CN113539215A (en) * 2020-12-29 2021-10-22 腾讯科技(深圳)有限公司 Music style conversion method, device, equipment and storage medium
CN113539215B (en) * 2020-12-29 2024-01-12 腾讯科技(深圳)有限公司 Music style conversion method, device, equipment and storage medium
CN112820255A (en) * 2020-12-30 2021-05-18 北京达佳互联信息技术有限公司 Audio processing method and device
CN115273866A (en) * 2022-06-23 2022-11-01 天水师范学院 Audio conversion method, device and storage medium
CN115273866B (en) * 2022-06-23 2024-05-10 天水师范学院 Audio conversion method, device and storage medium
CN115297108A (en) * 2022-08-11 2022-11-04 青岛美迪康数字工程有限公司 Diagnosis and treatment quality control file transmission method and device based on piano syllables
CN115297108B (en) * 2022-08-11 2023-08-25 青岛美迪康数字工程有限公司 Diagnosis and treatment quality control file transmission method and device based on piano syllables

Also Published As

Publication number Publication date
CN110246472B (en) 2024-05-24

Similar Documents

Publication Publication Date Title
CN110246472A (en) A kind of conversion method of music style, device and terminal device
Yang et al. MidiNet: A convolutional generative adversarial network for symbolic-domain music generation
CN101950377A (en) The new method of novel Markov sequence maker and generation Markov sequence
KR20090051173A (en) Method and device for the automatic or semi-automatic composition of a multimedia sequence
Nakamura et al. Statistical piano reduction controlling performance difficulty
US20200228596A1 (en) Streaming music categorization using rhythm, texture and pitch
CN109326270A (en) Generation method, terminal device and the medium of audio file
JP2000221968A (en) Automatic musical composition device and memory medium
CN102541980A (en) Information processing apparatus, information processing method, and program
CN110867174A (en) Automatic sound mixing device
SE527425C2 (en) Procedure and apparatus for musical depiction of an external process
CN110134823B (en) MIDI music genre classification method based on normalized note display Markov model
US10431191B2 (en) Method and apparatus for analyzing characteristics of music information
CN112420002A (en) Music generation method, device, electronic equipment and computer readable storage medium
WO1999046758A1 (en) Method for automatically controlling electronic musical devices by means of real-time construction and search of a multi-level data structure
Hirata et al. Interactive Music Summarization based on GTTM.
CN110516103A (en) Song rhythm generation method, equipment, storage medium and device based on classifier
CN114461885A (en) Song quality evaluation method, device and storage medium
CN109448697A (en) Poem melody generation method, electronic device and computer readable storage medium
Dubnov et al. Delegating creativity: Use of musical algorithms in machine listening and composition
CN114267318A (en) Method for generating Midi music file, storage medium and terminal
CN113140202A (en) Information processing method, information processing device, electronic equipment and storage medium
JP2006201278A (en) Method and apparatus for automatically analyzing metrical structure of piece of music, program, and recording medium on which program of method is recorded
CN109903744B (en) Melody generation method, melody generation device, computer-readable storage medium, and computer apparatus
CN112989109A (en) Music structure analysis method, electronic equipment and storage medium

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