Method and apparatus for generating string burning music

By preprocessing and splicing music materials, the problem of long production cycles for mashup music has been solved, enabling the rapid generation of mashup music and meeting diverse music needs.

CN115457924BActive Publication Date: 2025-10-17BEIJING HONGMIAN XIAOBING TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211262592.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-14
Publication Date
2025-10-17
Estimated Expiration
2042-10-14

AI Technical Summary

Technical Problem

The production cycle of medley music in the existing technology is long and the efficiency is low, which makes it difficult to meet people's growing needs.

Method used

By acquiring music materials from the material library, performing preset processing to determine the tempo, key, and measure, and splicing the materials to generate a medley of music under the condition of meeting the splicing requirements, the music can be generated in batches using text-type music files.

Benefits of technology

It enables the rapid and batch generation of medley music, satisfying people's demand for diverse music.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115457924B_ABST
    Figure CN115457924B_ABST
Patent Text Reader

Abstract

The application provides a method and device for generating a mashup music, and relates to the field of audio processing. The method comprises the following steps: obtaining a first music material and a second music material in a material library; the material library comprises a plurality of music materials; in the case that the first music material and the second music material meet a preset splicing condition, splicing the first music material and the second music material to generate a mashup music; wherein the music materials in the material library are obtained by processing music files of a text type according to a preset processing method; the preset processing method is used to determine the tempo, mode, music bar and chord of each music bar of a music file corresponding to a music piece. The method and device for generating a mashup music are used to improve the production efficiency of the mashup music, so as to meet the demand of people for the mashup music.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of audio processing, and in particular to a method and device for generating a mixtape. BACKGROUND

[0002] With the acceleration of modern life, people's demand for diversified music is also growing, for example, in addition to listening to the whole song from the beginning to the end, people's demand for mixtape composed of different styles and types of music clips is also growing.

[0003] In the related art, mixtape is mainly selected and sung by professional music producers, and finally post-produced by software. Its production cycle is long, and the number of works is limited, which is difficult to meet people's growing demand for mixtape. SUMMARY

[0004] The purpose of the present application is to provide a method and device for generating a mixtape, which can improve the production efficiency of mixtape to meet people's demand for mixtape.

[0005] The present application provides a method for generating a mixtape, comprising:

[0006] obtaining a first music material and a second music material in a material library; the material library includes a plurality of music materials; in the case that the first music material and the second music material meet a preset splicing condition, the first music material and the second music material are spliced to generate a mixtape; wherein the music materials in the material library are obtained by processing music files of text type according to a preset processing method; the preset processing method is used to determine the tempo, mode, music bar and chord of each music bar of the music file corresponding to the music.

[0007] Optionally, any music material in the material library is obtained by the following steps: obtaining a target music file, and determining the pitch and time value of each music tone of the target music according to the target music file; determining the tempo and mode of each music section according to the pitch and time value of each music tone; performing bar division on each music section by a prior model according to the prior knowledge of music bar, and obtaining a bar division result; one music section corresponds to at least one bar division result; correcting the position of the note in each music section according to the relative position relationship between the notes and bar lines in the music score corresponding to the music section, and adjusting at least one note to the beat; matching the chords of different combinations of bar division results according to the bar division result of each music section, and if there are multiple adjacent bars in the same music section that meet the preset chord, the music sentence corresponding to the multiple bars is taken as a music material.

[0008] Optionally, after the step of taking the multiple phrases corresponding to the multiple measures as the music materials, the method further comprises: removing the target music material from the material library in a case that there is a target note in a target measure of the target music material; wherein the target note is not a chord inner note of the target measure, not a passing note, and not a chord inner note of a next measure as a weak start.

[0009] Optionally, after the step of taking the multiple phrases corresponding to the multiple measures as the music materials, the method further comprises: calculating a similarity between a melody sequence of a first measure and a melody sequence of a second measure of each music material according to an edit distance between the melody sequence of the first measure and the melody sequence of the second measure; removing the music material with a similarity between the melody sequences less than a preset similarity from the material library; wherein the first measure comprises at least two consecutive measures; the second measure comprises at least two consecutive measures; the first measure and the second measure are not consecutive.

[0010] Optionally, the step of obtaining a target music file and determining a pitch and a duration of each note of a target music according to the target music file comprises: in a case that the target music file is a musical instrument digital interface (MIDI) file, converting a relative position in a start event, a relative position in an end event, and a relative position in a lyric in the MIDI file into an absolute position; combining the start event, the lyric, and the end event with the same absolute position into a note entry, and sorting the note entries according to absolute positions of the notes to obtain a note queue; the duration of the note in the note entry is represented by a length; determining a phrase and a section of the target music, and the pitch and the duration of each note according to the note queue; wherein parameters of the start event comprise the relative position, the pitch, and the volume; parameters of the end event comprise the relative position, the pitch, and the volume; the lyric comprises the relative position and a lyric text.

[0011] Optionally, the step of determining a tempo of the target music and a mode of each section according to the pitch and the duration of each note comprises: obtaining a duration of a shortest note of the target music, and determining a number of times of repeating the shortest note in a unit time as the tempo of the target music; the step of determining the mode of each section of the target music according to the pitch and the duration of each note comprises: obtaining a pitch of each note of a target section, and obtaining a target pitch set; in a case that the target pitch set is a subset of pitches contained in a target mode, determining the target mode as the mode of the target section; wherein the target section is any section in the target music.

[0012] Optionally, the step of performing the bar division on each music section according to the prior knowledge of music bars and by using the prior model, and obtaining a bar division result, comprises: predicting, according to the prior knowledge of music bars and by using the prior model, a position of a first bar line of each music section in a score corresponding to the target music; determining positions of remaining bar lines of each music section according to the position of the first bar line of each music section, a tempo of the target music, and a time signature of each music section; wherein the prediction result of the prior model for each music section is not unique.

[0013] Optionally, the step of correcting the positions of the notes in each music section according to the relative position relationship between the notes and the bar lines in the score corresponding to the music section, and adjusting at least one note to a beat, comprises: calculating distances between each note and the nearest beat in a target music section in a score corresponding to the target music, and obtaining a distance set; performing clustering analysis on distance values in the distance set, and dividing the distance values in the distance set into positive value classes and negative value classes; and according to the clustering analysis result, performing overall translation on the notes in the target music section, so that the position of at least one note is the same as the position of a beat; wherein the target music section is any music section of the target music; the beats within each bar of the target music section are determined according to the tempo of the target music and the time signature of the target music.

[0014] Optionally, the step of matching the different combinations of bar division results according to the bar division result of each music section, and if a plurality of adjacent bars in the same music section satisfy a preset harmonic progression, taking the music phrases corresponding to the plurality of bars as music materials, comprises: determining the chord of each bar of the target music section according to the pitch of the strong beat and the secondary strong beat within each bar of the target music section, and the chord of each bar; and in the case that the chords of a plurality of adjacent bars in the target music section satisfy the preset harmonic progression, taking the music phrases corresponding to the plurality of bars as music materials.

[0015] The application further provides a device for generating a mashup music, comprising:

[0016] The device comprises: an acquisition module, configured to acquire a first music material and a second music material in a material library; the material library comprises a plurality of music materials; and a generation module, configured to splice the first music material and the second music material to generate a mashup music in the case that the first music material and the second music material satisfy a preset splicing condition; wherein the music materials in the material library are obtained by processing music files of a text type according to a preset processing method; and the preset processing method is used to determine a tempo, a mode, music bars, and chords of each music bar of a music corresponding to the music files.

[0017] Optionally, the apparatus further comprises a determining module, a measure division module, a note position error correction module, and a harmony matching module; the obtaining module is further configured to obtain a target music file, and determine the pitch and time value of each note of a target music according to the target music file; the determining module is configured to determine the tempo of the target music and the mode of each section according to the pitch and time value of each note; the measure division module is configured to divide each section by a prior model according to the prior knowledge of a music measure, and obtain a measure division result; one section corresponds to at least one measure division result; the note position error correction module is configured to correct the position of a note in each section according to the relative position relationship between the note and a measure line in the corresponding music score of the section, and adjust at least one note to a beat; and the harmony matching module is configured to match the harmony of different combinations of measure division results according to the measure division result of each section, and if multiple adjacent measures in the same section satisfy a preset harmony, the corresponding phrase of the multiple measures is taken as a music material.

[0018] Optionally, the apparatus further comprises a material screening module; the material screening module is configured to remove a target music material from the material library if there is a target note in a target measure of the target music material; wherein the target note is not a chord inner note of the target measure, not a passing note, and not a chord inner note of the next measure as a weak start.

[0019] Optionally, the apparatus further comprises a calculating module; the calculating module is configured to calculate the similarity of a melody sequence of a first measure and a melody sequence of a second measure of each music material according to the edit distance between the melody sequence of the first measure and the melody sequence of the second measure; and the material screening module is further configured to remove a music material with a similarity of the melody sequence less than a preset similarity from the material library; wherein the first measure comprises at least two consecutive measures; the second measure comprises at least two consecutive measures; and the first measure and the second measure are discontinuous.

[0020] Optionally, the apparatus further comprises a music file processing module; the music file processing module is configured to, in the case that the target music file is a musical instrument digital interface (MIDI) file, convert relative positions in start events, relative positions in end events and relative positions in lyrics in the MIDI file into absolute positions; combine start events, lyrics and end events with the same absolute positions into musical note items, and sort the musical note items according to absolute positions of the musical notes to obtain a musical note queue; a duration of a musical note in the musical note item is represented by a length; the determining module is further configured to determine a phrase and a section of the target music, and a pitch and a duration of each musical note according to the musical note queue; wherein parameters of the start event include a relative position, a pitch and a volume; parameters of the end event include a relative position, a pitch and a volume; the lyrics include a relative position and a lyric text.

[0021] Optionally, the obtaining module is further configured to obtain a duration of the shortest musical note of the target music; the determining module is further configured to determine a number of times of repeating the shortest musical note in a unit of time as a tempo of the target music; the obtaining module is further configured to obtain pitches of each musical note of a target section to obtain a target pitch set; the determining module is further configured to determine a mode of the target section as a mode contained in the target pitch set; wherein the target section is any section in the target music.

[0022] Optionally, the measure division module is specifically configured to predict, according to prior knowledge of a music measure, a position of a first measure line of each section in a score corresponding to the target music by a prior model; the determining module is further configured to determine positions of remaining measure lines of each section according to the position of the first measure line of each section, the tempo of the target music and a time signature of each section; wherein the prediction result of the prior model for each section is not unique.

[0023] Optionally, the calculating module is further configured to calculate distances between each note and a nearest beat in a target section in a score corresponding to the target music to obtain a distance set; the calculating module is further configured to perform clustering analysis on distance values in the distance set, and divide the distance values in the distance set into positive value classes and negative value classes; the note position error correction module is specifically configured to perform overall translation on the notes in the target section according to a result of the clustering analysis, so that at least one note position is the same as a position of a beat; wherein the target section is any section in the target music; the beats in each measure of the target section are determined according to the tempo of the target music and a time signature of the target music.

[0024] Optionally, the determining module is further configured to determine the chord of each measure of the target music piece according to the pitches of the strong beat and the secondary strong beat in each measure of the target music piece, and the chord of each measure; and the determining module is further configured to take a musical phrase corresponding to a plurality of adjacent measures as the music material if the chords of the plurality of adjacent measures satisfy a preset harmonic progression.

[0025] The application further provides a computer program product, comprising computer programs / instructions, which, when executed by a processor, implement the steps of the method for generating a mashup music according to any one of the above.

[0026] The application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for generating a mashup music according to any one of the above when executing the program.

[0027] The application further provides a computer readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method for generating a mashup music according to any one of the above.

[0028] The application provides a method and device for generating a mashup music, which first acquires a first music material and a second music material in a material library, and then splices the first music material and the second music material to generate a mashup music if the first music material and the second music material satisfy a preset splicing condition; wherein the music materials in the material library are all text type music files processed according to a preset processing method; and the preset processing method is used to determine the tempo, mode and music measure of a music piece corresponding to the music file. In this way, the mashup music can be quickly and batch generated according to the music materials in the material library, greatly meeting the demand of people for the mashup music. BRIEF DESCRIPTION OF DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0030] Figure 1 is one of the flowcharts of the method for generating a mashup music provided by the present application;

[0031] Figure 2 is another flowchart of the method for generating a mashup music provided by the present application;

[0032] Figure 3is a structural schematic diagram of a generation device of the string music provided in the present application;

[0033] Figure 4 is a structural schematic diagram of an electronic device provided in the present application. DETAILED DESCRIPTION

[0034] For the purpose, technical solutions and advantages of the present application to be clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0035] The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second" and the like are generally of a kind, and are not limited to the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in an "or" relationship.

[0036] First, the profession involved in the embodiments of the present application is explained:

[0037] Lyrics: In the text format of the music file, the text sequence with information of sentence and paragraph.

[0038] Note: Note is a symbol used to record different lengths of sound. Whole note, half note, quarter note, eighth note, sixteenth note are the most common notes. It is the most important element in the staff. In the text format of the music file, it has four attributes of pitch, position, length and lyrics text.

[0039] Sound: Sound produced by the regular vibration of the sound object with fixed pitch is called sound. The three elements of sound include: tone, pitch and timbre.

[0040] Pitch: According to the specification of Musical Instrument Digital Interface (MIDI), it is represented by an integer between 0 and 127. For example, central C, C4 = 60.

[0041] Tempo: The number of beats per minute, unit: bpm (Beat Per Minute).

[0042] Mode: several musical notes that make up a piece of music are combined together in a certain relationship, and one of the notes is the tonic, and the rest of the notes tend to it. In the embodiment of the application, it refers to major mode, including C, C#, D, D#, E, F, F#, G, G#, A, A#, B.

[0043] Phrase: all notes corresponding to a sentence of lyrics.

[0044] Section: a collection of phrases, all notes corresponding to a section of lyrics.

[0045] Piece: a collection of sections, all notes corresponding to all lyrics, saved as a music score.

[0046] Bar: in the process of music, the strong beat and the weak beat always appear regularly, and the part from one strong beat to the next strong beat is called a bar. In the music score, the bars are separated by short vertical lines (bar lines). A bar with less than four beats is called an incomplete bar, which often appears at the beginning and end of a phrase (or a piece), and the two incomplete bars at the beginning and end are combined into a complete bar. A bar starting with a weak beat (or a weak position) is called a weak bar. The structure of the bar is indicated by the time signature.

[0047] Time signature: the time signature is a symbol used in the music score, which is in the form of a fraction. Each music score has a time signature at the beginning, and if the rhythm changes in the middle, the changed time signature is marked. The time signature is like a fraction. For example, 4 / 4 time, which means that 4 quarter notes make up one bar.

[0048] Triad: a kind of chord composed of three notes stacked in thirds.

[0049] Octave: in music, two notes of the same name in adjacent groups of notes, including altered scale degrees, are called an octave. According to the MIDI specification, Cn to Cn+1 is called an octave, n = 1, …, 7.

[0050] Harmonic progression: the connection of chords in a certain range in modal music. The concept of a certain level of chord in a harmonic progression is relative, for example, we choose the canon harmonic progression 15634125, which means that the eight consecutive bars of chords are I, V, VI, III, IV, I, II, and V. The I chord is C chord in C major, D chord in D major, and so on.

[0051] To solve the technical problems of long production cycle and low efficiency of the string music in the related art, the embodiment of the application provides a string music generation method, which can quickly and batch generate string music to meet people's demand for string music.

[0052] The following describes in detail the method for generating a medley music provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0053] like Figure 1 As shown, an embodiment of the present application provides a method for generating a medley music, which may include the following steps 101 and 102:

[0054] Step 101: Acquire a first music material and a second music material from a material library.

[0055] Among them, the material library includes multiple music materials; the music materials in the material library are all obtained by processing text-type music files according to a preset processing method; the preset processing method is used to determine the tempo, mode, music measure and chords of each music measure of the music corresponding to the music file.

[0056] For example, in order to reduce the space occupied by music materials and music files used to generate music materials, and at the same time, to speed up the production of medley music, music files in text format are used to generate music materials in the embodiment of the present application.

[0057] Exemplarily, the above-mentioned music files in text format may include: a first-category music file and a second-category music file, wherein the first-category music file is a MIDI file, and the second-category music file is similar to the note information stored in the MIDI file, but the position and length of the note are expressed in time units (usually milliseconds ms).

[0058] For example, in an embodiment of the present application, by processing the music file in the above-mentioned text format according to the preset processing method provided in the embodiment of the present application, music materials that can be used for generating medley music can be obtained, and multiple music materials obtained according to the preset processing method can be added to the material library.

[0059] Step 102: If the first music material and the second music material meet a preset splicing condition, splice the first music material and the second music material to generate a medley music.

[0060] For example, after obtaining the material library, any two or more music materials in the material library can be spliced ​​into a medley.

[0061] In one possible implementation, in order to combine materials into a song, the key, octave and tempo of the materials need to be unified in advance.

[0062] Specifically, before the above step 102, the method for generating a medley music provided in the embodiment of the present application may further include the following step 103, and any one of step 104, step 105, and step 1026:

[0063] Step 103, obtaining the minimum pitch and the maximum pitch of any music material to be processed in the material library.

[0064] Step 104, in the case that the minimum pitch is less than the preset minimum pitch, the melody of the music material to be processed is translated as a whole so that the pitch of each note is greater than the preset minimum pitch.

[0065] Step 105, in the case that the maximum pitch is greater than the preset maximum pitch, the melody of the music material to be processed is translated as a whole so that the pitch of each note is less than the preset maximum pitch.

[0066] Step 106, in the case that the maximum pitch is greater than the preset maximum pitch and the minimum pitch is less than the preset minimum pitch, the music material to be processed is removed from the material library.

[0067] It can be understood that the uniform mode only needs to translate the overall pitch of the material melody. When the uniform octave is D#5, the preset acceptable maximum pitch is C3. Calculate the maximum pitch and the minimum pitch in the material melody. If the maximum pitch exceeds D#5, the melody notes are lowered by 1 octave as a whole. If the minimum pitch is lower than C3, the melody notes are raised by 1 octave as a whole, so that the melody notes of the material are unified in a fixed range.

[0068] Exemplarily, after the uniformity of mode, octave and tempo of the above-mentioned first music material and second music material, the materials can be spliced.

[0069] Specifically, the above-mentioned step 102 can include the following steps 102b, 102c and 102d:

[0070] Step 102b, in the case that the end bar of the first music material can accommodate the weak start of the start bar of the second music material, or the start bar of the second music material is a reverse beat start bar, the first music material and the second music material are spliced to generate a mashup score.

[0071] Exemplarily, after splicing the above-mentioned first music material and second music material, only a mashup score can be obtained. In order to obtain a mashup music, it is still necessary to generate a mashup music according to the mashup score.

[0072] Step 102c, generating a vocal corresponding to the mashup score by a sound synthesizer to obtain a vocal track.

[0073] Step 102d, generating an instrumental track by a MIDI synthesizer based on the harmony of the first music material and the second music material, and merging the vocal track and the instrumental track to generate the mashup music.

[0074] It should be noted that in the case of generating mashup music by using more than two music materials, the splicing method between any two music materials can be spliced according to the splicing method of the first music material and the second music material in step 102 described above, and then the mashup music is obtained.

[0075] Optionally, in the embodiments of the present application, the music materials in the material library can be generated by the following steps.

[0076] Exemplarily, in the embodiments of the present application, as shown in Figure 2 The music material can be generated by the following steps 201 to 205:

[0077] Step 201, obtaining a target music file, and determining the pitch and time value of each note in the target music according to the target music file.

[0078] Exemplarily, based on the description of the target music file described above, the music file can include a first type of music file and a second type of music file. By the target music file described above, the pitch and time value of each note in the target music corresponding to the target music file can be determined.

[0079] Exemplarily, in the case of the target music file being the first type of music file, the target music file needs to be processed to determine the pitch and time value of each note in the target music.

[0080] Specifically, the step 201 described above can include the following steps 201a1 to 201a3:

[0081] Step 201a1, in the case of the target music file being a musical instrument digital interface (MIDI) file, converting the relative positions in the start event, the relative positions in the end event and the relative positions in the lyrics in the MIDI file into absolute positions.

[0082] Step 201a2, combining the start event, the lyrics and the end event with the same absolute position into a note entry, and sorting the note entries according to the absolute positions of the notes to obtain a note queue; the time value of the note in the note entry is represented by length.

[0083] Step 201a3, determining the phrase and section of the target music, and the pitch and time value of each note according to the note queue.

[0084] The parameters of the start event include relative position, pitch and volume; the parameters of the end event include relative position, pitch and volume; and the lyrics include relative position and lyrics text.

[0085] Exemplarily, MIDI events are stored in a MIDI file in the form of time queues, and the MIDI events can be divided into start events, end events and lyrics. The start event is represented by a three-tuple, the parameters of the start event include relative position, pitch and volume, the end event is also represented by a three-tuple, the parameters of the end event include relative position, pitch and volume, and the lyrics are represented by a two-tuple, the lyrics include relative position and lyrics text, as shown in Table 1 below:

[0086] Start event (200, 60, 120) Lyrics (0, <sts>I) < / sts> End event (200, 60, 0) Start event (0, 62, 120) Lyrics (0, yes) End event (200, 62, 0)

[0087] Table 1

[0088] Exemplarily, the relative position of the MIDI event is generally stored in the MIDI file, and in order to match the start event, the end event and the lyrics, the relative position needs to be converted into absolute position, as shown in Table 2 below:

[0089] Start event (200, 60, 120) Lyrics (200, <sts>I) < / sts> End event (400, 60, 0) Start event (400, 62, 120) Lyrics (400, yes) End event (600, 62, 0)

[0090] Table 2

[0091] Exemplarily, after the relative position is converted into absolute position, the start event, the end event and the lyrics are formed into respective time queues. The length of the start event queue should be the same as that of the end event queue, and the pitch of the start event and the end event at the same index in the queue is the same. As shown in Table 3, Table 4 and Table 5 below:

[0092] Start event (200, 60, 120) Start event (400, 62, 120)

[0093] Table 3

[0094] Lyrics (200, <sts>I) < / sts> Lyrics (400, yes)

[0095] Table 4

[0096] End event (400, 60, 0) End event (600, 62, 0)

[0097] Table 5

[0098] It should be noted that, generally, the volume range of the start event is (65, 128), and the volume range of the end event is [0, 64], and in the case where there is no event name, the start event and the end event can be determined according to the volume range of the event.

[0099] Exemplarily, in matching lyrics, when an absolute position appears a lyric identical to the absolute position of a start event, the lyric is matched to the start event, and after the matching, the lyric is removed from the lyric queue. The lyrics that can appear in the lyric queue are as follows <sts>Indicates the beginning of a sentence, and a line break indicates the end of a sentence.

[0100] For example, the matched start event, end event, and lyrics are saved as a musical note queue. The position of the musical note is the position of the start event, and the length of the musical note is the difference between the positions of the end event and the start event. The lyrics are generally required to be one Chinese character. When a musical note has no lyrics, the lyrics are recorded as empty, indicating a transposition. This is shown in Table 6 below:

[0101] Pitch = 60, position = 200, length = 200, lyrics = I Pitch = 62, position = 400, length = 200, lyrics = am

[0102] Table 6

[0103] It should be noted that musical sounds and musical notes represent the same content, and musical sounds are represented by musical notes on the musical score.

[0104] For example, for the second type of music file, since it uses time units to represent the position and length of musical notes, the pitch and duration of each musical note can be directly determined.

[0105] Step 202: Determine the tempo of the target music and the mode of each music section based on the pitch and duration of each musical note.

[0106] For example, after determining the pitch and duration of each musical note, it is necessary to calculate the tempo of the target music and the mode of each musical section in the target music.

[0107] Specifically, the step of determining the tempo of the target music in step 202 may include the following steps 202a1:

[0108] Step 202a1: Obtain the duration of the shortest musical note of the target music, and determine the number of times the shortest musical note is repeated per unit time as the tempo of the target music.

[0109] Specifically, the step of determining the mode of any music section in step 202 may include the following steps 202a2 and 202a3:

[0110] Step 202a2: Obtain the pitch of each musical note in the target music section and obtain a target pitch set.

[0111] Step 202a3: When the target pitch set is a subset of the pitches included in the target mode, determine the target mode as the mode of the target music section.

[0112] The target music section is any music section in the target music.

[0113] For example, the tempo of the target music is determined by the duration of the shortest note in the target music. The duration of the shortest note is unit (in milliseconds ms), and the tempo V of the target music is bmp The shortest note can be calculated by the following formula (I):

[0114] V bmp = 60000 / unit (Formula I)

[0115] It should be noted that for the first type of music file, the shortest note uses a fixed value of 120 milliseconds (ms), and the tempo uses a fixed value of 62.5 beats per minute (bmp).

[0116] For example, the determination of the mode of any target music section in the target music can be based on the following example: Assume that each music section of the music has a different mode, and the 12 major scale sets are respectively P k , where k∈{C, C#, D, D#, E, F, F#, G, G#, A, A#, B}, and the C major scale contains the scale P C ={C, D, E, F, G, A, B}. The set of all pitches in a section is P, and if there is n such that , where n∈

[0117] {C, C#, D, D#, E, F, F#, G, G#, A, A#, B}, then the mode of the section can be determined as n. Since n can not be unique, it can be excluded in the subsequent algorithm. According to the mode, the pitch can be converted to the staff mark. That is, when the mode of the section where the pitch is located is C major P C ={C, D, E, F, G, A, B}, and the pitch is D, the staff mark of the note corresponding to the pitch on the score is 2.

[0118] Step 203, according to the prior knowledge of the music bar, performing bar division on each music section through a prior model, and obtaining a bar division result.

[0119] Wherein, one music section corresponds to at least one bar division result.

[0120] It should be noted that the bar is a key information for judging chord and deriving harmony, and since there is no bar line mark in the score, we need to predict the position of the bar line.

[0121] Specifically, the above step 203 can include the following steps 203a1 and 203a2:

[0122] Step 201a1, according to the prior knowledge of the music bar, predicting the position of the first bar line of each music section in the score corresponding to the target music through a prior model.

[0123] Step 201a1, determining the position of the remaining bar lines of each section according to the position of the first bar line of each section, the tempo of the target music and the time signature of each section.

[0124] The prior model is not unique for the prediction result of each section.

[0125] For example, in the embodiment of the present application, the prior knowledge of music bar can be obtained by counting a large number of popular songs, and then the prior model can be obtained, and the position of the bar line in the music score can be predicted by the prior model.

[0126] It should be noted that since the fixed tempo and time signature are used for processing the MIDI file, the bar division of the music score can be accurately obtained through the first type of music file. In the embodiment of the present application, the bar division of the second type of music file is mainly described, and the first type of music file can also be divided into music bars by referring to the bar division method of the second type of music file.

[0127] For example, the above prior knowledge can include the following contents: 1. The time signature of the connecting bar between paragraphs may change, for example, the time signature of the paragraph is 4 / 4, and the time signature between paragraphs is 2 / 4, so the bar line needs to be predicted by section; 2. The first strong beat is generally an 8th note or more; 3. The first 8th note or more generally appears within the first 5 notes of each section; 4. When the first note is a long note, if the long note is a 4th note, the first bar line may appear on the note and the next 1 beat, 2 beats after the note; if the long note is more than 4th note, the first bar line may appear on the note. If the long note is less than 4th note, the first bar line may appear on the note, and the previous 1 beat, half beat, half beat, 1 beat, 1.5 beats, 2.5 beats after the note; 5. When the second note is a long note, the first bar line may appear on the note, and the previous 1 beat, 0.75 beats after the note; 6. When the third note is a long note, the first bar line may appear on the note, and the previous 1 beat; 7. When the fourth note is a long note, the first bar line may appear on the note, and the previous 1.25 beats, 0.75 beats; 8. When the fifth note is a long note, the first bar line may appear on the note, and the previous 1.5 beats, 1 beat; 9. When there is no long note in the previous 5 notes, the first bar line may appear on the note, and the previous 1.75 beats, 1.75 beats after the note.

[0128] For example, the above prior model is mainly used to predict the position of the first bar line of the section, and then the positions of the other bar lines in the section can be determined according to the tempo, the time signature and the position of the first bar line.

[0129] Exemplarily, since the prediction result of the first bar line of a section by the prior model is not unique, one or more bar division results can be obtained for each section. Subsequent algorithms can exclude incorrect bar division results.

[0130] Step 204, according to the relative position relationship between the notes and the bar lines in the score corresponding to the section, the positions of the notes in each section are corrected, and at least one note is adjusted to the beat.

[0131] Exemplarily, the positions of the notes in the score may be offset from the positions of the generated bar lines, and therefore the positions of the notes need to be corrected to ensure that at least one note is on the beat.

[0132] Specifically, the above step 204 can include the following steps 204a1 to 204a3:

[0133] Step 204a1, calculate the distance between each note of the target section in the score corresponding to the target music and the nearest beat, and obtain a distance set.

[0134] Step 204a2, cluster analysis is performed on the distance values in the distance set, and the distance values in the distance set are divided into positive value class and negative value class.

[0135] Step 204a3, according to the clustering analysis result, the notes of the target section are translated as a whole, so that at least one note position is the same as the position of the beat.

[0136] Wherein, the target section is any section of the target music; the beat in each bar of the target section is determined according to the tempo of the target music and the time signature of the target music.

[0137] For example, it is assumed that at least one note in a phrase can correspond to a beat, the length of the note is correct, but the position of the note is offset, at this time, the note only needs to be moved as a whole to the left or to the right. First, the distance between the position of all notes in the phrase and the nearest beat needs to be calculated, and a list (i.e. the above distance set) is formed, denoted as minDistance. When the distance between the note and the nearest beat is 0, the note in the phrase is not moved. In other cases, the notes of the phrase need to be considered as a whole to move to the left or to the right.

[0138] Therefore, two numbers need to be found as the moving distance through clustering analysis in the distance set, one is a positive number and the other is a negative number.

[0139] When selecting the positive and negative moving distances in the distance set, first, the positive and negative values in the distance set are clustered, and the number of clusters is at most 2, and then an arbitrary value is selected as the moving distance in each class of positive and negative values. After clustering, the following four cases can occur:

[0140] Case 1, both positive and negative values can be uniquely determined; Case 2, only positive or negative values can be uniquely determined; Case 3, neither can be uniquely determined; Case 4, there is a lack of positive or negative values.

[0141] Case 1 can directly determine the moving distances to the left and right in the score. In case 2, if the positive value can be uniquely determined, then in the negative value, the nearest beat with the same value as the positive value is selected for adjustment. That is, the left and right movements are relative to the same beat; if the negative value can be uniquely determined, then in the positive value, the nearest beat with the same value as the negative value is selected for adjustment. That is, the left and right movements are relative to the same beat. In case 3, the value in the larger category is selected from the positive and negative values. In case 4, when there is a lack of positive or negative values, only move in one direction.

[0142] Finally, when the distance of moving to the left exceeds the distance of moving to the right, or the distance of moving to the right exceeds the distance of moving to the left, only the direction with the smaller moving distance is selected for movement.

[0143] After moving the entire sentence, the positions of the lyrics corresponding to the musical phrases also need to be adjusted. At this time, the distance between the position of the moved lyrics and the nearest beat is calculated, and if the distance is less than a certain threshold, it is considered that the lyrics are on the beat, and the lyrics position is moved to the beat. Finally, if there are two moving results for a musical phrase in the same paragraph, the left and right moving musical phrases form two new sections, respectively.

[0144] Step 205, according to the measure division result of each section, match the measure division results of different combinations, if there are multiple adjacent measures in the same section that satisfy the preset harmonic progression, the musical phrases corresponding to the multiple measures are taken as music materials.

[0145] For example, if there are consecutive measures of chords that satisfy the preset harmonic progression, one matching is completed, and the musical phrases covering these consecutive measures are taken as a music material.

[0146] Specifically, the above step 205 can include the following steps 205a1 and 205a2:

[0147] Step 205a1, according to the pitch of the strong beat and the weak beat in each measure of the target section, and the chord of each measure, determine the chord of each measure of the target section.

[0148] Step 205a2, in the case that the chords of the adjacent multiple measures in the target music section satisfy the preset harmonic progression, the music phrases corresponding to the multiple measures are taken as the music materials.

[0149] Exemplarily, in the case of matching the harmonic progression, the chords of each measure need to be determined first. The chord of a measure can be inferred by the musical notation of the notes on the strong beat and the secondary strong beat in the measure. Specifically, the pitch of the measure can be converted into the musical notation of the measure according to the mode of the measure. In the embodiments of the present application, taking the inference of the triad as an example, if the musical notation of the note on the strong beat or the secondary strong beat is a component note of a certain triad, then the chord of the measure can be inferred as the triad. The above inferred chord of the measure is not unique, but the incorrect chord will not affect finding a correct harmonic progression. The matching of the harmonic progression can exclude the incorrect mode. When the measure is converted into the musical notation by the incorrect mode and the chord is inferred, a correct harmonic progression that meets the preset will not generally appear.

[0150] Optionally, in the embodiments of the present application, after obtaining the above music materials, the music materials need to be screened to ensure that the music corresponding to all the music materials is consistent with the actual situation.

[0151] Exemplarily, after the above step 205, the method for generating the mashup music provided by the embodiments of the present application can further include the following step 206:

[0152] Step 206, in the case that there is a target note in the target measure of the target music material, the target music material is removed from the material library.

[0153] The target note is not a inner note of the chord of the target measure, not a passing note, and not an inner note of the chord of the next measure as a weak start.

[0154] Exemplarily, all the music materials obtained by the above steps 201 to 205 meet the preset harmonic progression, but there are correct harmonic progressions matched by incorrect chords of the measures, so the incorrect materials need to be excluded.

[0155] Exemplarily, if there is a note in a measure that is neither an inner note of the chord of the measure, nor a passing note, nor an inner note of the chord of the next measure as a weak start, it is judged that the chord of the measure is an incorrect chord, and the material needs to be removed from the material library.

[0156] Exemplarily, after the above step 205, the method for generating the mashup music provided by the embodiments of the present application can further include the following steps 207 and 208:

[0157] Step 207, calculating the similarity of the melody sequence of the first measure and the second measure according to the edit distance between the melody sequence of the first measure and the melody sequence of the second measure of each music material.

[0158] The first measure includes at least two consecutive measures; the second measure includes at least two consecutive measures; the first measure and the second measure are discontinuous.

[0159] Step 208, removing the music material with a similarity of the melody sequence less than a preset similarity from the material library.

[0160] Exemplarily, when scoring the music material, the score of the music material is the accuracy of the measure line, and the more accurate the measure line, the higher the score of the music material. The accuracy of the measure line is defined as the edit distance of the melody sequence of the first and second measures and the fifth and sixth measures of the music material, that is, the more similar the melody sequence of the first, second, fifth and sixth measures, the higher the score.

[0161] Exemplarily, after obtaining the score of each music material, the music material with a score lower than a preset threshold can be removed from the material library by setting the preset threshold.

[0162] The generation method of the mashup music provided by the embodiment of the present application, 1. The full-automatic mashup technology realizes that the complete music score of two or more songs and a harmony are input, and the mashup work that meets the harmony and is re-sung by an artificial intelligence singer is output; 2. The full-automatic mashup technology only needs to input the music score, without additional annotation of bpm and mode, which saves a lot of manual annotation work; 3. The measure line prediction model can predict the position of the measure line from the original music score, which saves a lot of manual annotation work; 4. The note position correction model allows the note position of the input music score to be automatically recognized by the algorithm, and the model can correct the deviated notes to the beat, which saves a lot of manual annotation work; 5. Scoring the materials and the mashup work can exclude the predicted incorrect measure line and select the materials with similar melodies, so as to control the quality of the work.

[0163] The generation method of the mashup music provided by the embodiment of the present application, first acquires a first music material and a second music material in a material library, and then splices the first music material and the second music material to generate mashup music when the first music material and the second music material meet a preset splicing condition; wherein the music materials in the material library are obtained by processing music files of a text type according to a preset processing method; and the preset processing method is used to determine the tempo, mode and music measure of the music file corresponding to the music. In this way, the mashup music can be quickly and batch generated according to the music materials in the material library, which greatly meets the demand of people for mashup music.

[0164] It should be noted that the execution subject of the generation method of the mixtape music provided in the embodiments of the present application can be a mixtape music generation device, or a control module in the mixtape music generation device for executing the generation method of the mixtape music. In the embodiments of the present application, the mixtape music generation device is taken as an example to execute the generation method of the mixtape music, and the mixtape music generation device provided in the embodiments of the present application is described.

[0165] It should be noted that the generation method of the mixtape music shown in each method figure in the embodiments of the present application is described by taking one of the figures in the embodiments of the present application as an example. In the specific implementation, the generation method of the mixtape music shown in each method figure can also be implemented in combination with any other figure that can be combined as described in the above embodiments, which will not be described here.

[0166] The mixtape music generation device provided in the present application is described below, and the mixtape music generation method described below can be referred to each other.

[0167] Figure 3 The structure diagram of the mixtape music generation device provided in an embodiment of the present application is shown in FIG. 1, and specifically includes: Figure 3

[0168] The acquisition module 301 is configured to acquire a first music material and a second music material in a material library; the material library includes a plurality of music materials; the generation module 302 is configured to splice the first music material and the second music material to generate mixtape music when the first music material and the second music material meet a preset splicing condition; wherein the music materials in the material library are obtained by processing music files of a text type according to a preset processing method; and the preset processing method is used to determine the tempo, mode, music bar and chord of each music bar of a music file corresponding music.

[0169] ​Optionally, the apparatus further comprises a determining module, a measure division module, a note position error correction module, and a harmony matching module; the obtaining module 301 is further configured to obtain a target music file, and determine the pitch and time value of each note of a target music according to the target music file; the determining module is configured to determine the tempo of the target music and the mode of each section according to the pitch and time value of each note; the measure division module is configured to divide each section by a priori model according to the priori knowledge of music measures, and obtain a measure division result; one section corresponds to at least one measure division result; the note position error correction module is configured to correct the position of a note in each section according to the relative position relationship between the note and the measure line in the corresponding music score of the section, and adjust at least one note to the beat; and the harmony matching module is configured to match the harmony of different combinations of measure division results according to the measure division result of each section, and if multiple adjacent measures in the same section satisfy a preset harmony, the corresponding phrase of the multiple measures is taken as a music material.

[0170] Optionally, the apparatus further comprises a material screening module; the material screening module is configured to remove the target music material from the material library if there is a target note in the target measure of the target music material; wherein the target note is not a chord inner note of the target measure, not a passing note, and not a chord inner note of the next measure as a weak start.

[0171] Optionally, the apparatus further comprises a calculating module; the calculating module is configured to calculate the similarity of the melody sequence of a first measure and the melody sequence of a second measure of each music material according to the edit distance between the melody sequence of the first measure and the melody sequence of the second measure; and the material screening module is further configured to remove the music material with a similarity of the melody sequence less than a preset similarity from the material library; wherein the first measure comprises at least two consecutive measures; the second measure comprises at least two consecutive measures; and the first measure and the second measure are discontinuous.

[0172] Optionally, the apparatus further comprises a music file processing module; the music file processing module is configured to, in the case that the target music file is a musical instrument digital interface (MIDI) file, convert relative positions in start events, relative positions in end events and relative positions in lyrics in the MIDI file into absolute positions; combine start events, lyrics and end events with the same absolute positions into musical note items, and sort the musical note items according to absolute positions of the musical notes to obtain a musical note queue; a duration of a musical note in the musical note item is represented by a length; the determining module is further configured to determine a phrase and a section of the target music, and a pitch and a duration of each musical note according to the musical note queue; wherein parameters of the start event include a relative position, a pitch and a volume; parameters of the end event include a relative position, a pitch and a volume; the lyrics include a relative position and a lyric text.

[0173] Optionally, the obtaining module 301 is further configured to obtain a duration of the shortest musical note of the target music; the determining module is further configured to determine a number of times of repeating the shortest musical note in a unit of time as a tempo of the target music; the obtaining module 301 is further configured to obtain pitches of each musical note of a target section to obtain a target pitch set; the determining module is further configured to determine a mode of the target section as a mode contained in the target mode in the case that the target pitch set is a subset of the pitches contained in the target mode; wherein the target section is any section in the target music.

[0174] Optionally, the measure division module is specifically configured to predict, according to prior knowledge of a music measure, a position of a first measure line of each section in a score corresponding to the target music by a prior model; the determining module is further configured to determine positions of remaining measure lines of each section according to the position of the first measure line of each section, the tempo of the target music and a time signature of each section; wherein the prediction result of the prior model for each section is not unique.

[0175] Optionally, the calculating module is further configured to calculate distances between each note and a nearest beat in a target section in a score corresponding to the target music to obtain a distance set; the calculating module is further configured to perform clustering analysis on distance values in the distance set, and divide the distance values in the distance set into positive value classes and negative value classes; the note position error correction module is specifically configured to perform overall translation on the notes in the target section according to a clustering analysis result, so that at least one note position is the same as a position of a beat; wherein the target section is any section in the target music; the beats in each measure of the target section are determined according to the tempo of the target music and a time signature of the target music.

[0176] Optionally, the determining module is further configured to determine the chord of each measure of the target music section according to the pitches of the strong beat and the secondary strong beat in each measure of the target music section, and the chord of each measure; and the determining module is further configured to take a musical phrase corresponding to a plurality of adjacent measures as the music material if the chords of the plurality of adjacent measures satisfy a preset harmonic progression.

[0177] The application provides a device for generating mashup music. The device first acquires a first music material and a second music material in a material library, and then splices the first music material and the second music material to generate mashup music if the first music material and the second music material satisfy a preset splicing condition. The music materials in the material library are all text type music files processed according to a preset processing method. The preset processing method is used to determine the tempo, mode and music measure of the music file. In this way, the mashup music can be quickly and batch generated according to the music materials in the material library, greatly meeting the demand of people for mashup music.

[0178] Figure 4 An example of a schematic diagram of the physical structure of an electronic device is shown in Figure 4 The electronic device can include a processor 410, a communications interface 420, a memory 430 and a communications bus 440, wherein the processor 410, the communications interface 420 and the memory 430 can communicate with each other through the communications bus 440. The processor 410 can call the logical instructions in the memory 430 to execute a method for generating mashup music, which includes acquiring a first music material and a second music material in a material library; the material library includes a plurality of music materials; splicing the first music material and the second music material to generate mashup music if the first music material and the second music material satisfy a preset splicing condition. The music materials in the material library are all text type music files processed according to a preset processing method. The preset processing method is used to determine the tempo, mode, music measure and chord of each music measure of the music file.

[0179] Further, the logic instructions in the memory 430 described above can be implemented in the form of software functional units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0180] In another aspect, the present application also provides a computer program product, which comprises a computer program stored on a computer readable storage medium, and the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer can execute the generation method of the string burning music provided by the above-mentioned methods. The method comprises: obtaining a first music material and a second music material in a material library; the material library comprises a plurality of music materials; in the case that the first music material and the second music material satisfy a preset splicing condition, splicing the first music material and the second music material to generate string burning music; wherein the music materials in the material library are obtained after the music files of the text type are processed according to a preset processing method; the preset processing method is used to determine the tempo, mode, music bar and chord of each music bar of the music file corresponding music.

[0181] In another aspect, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the generation method of the string burning music provided by the above-mentioned methods. The method comprises: obtaining a first music material and a second music material in a material library; the material library comprises a plurality of music materials; in the case that the first music material and the second music material satisfy a preset splicing condition, splicing the first music material and the second music material to generate string burning music; wherein the music materials in the material library are obtained after the music files of the text type are processed according to a preset processing method; the preset processing method is used to determine the tempo, mode, music bar and chord of each music bar of the music file corresponding music.

[0182] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0183] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and necessary universal hardware platforms, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software products, and the computer software products can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and include a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0184] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.< / sts>

Claims

1. A method for generating a medley of music, characterized in that: include: Acquire a first music material and a second music material from a material library; the material library includes a plurality of music materials; If the first music material and the second music material meet a preset splicing condition, splicing the first music material and the second music material to generate a medley; The music materials in the material library are all text-type music files processed according to a preset processing method; the preset processing method is used to determine the tempo, mode, music measure and chords of each music measure of the music file corresponding to the music file; Any music material in the material library is obtained through the following steps: Obtaining a target music file, and determining the pitch and duration of each musical note of the target music file according to the target music file; Determining the tempo of the target music and the mode of each musical section based on the pitch and duration of each musical note; Based on the prior knowledge of music measures, each music segment is divided into measures using the prior model and the measure division results are obtained; each music segment corresponds to at least one measure division result; Correct the position of the notes in each musical segment based on the relative position relationship between the notes and the bar lines in the musical score corresponding to the musical segment, and adjust at least one note to the beat; According to the measure division result of each music segment, the measure division results of different combinations are harmonically matched. If there are multiple adjacent measures in the same music segment that meet the preset harmony, the phrases corresponding to the multiple measures are used as music materials.

2. The method according to claim 1, characterized in that After using the phrases corresponding to the multiple measures as music materials, the method further includes: In a case where a target note exists in a target measure of the target music material, removing the target music material from the material library; The target note is a tone within the chord that does not belong to the target measure, is not a passing tone, and is not a tone within the chord that starts weakly and belongs to the next measure.

3. The method according to claim 1, characterized in that After using the phrases corresponding to the multiple measures as music materials, the method further includes: Calculating the similarity between the melody sequences of the first measure and the second measure of each music material according to the edit distance between the melody sequences of the first measure and the second measure; removing music materials whose similarity to the melody sequence is less than a preset similarity from the material library; The first subsection includes at least two consecutive subsections; the second subsection includes at least two consecutive subsections; and the first subsection is discontinuous with the second subsection.

4. The method according to claim 1, wherein The step of obtaining a target music file and determining the pitch and duration of each musical note of the target music file according to the target music file includes: In the case where the target music file is a Musical Instrument Digital Interface (MIDI) file, converting the relative position in the start event, the relative position in the end event, and the relative position in the lyrics in the MIDI file into absolute positions; Combining start events, lyrics, and end events with the same absolute position into musical note entries, and sorting the musical note entries according to the absolute position of each musical note to obtain a musical note queue; the duration of the musical note in the musical note entry is represented by the length; Determining the phrases and sections of the target music, as well as the pitch and duration of each musical note, based on the musical note sequence; The parameters of the start event include: relative position, pitch and volume; the parameters of the end event include: relative position, pitch and volume; the lyrics include: relative position and lyrics text.

5. The method according to claim 1, wherein Determining the tempo of the target music piece according to the pitch and duration of each musical note includes: Obtaining the duration of the shortest musical note of the target music, and determining the number of times the shortest musical note is repeated per unit time as the tempo of the target music; Determining the mode of each section of the target music according to the pitch and duration of each musical note includes: Obtain the pitch of each note in the target music segment and obtain a target pitch set; In a case where the target pitch set is a subset of the pitches included in the target mode, determining the target mode as the mode of the target music section; The target music section is any music section in the target music.

6. The method according to claim 1, characterized in that According to the prior knowledge of music bars, each music segment is divided into bars through the prior model, and the bar division result is obtained, including: Based on the prior knowledge of music bars, the position of the first bar line of each section in the music score corresponding to the target music is predicted by the prior model; Determining the positions of the remaining bar lines of each music section according to the position of the first bar line of each music section, the tempo of the target music, and the time signature of each music section; The prediction result of the prior model for each music segment is not unique.

7. The method according to claim 1, characterized in that The method of correcting the position of the notes in each music segment according to the relative position relationship between the notes and the bar lines in the music score corresponding to the music segment, and adjusting at least one note to the beat, includes: Calculating the distance between each note of a target music section and the nearest beat in the music score corresponding to the target music piece, and obtaining a distance set; Performing cluster analysis on the distance values ​​in the distance set, and dividing the distance values ​​in the distance set into positive value classes and negative value classes; According to the cluster analysis results, the notes of the target music segment are shifted as a whole so that the position of at least one note is the same as the position of the beat; The target music section is any music section of the target music; and the beat in each measure of the target music section is determined according to the tempo and time signature of the target music.

8. The method according to claim 1, characterized in that According to the measure division result of each music segment, the measure division results of different combinations are harmonically matched. If there are multiple adjacent measures in the same music segment that meet the preset harmony, the phrases corresponding to the multiple measures are used as music materials, including: Determining the chord of each measure of the target music section based on the pitches of the strong beat and the secondary strong beat in each measure of the target music section and the chord of each measure; In the case that chords of a plurality of adjacent bars satisfy a preset harmonic progression within the target music section, the phrases corresponding to the plurality of bars are used as music materials.

9. A device for generating a medley of music, characterized in that: The device comprises: An acquisition module, configured to acquire a first music material and a second music material from a material library; the material library includes a plurality of music materials; a generating module configured to, when the first music material and the second music material meet a preset splicing condition, splice the first music material and the second music material to generate a medley; The music materials in the material library are all text-type music files processed according to a preset processing method; the preset processing method is used to determine the tempo, mode, music measure and chords of each music measure of the music file corresponding to the music file; The device further comprises: a determination module, a measure division module, a note position error correction module, and a harmony matching module; The acquisition module is further configured to acquire a target music file and determine the pitch and duration of each musical note of the target music file according to the target music file; The determining module is configured to determine the tempo of the target music and the mode of each music section according to the pitch and duration of each musical note; The bar division module is used to divide each music segment into bars based on the prior knowledge of music bars and the prior model, and obtain the bar division results; each music segment corresponds to at least one bar division result; The note position correction module is used to correct the position of the notes in each music segment based on the relative position relationship between the notes and the bar lines in the music score corresponding to the music segment, and adjust at least one note to the beat; The sound progression matching module is used to perform harmony matching on the different combinations of measure division results according to the measure division results of each music segment. If there are multiple adjacent measures in the same music segment that meet the preset harmony progression, the phrases corresponding to the multiple measures are used as music materials.

Citation Information

Patent Citations

  • Automatic mixing device

    CN110867174A