Music accompaniment separation method and device

Through blind source separation technology and network optimization, a network of vocals, accompaniment and musical instruments is constructed, which solves the problem of low accompaniment quality in the existing technology and achieves high-fidelity music accompaniment separation, which is suitable for mono songs and small-scale songs. Library.

CN114005461BActive Publication Date: 2024-09-17GUANGZHOU AIMYUNION NETWORK TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111262479.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2024-09-17
Estimated Expiration
2041-10-28

Smart Images

  • Figure CN114005461B
    Figure CN114005461B
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and computer-readable storage medium for separating music accompaniment; the method comprises: obtaining imported music and converting the imported music into music spectrum; inputting the music spectrum into a vocal network, an accompaniment network and a musical instrument network respectively to obtain a vocal spectrum, an initial accompaniment spectrum and musical instrument accompaniment spectrum corresponding to various musical instruments; obtaining a vocal file, an initial accompaniment file and musical instrument accompaniment files corresponding to various musical instruments respectively according to the vocal spectrum, the initial accompaniment spectrum and the musical instrument accompaniment spectrum; obtaining the musical instrument characteristics of each musical instrument according to the musical instrument accompaniment file, and reshaping the initial accompaniment file according to the musical instrument characteristics to obtain a high-fidelity accompaniment file; the technical scheme first performs blind source separation to obtain preliminary accompaniment separation, and then reshapes each musical instrument to obtain a high-fidelity accompaniment file, which effectively improves the quality of the separated accompaniment and can achieve highly fidelity separated music accompaniment for the imported music.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of music processing, and in particular to a method, device, computer equipment and computer-readable storage medium for separating music accompaniment. Background Art

[0002] In the process of singing, it is often necessary to constantly replay, compose and perform the songs, which requires accompaniment. As people's spiritual pursuits continue to improve, more and more music lovers are no longer satisfied with singing songs along with singers, but hope to listen to pleasant accompaniment and sing along with the accompaniment like singers, as if they were having an immersive experience of a personal concert. This requires a high-quality accompaniment song, but the cost of pure instrumental accompaniment is high. A high-quality accompaniment song needs to be played by multiple instrumentalists, which is expensive and difficult for individual users to obtain. Currently, most of the software separation methods on the market separate a complete song with accompaniment into vocals and accompaniment, but the existing technology is prone to distortion of vocals and accompaniment, which greatly affects the creator's creative enthusiasm.

[0003] For example, there is currently a technology that uses the encoding module in the accompaniment vocal extraction model to encode the mixed audio data, obtain the encoded audio features, and perform convolution processing on the accompaniment vocal decoding to obtain the target vocal and accompaniment; this technology requires the use of a large amount of song data for training in order to train a better encoder for separating the vocals and accompaniment, otherwise the quality of the vocals and accompaniment will be greatly reduced.

[0004] For example, there is a technology that weights the vocal gain of the mean signal of the corresponding frequency pair of the left and right channel signals. The vocal gain is directly proportional to the normalized cross-correlation value of the current frequency pair. The mean signal of the left and right channels after the weighted vocal gain is converted from the frequency domain to the time domain to extract the vocals. This technology mainly separates the vocal accompaniment for stereo, but cannot achieve song separation for monophonic songs, and its scope of use is obviously limited.

[0005] As another example, there is a technology that extracts voiceprint information from audio, searches for matching song information in a pre-established music database based on the voiceprint features, and extracts accompaniment music corresponding to the song information. This technology uses voiceprint recognition to search for the accompaniment in the inventory after recognition, but requires a huge accompaniment library, and there may be a situation where the accompaniment of the song is not available, making it difficult to meet user needs.

[0006] In summary, the existing technology relies too much on a huge song library to effectively improve the quality of separated accompaniment, and cannot achieve highly fidelity separated music accompaniment. Summary of the invention

[0007] In response to one of the above-mentioned technical defects, the present application provides a method, device, computer equipment and computer-readable storage medium for separating music accompaniment, which can effectively improve the quality of separated accompaniment and achieve highly fidelity separated music accompaniment.

[0008] A method for separating a music accompaniment, comprising:

[0009] Obtaining imported music, and converting the imported music into a music spectrum;

[0010] Input the music spectrum into the vocal network, the accompaniment network and the musical instrument network respectively to obtain the vocal spectrum, the initial accompaniment spectrum and the musical instrument accompaniment spectrum corresponding to various musical instruments;

[0011] According to the human voice spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum, respectively obtain a human voice file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments;

[0012] The instrumental music features of each instrument are obtained according to the instrumental music features, and the initial accompaniment file is reshaped according to the instrumental music features to obtain a high-fidelity accompaniment file.

[0013] In one embodiment, the method for separating the music accompaniment further comprises:

[0014] Construct the vocal network, accompaniment network and instrument network based on blind source separation technology;

[0015] Use sample music with accompaniment in the song library to input the vocal network, accompaniment network and instrument network, and use the pure vocals, pure accompaniment and pure instrument timbres in the song library to compare the outputs of the vocal network, accompaniment network and instrument network respectively;

[0016] The vocal network, accompaniment network and instrument network are optimized according to the comparison results.

[0017] In one embodiment, the method uses sample music with accompaniment in a song library to input a vocal network, an accompaniment network, and a musical instrument network, and uses pure vocals, pure accompaniment, and pure musical instrument timbres in the song library to compare the outputs of the vocal network, the accompaniment network, and the musical instrument network, respectively, including:

[0018] The sample music with accompaniment, pure human voice, pure accompaniment and pure instrument timbre in the song library are respectively subjected to STFT conversion to obtain the corresponding sample music logarithmic Mel spectrum, human voice logarithmic Mel spectrum, accompaniment logarithmic Mel spectrum and instrument logarithmic Mel spectrum, and wavelet analysis is performed on them respectively;

[0019] Analyze the sample music logarithmic Mel spectrum through the vocal network, accompaniment network and instrument network to obtain the corresponding vocal track amplitude spectrum, accompaniment track amplitude spectrum and instrument track amplitude spectrum;

[0020] Performing ADSR analysis on the pure instrument timbre to obtain envelope features corresponding to various types of instruments, and correcting the instrument track amplitude spectrum according to the envelope features;

[0021] The continuously optimizing the vocal network, the accompaniment network and the musical instrument network according to the comparison results includes:

[0022] Calculate the Manhattan distances between the amplitude spectrum of the vocal track, the amplitude spectrum of the accompaniment track and the amplitude spectrum of the instrument track and the logarithmic Mel spectrum of the vocal, the logarithmic Mel spectrum of the accompaniment and the logarithmic Mel spectrum of the instrument respectively;

[0023] The Manhattan distance mean is used as the loss function of the vocal network, accompaniment network and instrument network, and the loss function is adjusted and optimized according to the Manhattan distance.

[0024] In one embodiment, converting the imported music into a music spectrum includes:

[0025] Performing STFT spectrum analysis on the imported music, and performing logarithmic Mel spectrum conversion to obtain the logarithmic Mel spectrum of the imported music;

[0026] The method of obtaining a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments respectively according to the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum comprises:

[0027] Input the imported music logarithmic Mel spectrum into the vocal network, the accompaniment network and the musical instrument network respectively to obtain the vocal spectrum, the accompaniment spectrum and the musical instrument spectrum;

[0028] Calculating respectively the first proportion and the second proportion of the vocal spectrum and the accompaniment spectrum in the overall music spectrum, and the third proportion of the instrument spectrum in the accompaniment spectrum; wherein the overall music spectrum is the frequency range of the vocal spectrum and the accompaniment spectrum;

[0029] The first ratio is multiplied by the logarithmic Mel spectrum of the imported music to obtain the logarithmic Mel spectrum of the vocals; the second ratio is multiplied by the logarithmic Mel spectrum of the imported music to obtain the logarithmic Mel spectrum of the accompaniment;

[0030] Multiplying the third ratio by the accompaniment logarithmic Mel spectrum to obtain the instrument logarithmic Mel spectrum;

[0031] The method of obtaining a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments respectively according to the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum comprises:

[0032] ISFTF analysis is performed on the vocal logarithmic Mel spectrum, the accompaniment logarithmic Mel spectrum and the instrument logarithmic Mel spectrum respectively to obtain a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments.

[0033] In one embodiment, the step of acquiring the instrumental music features of each instrument according to the instrumental music file, and reshaping the initial accompaniment file according to the instrumental music features to obtain a high-fidelity accompaniment file includes:

[0034] Extracting instrumental music features from the instrumental accompaniment files of each sounding instrument respectively; wherein the instrumental music features include the current note and its duration and intensity value;

[0035] A consistent target instrument is searched from the instrument timbre library, and the instrumental music features of the target instrument are used to reconstruct the initial accompaniment file to obtain a high-fidelity accompaniment file.

[0036] In one embodiment, searching for a consistent target instrument from the instrument timbre library and reconstructing the initial accompaniment file using the instrumental music features of the target instrument to obtain a high-fidelity accompaniment file includes:

[0037] Calculate the ADSR value of the note of the sounding instrument, and search the instrument closest to the ADSR value from the instrument timbre library as the target instrument;

[0038] Calculating the pitch ratio of the sounding instrument to the target instrument;

[0039] Calculating a dynamic gain value of a note of a sounding instrument according to the pitch ratio;

[0040] Acquire a corresponding wavetable value according to the dynamic gain value, and perform low-pass filtering on the wavetable value;

[0041] The accompaniment signal output by the low-pass filter is obtained, and the accompaniment signals corresponding to the various instruments are mixed for multiple instruments to obtain a high-fidelity accompaniment file.

[0042] In one embodiment, the step of acquiring the instrumental music features of each instrument according to the instrumental music file, and reshaping the initial accompaniment file according to the instrumental music features to obtain a high-fidelity accompaniment file includes:

[0043] Extracting instrumental music features from the instrumental accompaniment files of each sounding instrument respectively; wherein the instrumental music features include the current note and its duration and intensity value;

[0044] Segment the note segments of the instrument accompaniment file of the sounding instrument, search for the corresponding target instrument from the instrument timbre library, generate a frequency response curve and compare it with the note segments of the target instrument, and calculate the optimal EQ parameters;

[0045] EQ compensation is performed on each note of the initial accompaniment file according to the optimal EQ parameter to obtain a high-fidelity accompaniment file.

[0046] In one embodiment, the segmentation of the note segments of the instrument accompaniment file of the sound-producing instrument, searching for the corresponding target instrument from the instrument timbre library, generating a frequency response curve and comparing it with the note segments of the target instrument, and calculating the optimal EQ parameters include:

[0047] Divide single notes or multiple notes according to the note segment of each instrument;

[0048] Use STFT to calculate the frequency response curve of each note segment of the instrument accompaniment file of the sounding instrument;

[0049] Using a genetic algorithm to obtain optimal EQ parameters of the frequency response curve of the sound-producing instrument;

[0050] The step of performing EQ compensation on each note of the initial accompaniment file according to the optimal EQ parameter to obtain a high-fidelity accompaniment file comprises:

[0051] EQ compensation is performed one by one on each note segment of the initial accompaniment file according to each note segment of each instrument at the same time, so as to obtain a high-fidelity accompaniment file.

[0052] In one embodiment, the musical instrument timbre library includes multiple timbres; wherein each timbre is set with a different number of notes and each note is set with a corresponding ADSR value, low-pass filter frequency f and Q value, sampling rate and LFO low-frequency oscillation modulator.

[0053] A separation device for music accompaniment, comprising:

[0054] A spectrum conversion module, used for acquiring imported music and converting the imported music into a music spectrum;

[0055] A blind source separation module, used for inputting the music spectrum into the vocal network, the accompaniment network and the musical instrument network respectively, to obtain the vocal spectrum, the initial accompaniment spectrum and the musical instrument accompaniment spectrum corresponding to various musical instruments;

[0056] A file conversion module, used for respectively obtaining a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments according to the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum;

[0057] The accompaniment reconstruction module is used to obtain the instrumental music characteristics of each instrument according to the instrumental music file, and reshape the initial accompaniment file according to the instrumental music characteristics to obtain a high-fidelity accompaniment file.

[0058] A computer device comprising:

[0059] one or more processors;

[0060] Memory;

[0061] One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs are configured to: execute the above-mentioned method for separating the music accompaniment.

[0062] A computer-readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, wherein the at least one instruction, the at least one program, the code set or the instruction set is loaded by the processor and executes the above-mentioned method for separating the music accompaniment.

[0063] The above-mentioned music accompaniment separation method, device, computer equipment and computer-readable storage medium first convert the imported music into a music spectrum, and input the human voice network, accompaniment network and musical instrument network based on the blind source separation technology to obtain the corresponding musical instrument accompaniment spectrum, so as to obtain the human voice file, the initial accompaniment file and the musical instrument accompaniment files corresponding to various musical instruments; thereafter, the instrumental music characteristics of each musical instrument are obtained according to the musical instrument accompaniment file, and the initial accompaniment file is reshaped according to the musical instrument music characteristics to obtain a high-fidelity accompaniment file; this technical solution first performs model prediction according to the blind source separation method to realize preliminary accompaniment separation work, and then reshapes each instrument according to the music spectrum of each musical instrument predicted by the musical instrument network to obtain a high-fidelity accompaniment file, which effectively improves the quality of the separated accompaniment and can achieve highly fidelity separated music accompaniment for the imported music.

[0064] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0066] Figure 1 This is an example of a blind separation model training flow chart;

[0067] Figure 2 This is an example loss function optimization flowchart;

[0068] Figure 3 is a flowchart of a method for separating a musical accompaniment of an example;

[0069] Figure 4 is an example spectrum generation flow chart;

[0070] Figure 5is an example preliminary separation flow chart;

[0071] Figure 6 is a sample reconstructed accompaniment flow chart;

[0072] Figure 7 is a flow chart of an example EQ compensation process;

[0073] Figure 8 It is a schematic diagram of the process of restoring the original high-quality music;

[0074] Fig. 9 The figure is a schematic diagram of the structure of a separation device for a music accompaniment of an example. DETAILED DESCRIPTION

[0075] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0076] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, but does not exclude the presence or addition of one or more other features, integers, steps, operations.

[0077] The music accompaniment separation scheme of the present application can be applied to any terminal device, such as smart speakers, smart phones, tablets, personal computers, etc., and the terminal device can be connected to the musical instrument sound library through the network. The present application first constructs a blind separation model based on the blind source separation method, and then uses the blind separation model to instantly separate the human voice, accompaniment and its corresponding various musical instrument accompaniment files; therefore, the human voice separation technology of this embodiment is explained in combination with some embodiments below.

[0078] In one embodiment, the blind separation model training process can construct a blind separation model including a vocal network, an accompaniment network and a musical instrument network based on blind source separation technology, and then use sample music with accompaniment in a song library to input the vocal network, accompaniment network and musical instrument network, and use pure vocals, pure accompaniment and pure musical instrument timbres in the song library to compare the outputs of the vocal network, accompaniment network and musical instrument network respectively, and then optimize the vocal network, accompaniment network and musical instrument network according to the comparison results.

[0079] In one embodiment, reference Figure 1 , Figure 1This is an example of a blind separation model training flow chart. The technical solution mainly includes the following steps:

[0080] S101, constructs the vocal network, accompaniment network and instrument network based on blind source separation technology.

[0081] The existing song library can be used for model training. For example, the current song library stores 100,000 songs. The vocals and accompaniment in the song library and their corresponding instrument timbre libraries are used to construct the vocal network, accompaniment network and instrument network respectively (currently it can support the performance of 128 kinds of instrument sounds).

[0082] As described above, the present embodiment adopts the instrument timbre library of the song library, which is a musical instrument timbre library constructed with high-quality timbres, including 128 commonly used timbres (Flute TB, Orchestra, Guitar Harmonics, Distortion Guitar, Overdrive Guitar, Piano, Harpsichord, etc.), in addition, there are also piano, cello, guzheng, flute, guitar, organ, etc. with high sound quality recorded in professional recording studios.

[0083] The functions of the instrument library can include:

[0084] (1) Provide the timbres of various musical instruments for wavetable synthesis and synthetic instrument sound generators;

[0085] (2) For each timbre, it can be used to identify which type of instrument is present in the accompaniment, based on the timbre characteristics of its ADSR;

[0086] (3) It can be used for multiple instrument separation techniques. In a mixed accompaniment, the characteristics of each timbre can be used to separate the music of each instrument.

[0087] The instrument library has the following features:

[0088] Each timbre has a different number of notes. For example, a piano has 88 keys, or 88 notes. Each note has its own ADSR value, low-pass filter frequency f and Q value, sampling rate, LFO low-frequency oscillation modulator, etc., which are used to control the unique timbre of each note.

[0089] The parameters of the instrument library have the following properties:

[0090] (1) ADSR stands for the attack time ATTACK, decay time DECAY, sustain time SUSTAIN and release time RELEASE when the key is pressed. Not all instruments have these three parameters. For example, the piano sound only has the attack time, decay time and release time.

[0091] (2) Low-frequency oscillation modulator, controlled by the modulation frequency, creates a "shaking" motion feeling in the sound, simulating the vibrato effect during playing;

[0092] (3) In order to prevent the high-frequency noise generated by mixing multiple tones, an ultra-high frequency low-pass filter is used for intervention.

[0093] S102, performing STFT (Short-Time Fourier Transform) conversion on the sample music with accompaniment, pure vocals, pure accompaniment and pure instrument timbre in the song library to obtain corresponding sample music logarithmic Mel spectrum, vocal logarithmic Mel spectrum, accompaniment logarithmic Mel spectrum and instrument logarithmic Mel spectrum, and performing wavelet analysis on them respectively.

[0094] STFT analysis was performed on four types of materials: sample music with accompaniment, pure vocals, pure accompaniment, and pure instrumental timbre. Since the characteristics of human voice can better reflect the characteristics of human voice in the Mel frequency band, each type of material is transformed by a logarithmic Mel filter group to highlight the characteristics of human voice and reduce the loss of vocal separation.

[0095] Furthermore, wavelet analysis was performed on four types of materials, namely sample music, pure vocals, pure accompaniment, and pure instrumental timbre, to compensate for the defects of STFT in analyzing signal non-stationarity, filter out irrelevant noise parts, and enhance the sparsity of the fundamental frequency of each type, which is helpful to improve the feature extraction of vocals under the blind source separation algorithm and improve the restoration quality.

[0096] S103, analyzing the logarithmic Mel spectrum of the sample music through the vocal network, the accompaniment network and the instrument network to obtain corresponding amplitude spectrum of the vocal track, the amplitude spectrum of the accompaniment track and the amplitude spectrum of the instrument track.

[0097] S104, performing ADSR analysis on the pure instrument timbre to obtain envelope features corresponding to various types of instruments, and correcting the instrument track amplitude spectrum according to the envelope features.

[0098] Perform ADSR analysis on the instrument timbre library. Since each instrument in each instrument timbre library has a different sounding envelope, its corresponding timbre is also very different. It mainly exists in ADSR (attack, decay, sustain, release) and constitutes the main component of the timbre. This feature can also be used to analyze the instrument type in the accompaniment and further separate the instruments, so as to realize the function of users creating songs with personalized instrument background.

[0099] The envelope extraction formula is as follows:

[0100]

[0101] S105, respectively calculating the Manhattan distances between the amplitude spectrum of the vocal track, the amplitude spectrum of the accompaniment track and the amplitude spectrum of the instrument track and the logarithmic Mel spectrum of the vocal, the logarithmic Mel spectrum of the accompaniment and the logarithmic Mel spectrum of the instrument.

[0102] S106, taking the mean of the Manhattan distance as the loss function of the vocal network, the accompaniment network and the instrument network, and adjusting and optimizing the loss function according to the Manhattan distance to obtain a blind separation model.

[0103] Manhattan distance is used to calculate the similarity between the two, and the average is used as the loss function to continuously optimize and adjust the parameters of blind separation; for the loss function, the formula is as follows:

[0104] Distance=Σ|xi-yi|

[0105] mean=0.5*(∑(ai*Distancei)+∑aj*Distancej))

[0106] In the above formula, Distance is the Manhattan distance and mean is the loss function.

[0107] For the loss function optimization process, refer to Figure 2 As shown, Figure 2 This is an example of a loss function optimization flowchart. By continuously optimizing the loss function, accurate vocal networks, accompaniment networks, and instrument networks are obtained. After the blind separation model is constructed, the vocal accompaniment separation process can be performed based on the blind separation model.

[0108] refer to Figure 3 As shown, Figure 3 This is an example of a music accompaniment separation method flow chart, which mainly includes the initial separation stage and the accompaniment reconstruction stage. The specific steps are as follows:

[0109] Step S20: Obtain imported music, and convert the imported music into a music spectrum.

[0110] In this embodiment, in order to use the blind separation model for preliminary separation, the input music signal is first subjected to STFT spectrum analysis, and then a logarithmic Mel spectrum conversion is performed to obtain the logarithmic Mel spectrum of the imported music, thereby obtaining the same signal features as those during the blind separation model training.

[0111] Step S30: inputting the music spectrum into the vocal network, accompaniment network and instrument network respectively, to obtain the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum corresponding to various instruments.

[0112] In one embodiment, reference Figure 4 , Figure 4 is an example spectrum generation flow chart, and the spectrum generation process of step S30 may include the following:

[0113] S301, inputting the imported music logarithmic Mel-spectrogram spectra into a vocal network, an accompaniment network and a musical instrument network respectively to obtain a vocal spectrum, an accompaniment spectrum and a musical instrument spectrum.

[0114] S302, respectively calculating a first proportion and a second proportion of the vocal spectrum and the accompaniment spectrum in the overall music spectrum, and a third proportion of the instrument spectrum in the accompaniment spectrum; wherein the overall music spectrum is the frequency range of the vocal spectrum and the accompaniment spectrum.

[0115] S303, multiplying the first ratio by the logarithmic Mel spectrum of the imported music to obtain the logarithmic Mel spectrum of vocals; and multiplying the second ratio by the logarithmic Mel spectrum of the imported music to obtain the logarithmic Mel spectrum of accompaniment.

[0116] S304, multiplying the third ratio by the accompaniment logarithmic Mel spectrum to obtain the instrument logarithmic Mel spectrum;

[0117] Step S40: obtaining a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments respectively according to the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum.

[0118] In one embodiment, ISFTF analysis is performed on the vocal logarithmic Mel spectrum, the accompaniment logarithmic Mel spectrum and the instrument logarithmic Mel spectrum to obtain a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments.

[0119] Exemplary, reference Figure 5 , Figure 5 This is an example of a preliminary separation flow chart. The logarithmic Mel spectrum can be input into the vocal network, accompaniment network and instrument network respectively to obtain the corresponding spectrum information, and the spectrum information is squared; then the proportion of the vocal spectrum in the entire music spectrum and the accompaniment spectrum in the entire music spectrum are calculated based on the spectrum information, and the proportion of the accompaniment in the entire music spectrum is obtained. The vocal spectrum and the accompaniment spectrum are multiplied by the music spectrum according to the proportion to obtain the vocal spectrum and the accompaniment spectrum. Then, the vocal spectrum and the accompaniment spectrum are converted into vocal files and initial accompaniment files by ISFTF, and saved in corresponding wav and other formats to provide accompaniment materials and vocal materials for users to create 4; in addition, the same calculation method can be used to calculate the various instrument music signal spectra in the initial accompaniment file, and saved in corresponding WAV, midi and other formats to provide users with separate instrument accompaniment files for creating songs.

[0120] Step S50: Acquire the instrumental music features of each instrument according to the instrumental music features, and reshape the initial accompaniment file according to the instrumental music features to obtain a high-fidelity accompaniment file.

[0121] Exemplarily, this embodiment can reconstruct each instrument of the initial accompaniment file or perform automatic EQ adjustment on the initial accompaniment file to obtain a high-fidelity accompaniment file.

[0122] In one embodiment, the above-mentioned method of reconstructing the initial accompaniment file for each instrument to obtain a high-fidelity accompaniment file is as follows: Figure 6 As shown, Figure 6 Here is an example of a reconstructed accompaniment flow chart, which may include the following:

[0123] S511, extracting instrumental music features from the instrumental accompaniment files of each sounding instrument respectively; wherein the instrumental music features include the current note and its duration and intensity value.

[0124] Specifically, after separating the vocal accompaniment, the vocal file and the initial accompaniment file can be obtained, and the instrumental music characteristics of each sounding instrument can be obtained, such as Justin Bieber's <baby>, there are guitar and drums, STFT is used to calculate the current note, the duration of the current note is determined by duration, the note duration Y(w, t-jP) is the energy value of the fundamental frequency point w, which is used to determine the duration time of the current note, the formula is as follows:

[0125]

[0126] According to the 12 scales (C, C#, D, D#, E, F, F#, G, G#, A, A#, B), all the scales corresponding to the fundamental tones of the whole spectrum are placed in a b matrix (also called a chromaticity matrix). If the number of corresponding scales is the largest, and the number of fundamental tones after this scale is also relatively large, then this scale is considered to be the key signature of the song; according to the commonly used time signatures (4 / 4, 6 / 8, 3 / 8) and the calculated beat duration, the continuous beat time is converted into 1000 The duration value uses various continuous beat combinations (750+250, 500+250+250, 333+333+333, 333+666, 165+165+165+165+165+165 (eighth note), 165+165+333+333 (sixteenth note), 165+165+666). If the calculated duration value is not in this value range, it is mapped into this range.

[0127] The intensity is determined by a smoothed effective level value (RMS), which is used to represent the intensity parameter of the note. The effective level value is calculated as follows:

[0128] RMS=20*log10(xi2*β+(1-β)*RMSold)

[0129] Through the duration of the current note and the note's intensity parameters, find out the note position and its start and end positions, and mark its intensity.

[0130] S512, searching for a consistent target instrument from the instrument timbre library, and reconstructing the initial accompaniment file using the instrumental music features of the target instrument to obtain a high-fidelity accompaniment file. This mainly includes the following steps:

[0131] (a) calculating the ADSR value of the note of the sounding instrument, and searching the instrument closest to the ADSR value from the instrument timbre library as the target instrument;

[0132] Search the instrument timbre library according to the instrument type, and capture different timbres of the same note (single tone) for similarity calculation, mainly through the ADSR value of the note. The similarity calculation is determined by the threshold of the trend of each segment (attack phase, decay phase, stable phase and release phase) in the energy envelope. The ADSR value of the timbre in the closest instrument timbre library is used to determine the target instrument for accompaniment reconstruction; such as guitar and drum set; each note in the instrumental song and its loudness, duration and ADSR (attack start time, decay time, sustain time, release time) in the instrument library simulate the process of the piano being pressed and released.

[0133] (b) Calculating the pitch ratio of the sounding instrument to the target instrument.

[0134] Specifically, the pitch ratio is calculated by using the corresponding notes and their duration, force parameters, etc. of the known instrument timbre library:

[0135]

[0136] Among them, pitchcenter is the standard center pitch carried by each note in each timbre library. The deviation of each standard center pitch will produce different frequencies. Note represents the position of the note. For example, the notes on the piano are 0-88, and the minimum setting of the instrument timbre library is 27, that is, the total range is 27 to 116. Pitchtrack represents the tracking value of the note range. There will be a little deviation according to the note position, which is used to correct the frequency ratio. Wavetablesamplerate represents the sampling rate of the instrument timbre library when it is established, and outputsamplerate represents the sampling rate of the accompaniment output.

[0137] (c) Calculating a dynamic gain value of a note of a sounding instrument according to the pitch ratio.

[0138] Specifically, the note gain value of the sounding instrument at this time is calculated to control the sound volume in the current state, produce a sound envelope similar to the sound envelope of the real instrument key, and simulate the envelope of the ADSR. The gain calculation formula is as follows:

[0139]

[0140] Among them, wavetableattenuation represents the fixed attenuation, that is, the fixed attenuation unique to the note of the current timbre, velocity represents the pressing intensity (also called pressing speed), and amplifier represents the gain level of the four time periods of the ADSR value.

[0141] (d) Obtaining a corresponding wavetable value according to the dynamic gain value, and performing a low-pass filter on the wavetable value.

[0142] According to the calculated gain parameter, the corresponding wave table value is obtained, and the high-frequency noise of the value is filtered using a low-pass filter, such as a first-order Butterworth low-pass filter:

[0143] y=b1×x+b2×x1-a1×y1

[0144] Where a1, b1, and b2 are first-order Butterworth filter coefficients, x is the current input value, x1 is the previous value of x, and y1 is the previous value of y.

[0145] (e) obtaining the accompaniment signal output by the low-pass filter, and performing multi-instrument mixing on the accompaniment signals corresponding to the various instruments to obtain a high-fidelity accompaniment file; specifically, when the accompaniment is composed of multiple instruments, the accompaniment signals of the corresponding instruments are output respectively, and then the multi-instrument mixing is performed.

[0146] In another embodiment, the above-mentioned automatic EQ adjustment method is used to adjust the initial accompaniment file to obtain a high-fidelity accompaniment file, which may include the following:

[0147] S521, extracting instrumental music features from the instrumental accompaniment files of each sounding instrument respectively; wherein the instrumental music features include the current note and its duration and intensity value.

[0148] S522, segment the note segments of the instrument accompaniment file of the sounding instrument, search for the corresponding target instrument from the instrument timbre library, generate a frequency response curve and compare it with the note segments of the target instrument, and calculate the optimal EQ parameters.

[0149] (a) Divide into single notes or multiple notes according to the note segment of each instrument.

[0150] Separate the initial accompaniment file and the instrumental accompaniment file according to the vocal accompaniment; from this, we can know the various types of instruments contained in the accompaniment, such as Justin Bieber's <baby>, there are guitars and drums, etc.; single notes and multiple notes are divided according to the note segments of each instrument (such as both guitar and drums play the note C).

[0151] (b) Use STFT to calculate the frequency response curve of each note segment of the instrumental accompaniment file of the sounding instrument.

[0152] The frequency response curve of each note segment of the initial accompaniment file is calculated using STFT, and compared with the frequency response curve of the combined notes or single notes of the same target instrument in the instrument timbre library to determine the missing timbre in the instrument accompaniment file of the sounding instrument.

[0153] (c) Using a genetic algorithm to obtain the optimal EQ parameters of the frequency response curve of the sound-producing instrument.

[0154] Specifically, a genetic algorithm is used, and the frequency points are set to 13, and each EQ has a Q value, that is, 13-band EQ, and its objective function is:

[0155]

[0156] The genetic algorithm uses arithmetic crossover operators and two-point crossover operators. The arithmetic crossover operator generates new individuals by exchanging information with better individuals in other populations, thus enriching the diversity. The two-point crossover operator accelerates the convergence of the algorithm. X = (fs, Q) value, and each X represents an EQ filter:

[0157] X′ i = r·X i +(1-r)·X j ,

[0158] Xi″=(1-r)·X i +r·Xj.

[0159]

[0160]

[0161] S523, performing EQ compensation on each note of the initial accompaniment file according to the optimal EQ parameter to obtain a high-fidelity accompaniment file.

[0162] Specifically, after the optimal EQ parameters are obtained by the genetic algorithm, EQ compensation is performed one by one on each note segment of the initial accompaniment file according to each note segment of each instrument at the same time to obtain a high-fidelity accompaniment file.

[0163] refer to Figure 7 As shown, Figure 7 This is a flowchart of an example EQ compensation process. By adopting dynamic EQ compensation technology, corresponding EQ compensation is performed on each note segment. The 13-band EQ controls the missing or excessive gain of each note segment.

[0164] The above embodiment illustrates the separation scheme of the music accompaniment provided by the present application. Based on the separation method of the music accompaniment provided by the present application, it can be used to reconstruct the music in the song library and restore the original high-quality music, thereby greatly saving the cost of re-playing; Figure 8 As shown, Figure 8 This is a schematic diagram of the process of restoring original high-quality music, which may include the following:

[0165] (1) Import songs, such as JustinBieber's <baby>The song is played with guitar and drums. According to the vocal separation method provided in this application, after the pure vocals, pure accompaniment music, and pure instrumental music (guitar and drum music) are extracted, the instrumental music feature analysis (notes, note duration, note intensity, rhythm, etc.) is performed on each instrument.

[0166] (2) Generate corresponding MIDI files based on the pitch, tempo, note, duration and other characteristics of the entire spectrum of the instrumental music, search for the most similar instrument through the instrument timbre library, and regenerate high-definition music accompaniment files. For example, if the instrument of the song is a bass, simulate the song playing process by combining the rhythm, notes and pitch information of the song, automatically generate the corresponding accompaniment file, and then combine with the human voice to restore the original song, and generate 24-bit, 96K or 192K sampling rate wav, flac, ape, wave, aiff and other formats.

[0167] In addition, according to the instrument information in the song, automatic equalization technology can be used to compensate the song audio bands and generate high-definition accompaniment files. For example, each music accompaniment is composed of one or more instruments. The high-quality instrument sound library of the song library is used to form a corresponding frequency response curve through one or more series combinations. The corresponding missing timbre can be known through the comparison of the frequency response curves, and EQ compensation is performed according to the corresponding frequency. The genetic algorithm is used to calculate the optimal Q value and frequency value f, as well as the number of EQ combinations, for subsequent use, thereby achieving the purpose of reshaping the song accompaniment.

[0168] To sum up, through the accompaniment reshaping technology, the accompaniment of the music is restored using the instrument timbre library, which can simulate the performance scene and effectively achieve high-quality song accompaniment synthesis; compared with the common technology that relies on numerous song libraries for model training to obtain the best separation model, which often requires a large number of songs as training sets, the technical solution of the present application can still restore and compensate the song accompaniment when the song library is insufficient, so as to achieve the purpose of high fidelity.

[0169] An embodiment of a separation device for musical accompaniment is described below.

[0170] refer to Figure 8 As shown, Figure 8 The structure diagram of a separation device of a music accompaniment is an example, comprising:

[0171] The spectrum conversion module 20 is used to obtain imported music and convert the imported music into a music spectrum;

[0172] A blind source separation module 30 is used to input the music spectrum into the vocal network, the accompaniment network and the instrument network respectively to obtain the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum corresponding to various instruments;

[0173] A file conversion module 40 is used to obtain a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments according to the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum;

[0174] The accompaniment reconstruction module 50 is used to obtain the instrumental music characteristics of each instrument according to the instrumental music characteristics, and reshape the initial accompaniment file according to the instrumental music characteristics to obtain a high-fidelity accompaniment file.

[0175] The music accompaniment separation device of this embodiment can execute a music accompaniment separation method provided by the embodiment of the present disclosure, and its implementation principle is similar. The actions performed by each module in the music accompaniment separation device in each embodiment of the present disclosure correspond to the steps in the music accompaniment separation method in each embodiment of the present disclosure. For the detailed functional description of each module of the music accompaniment separation device, please refer to the description of the corresponding music accompaniment separation method shown in the previous text, which will not be repeated here.

[0176] An embodiment of a computer device of the present application is described below. The computer device comprises:

[0177] one or more processors;

[0178] Memory;

[0179] One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs are configured to: execute the method for separating the music accompaniment according to any of the above embodiments.

[0180] An embodiment of a computer-readable storage medium of the present application is described below, wherein the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded by the processor and execute the method for separating the music accompaniment of any of the above embodiments.

[0181] In the technical solutions of the above-mentioned music accompaniment separation device, computer equipment and computer-readable storage medium, model prediction is first performed according to the blind source separation method to achieve preliminary accompaniment separation work, and then each instrument is reshaped according to the music spectrum of each instrument predicted by the instrument network to obtain a high-fidelity accompaniment file, which effectively improves the quality of the separated accompaniment and can achieve highly fidelity separated music accompaniment for the imported music.

[0182] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.< / baby> < / baby> < / baby>

Claims

1. A method for separating a musical accompaniment, characterized in that: include: Obtaining imported music, and converting the imported music into a music spectrum; Input the music spectrum into the vocal network, the accompaniment network and the musical instrument network respectively to obtain the vocal spectrum, the initial accompaniment spectrum and the musical instrument accompaniment spectrum corresponding to various musical instruments; According to the human voice spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum, respectively obtain a human voice file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments; The invention relates to a method for obtaining the musical instrument characteristics of each musical instrument according to the musical instrument accompaniment file, and reshaping the initial accompaniment file according to the musical instrument characteristics to obtain a high-fidelity accompaniment file, including: extracting the musical instrument characteristics from the musical instrument accompaniment files of each sounding musical instrument respectively; wherein the musical instrument characteristics include the current note and its duration and intensity value; calculating the ADSR value of the musical note of the sounding musical instrument, and searching the musical instrument closest to the ADSR value from the musical instrument timbre library as the target instrument; calculating the pitch ratio between the sounding musical instrument and the target instrument; calculating the dynamic gain value of the musical note of the sounding musical instrument according to the pitch ratio; obtaining the corresponding wavetable value according to the dynamic gain value, and performing low-pass filtering on the wavetable value; obtaining the accompaniment signal output by the low-pass filtering, and performing multi-instrument mixing on the accompaniment signals corresponding to each musical instrument respectively to obtain a high-fidelity accompaniment file.

2. The method for separating music accompaniment according to claim 1, characterized in that: Also includes: Construct the vocal network, accompaniment network and instrument network based on blind source separation technology; Use sample music with accompaniment in the song library to input the vocal network, accompaniment network and instrument network, and use the pure vocals, pure accompaniment and pure instrument timbres in the song library to compare the outputs of the vocal network, accompaniment network and instrument network respectively; The vocal network, accompaniment network and instrument network are optimized according to the comparison results.

3. The method for separating music accompaniment according to claim 2, characterized in that: The method uses sample music with accompaniment in the song library to input the vocal network, the accompaniment network and the instrument network, and uses the pure vocals, pure accompaniment and pure instrument timbres in the song library to compare the outputs of the vocal network, the accompaniment network and the instrument network respectively, including: The sample music with accompaniment, pure human voice, pure accompaniment and pure instrument timbre in the song library are respectively subjected to STFT conversion to obtain the corresponding sample music logarithmic Mel spectrum, human voice logarithmic Mel spectrum, accompaniment logarithmic Mel spectrum and instrument logarithmic Mel spectrum, and wavelet analysis is performed on them respectively; Analyze the sample music logarithmic Mel spectrum through the vocal network, accompaniment network and instrument network to obtain the corresponding vocal track amplitude spectrum, accompaniment track amplitude spectrum and instrument track amplitude spectrum; Performing ADSR analysis on the pure instrument timbre to obtain envelope characteristics corresponding to various types of instruments, and correcting the instrument track amplitude spectrum according to the envelope characteristics; The continuously optimizing the vocal network, the accompaniment network and the musical instrument network according to the comparison results includes: Calculate the Manhattan distances between the amplitude spectrum of the vocal track, the amplitude spectrum of the accompaniment track and the amplitude spectrum of the instrument track and the logarithmic Mel spectrum of the vocal, the logarithmic Mel spectrum of the accompaniment and the logarithmic Mel spectrum of the instrument respectively; The Manhattan distance mean is used as the loss function of the vocal network, accompaniment network and instrument network, and the loss function is adjusted and optimized according to the Manhattan distance.

4. The method for separating music accompaniment according to claim 3, characterized in that: The converting the imported music into a music spectrum comprises: Performing STFT spectrum analysis on the imported music, and performing logarithmic Mel spectrum conversion to obtain the logarithmic Mel spectrum of the imported music; The step of inputting the music spectrum into the vocal network, the accompaniment network and the musical instrument network respectively to obtain the vocal spectrum, the initial accompaniment spectrum and the musical instrument accompaniment spectrum corresponding to various musical instruments comprises: Input the imported music logarithmic Mel spectrum into the vocal network, the accompaniment network and the musical instrument network respectively to obtain the vocal spectrum, the accompaniment spectrum and the musical instrument spectrum; Calculate respectively the first proportion and the second proportion of the vocal spectrum and the accompaniment spectrum in the overall music spectrum, and the third proportion of the instrument spectrum in the accompaniment spectrum; wherein the overall music spectrum is the frequency range of the vocal spectrum and the accompaniment spectrum; The first ratio is multiplied by the logarithmic Mel spectrum of the imported music to obtain the logarithmic Mel spectrum of the vocals; the second ratio is multiplied by the logarithmic Mel spectrum of the imported music to obtain the logarithmic Mel spectrum of the accompaniment; Multiplying the third ratio by the accompaniment logarithmic Mel spectrum to obtain the instrument logarithmic Mel spectrum; The method of obtaining a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments respectively according to the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum comprises: ISFTF analysis is performed on the vocal logarithmic Mel spectrum, the accompaniment logarithmic Mel spectrum and the instrument logarithmic Mel spectrum respectively to obtain a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments.

5. The method for separating the music accompaniment according to any one of claims 1 to 4, characterized in that: The step of obtaining the musical instrument characteristics of each musical instrument according to the musical instrument accompaniment file, and reshaping the initial accompaniment file according to the musical instrument characteristics to obtain a high-fidelity accompaniment file includes: Extracting instrumental music features from the instrumental accompaniment files of each sounding instrument respectively; wherein the instrumental music features include the current note and its duration and intensity value; Segment the note segments of the instrument accompaniment file of the sounding instrument, search for the corresponding target instrument from the instrument timbre library, generate a frequency response curve and compare it with the note segments of the target instrument, and calculate the optimal EQ parameters; EQ compensation is performed on each note of the initial accompaniment file according to the optimal EQ parameters to obtain a high-fidelity accompaniment file.

6. The method for separating music accompaniment according to claim 5, characterized in that: The method of segmenting the note segments of the instrument accompaniment file of the sound-producing instrument, searching for the corresponding target instrument from the instrument timbre library, generating a frequency response curve and comparing it with the note segments of the target instrument, and calculating the optimal EQ parameters includes: Divide single notes or multiple notes according to the note segment of each instrument; Use STFT to calculate the frequency response curve of each note segment of the instrument accompaniment file of the sounding instrument; Using a genetic algorithm to obtain optimal EQ parameters of the frequency response curve of the sound-producing instrument; The step of performing EQ compensation on each note of the initial accompaniment file according to the optimal EQ parameter to obtain a high-fidelity accompaniment file comprises: EQ compensation is performed one by one on each note segment of the initial accompaniment file according to each note segment of each instrument at the same time, so as to obtain a high-fidelity accompaniment file.

7. The method for separating music accompaniment according to claim 1, characterized in that: The musical instrument timbre library includes a variety of timbres; wherein each timbre is set with a different number of notes and each note is set with a corresponding ADSR value, low-pass filter frequency f and Q value, sampling rate and LFO low-frequency oscillation modulator.

8. A separation device for music accompaniment, characterized in that: include: A spectrum conversion module, used for acquiring imported music and converting the imported music into a music spectrum; A blind source separation module is used to input the music spectrum into a vocal network, an accompaniment network and a musical instrument network respectively to obtain a vocal spectrum, an initial accompaniment spectrum and musical instrument accompaniment spectrum corresponding to various musical instruments; A file conversion module, used for respectively obtaining a vocal file, an initial accompaniment file and instrument accompaniment files corresponding to various instruments according to the vocal spectrum, the initial accompaniment spectrum and the instrument accompaniment spectrum; An accompaniment reconstruction module is used to obtain the instrument music features of each instrument according to the instrument accompaniment file, and reshape the initial accompaniment file according to the instrument music features to obtain a high-fidelity accompaniment file, including: extracting the instrument music features from the instrument accompaniment files of each sounding instrument respectively; wherein the instrument music features include the current note and its duration and intensity value; calculating the ADSR value of the note of the sounding instrument, searching the instrument closest to the ADSR value from the instrument timbre library as the target instrument; calculating the pitch ratio of the sounding instrument and the target instrument; calculating the dynamic gain value of the note of the sounding instrument according to the pitch ratio; obtaining the corresponding wavetable value according to the dynamic gain value, and low-pass filtering the wavetable value; obtaining the accompaniment signal output by the low-pass filter, and performing multi-instrument mixing on the accompaniment signals corresponding to each instrument to obtain a high-fidelity accompaniment file.