Music data processing method and device, storage medium and electronic equipment

The state transition probability of Markov model repairs the melody misbeat and start and end point errors in the music rotation score, improves the accuracy and usability of the rotation score results, and solves the problems of melody misbeat and start and end point errors in the existing technology. Achieve efficient melody and rhythm repair.

CN119132264AActive Publication Date: 2024-12-13HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD

Patent Information

Application Number
CN202411281847.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-13
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

There are problems such as misbeating melody and wrong start and end points in the existing music score technology, resulting in low accuracy and usability of the score.

Method used

The state transition probability of the Markov model is used to repair the music data melody rhythm. By determining the probability of generation of melody rhythm segments, the pitch offset and rhythm deviation during automatic rotation scores are repaired, and the accuracy and usability of the rotation score results are improved.

Benefits of technology

The accuracy and usability of music score results are improved, and the efficiency of music melody rhythm repair is improved through the state transition probability determined in advance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119132264A_ABST
    Figure CN119132264A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a music data processing method, a music data processing device, a computer storage medium and electronic equipment, and relates to the technical field of data processing. The method comprises the following steps: determining the length of a first candidate melody rhythm sequence according to the note number of candidate music data and a preset music bar length; obtaining a first melody rhythm sequence according to whether each index position in each first candidate melody rhythm sequence has a note; slicing the first melody rhythm sequence according to a preset music bar length to obtain a first melody rhythm segment sequence data set; based on the first melody rhythm fragment sequence data set, according to each group of adjacent index positions in the first melody rhythm fragment sequence and the change condition of element values of the adjacent index positions, obtaining the state transition probability of the Markov model; and according to the state transition probability, carrying out melody rhythm restoration on the music data. According to the invention, the accuracy of automatic spectrum transfer can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of data processing technology. More specifically, the embodiments of the present disclosure relate to a music data processing method, a music data processing device, a computer-readable storage medium, and an electronic device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims, and no statement herein is admitted to be prior art by inclusion in this section.

[0003] Music-to-score technology converts music from audio files into readable, editable sheet music or MIDI (Musical Instrument Digital Interface) files. Currently, this typically involves feeding a segment of audio into a neural network, which then infers the resulting MIDI sequences of different instrument tracks and vocal melodies. Summary of the Invention

[0004] However, the above schemes usually have problems such as wrong beats and wrong starting and ending points in the transcription results, resulting in low transcription accuracy and usability.

[0005] Therefore, there is a great need for a music data processing method that can improve the accuracy and reliability of automatic transcription, thereby improving the usability of the transcription results.

[0006] In this context, embodiments of the present disclosure are intended to provide a music data processing method, a music data processing apparatus, a computer-readable storage medium, a computer program product, and an electronic device.

[0007] According to a first aspect of an embodiment of the present disclosure, a music data processing method is provided, comprising: for each candidate music data in a candidate music data set, determining the length of a first candidate melody rhythm sequence of the candidate music data according to the number of first notes of the candidate music data and a preset music measure length, wherein the preset music measure length is determined according to a preset number of notes; for each index position in each of the first candidate melody rhythm sequences, if a first note exists at the index position, configuring the element indicated by the index position to a first preset value, and if the first note does not exist at the index position, configuring the element indicated by the index position to a second preset value, thereby obtaining the first melody rhythm sequence of the candidate music data; for each first melody rhythm sequence of the candidate music data The first melody and rhythm sequence is sliced ​​according to the preset music measure length to obtain a first melody and rhythm fragment sequence data set; for each group of adjacent index positions in the first melody and rhythm fragment sequence, based on the first melody and rhythm sequence fragment data set, statistics are made on the case where the element value of the previous index position is the first preset value, the first probability that the element value of the next index position is the first preset value and the second probability that it is the second preset value, and on the case where the element value of the previous index position is the second preset value, the third probability that the element value of the next index position is the first preset value and the fourth probability that it is the second preset value, to obtain the state transition probability of the Markov model; according to the state transition probability of the Markov model, the melody and rhythm of the first music data are repaired.

[0008] In an optional embodiment, determining the length of the first candidate melody rhythm sequence of the candidate music data based on the first note number of the candidate music data and the preset music measure length includes: determining the first music measure number of the candidate music data based on the first note number of the candidate music data and the preset music measure length; determining the length of the first candidate melody rhythm sequence of the candidate music data based on the product of the first music measure number and the preset music measure length.

[0009] In an optional embodiment, the method for determining whether the first note exists at the index position includes: determining the first beat duration of each beat of the candidate music data according to the first music speed of the candidate music data; determining the first beat signature of each first note according to the first time signature of each first note in the candidate music data and the preset number of beats of each music measure, wherein the first beat signature is used to indicate the first music measure to which the first note belongs and the second time signature of the first note in the first music measure; determining the first starting time point of each beat in the candidate music data based on the first beat duration, the first beat signature, and the preset music measure length to obtain a first beat point sequence; obtaining the second starting time point of each first note in the candidate music data, and determining the first measure number corresponding to the first music measure to which each first note belongs according to the second starting time point, the first beat duration, and the preset number of beats; determining whether the first note exists at the index position according to the first measure number corresponding to the first music measure to which each first note belongs, the first starting time point, and the preset music measure length.

[0010] In an optional embodiment, determining whether there is a first note at the index position based on the first measure number corresponding to the first music measure to which each first note belongs, the first starting time point and the preset music measure length includes: for each first note, determining the first target beat point of the first note based on the first starting time point closest to the second starting time point of the first note in the first beat point sequence; for the first target beat point of each first note, determining the third time signature of the first target beat point in the measure to which the first target beat point belongs; determining the first target index position from the index position of the first candidate melody rhythm sequence based on the third time signature corresponding to the first target beat point of each first note, the first measure number corresponding to the first music measure to which each first note belongs, and the preset music measure length; determining that there is a first note at the first target index position in the first candidate melody rhythm sequence, and that there is no first note at other index positions except the first target index position.

[0011] In an optional embodiment, the first target index position is determined from the index position of the first candidate melody rhythm sequence based on the third time signature corresponding to the first target beat point of each first note, the first measure number corresponding to the first music measure to which each first note belongs, and the preset music measure length, including: determining the product of the first measure number of the first music measure to which the first note belongs and the preset music measure length to obtain a first product; determining the sum of the first product and the third time signature to obtain a first sum value; and determining the index position in the first candidate melody rhythm sequence whose index value is the first sum value as the first target index position.

[0012] In an optional embodiment, the melody and rhythm repair of the first music data according to the state transition probability of the Markov model includes: determining the length of a second candidate melody and rhythm sequence of the first music data according to the number of second notes of the first music data and the preset music measure length; for each index position in the second candidate melody and rhythm sequence, if there is a second note at the index position, configuring the element indicated by the index position to a first preset value, and if there is no second note at the index position, configuring the element indicated by the index position to a second preset value, so as to obtain a second melody and rhythm sequence of the first music data; for the second melody and rhythm sequence, slicing the second melody and rhythm sequence according to the preset music measure length to obtain one or more second melody and rhythm fragment sequences; for each second melody and rhythm fragment sequence, determining a first generation probability of the second melody and rhythm fragment sequence according to the state transition probability of the Markov model; based on the first generation probability, determining a melody and rhythm fragment sequence to be repaired from the second melody and rhythm fragment sequence, and repairing the melody and rhythm fragment sequence to be repaired.

[0013] In an optional embodiment, determining the first generation probability of the second melody rhythm fragment sequence based on the state transition probability of the Markov model includes: for each group of adjacent index positions in the second melody rhythm fragment sequence, searching for the first transition probability of the element value from the previous index position to the element value of the next index position in the state transition probability of the Markov model; and determining the first generation probability of the second melody rhythm fragment sequence based on the product of the first transition probabilities of each group of adjacent index positions.

[0014] In an optional embodiment, determining the melody rhythm fragment sequence to be repaired from the second melody rhythm fragment sequence based on the first generation probability includes: determining the melody rhythm fragment to be repaired based on the second melody rhythm fragment sequence whose first generation probability is less than a third preset value.

[0015] In an optional embodiment, the repairing of the melody rhythm fragment sequence to be repaired includes: determining a first target melody rhythm fragment sequence based on each index position in the melody rhythm fragment sequence and the candidate index value corresponding to each index position, the candidate index value including the first preset value and the second preset value, and the length of the melody rhythm fragment sequence is determined according to the preset music measure length; determining a second generation probability of each of the first target melody rhythm fragment sequences based on the state transition probability of the Markov model; and repairing the melody rhythm fragment sequence to be repaired based on the second generation probability.

[0016] In an optional embodiment, repairing the melody rhythm fragment sequence to be repaired based on the second generation probability includes: determining a second target melody rhythm fragment sequence based on the first target melody rhythm fragment sequence whose second generation probability is greater than a fourth preset value; calculating a first similarity between the second target melody rhythm fragment sequence and the melody rhythm fragment sequence to be repaired; and repairing the melody rhythm fragment sequence to be repaired based on the first similarity and the second generation probability of the second target melody rhythm fragment sequence.

[0017] In an optional embodiment, repairing the melody rhythm fragment sequence to be repaired according to the first similarity and the second generation probability of the second target melody rhythm fragment sequence includes: calculating the second sum of the first similarity and the second generation probability corresponding to each second target melody rhythm fragment sequence; taking the second target melody rhythm fragment sequence with the largest second sum as the target melody rhythm fragment sequence; and taking the target melody rhythm fragment sequence as the repair result of the melody rhythm fragment sequence to be repaired.

[0018] In an optional embodiment, repairing the melody rhythm fragment sequence to be repaired based on the second generation probability includes: calculating the second similarity between the first target melody rhythm fragment sequence and the melody rhythm fragment sequence to be repaired; determining a third target melody rhythm fragment sequence based on the first target melody rhythm fragment sequence whose second similarity is greater than a fifth preset value; and repairing the melody rhythm fragment sequence to be repaired based on the second similarity and the second generation probability of the third target melody rhythm fragment sequence.

[0019] In an optional embodiment, the repairing of the melody rhythm fragment sequence to be repaired based on the second similarity and the second generation probability of the third target melody rhythm fragment sequence includes: calculating the third sum of the second similarity and the second generation probability corresponding to each third target melody rhythm fragment sequence; taking the second target melody rhythm fragment sequence with the largest third sum as the target melody rhythm fragment sequence; and taking the target melody rhythm fragment sequence as the repair result of the melody rhythm fragment sequence to be repaired.

[0020] In an optional embodiment, determining the length of the second candidate melody rhythm sequence of the first music data based on the second note number of the first music data and the preset music measure length includes: determining the second music measure number of the first music data based on the second note number of the first music data and the preset music measure length; and determining the length of the second candidate rhythm sequence of the first music data based on the product of the second music measure number and the preset music measure length.

[0021] In an optional embodiment, the method for determining whether a second note exists at the index position includes: determining the second beat duration of each beat of the first music data according to the second music speed of the first music data; determining the second beat signature of each second note according to the fourth beat signature of each second note in the first music data and the preset number of beats of each music measure, the second beat signature being used to indicate the second music measure to which the second note belongs and the fifth beat signature of the second note in the second music measure; determining the third starting time point of each beat in the first music data based on the second beat duration, the second beat signature, and the preset music measure length to obtain a second beat point sequence; obtaining the fourth starting time point of each second note in the first music data, and determining the second measure number corresponding to the second music measure to which each second note belongs according to the third starting time point, the second beat duration, and the preset number of beats; determining whether a second note exists at the index position according to the second measure number corresponding to the second music measure to which each second note belongs, the third starting time point, and the preset music measure length.

[0022] In an optional embodiment, determining whether there is a second note at the index position based on the second measure number corresponding to the second music measure to which each second note belongs, the third starting time point and the preset music measure length includes: for each second note, determining the second target beat point of the second note based on the third starting time point closest to the fourth starting time point of the second note in the second beat point sequence; for the second target beat point of each second note, determining the sixth time signature of the second target beat point in the measure to which the second target beat point belongs; determining the second target index position from the index position of the second candidate melody rhythm sequence based on the sixth time signature corresponding to the second target beat point of each second note, the second measure number corresponding to the second music measure to which each second note belongs, and the preset music measure length; determining that there is a second note at the second target index position in the second candidate melody rhythm sequence, and no second note exists at other index positions except the second target index position.

[0023] In an optional embodiment, the second target index position is determined from the index position of the second candidate melody rhythm sequence based on the sixth time signature corresponding to the second target beat point of each second note, the second measure number corresponding to the second music measure to which each second note belongs, and the preset music measure length, including: determining the product of the second measure number of the second music measure to which the second note belongs and the preset music measure length to obtain a second product; determining the sum of the second product and the sixth time signature to obtain a fourth sum value; and determining the index position in the second candidate melody rhythm sequence whose index value is the fourth sum value as the second target index position.

[0024] According to a second aspect of the present disclosure, a music data processing device is provided, comprising: a first candidate rhythm sequence determination module, configured to determine, for each candidate music data in a candidate music data set, the length of a first candidate melody rhythm sequence of the candidate music data according to the number of first notes of the candidate music data and a preset music measure length, wherein the preset music measure length is determined based on a preset number of first notes; the first melody rhythm sequence determination module is configured to, for each index position in each of the first candidate melody rhythm sequences, configure the element indicated by the index position to a first preset value if the first note exists at the index position, and configure the element indicated by the index position to a second preset value if the first note does not exist at the index position, so as to obtain the first melody rhythm sequence of the candidate music data; the first melody rhythm segment sequence data set determination module is configured to, for each A first melody and rhythm sequence of candidate music data is sliced ​​according to the preset music measure length to obtain a first melody and rhythm fragment sequence data set; a state transition probability determination module is configured to, for each group of adjacent index positions in the first melody and rhythm fragment sequence, based on the first melody and rhythm sequence fragment data set, count the first probability that the element value of the next index position is the first preset value and the second probability that the element value of the next index position is the second preset value when the element value of the previous index position is the first preset value, and the third probability that the element value of the next index position is the first preset value and the fourth probability that the element value of the next index position is the second preset value when the element value of the previous index position is the second preset value, to obtain the state transition probability of the Markov model; a melody and rhythm repair module is configured to perform melody and rhythm repair on the first music data according to the state transition probability of the Markov model.

[0025] According to a third aspect of the embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the music data processing method described in the first aspect is implemented.

[0026] According to the fourth aspect of the embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the music data processing method described in the first aspect above by executing the executable instructions.

[0027] According to the music data processing method, music data processing device, computer-readable storage medium and electronic device of the embodiments of the present disclosure, the melody and rhythm of music data are repaired through the state transition probability of the Markov model. On the one hand, the state transition probability of the Markov model can be used to repair the pitch offset and rhythm deviation problems that occur during automatic transcription, thereby improving the accuracy and usability of the transcription results. On the other hand, since the state transition probability of the Markov model can be determined in advance, it can help improve the efficiency of music melody and rhythm repair. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings, in which several embodiments of the present disclosure are shown by way of example and not limitation, wherein:

[0029] Figure 1 A flowchart of a music data processing method in an embodiment of the present disclosure is shown;

[0030] Figure 2 A schematic flow chart showing a method for determining the length of a first candidate melody rhythm sequence in an embodiment of the present disclosure is shown;

[0031] Figure 3 A schematic flow chart of a method for determining whether a first note exists at an index position according to an embodiment of the present disclosure is shown;

[0032] Figure 4 A flow chart showing another method for determining whether a first note exists at an index position in an embodiment of the present disclosure is shown;

[0033] Figure 5 A schematic flow chart of a method for determining a first target index position according to an embodiment of the present disclosure is shown;

[0034] Figure 6 A schematic flow chart showing a method for repairing melody rhythm according to an embodiment of the present disclosure is shown;

[0035] Figure 7 A schematic flow chart of a method for determining a first generation probability according to an embodiment of the present disclosure is shown;

[0036] Figure 8 A schematic flow chart showing a method for repairing a melody rhythm segment sequence to be repaired according to an embodiment of the present disclosure is shown;

[0037] Figure 9 A flow chart of a method for repairing a melody and rhythm segment sequence to be repaired according to a second generation probability according to an embodiment of the present disclosure is shown;

[0038] Figure 10 A flow chart showing another method for repairing a melody rhythm segment sequence to be repaired based on a second generation probability according to an embodiment of the present disclosure is shown;

[0039] Figure 11 A schematic diagram showing the composition of a music data processing device according to an embodiment of the present disclosure; and

[0040] Figure 12 A structural diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0041] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts. DETAILED DESCRIPTION

[0042] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. Rather, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0043] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.

[0044] According to an embodiment of the present disclosure, a large music data processing method, a music data processing device, a computer-readable storage medium, and an electronic device are provided.

[0045] In this document, any number of elements in the drawings is for illustration and not for limitation, and any naming is for distinction only and does not have any limiting meaning.

[0046] The principles and spirit of the present disclosure are described in detail below with reference to several representative embodiments of the present disclosure. SUMMARY OF THE INVENTION

[0048] The inventors of the present disclosure found that due to the uncertainty of the audio environment and the diversity of singing methods, the transcription results of related automatic transcription technologies have problems such as melody mismatches and incorrect start and end points, resulting in low accuracy and usability of the transcription results.

[0049] In view of the above content, the basic idea of ​​the present disclosure is to provide a music data processing method, a music data processing device, a computer-readable storage medium and an electronic device, and to perform melody and rhythm repair on music data through the state transition probability of the Markov model. On the one hand, the state transition probability of the Markov model can be used to repair the pitch offset and rhythm deviation problems that occur during automatic transcription, thereby improving the accuracy and usability of the transcription results. On the other hand, since the state transition probability of the Markov model can be determined in advance, it can help improve the efficiency of music melody and rhythm repair.

[0050] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0051] Application Scenario Overview

[0052] It should be noted that the following application scenarios are only provided to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0053] The embodiments of the present disclosure support defect detection for the transcription results of the automatic transcription technology, and repair of the detected defective melody and rhythm fragments. For example, after the automatic transcription is completed, one or more second melody and rhythm fragment sequences can be obtained based on the MIDI file obtained after the automatic transcription, and then the generation probability of each second melody and rhythm fragment sequence can be determined based on the state transition probability of the Markov model, and the second melody and rhythm sequence with a generation probability less than a first preset value is determined as the melody and rhythm fragment to be repaired, and then the melody and rhythm fragment to be repaired is repaired according to the Markov model, and the melody and rhythm fragment obtained after the repair is determined as the final result of the automatic transcription, thereby improving the accuracy and usability of the automatic transcription results.

[0054] Exemplary Methods

[0055] First, the relevant technical terms in this disclosure are explained to better understand the technical content of this disclosure.

[0056] Musical rhythm (also known as melodic rhythm) is a combination of timing and repetition in music. It is one of the fundamental elements of music, measuring the duration and strength of notes. In musical notation, rhythm is represented by various note symbols and rests, making it a crucial aspect of music.

[0057] Sequence: A sequence is a set of elements or objects arranged in a certain order. In fields such as mathematics, computer science, and statistics, a sequence typically refers to a finite or infinite series of consecutive elements. Each element in a sequence has a specific position or index, which is usually expressed as an integer. The elements of a sequence can be numbers, characters, bytes, objects, or other types of data.

[0058] Beat: Beat is the basic unit of time in music, used to organize and measure time in music. It is a regular, repetitive pulse or beat that is used to determine the stable sense of time in music.

[0059] MIDI file: A MIDI (Musical Instrument Digital Interface) file is a digital audio file format used to transfer musical information between electronic instruments, computer music software, and other music devices. A MIDI file does not contain audio waveform data, but rather a digital encoding of musical information such as notes, volume, and instrument selection.

[0060] Markov model: Markov model is a mathematical tool used to describe the transition law between states in a random process. It has the "Markov property", that is, the future state depends only on the current state and has nothing to do with the past state.

[0061] State transition matrix: The state transition matrix is ​​an important concept in Markov models. It is used to describe the transition probability between states in the model. For a Markov chain with n states, the state transition matrix is ​​an n×n matrix, where the (i, j)th element represents the transition probability from state i to state j.

[0062] Markov model training: Markov model training involves estimating model parameters, such as the transition probabilities of the state transition matrix, based on a given dataset. Through training, the Markov model learns the transition patterns between states from the data, enabling better prediction and modeling of future states.

[0063] Binary storage method: Binary storage refers to the method of using binary numbers (0 and 1) to represent and store data. This storage method can efficiently read, write and process data, providing computers with powerful data processing capabilities.

[0064] The exemplary embodiment of the present disclosure first provides a music data processing method, Figure 1 A flowchart of a method for processing music data in an embodiment of the present disclosure is shown. Figure 1According to an embodiment of the present disclosure, a music data processing method includes the following steps:

[0065] Step S110, for each candidate music data in the candidate music data set, determining the length of a first candidate melody rhythm sequence of the candidate music data according to the number of first notes of the candidate music data and a preset music measure length, wherein the preset music measure length is determined based on a preset number of first notes;

[0066] Step S120: for each index position in each of the first candidate melody and rhythm sequences, if a first note exists at the index position, configuring the element indicated by the index position to a first preset value; if the first note does not exist at the index position, configuring the element indicated by the index position to a second preset value, thereby obtaining a first melody and rhythm sequence of the candidate music data;

[0067] Step S130, for each candidate music data, slicing the first melody and rhythm sequence according to the preset music measure length to obtain a first melody and rhythm segment sequence data set;

[0068] Step S140: For each group of adjacent index positions in the first melody and rhythm segment sequence, based on the first melody and rhythm segment data set, statistically calculating, when the element value of the previous index position is the first preset value, a first probability that the element value of the next index position is the first preset value and a second probability that the element value of the next index position is the second preset value, and when the element value of the previous index position is the second preset value, a third probability that the element value of the next index position is the first preset value and a fourth probability that the element value of the next index position is the second preset value, to obtain a state transition probability of the Markov model;

[0069] Step S150: Repairing the melody and rhythm of the first music data according to the state transition probability of the Markov model.

[0070] Next, a detailed description will be given of the specific implementation method of step S110 for determining the length of the first candidate melody rhythm sequence of each candidate music data in the candidate music data set according to the first note number of the candidate music data and the preset music measure length.

[0071] In an optional embodiment, the candidate music data set may include a training music data set. For example, the candidate music data set may include any music data set.

[0072] In an optional implementation, the data in the MIDI format in the existing music data set may be cleaned, and the verses, choruses, and bridge segments in the music data set may be used as candidate music data for determining the Markov model.

[0073] In other words, the candidate music data in the candidate music data set of the present disclosure may be in MIDI format, which includes information such as phrase marks, music structure marks, lyrics, etc. of the music.

[0074] In an optional embodiment, the preset music section length is determined according to a preset number of notes. In other words, a music section includes a preset number of notes.

[0075] For example, using quarter notes as an example, the melodic granularity of the notes can be configured such that one musical measure includes 16 quarter notes, each quarter note occupies one beat, and one musical measure includes four beats. The preset musical measure length can be customized as needed, for example, one musical measure can also include 8 quarter notes, which is not specifically limited in this exemplary embodiment.

[0076] For ease of explanation, the embodiments of the present disclosure are all described using the example of quarter notes, with each musical measure comprising 16 quarter notes. In other words, both the first note and the second note in the present disclosure may comprise quarter notes, and the preset musical measure length is such that each musical measure comprises 16 quarter notes.

[0077] For example, Figure 2 FIG2 is a flow chart showing a method for determining the length of a first candidate melody rhythm sequence in an embodiment of the present disclosure. Figure 2 The method may include steps S210 to S220.

[0078] In step S210, the number of first music measures of the candidate music data is determined according to the number of first notes of the candidate music data and a preset music measure length.

[0079] For example, the preset musical measure length is determined based on a preset number of notes. Therefore, the number of musical data included in the candidate musical data, i.e., the number of first musical measures, can be determined by rounding up the quotient of the number of notes in the candidate musical data and the preset number. For example, if the preset musical measure length is 16 quarter notes and the candidate musical data includes 79 quarter notes, then the number of first musical measures in the candidate musical data is 5.

[0080] In step S220, the length of the first candidate melody rhythm sequence of the candidate music data is determined based on the product of the first number of music bars and the preset music bar length.

[0081] For example, the product of the number of first musical bars and the preset musical bar length can be used as the length of the first candidate melody and rhythm sequence corresponding to the candidate music data. For example, if the preset musical bar length is 16 quarter notes and the candidate music data includes 79 quarter notes, the length of the first candidate melody and rhythm sequence corresponding to the candidate music data is 80, i.e., the first candidate melody and rhythm sequence includes 80 index positions.

[0082] That is to say, when the last music measure of the candidate music data is less than 16 notes, it is necessary to complete the last music measure, that is, to complete the positions of 16 notes. For example, if the last music measure includes 14 notes, 2 more note positions are added. Then, the length of the first candidate melody rhythm sequence is obtained based on the sum of the number of note positions of all the completed music measures.

[0083] Next, for step S120, for each index position in each of the first candidate melody and rhythm sequences, when there is a first note at the index position, the element indicated by the index position is configured as a first preset value; when there is no first note at the index position, the element indicated by the index position is configured as a second preset value, and a specific implementation method of obtaining the first melody and rhythm sequence of the candidate music data is described in detail.

[0084] In an optional implementation, the number of index positions in the first melody rhythm sequence is related to the length of the first melody rhythm sequence. For example, if the length of the first melody rhythm sequence is 80, the first melody rhythm sequence includes 80 index positions.

[0085] For example, Figure 3 A flow chart showing a method for determining whether a first note exists at an index position in an embodiment of the present disclosure is shown. Figure 3 The method may include steps S310 to S350.

[0086] In step S310, the first beat duration of each beat of the candidate music data is determined according to the first music tempo of the candidate music data.

[0087] For example, each MIDI file in the candidate music data set records information such as notes, time signatures, and music tempo (BPM), so the music tempo BPM of the candidate music data can be obtained from the MIDI file of the candidate music data to obtain the first music tempo.

[0088] BPM is short for Beat Per Minute, which is the unit of beats per minute and is the speed mark of the entire song. Based on this, the first beat duration SecondPerBeat can be obtained based on BPM using the following formula (1):

[0089] SecondPerBeat=60 / BPM (1)

[0090] In formula (1), 60 means 60 seconds per minute, and BPM can be understood as the first music speed mentioned above.

[0091] In step S320, the first time signature of each first note in the candidate music data is determined according to the first time signature of each first note and the preset number of beats of each music measure.

[0092] In an optional embodiment, the first time signature is used to indicate the first musical measure to which the first note belongs and the second time signature of the first note in the first musical measure. For example, a time signature of 2.1 indicates that the note belongs to the first beat of the second musical measure, and a time signature of 2.2 indicates the second beat of the second musical measure.

[0093] In an optional embodiment, the preset number of beats in each music measure is related to the preset music measure length. For example, taking each music measure as including 16 quarter notes, the preset number of beats in each music measure is 4.

[0094] As previously mentioned, the time signatures of the notes can be extracted from the MIDI file of the candidate music data to obtain the first time signature of each first note. For example, if the preset number of beats in each musical measure is 4, a musical measure can be obtained with 4 time signatures as a unit, thereby obtaining the musical measure to which the time signature of each note belongs. Then, a modulo-4 operation is performed on the time signature in each musical measure to obtain the time signature of each note in the musical measure to which it belongs, thereby obtaining the first time signature of each note. That is, for example, if each musical measure includes 16 quarter notes and each musical measure has 4 beats, the time signatures are numbered such as 1.1, 1.2, 1.3, 1.4, 2.1, 2.2, 2.3, 2.4, 3.1, 3.2, 3.3, 3.4, etc., with 4 beats as one musical measure.

[0095] In step S330, the first starting time point of each beat in the candidate music data is determined based on the first beat duration, the first beat signature, and the preset music measure length to obtain a first beat point sequence.

[0096] In an optional embodiment, the first starting time point of each beat can be obtained based on the product of the first beat duration, the first beat number of each beat and the preset music measure length, and then the first beat point sequence can be obtained based on the time sequence composed of the first starting time points of each beat.

[0097] For example, the first starting time point BeatTimestamp of each beat in the candidate music data can be obtained according to the following formula (2):

[0098] BeqtTimestamp=SecondPerBeat*beat_num*16(2)

[0099] In formula (2), SecondPerBeat is the first beat duration, which can be determined according to the above formula (1), beat_num is the beat number, and 16 is the preset music measure length, that is, each music measure includes 16 quarter notes.

[0100] In step S340, the second starting time point of each first note in the candidate music data is obtained, and the first measure number corresponding to the first music measure to which each first note belongs is determined based on the second starting time point, the first beat duration and the preset number of beats.

[0101] For example, for the MIDI file corresponding to each candidate music data, the "vocal" track in the MIDI file can be selected as the melody track, and the second starting time point of each note in the candidate music data can be obtained based on the starting time point of each note in the melody track.

[0102] In an optional implementation, the first measure number Bar(Note) corresponding to the first musical measure to which each first note belongs can be obtained according to the following formula (3):

[0103]

[0104] In formula (3), Note.start represents the second starting time point of the first note, SecondPerBeat is the duration of the first beat, and 4 is the preset number of beats for each musical measure. That is, the musical measure in which each note is located can be obtained through formula (3).

[0105] In step S350, it is determined whether there is a first note at the index position according to the first measure number corresponding to the first music measure to which each first note belongs, the first starting time point and the preset music measure length.

[0106] For example, Figure 4FIG2 is a flow chart showing another method for determining whether there is a first note at an index position in an embodiment of the present disclosure. Figure 4 , the method may include steps S410 to S440.

[0107] In step S410, for each first note, a first target beat point of the first note is determined according to a first start time point in the first beat point sequence that is closest to the second start time point of the first note.

[0108] For example, the first starting time point in the first beat point sequence that is closest to the starting time point of the first note can be determined as the first target beat point of the first note.

[0109] In step S420, for each first target beat point of the first note, the third time signature of the first target beat point in the measure to which the first target beat point belongs is determined.

[0110] For example, the beats in the first beat sequence can be divided into units of four beats, and the first starting time point of each beat can be assigned to a corresponding musical measure. Then, based on the time signature of the first starting time point in the corresponding musical measure, the third time signature can be obtained. That is, the third time signature can take four values: 1, 2, 3, and 4. The third time signature corresponding to the first target beat is one of these four values.

[0111] In step S430, the first target index position is determined from the index position of the first candidate melody rhythm sequence based on the third time signature corresponding to the first target beat point of each first note, the first measure number corresponding to the first music measure to which each first note belongs, and the preset music measure length.

[0112] For example, Figure 5 FIG2 is a flow chart showing a method for determining a first target index position according to an embodiment of the present disclosure. Figure 5 The method may include steps S510 to S530. In step S510, the product of the first measure number of the first musical measure to which the first note belongs and the preset musical measure length is determined to obtain a first product; in step S520, the sum of the first product and the third time signature is determined to obtain a first sum value; and in step S530, the index position in the first candidate melody rhythm sequence whose index value is the first sum value is determined as the first target index position.

[0113] For example, the first target index position R can be determined according to the following formula (4): i :

[0114] R i=16*Bar(Note)+i'(4)

[0115] In formula (4), i' represents the third time signature corresponding to the first target beat point of each first note, Bar(Note) is the first measure number of the first musical measure to which each first note belongs obtained by formula (3), which is a consecutive number value such as 1, 2, 3, 4, 5, etc., 16 is the preset musical measure length, that is, each musical measure includes 16 notes, and * represents a product operation.

[0116] In step S440 , it is determined that a first note exists at a first target index position in the first candidate melody rhythm sequence, and that no first note exists at other index positions except the first target index position.

[0117] For example, after obtaining the first target index position, it can be determined that each first target index position in the first candidate rhythm sequence contains a first note, while all index positions other than the first target index position do not contain a first note. Consequently, a first preset value is assigned to the first target index position in the first candidate melody rhythm sequence, and a second preset value is assigned to all index positions other than the first target index position, thereby obtaining the first melody rhythm sequence.

[0118] That is, the first melody rhythm sequence is obtained by assigning a first preset value to a first target index position in the first candidate melody rhythm sequence and assigning a second preset value to all index positions other than the first target index position. For example, after determining the length of the first candidate melody rhythm sequence in step S110, each index position can be arbitrarily assigned a value to obtain the first candidate melody rhythm sequence. Then, in step S120, each index position in the first candidate melody rhythm sequence is reassigned based on whether a note exists at each index position in the first candidate melody rhythm sequence. For example, an index position where a first note exists is reassigned the first preset value, and an index position where the first note does not exist is reassigned the second preset value, thereby obtaining the first melody rhythm sequence.

[0119] The first preset value and the second preset value are different. The specific values ​​of the first preset value and the second preset value can be customized, as long as they can distinguish whether the first note exists at a certain index position. This exemplary embodiment does not specifically limit this. For example, the first preset value can be 1 and the second preset value can be 0. The first preset value can also be 0 and the second preset value can be 1, or the first preset value can be 1 and the second preset value can be 2, etc.

[0120] For example, for each MIDI file in the candidate music data set, its note, time signature, and tempo information can be extracted to obtain the first note, first time signature, and first tempo correspondingly. The melody granularity of the note is then configured to be 16 notes per musical measure, with 4 beats per musical measure. The first beat duration of each beat is then obtained according to the above formula (1). The first starting time point of each beat is then obtained based on the first beat duration using the above formula (2). After obtaining the starting time point of the last beat, if the measure containing the last beat is less than 4 beats, the last measure is completed and regarded as the last measure to obtain the number of musical measures of the MIDI file. For a song with N measures, a sequence R1 of all zeros (i.e., the first candidate melody rhythm sequence) with a length of 16 times N can be established.

[0121] Then, according to the above formula (3), the measure position of each note in the melody track corresponding to the MIDI file can be determined. After obtaining the measure position of the note, the first starting time point closest to the starting time point of the note can be found in the above first beat point sequence, and then the time signature of the closest first starting time point in the measure can be determined. Thus, the first target index position in the all-0 sequence R1 can be obtained by the above formula (4), and the element at the first target index position in the all-0 sequence R1 can be reassigned to 1. After performing this operation for each first note, the rhythm sequence R2 of the melody can be obtained, that is, the first melody rhythm sequence mentioned above. In this way, only the element at the first target index position needs to be reassigned, and the element values ​​of the other index positions are the 0 in the initial all-0 sequence.

[0122] Next, a specific implementation of step S130 of slicing the first melody and rhythm sequence of each candidate music data according to the preset music measure length to obtain a first melody and rhythm segment sequence data set will be described.

[0123] For example, after obtaining the first melody and rhythm sequence of each candidate music data, each first melody and rhythm sequence can be sliced ​​into bars to obtain a first melody and rhythm segment sequence corresponding to each first melody and rhythm sequence. The first melody and rhythm segment sequences corresponding to the first melody and rhythm sequences of all candidate music data can be aggregated to obtain a first melody and rhythm segment sequence dataset.

[0124] Taking the preset length of a music measure as 16 notes as an example, for each first melody rhythm segment sequence, there are 16 index positions, and the element value of each index position is a first preset value or a second preset value. The first preset value indicates that there is a note head (i.e., the starting note) at the index position, and the second preset value indicates that there is no note head at the index position. In this way, each element in each first melody rhythm segment sequence can be represented as [<positioni,statej> ], the length of the first melody rhythm fragment sequence is 16, that is, i belongs to 1 to 16, and j belongs to the first preset value or the second preset value.

[0125] Next, the specific implementation of step S140 is described in detail.

[0126] For example, the state transition matrix of the Markov model can be constructed based on the index position of the first melody rhythm fragment sequence and the candidate values ​​of the index position, so as to obtain the state transition probability in the state transition matrix based on the first melody rhythm fragment sequence data set, wherein the candidate values ​​include the above-mentioned first preset value and second preset value.

[0127] In an optional embodiment, the state transition matrix of the Markov model can be the element value change state between each group of adjacent index positions of the first melody rhythm segment sequence. For example, if the length of the first melody rhythm segment sequence is 16, there are 15 groups of adjacent index positions. For each group of adjacent index positions, the element value change state between the previous and next index positions includes four types, namely, changing from the first preset value of the previous index position to the second preset value of the next index position, changing from the first preset value of the previous index position to the first preset value of the next index position, changing from the second preset value of the previous index position to the second preset value of the next index position, and changing from the second preset value of the previous index position to the first preset value of the next index position.

[0128] In other words, the state transition matrix of the Markov model represents the state of element value changes at each group of adjacent index positions. This means the state transition matrix can be a 32-by-32 matrix, representing 16 index positions, with each index position taking both the first and second preset values, for a total of 32 states. For these 32 states, because notes don't jump, it's only necessary to count the state transition probabilities between each group of adjacent index positions. For example, it's only necessary to count the state transitions from the first index position to the second index position, and then from the second index position to the third index position, for a total of 15 groups of state changes. State transition probabilities for non-adjacent index positions do not need to be counted and can be directly assigned a value of 0.

[0129] In an optional embodiment, for each group of adjacent index positions, such as adjacent index positions 1 and 2, the number of first melodic rhythm segment sequences in the first melodic rhythm segment sequence data set with index position 1 being a first preset value and index position 2 also being a first preset value can be counted. Based on a first ratio of this number to the total number of first melodic rhythm segment sequences included in the first melodic rhythm segment sequence data set, a first probability corresponding to adjacent index positions 1 and 2 can be obtained. Similarly, the second probability, third probability, and fourth probability corresponding to adjacent index positions 1 and 2 can also be obtained using a similar method. Similarly, the first probability, second probability, third probability, and fourth probability corresponding to other adjacent index positions, such as index positions 2 and 3, index positions 3 and 4, index positions 4 and 5, and index positions 5 and 6, can also be obtained using the same method, until the first probability, second probability, third probability, and fourth probability corresponding to 15 groups of adjacent index positions are counted.

[0130] Taking the above-mentioned 16 index positions, where each index position takes the first preset value and the second preset value as an example, according to the first probability, second probability, third probability and fourth probability corresponding to 15 groups of adjacent index positions, 15 times 4 are obtained, totaling 60 state transition probabilities of the Markov model.

[0131] Next, a specific implementation method of step S150, which is to repair the melody and rhythm of the first music data according to the state transition probability of the Markov model, will be described in detail.

[0132] For example, Figure 6 A flow chart showing a method for repairing melody rhythm according to an embodiment of the present disclosure is shown. Figure 6 The method may include steps S610 to S650.

[0133] In step S610, the length of the second candidate melody rhythm sequence of the first music data is determined according to the second note number of the first music data and the preset music measure length.

[0134] In an exemplary embodiment, the music audio A to be processed can be input into a deep learning network capable of automatic music transcription, and the initial MIDI file corresponding to the music audio A to be processed can be obtained by combining the sentence segmentation of the lyrics content, and the initial MIDI file can be used as the first music data.

[0135] Exemplarily, a specific implementation of step S610 may include: determining the number of second music measures of the first music data based on the number of second notes of the first music data and the preset music measure length; and determining the length of the second candidate rhythm sequence of the first music data based on the product of the number of second music measures and the preset music measure length.

[0136] Among them, the specific implementation of step S610 can refer to the specific implementation of the above-mentioned step S110, and the technical terms related to the candidate music data can be replaced with technical terms related to the first music data, such as replacing the first number of notes with the second number of notes, replacing the first number of music measures with the second number of music measures, etc., which will not be repeated here.

[0137] In step S620, for each index position in the second candidate melody and rhythm sequence, if there is a second note at the index position, the element indicated by the index position is configured as a first preset value; if there is no second note at the index position, the element indicated by the index position is configured as a second preset value, thereby obtaining the second melody and rhythm sequence of the first music data.

[0138] Exemplarily, an implementation method for determining whether a second note exists at an index position in a second candidate melody rhythm sequence may include: determining the second beat duration of each beat of the first music data according to the second music speed of the first music data; determining the second beat signature of each second note according to the fourth beat signature of each second note in the first music data and the preset number of beats of each music measure, the second beat signature being used to indicate the second music measure to which the second note belongs and the fifth beat signature of the second note in the second music measure; determining the third starting time point of each beat in the first music data based on the second beat duration, the second beat signature, and the preset music measure length to obtain a second beat point sequence; obtaining the fourth starting time point of each second note in the first music data, and determining the second measure number corresponding to the second music measure to which each second note belongs according to the third starting time point, the second beat duration, and the preset number of beats; determining whether a second note exists at the index position according to the second measure number corresponding to the second music measure to which each second note belongs, the third starting time point, and the preset music measure length.

[0139] Exemplarily, an implementation method for determining whether there is a second note at the index position based on the second measure number corresponding to the second music measure to which each second note belongs, the third starting time point and the preset music measure length may include: for each second note, determining the second target beat point of the second note based on the third starting time point closest to the fourth starting time point of the second note in the second beat point sequence; for the second target beat point of each second note, determining the sixth time signature of the second target beat point in the measure to which the second target beat point belongs; determining the second target index position from the index position of the second candidate melody rhythm sequence based on the sixth time signature corresponding to the second target beat point of each second note, the second measure number corresponding to the second music measure to which each second note belongs, and the preset music measure length; determining that there is a second note at the second target index position in the second candidate melody rhythm sequence, and that there is no second note at other index positions except the second target index position.

[0140] Exemplarily, an implementation method of determining the second target index position from the index position of the second candidate melody rhythm sequence based on the sixth time signature corresponding to the second target beat point of each second note, the second measure number corresponding to the second music measure to which each second note belongs, and the preset music measure length may include: determining the product of the second measure number of the second music measure to which the second note belongs and the preset music measure length to obtain a second product; determining the sum of the second product and the sixth time signature to obtain a fourth sum value; and determining the index position in the second candidate melody rhythm sequence whose index value is the fourth sum value as the second target index position.

[0141] Among them, the specific implementation method of determining whether there is a second note in the index position of the second candidate melody rhythm sequence can refer to the above-mentioned specific implementation method of determining whether there is a first note in the index position of the first candidate melody rhythm sequence, that is, the specific implementation method of step S620 can refer to the above-mentioned specific implementation method of step S120. Similarly, the technical terms related to the candidate music data can be replaced with technical terms related to the first music data, and no further details will be given here.

[0142] In step S630, the second melody and rhythm sequence is sliced ​​according to the preset music measure length to obtain one or more second melody and rhythm segment sequences.

[0143] For example, the specific implementation of slicing the second melody rhythm sequence may refer to the above-mentioned implementation of slicing the first melody rhythm sequence, which will not be described in detail here.

[0144] In step S640 , for each second melody and rhythm segment sequence, a first generation probability of the second melody and rhythm segment sequence is determined according to the state transition probability of the Markov model.

[0145] For example, Figure 7 FIG. 1 is a flow chart showing a method for determining a first generation probability in an exemplary embodiment of the present disclosure. Figure 7 The method may include steps S710 to S720.

[0146] In step S710, for each group of adjacent index positions in the second melody rhythm segment sequence, a first transition probability of transferring from the element value of the previous index position to the element value of the next index position is found in the state transition probability of the Markov model.

[0147] For example, the state transition probability of the Markov model obtained in step S140 has recorded the probabilities corresponding to all possible state value changes of each group of adjacent index positions. For the second melody rhythm fragment sequence, the state value change of each group of adjacent index positions has been determined. The probability corresponding to the state value change can be directly searched in the state transition probability of the Markov model according to the state value change, thereby obtaining the first transition probability corresponding to each group of adjacent index positions, that is, obtaining 15 first transition probabilities.

[0148] For example, taking the first preset value as 1, the second preset value as 0, and the second melody rhythm fragment sequence as [0,1,0,1,1,1,0,0,1,1,0,1,1,1,1,0], the state transition probability from (1,0) to (2,1) can be directly searched in the state transition probability of the Markov model to obtain the first transition probability corresponding to index positions 1 and 2, the state transition probability from (2,1) to (3,0) can be searched to obtain the first transition probability corresponding to index positions 2 and 3, the state transition probability from (3,0) to (4,1) can be searched to obtain the first transition probability corresponding to index positions 3 and 4, and so on, until the state transition probabilities of all adjacent index positions in the second melody rhythm fragment sequence are searched, thereby obtaining the first transition probability corresponding to each group (15 groups in total) of adjacent index positions.

[0149] Among them, (1,0) indicates that the element value at index position 1 is 0, and (2,1) indicates that the element value at index position 2 is 1. That is, in (i,j), i represents the index position, and j represents the element value at the index position. The state transition probability from (1,0) to (2,1) can be understood as the probability that the element value at index position 2 is 1 when the element value at index position 1 is 0. The state transition probability from (2,1) to (3,0) can be understood as the probability that the element value at index position 3 is 0 when the element value at index position 2 is 1. The meanings of other state transition probabilities are similar and will not be repeated here.

[0150] In step S720 , a first generation probability of the second melody rhythm segment sequence is determined according to the product of the first transition probabilities of each group of adjacent index positions.

[0151] For example, for each second melody rhythm fragment sequence, the first transition probabilities corresponding to each group of adjacent index positions can be multiplied, that is, 15 first transition probabilities can be multiplied, and then the product of the 15 first transition probabilities can be used as the generation probability of the second melody rhythm fragment sequence, that is, the first generation probability.

[0152] In step S650, a melody and rhythm segment sequence to be repaired is determined from the second melody and rhythm segment sequence according to the first generation probability, and the melody and rhythm segment sequence to be repaired is repaired.

[0153] Exemplarily, a specific implementation of determining a melody rhythm segment sequence to be repaired from a second melody rhythm segment sequence based on the first generation probability may include: determining the melody rhythm segment to be repaired based on a second melody rhythm segment sequence whose first generation probability is less than a third preset value.

[0154] For example, after obtaining the first generation probability of each second melody rhythm fragment sequence, the first generation probability can be compared with the third preset value. If the first generation probability is less than the third preset value, it means that from the perspective of the state transition probability of the Markov model, the MIDI file generated by the transcription is less likely to be the melody rhythm fragment sequence, which means that the melody rhythm fragment sequence has a great problem and needs to be repaired.

[0155] Among them, the third preset value can be any value greater than 0 and less than 1, which can be customized according to needs. Because the state transition probability of the Markov model is definitely less than or equal to 1, the product between the first transition probabilities of each group of adjacent index positions is definitely less than 1. Therefore, the third preset value can be any value greater than 0 and less than 1.

[0156] In the present disclosure, the state transition probability of the Markov model can be used to quickly detect whether a melody rhythm segment sequence has defects, thereby improving the efficiency of repairing the transcription result.

[0157] For example, Figure 8 A flow chart of a method for repairing a melody rhythm segment sequence to be repaired according to an embodiment of the present disclosure is shown. Figure 8 The method may include steps S810 to S830.

[0158] In step S810, a first target melody and rhythm segment sequence is determined according to each index position in the melody and rhythm segment sequence and a candidate index value corresponding to each index position.

[0159] In an exemplary embodiment, the candidate index values ​​include the first preset value and the second preset value mentioned above, and the length of the melody rhythm segment sequence is determined according to the preset music measure length.

[0160] For example, if the length of a melodic rhythm segment sequence corresponds to the length of a musical measure, and a musical measure includes 16 quarter notes, the melodic rhythm segment sequence includes 16 index positions, and each index position corresponds to one of two possible candidate index positions: a first preset value or a second preset value. In other words, based on the number of index positions and the possible values ​​of each index position, it can be determined that there are 2 to the power of 16, or 65,536, possible melodic rhythm segment sequences. That is, based on each index position in the melodic rhythm segment sequence and the candidate index values ​​corresponding to each index position, 65,536 first target melodic rhythm segment sequences can be obtained.

[0161] In step S820, a second generation probability of each of the first target melody rhythm segment sequences is determined according to the state transition probability of the Markov model.

[0162] For the 65536 first target melody rhythm fragment sequences, the value of each index position in each first target melody rhythm fragment sequence is determined, so the transition probability corresponding to the element values ​​of each group of adjacent index positions can be found in the state transition probability of the Markov model, and then the second generation probability of the first melody rhythm fragment sequence can be obtained according to the product of the transition probabilities corresponding to the element values ​​of each group of adjacent index positions.

[0163] Exemplarily, the method for determining the second generation probability may refer to the method for determining the first generation probability described above, which will not be described in detail here.

[0164] In an optional embodiment, taking the first preset value being 1 and the second preset value being 0 as an example, since each melody rhythm fragment sequence has only 16 index positions, each first target melody rhythm fragment sequence can be represented as a string of 16-bit binary numbers. Therefore, all possible first target melody rhythm fragment sequences can be represented by corresponding integer numbers, that is, from 1 to 65536, 65536 first target melody rhythm fragment sequences are represented. Then, the integer numbers mapped to each first target melody rhythm fragment sequence and their corresponding second generation probabilities are stored in a database. That is, what is stored in the database is the correspondence between the integer numbers and the second generation probabilities. In this way, the integer numbers corresponding to the melody rhythm fragment sequences can be directly used for matching and comparison, thereby improving processing efficiency.

[0165] For example, when determining the first generation probability of the second melody rhythm fragment sequence, there is no need to look up the first transition probability of each group of adjacent index positions and then calculate the first generation probability based on the first transition probability. Instead, you can directly look up the integer corresponding to the second melody rhythm fragment sequence in the database, and then directly use the second generation probability corresponding to the integer as the first generation probability of the second melody rhythm fragment sequence.

[0166] Of course, when the first and second preset values ​​are other values, the first target melody and rhythm sequence and its corresponding second generation probability can also be stored in a similar manner. Of course, instead of converting the first target melody and rhythm segment sequence into corresponding integers, the 16-bit first target melody and rhythm segment sequence and its corresponding second generation probability can also be directly stored. This exemplary embodiment does not specifically limit this.

[0167] In step S830, the melody and rhythm segment sequence to be repaired is repaired according to the second generation probability.

[0168] For example, Figure 9 FIG2 shows a flow chart of a method for repairing a melody rhythm segment sequence to be repaired according to a second generation probability according to an embodiment of the present disclosure. Figure 9 The method may include steps S910 to S930.

[0169] In step S910 , a second target melody and rhythm segment sequence is determined based on the first target melody and rhythm segment sequence whose second generation probability is greater than a fourth preset value.

[0170] For example, the first target melody and rhythm segment sequence whose second generation probability is greater than a fourth preset value may be determined as the second target melody and rhythm segment sequence.

[0171] Among them, the fourth preset value can be determined according to the intensity of the desired repair. The larger the fourth preset value, the greater the repair intensity, that is, the smaller the gap between the repaired result and the correct result. The fourth preset value can be any value greater than 0 and less than 1. This exemplary embodiment does not make any special limitations on this.

[0172] In step S920 , a first similarity between the second target melody and rhythm segment sequence and the melody and rhythm segment sequence to be repaired is calculated.

[0173] For example, a first similarity between each second target melody and rhythm segment sequence and the melody and rhythm segment sequence to be repaired may be calculated.

[0174] For example, when the first preset value is 1 and the second preset value is 0, the XOR number of the second target melody rhythm segment sequence and the melody rhythm segment sequence to be repaired can be determined first, and then the inverse of the XOR number can be taken to obtain the first similarity.

[0175] Of course, the first similarity between the second target melody rhythm fragment sequence and the melody rhythm fragment sequence to be repaired can also be calculated in other ways, such as treating the two melody rhythm fragment sequences as 16-dimensional vectors respectively, and then calculating the similarity between the two 16-dimensional vectors, etc. This exemplary embodiment does not make any special limitations on this.

[0176] In step S930 , the melody and rhythm segment sequence to be repaired is repaired according to the first similarity and the second generation probability of the second target melody and rhythm segment sequence.

[0177] Exemplarily, a specific implementation of step S930 may include: calculating the second sum of the first similarity and the second generation probability corresponding to each second target melody rhythm fragment sequence; taking the second target melody rhythm fragment sequence with the largest second sum as the target melody rhythm fragment sequence; and taking the target melody rhythm fragment sequence as the repair result of the melody rhythm fragment sequence to be repaired.

[0178] For example, for each second target melody and rhythm sequence, the sum of the first similarity and the second generation probability corresponding to the second target melody and rhythm sequence can be calculated, and the second target melody and rhythm sequence with the largest sum value can be used as the repair result of the melody and rhythm sequence to be repaired. In other words, the second target melody and rhythm sequence with the largest sum value can be used to replace the melody and rhythm sequence to be repaired as the new transcription result.

[0179] For example, Figure 10 FIG2 shows a flow chart of another method for repairing a melody rhythm segment sequence to be repaired according to a second generation probability according to an embodiment of the present disclosure. Figure 10The method may include steps S1010 to S1030.

[0180] In step S1010 , a second similarity between the first target melody and rhythm segment sequence and the melody and rhythm segment sequence to be repaired is calculated.

[0181] The method for calculating the second similarity may refer to the method for calculating the first similarity described above, and will not be described in detail here.

[0182] In step S1020 , a third target melody and rhythm segment sequence is determined based on the first target melody and rhythm segment sequence whose second similarity is greater than a fifth preset value.

[0183] For example, a first target melody and rhythm segment sequence whose second similarity is greater than a fifth preset value can be used as a third target melody and rhythm segment sequence. The fifth preset value can also be customized as needed and can be any value between 0 and 1, which is not specifically limited in this exemplary embodiment.

[0184] In step S1030 , the melody and rhythm segment sequence to be repaired is repaired according to the second similarity and the second generation probability of the third target melody and rhythm segment sequence.

[0185] Exemplarily, a specific implementation of step S1030 may include: calculating the third sum of the second similarity and the second generation probability corresponding to each third target melody rhythm fragment sequence; taking the second target melody rhythm fragment sequence with the largest third sum as the target melody rhythm fragment sequence; and taking the target melody rhythm fragment sequence as the repair result of the melody rhythm fragment sequence to be repaired.

[0186] For example, similarly, for each third target melody and rhythm sequence, the sum of the second similarity and the second generation probability corresponding to the third target melody and rhythm sequence can be calculated, and the third target melody and rhythm sequence with the largest sum value can be used as the repair result of the melody and rhythm sequence to be repaired. In other words, the third target melody and rhythm sequence with the largest sum value can be used to replace the melody and rhythm sequence to be repaired as the new transcription result.

[0187] As for the repair of melody rhythm, if the melody rhythm is repaired only based on the similarity, the generation probability of the first target melody rhythm fragment sequence with a high similarity to the melody rhythm fragment sequence to be repaired is low, that is, the possibility of the first target melody rhythm fragment sequence used to repair the melody rhythm fragment sequence to be repaired itself is low, so if it is used to repair the melody rhythm sequence to be repaired, the accuracy of the repair will be low; and if the melody rhythm is repaired only based on the generation probability, there is a situation where the similarity between the first target melody rhythm fragment sequence with a high generation probability and the melody rhythm fragment sequence to be repaired is low. In this way, the changes to the melody rhythm fragment sequence to be repaired will be relatively large, which may also lead to inaccurate final repair results.

[0188] In the present disclosure, through the above-mentioned steps S910 to S930, and steps S1010 to S1030, the melody rhythm can be repaired together according to the similarity and generation probability, thereby achieving a balance between the generation probability and the degree of modification, and improving the accuracy of the melody rhythm repair.

[0189] Based on the above technical solutions, the present disclosure can at least achieve the following technical effects:

[0190] On the one hand, the state transition probability of the Markov model can be used to repair the pitch offset and rhythm deviation problems that occur during automatic transcription, thereby improving the accuracy and usability of the transcription results. On the other hand, since the state transition probability of the Markov model can be determined in advance, it can help improve the efficiency of music melody and rhythm repair.

[0191] Exemplary devices

[0192] After introducing the music data processing method according to the exemplary embodiment of the present disclosure, Figure 11 A music data processing device according to an exemplary embodiment of the present disclosure will be described.

[0193] Figure 11The above-mentioned music data processing device 1100 is shown, comprising: a first candidate rhythm sequence determination module 1110, configured to determine, for each candidate music data in the candidate music data set, the length of the first candidate melody rhythm sequence of the candidate music data according to the number of first notes of the candidate music data and the preset music measure length, wherein the preset music measure length is determined according to the preset number of first notes; a first melody rhythm sequence determination module 1120, configured to, for each index position in each of the first candidate melody rhythm sequences, configure the element indicated by the index position to a first preset value if the first note exists at the index position, and configure the element indicated by the index position to a second preset value if the first note does not exist at the index position, so as to obtain the first melody rhythm sequence of the candidate music data; a first melody rhythm segment sequence data set determination module 1130, configured to determine, for each candidate music data in the candidate music data set, the length of the first candidate melody rhythm sequence of the candidate music data according to the number of first notes of the candidate music data and the preset music measure length, wherein the preset music measure length is determined according to the preset number of first notes; A first melody and rhythm sequence of music data is selected, and the first melody and rhythm sequence is sliced ​​according to the preset music measure length to obtain a first melody and rhythm fragment sequence data set; a state transition probability determination module 1140 is configured to, for each group of adjacent index positions in the first melody and rhythm fragment sequence, based on the first melody and rhythm sequence fragment data set, count the first probability that the element value of the next index position is the first preset value and the second probability that the element value of the next index position is the second preset value when the element value of the previous index position is the first preset value, and the third probability that the element value of the next index position is the first preset value and the fourth probability that the element value of the next index position is the second preset value when the element value of the previous index position is the second preset value, to obtain the state transition probability of the Markov model; a melody and rhythm repair module 1150 is configured to perform melody and rhythm repair on the first music data according to the state transition probability of the Markov model.

[0194] In an exemplary embodiment, the above-mentioned first candidate melody rhythm sequence determination module 1110 can be specifically configured as: determining the first music measure number of the candidate music data based on the first note number of the candidate music data and the preset music measure length; determining the length of the first candidate melody rhythm sequence of the candidate music data based on the product of the first music measure number and the preset music measure length.

[0195] In an exemplary embodiment, a method for determining whether a first note exists at the index position includes: determining a first beat duration of each beat of the candidate music data according to a first music speed of the candidate music data; determining a first beat signature of each first note in the candidate music data according to a first time signature of each first note and a preset number of beats of each music measure, wherein the first beat signature is used to indicate the first music measure to which the first note belongs and the second time signature of the first note in the first music measure; determining a first starting time point of each beat in the candidate music data based on the first beat duration, the first beat signature, and the preset music measure length to obtain a first beat point sequence; obtaining a second starting time point of each first note in the candidate music data, and determining a first measure number corresponding to the first music measure to which each first note belongs according to the second starting time point, the first beat duration, and the preset number of beats; determining whether a first note exists at the index position according to the first measure number corresponding to the first music measure to which each first note belongs, the first starting time point, and the preset music measure length.

[0196] In an exemplary embodiment, determining whether there is a first note at the index position based on the first measure number corresponding to the first music measure to which each first note belongs, the first starting time point and the preset music measure length includes: for each first note, determining the first target beat point of the first note based on the first starting time point closest to the second starting time point of the first note in the first beat point sequence; for the first target beat point of each first note, determining the third time signature of the first target beat point in the measure to which the first target beat point belongs; determining the first target index position from the index positions of the first candidate melody rhythm sequence based on the third time signature corresponding to the first target beat point of each first note, the first measure number corresponding to the first music measure to which each first note belongs, and the preset music measure length; determining that there is a first note at the first target index position in the first candidate melody rhythm sequence, and there is no first note at other index positions except the first target index position.

[0197] In an exemplary embodiment, the first target index position is determined from the index position of the first candidate melody rhythm sequence based on the third time signature corresponding to the first target beat point of each first note, the first measure number corresponding to the first music measure to which each first note belongs, and the preset music measure length, including: determining the product of the first measure number of the first music measure to which the first note belongs and the preset music measure length to obtain a first product; determining the sum of the first product and the third time signature to obtain a first sum value; and determining the index position in the first candidate melody rhythm sequence whose index value is the first sum value as the first target index position.

[0198] In an exemplary embodiment, the melody and rhythm repair module 1150 can be specifically configured as follows: determining the length of a second candidate melody and rhythm sequence of the first music data based on the number of second notes of the first music data and the preset music measure length; for each index position in the second candidate melody and rhythm sequence, if there is a second note at the index position, configuring the element indicated by the index position to a first preset value, and if there is no second note at the index position, configuring the element indicated by the index position to a second preset value, to obtain a second melody and rhythm sequence of the first music data; for the second melody and rhythm sequence, slicing the second melody and rhythm sequence according to the preset music measure length to obtain one or more second melody and rhythm fragment sequences; for each second melody and rhythm fragment sequence, determining a first generation probability of the second melody and rhythm fragment sequence based on the state transition probability of the Markov model; based on the first generation probability, determining a melody and rhythm fragment sequence to be repaired from the second melody and rhythm fragment sequence, and repairing the melody and rhythm fragment sequence to be repaired.

[0199] In an exemplary embodiment, determining the first generation probability of the second melody rhythm fragment sequence based on the state transition probability of the Markov model includes: for each group of adjacent index positions in the second melody rhythm fragment sequence, searching for the first transition probability of the element value from the previous index position to the element value of the next index position in the state transition probability of the Markov model; and determining the first generation probability of the second melody rhythm fragment sequence based on the product of the first transition probabilities of each group of adjacent index positions.

[0200] In an exemplary embodiment, determining the melody rhythm fragment sequence to be repaired from the second melody rhythm fragment sequence based on the first generation probability includes: determining the melody rhythm fragment to be repaired based on the second melody rhythm fragment sequence whose first generation probability is less than a third preset value.

[0201] In an exemplary embodiment, the repairing of the melody and rhythm fragment sequence to be repaired includes: determining a first target melody and rhythm fragment sequence based on each index position in the melody and rhythm fragment sequence and the candidate index value corresponding to each index position, the candidate index value including the first preset value and the second preset value, and the length of the melody and rhythm fragment sequence is determined according to the preset music measure length; determining a second generation probability of each of the first target melody and rhythm fragment sequences based on the state transition probability of the Markov model; and repairing the melody and rhythm fragment sequence to be repaired based on the second generation probability.

[0202] In an exemplary embodiment, repairing the melody rhythm fragment sequence to be repaired based on the second generation probability includes: determining a second target melody rhythm fragment sequence based on the first target melody rhythm fragment sequence whose second generation probability is greater than a fourth preset value; calculating a first similarity between the second target melody rhythm fragment sequence and the melody rhythm fragment sequence to be repaired; and repairing the melody rhythm fragment sequence to be repaired based on the first similarity and the second generation probability of the second target melody rhythm fragment sequence.

[0203] In an exemplary embodiment, repairing the melody rhythm fragment sequence to be repaired according to the first similarity and the second generation probability of the second target melody rhythm fragment sequence includes: calculating the second sum of the first similarity and the second generation probability corresponding to each second target melody rhythm fragment sequence; taking the second target melody rhythm fragment sequence with the largest second sum as the target melody rhythm fragment sequence; and taking the target melody rhythm fragment sequence as the repair result of the melody rhythm fragment sequence to be repaired.

[0204] In an exemplary embodiment, repairing the melody rhythm fragment sequence to be repaired based on the second generation probability includes: calculating the second similarity between the first target melody rhythm fragment sequence and the melody rhythm fragment sequence to be repaired; determining a third target melody rhythm fragment sequence based on the first target melody rhythm fragment sequence whose second similarity is greater than a fifth preset value; and repairing the melody rhythm fragment sequence to be repaired based on the second similarity and the second generation probability of the third target melody rhythm fragment sequence.

[0205] In an exemplary embodiment, the repairing of the melody rhythm fragment sequence to be repaired based on the second similarity and the second generation probability of the third target melody rhythm fragment sequence includes: calculating the third sum of the second similarity and the second generation probability corresponding to each third target melody rhythm fragment sequence; taking the second target melody rhythm fragment sequence with the largest third sum as the target melody rhythm fragment sequence; and taking the target melody rhythm fragment sequence as the repair result of the melody rhythm fragment sequence to be repaired.

[0206] In an exemplary embodiment, determining the length of the second candidate melody rhythm sequence of the first music data based on the second note number of the first music data and the preset music measure length includes: determining the second music measure number of the first music data based on the second note number of the first music data and the preset music measure length; and determining the length of the second candidate rhythm sequence of the first music data based on the product of the second music measure number and the preset music measure length.

[0207] In an exemplary embodiment, a method for determining whether a second note exists at the index position includes: determining a second beat duration of each beat of the first music data according to the second music speed of the first music data; determining a second beat signature of each second note according to a fourth beat signature of each second note in the first music data and a preset number of beats in each music measure, wherein the second beat signature is used to indicate the second music measure to which the second note belongs and the fifth beat signature of the second note in the second music measure; determining a third starting time point of each beat in the first music data based on the second beat duration, the second beat signature, and the preset music measure length to obtain a second beat point sequence; obtaining a fourth starting time point of each second note in the first music data, and determining a second measure number corresponding to the second music measure to which each second note belongs according to the third starting time point, the second beat duration, and the preset number of beats; and determining whether a second note exists at the index position according to the second measure number corresponding to the second music measure to which each second note belongs, the third starting time point, and the preset music measure length.

[0208] In an exemplary embodiment, determining whether there is a second note at the index position based on the second measure number corresponding to the second music measure to which each second note belongs, the third starting time point and the preset music measure length includes: for each second note, determining the second target beat point of the second note based on the third starting time point closest to the fourth starting time point of the second note in the second beat point sequence; for the second target beat point of each second note, determining the sixth time signature of the second target beat point in the measure to which the second target beat point belongs; determining the second target index position from the index position of the second candidate melody rhythm sequence based on the sixth time signature corresponding to the second target beat point of each second note, the second measure number corresponding to the second music measure to which each second note belongs, and the preset music measure length; determining that there is a second note at the second target index position in the second candidate melody rhythm sequence, and no second note exists at other index positions except the second target index position.

[0209] In an exemplary embodiment, the second target index position is determined from the index position of the second candidate melody rhythm sequence based on the sixth time signature corresponding to the second target beat point of each second note, the second measure number corresponding to the second music measure to which each second note belongs, and the preset music measure length, including: determining the product of the second measure number of the second music measure to which the second note belongs and the preset music measure length to obtain a second product; determining the sum of the second product and the sixth time signature to obtain a fourth sum value; and determining the index position in the second candidate melody rhythm sequence whose index value is the fourth sum value as the second target index position.

[0210] In addition, other specific details of the embodiments of the present disclosure have been described in detail in the invention implementation of the above method and will not be repeated here.

[0211] Exemplary Storage Media

[0212] The storage medium according to the exemplary embodiment of the present disclosure will be described below.

[0213] In this exemplary embodiment, the aforementioned music data processing method can be implemented using a program product, such as a portable compact disc read-only memory (CD-ROM) that includes program code, and the steps of the aforementioned music data processing method can be executed on a device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0214] The program product can be implemented in any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0215] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0216] The program code contained on the readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RE, etc., or any suitable combination of the foregoing.

[0217] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and the like, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (FAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0218] Exemplary electronic devices

[0219] refer to Figure 12 An electronic device according to an exemplary embodiment of the present disclosure will be described.

[0220] Figure 12 The electronic device 1200 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0221] like Figure 12 As shown, electronic device 1200 is implemented as a general-purpose computing device. Components of electronic device 1200 may include, but are not limited to, at least one processing unit 1210, at least one storage unit 1220, a bus 1230 connecting various system components (including storage unit 1220 and processing unit 1210), and a display unit 1240.

[0222] The storage unit stores program codes, which can be executed by the processing unit 1210, so that the processing unit 1210 performs the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section above. For example, the processing unit 1210 can perform the following steps: Figures 1 to 10 The method steps shown in etc.

[0223] The storage unit 1220 may include a volatile storage unit, such as a random access memory unit (RAM) 1221 and / or a cache memory unit 1222 , and may further include a read-only memory unit (ROM) 1223 .

[0224] The storage unit 1220 may also include a program / utility 1224 having a set (at least one) of program modules 1225, such program modules 1225 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0225] The bus 1230 may include a data bus, an address bus, and a control bus.

[0226] The electronic device 1200 can also communicate with one or more external devices 1300 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), and such communication can be performed via an input / output (I / O) interface 1250. The electronic device 1200 also includes a display unit 1240, which is connected to the input / output (I / O) interface 1250 for display. In addition, the electronic device 1200 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 via a bus 1230. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0227] It should be noted that although several modules or submodules of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in a single unit / module. Conversely, the features and functions of a single unit / module described above can be further divided and embodied by multiple units / modules.

[0228] Furthermore, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all illustrated operations must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0229] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features in these aspects cannot be combined to benefit. Such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims.

Claims

1. A music data processing method, characterized in that: include: For each candidate music data in the candidate music data set, determining the length of a first candidate melody rhythm sequence of the candidate music data according to the number of first notes of the candidate music data and a preset music measure length, wherein the preset music measure length is determined according to a preset number of notes; For each index position in each of the first candidate melody and rhythm sequences, if there is a first note at the index position, the element indicated by the index position is configured as a first preset value, and if there is no first note at the index position, the element indicated by the index position is configured as a second preset value, to obtain a first melody and rhythm sequence of the candidate music data; For each first melody and rhythm sequence of the candidate music data, slicing the first melody and rhythm sequence according to the preset music measure length to obtain a first melody and rhythm segment sequence data set; For each group of adjacent index positions in the first melody rhythm fragment sequence, based on the first melody rhythm sequence fragment data set, statistically calculate a first probability that the element value of the next index position is the first preset value and a second probability that the element value of the next index position is the second preset value when the element value of the previous index position is the first preset value, and a third probability that the element value of the next index position is the first preset value and a fourth probability that the element value of the next index position is the second preset value when the element value of the previous index position is the second preset value, to obtain a state transition probability of the Markov model; The melody and rhythm of the first music data are repaired according to the state transition probability of the Markov model.

2. The music processing method according to claim 1, characterized in that: The step of repairing the melody and rhythm of the first music data according to the state transition probability of the Markov model comprises: Determining the length of a second candidate melody rhythm sequence of the first music data according to the second note number of the first music data and the preset music measure length; For each index position in the second candidate melody and rhythm sequence, if there is a second note at the index position, the element indicated by the index position is configured as a first preset value, and if there is no second note at the index position, the element indicated by the index position is configured as a second preset value, so as to obtain a second melody and rhythm sequence of the first music data; For the second melody and rhythm sequence, slicing the second melody and rhythm sequence according to the preset music measure length to obtain one or more second melody and rhythm segment sequences; For each second melody and rhythm segment sequence, determining a first generation probability of the second melody and rhythm segment sequence according to the state transition probability of the Markov model; According to the first generation probability, a melody rhythm segment sequence to be repaired is determined from the second melody rhythm segment sequence, and the melody rhythm segment sequence to be repaired is repaired.

3. The music processing method according to claim 2, characterized in that: Determining the first generation probability of the second melody rhythm segment sequence according to the state transition probability of the Markov model includes: For each group of adjacent index positions in the second melody rhythm segment sequence, searching for a first transition probability of transferring from an element value at a previous index position to an element value at a subsequent index position in the state transition probability of the Markov model; The first generation probability of the second melody rhythm segment sequence is determined according to the product of the first transition probabilities of each group of adjacent index positions.

4. The music processing method according to claim 2, characterized in that: The step of determining a melody rhythm segment sequence to be repaired from the second melody rhythm segment sequence according to the first generation probability comprises: The melody rhythm segment to be repaired is determined according to a second melody rhythm segment sequence whose first generation probability is less than a third preset value.

5. The music processing method according to claim 2, characterized in that: The repairing of the melody rhythm segment sequence to be repaired comprises: Determine a first target melody rhythm segment sequence according to each index position in the melody rhythm segment sequence and a candidate index value corresponding to each index position, wherein the candidate index value includes the first preset value and the second preset value, and the length of the melody rhythm segment sequence is determined according to the preset music measure length; Determining a second generation probability of each of the first target melody rhythm fragment sequences according to the state transition probability of the Markov model; The melody rhythm segment sequence to be repaired is repaired according to the second generation probability.

6. The music processing method according to claim 5, characterized in that: The repairing of the melody rhythm segment sequence to be repaired according to the second generation probability comprises: determining a second target melody rhythm segment sequence based on the first target melody rhythm segment sequence for which the second generation probability is greater than a fourth preset value; Calculating a first similarity between the second target melody and rhythm segment sequence and the melody and rhythm segment sequence to be repaired; The to-be-repaired melody and rhythm segment sequence is repaired according to the first similarity and the second generation probability of the second target melody and rhythm segment sequence.

7. The music processing method according to claim 6, characterized in that: According to the first similarity and the second generation probability of the second target melody and rhythm fragment sequence, repairing the melody and rhythm fragment sequence to be repaired includes: Calculate a second sum of the first similarity and the second generation probability corresponding to each second target melody rhythm segment sequence; taking the second target melody rhythm segment sequence with the largest second sum as the target melody rhythm segment sequence; The target melody and rhythm segment sequence is used as the repair result of the melody and rhythm segment sequence to be repaired.

8. A music data processing device, characterized in that: include: A first candidate rhythm sequence determination module is configured to determine, for each candidate music data in the candidate music data set, the length of a first candidate melody rhythm sequence of the candidate music data according to the number of first notes of the candidate music data and a preset music measure length, wherein the preset music measure length is determined according to a preset number of first notes; A first melody rhythm sequence determination module is configured to, for each index position in each of the first candidate melody rhythm sequences, configure the element indicated by the index position to a first preset value if the first note exists at the index position, and configure the element indicated by the index position to a second preset value if the first note does not exist at the index position, so as to obtain a first melody rhythm sequence of the candidate music data; A first melody and rhythm segment sequence data set determination module is configured to slice the first melody and rhythm segment sequence of each candidate music data according to the preset music measure length to obtain a first melody and rhythm segment sequence data set; The state transition probability determination module is configured to, for each group of adjacent index positions in the first melody rhythm segment sequence, based on the first melody rhythm sequence segment data set, count a first probability that the element value of the next index position is the first preset value and a second probability that the element value of the next index position is the second preset value when the element value of the previous index position is the first preset value, and a third probability that the element value of the next index position is the first preset value and a fourth probability that the element value of the next index position is the second preset value when the element value of the previous index position is the second preset value, so as to obtain the state transition probability of the Markov model; The melody and rhythm repair module is configured to perform melody and rhythm repair on the first music data according to the state transition probability of the Markov model.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method according to any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Patent Citations

  • Music to score conversion method and device based on artificial intelligence

    CN112669796A

  • Music melody generation method and device, model training method and device and medium

    CN114141216A

  • Music generation method based on large pre-training language model

    CN117496926A

  • Device and method for analyzing musical information and recording medium with musical information analyzing program

    JP2001290474A

  • Automated swinging device

    US20010027135A1

Cited By

  • Finger individualized motion activation sequence generation method, device and equipment

    CN121387085A