Music generation method, computer equipment, storage medium and computer program product

CN118629375APending Publication Date: 2024-09-10TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410876307.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-10

Smart Images

  • Figure CN118629375A
    Figure CN118629375A
Patent Text Reader

Abstract

The invention relates to a music generation method, computer equipment, a storage medium and a computer program product. The method comprises the following steps: in response to a music generation request, obtaining a music structure matched with the music generation request; the music structure comprises a plurality of music composition units which are arranged in sequence, each music composition unit corresponds to music description data, and each music composition unit comprises a plurality of audio frame units which are arranged in sequence; according to the arrangement sequence of the plurality of music composition units in the music structure, sequentially based on the music description data of the at least one music composition unit, generating a music signal of each audio frame unit contained in the at least one music composition unit; and outputting music signals corresponding to the audio frame units according to the arrangement sequence of the audio frame units in the music structure. By adopting the method, the real-time performance of music generation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of audio processing, and in particular to a music generation method, a computer device, a storage medium and a computer program product. Background Art

[0002] With the development of audio processing technology, a technical solution for generating unique personalized music has emerged. This technology allows users to input attribute parameters for generating music on a display interface, such as the duration of the generated music, the density parameters of the music, and the reverberation degree parameters, etc., and then generate music that matches the above attribute parameters.

[0003] In traditional technology, the generation of personalized music for users is usually achieved by large models or machine learning networks. However, music has an extremely complex structure. The connections between tracks and the context in the time domain are difficult to generate a perfect structure through neural networks, and the model requires computing power support. Currently, the methods of generating music through large models or machine learning networks are all offline. In the case of limited computing power, only the generation of fragments of music in advance is supported when landing on the front end. Therefore, in the existing music generation methods, the real-time performance of music generation is low. Summary of the invention

[0004] Based on this, it is necessary to provide a music generation method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the real-time performance of music generation in response to the above-mentioned technical problems.

[0005] In a first aspect, the present application provides a music generation method, comprising:

[0006] In response to a music generation request, a music structure matching the music generation request is obtained; the music structure comprises a plurality of music composition units arranged in sequence, each of the music composition units corresponds to music description data, and each of the music composition units comprises a plurality of audio frame units arranged in sequence;

[0007] Generate a music signal of each audio frame unit included in the at least one music composition unit based on the music description data of the at least one music composition unit in accordance with the arrangement order of the multiple music composition units in the music structure;

[0008] According to the arrangement order of the audio frame units in the music structure, the music signals respectively corresponding to the audio frame units are output.

[0009] In one of the embodiments, the music signal of each audio frame unit included in the at least one music composition unit is generated based on the music description data of at least one music composition unit in turn according to the arrangement order of the multiple music composition units in the music structure, including: obtaining the current music composition unit and the next music composition unit sequentially located after the current music composition unit according to the arrangement order of the multiple music composition units in the music structure; when the music description data of the current music composition unit is consistent with the music description data corresponding to the next music composition unit, generating the music signal of each audio frame unit included in the current music composition unit and the music signal of the audio frame unit included in the next music composition unit based on the consistent music description data; when the music description data of the current music composition unit is inconsistent with the music description data corresponding to the next music composition unit, generating the music signal of each audio frame unit included in the current music composition unit based on the music description data of the current music composition unit.

[0010] In one of the embodiments, the music description data corresponding to each of the music composition units includes event description information of at least one audio event, and the event description information includes an audio event note and the duration of the audio event note; the music signal of each audio frame unit contained in the at least one music composition unit is generated based on the music description data of at least one music composition unit, including: for any of the music composition units, determining whether each of the audio frame units contained in the music composition unit corresponds to the audio event according to the duration of the audio event note corresponding to the music composition unit and the arrangement order of the multiple audio frame units contained in the music composition unit; when the audio frame unit corresponds to the audio event, generating the music signal corresponding to the audio frame unit according to the event description information of the audio event corresponding to the audio frame unit.

[0011] In one of the embodiments, the event description information is stored in a stack; after generating a music signal corresponding to the audio frame unit according to the event description information of the audio event corresponding to the audio frame unit, it also includes: when the event description information of the audio event corresponding to the audio frame unit represents that the audio frame unit is an event end frame of the audio event corresponding to the audio frame unit, the event description information corresponding to the audio frame unit is deleted from the stack.

[0012] In one of the embodiments, obtaining the music structure that matches the music generation request includes: obtaining the music generation mode parameters indicated by the music generation request; sending the music generation mode parameters to a background server, and receiving music level information returned by the background server according to the music generation mode parameters; wherein the music level information includes the music stages included in the music to be generated and the music composition units included in the music stages; and determining the music stages included in the music to be generated and the music composition units included in the music stages as the music structure of the music to be generated.

[0013] In one of the embodiments, after sending the music generation mode parameters to the background server, it also includes: receiving music attribute information of the music to be generated returned by the background server according to the music generation mode parameters, the music attribute information including public attribute information, attribute information of the music stage and attribute information of the music composition units contained in the music stage; for any of the music composition units, the public attribute information, the attribute information of the music stage to which the music composition unit belongs and the attribute information of the music composition unit are combined to obtain the music description data corresponding to the music composition unit.

[0014] In one of the embodiments, the method further includes: in response to a music attribute update request, obtaining updated music attribute information and a triggering audio frame unit corresponding to when the music attribute update request is triggered; and updating the music description data corresponding to the audio frame unit that is sequentially located after the triggering audio frame unit according to the updated music attribute information.

[0015] In a second aspect, the present application also provides a music generating device, comprising:

[0016] A music structure acquisition module, for obtaining a music structure matching the music generation request in response to the music generation request; the music structure comprises a plurality of music composition units arranged in sequence, each of the music composition units corresponds to music description data, and each of the music composition units comprises a plurality of audio frame units arranged in sequence;

[0017] A music signal generating module, configured to generate a music signal of each audio frame unit included in the at least one music component unit based on the music description data of the at least one music component unit in accordance with the arrangement order of the plurality of music component units in the music structure;

[0018] The music signal output module is used to output the music signals corresponding to each of the audio frame units according to the arrangement order of each of the audio frame units in the music structure.

[0019] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method as described in any one of the embodiments of the first aspect are implemented.

[0020] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method as described in any one of the embodiments of the first aspect.

[0021] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method as described in any one of the embodiments of the first aspect.

[0022] The above-mentioned music generation method, apparatus, computer equipment, storage medium and computer program product can generate a music structure including multiple music composition units when responding to a music generation request, and each music composition unit can be composed of multiple audio frame units. Thereafter, the music signal of each audio frame unit contained in at least one music composition unit can be generated in sequence based on the music description data of at least one music composition unit according to the order of the music composition units in the music structure, thereby outputting the music signal in the order of the audio frame units. In this way, the framing of the music structure is realized, thereby generating the corresponding music signal output in the order of the audio frame units. Compared with the prior art that realizes music signal output through a large model or a neural network, the music signal output provided by the present application can support real-time generation of music because it can be output in the order of audio frame units, thereby improving the real-time performance of music generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] FIG1 is a schematic diagram of a flow chart of a music generation method in one embodiment;

[0025] FIG2 is a schematic diagram of a process for generating a music signal corresponding to each audio frame unit in one embodiment;

[0026] FIG3 is a schematic diagram of a flow chart of generating a music signal corresponding to each audio frame unit in another embodiment;

[0027] FIG4 is a schematic diagram of a process for obtaining a music structure of generated music in one embodiment;

[0028] FIG5 is a schematic diagram of a process for obtaining music description data in one embodiment;

[0029] FIG6 is a schematic diagram of information content of public attribute information in one embodiment;

[0030] FIG7 is a schematic diagram of information content of attribute information of a music stage in one embodiment;

[0031] FIG8 is a schematic diagram showing the information content of the attribute information of a music composition unit in one embodiment;

[0032] FIG9 is a schematic diagram of content of updateable music attributes in one embodiment;

[0033] FIG10 is a schematic diagram of a deployment mechanism of a real-time interactive streaming music generation framework in one embodiment;

[0034] FIG11 is a schematic diagram of music structure division in one embodiment;

[0035] FIG12 is a schematic diagram of a section structure in one embodiment;

[0036] FIG13 is a schematic diagram showing the relationship between audio events and audio frames in one embodiment;

[0037] FIG14 is a block diagram of a music generating device according to an embodiment;

[0038] FIG. 15 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0040] In one embodiment, as shown in FIG1 , a music generation method is provided. This embodiment is illustrated by applying the method to a terminal. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0041] Step S101, in response to a music generation request, obtain a music structure that matches the music generation request; the music structure includes a plurality of music composition units arranged in sequence, each music composition unit corresponds to music description data, and each music composition unit includes a plurality of audio frame units arranged in sequence.

[0042] Among them, the music generation request refers to a request triggered by a user for generating and outputting a music signal, and the music structure is the structure of the music signal that constitutes the music to be generated. The music structure can be divided into multiple music composition units, and the division of the music structure can be divided into multiple dimensions, for example, it can be divided according to the time dimension, that is, the music structure is divided into multiple music composition units according to different times, or it can be divided according to the instrument dimension, that is, the music structure is divided into multiple music composition units according to the different instrument channels used, or the music structure can be divided according to the time dimension and the instrument dimension at the same time, that is, the music structure is first divided according to the time dimension, and then the division result is further divided according to different instrument channels to obtain multiple music composition units, and each music composition unit can be composed of multiple audio frame units. Since the division of the music composition units is divided according to multiple dimensions, the audio frame unit also has multiple dimensions, such as the time dimension and the instrument dimension, etc. When editing and modifying the audio frame unit, the above dimensions can also be modified and edited separately.

[0043] In this embodiment, when the terminal receives a music generation request initiated by the user, it can respond to the request and determine the music that needs to be generated corresponding to the music generation request, that is, the music structure of the music to be generated. The music structure can include multiple music composition units, and each music composition unit can be composed of multiple audio frame units.

[0044] Step S102, generating music signals of the audio frame units included in at least one music component unit based on the music description data of at least one music component unit in accordance with the arrangement order of the multiple music component units in the music structure.

[0045] The music description data is data used to describe the music composition unit, for example, it may include the bpm speed of the target music unit, whether a track of the music composition unit is turned on, the timbre of the track, the audio density, the chords used and other descriptive information, while the music signal is the music signal corresponding to each audio frame unit in each music composition unit.

[0046] In this embodiment, the music composition units can be processed in sequence. The terminal can obtain the single or multiple music composition units that need to be processed in sequence according to the order of the music composition units in the music structure, and use the music description data of the single or multiple music composition units that need to be processed to generate music signals corresponding to each audio frame unit contained in the music composition unit.

[0047] Step S103: outputting the music signals corresponding to the audio frame units according to the arrangement order of the audio frame units in the music structure.

[0048] After obtaining the music signal of the audio frame unit, the music signal corresponding to each audio frame unit can be outputted respectively according to the arrangement order of each audio frame unit in the music structure, so as to realize the sequential generation and output of the music signal corresponding to each audio frame unit, and then complete the music signal output of the currently processed music component unit. Then, the process can return to step S102 to obtain the next processed music component unit according to the arrangement order of the music component units, so as to complete the music signal output of each music component unit.

[0049] In the above-mentioned music generation method, by responding to a music generation request, a music structure including multiple music composition units can be generated, and each music composition unit can be composed of multiple audio frame units. Then, according to the order of the music composition units in the music structure, the music signals of the audio frame units contained in at least one music composition unit can be generated based on the music description data of at least one music composition unit in sequence, so that the music signal is output in the order of the audio frame units. In this way, the framing of the music structure is realized, so that the corresponding music signal output is generated in the order of the audio frame units. Compared with the prior art that realizes music signal output through a large model or a neural network, the music signal output provided by the present application can support real-time generation of music because it can be output in the order of audio frame units, thereby improving the real-time performance of music generation.

[0050] In one embodiment, as shown in FIG. 2 , step S102 may further include:

[0051] Step S201, according to the arrangement order of multiple music composition units in the music structure, obtain the current music composition unit and the next music composition unit that is sequentially located after the current music composition unit.

[0052] The current music component unit refers to the music component unit with the first order among the unprocessed music component units. Since the processing order of the music component units matches the arrangement order of the music component units in the music structure, the current music component unit can be the music component unit with the first order in the music structure and the unprocessed music component unit, and the next music component unit is the next music component unit with the arrangement order after the current music component unit. For example, if the music component units include music component unit 0, music component unit 1, music component unit 2, music component unit 3 and music component unit 4, if music component units 0 and 1 have been processed, then music component unit 2 can be used as the current music component unit, and music component unit 3 can be used as the next music component unit.

[0053] Step S202, when the music description data of the current music composition unit is consistent with the music description data corresponding to the next music composition unit, the music signals of the audio frame units contained in the current music composition unit and the music signals of the audio frame units contained in the next music composition unit are generated based on the consistent music description data.

[0054] After the terminal determines the current music component unit and the next music component unit, it can determine whether the music description data corresponding to the current music component unit is consistent with the music description data corresponding to the next music component unit. If so, the consistent music description data can be used to generate the music signal of the audio frame unit contained in the current music component unit and the next music component unit. For example, if the music description data of music component unit 2 and music component unit 3 are consistent, in this case, the terminal can use the above-mentioned consistent music description data to generate the music signal of each audio frame unit contained in music component unit 2 and music component unit 3, thereby realizing the continuous generation of music signals of adjacent music component units.

[0055] Step S203, when the music description data of the current music component unit is inconsistent with the music description data corresponding to the next music component unit, generate the music signal of each audio frame unit included in the current music component unit based on the music description data of the current music component unit.

[0056] If the music description data corresponding to the current music component unit is inconsistent with the music description data corresponding to the next music component unit, the terminal will not continuously generate the music signals of the current music component unit and the next music component unit, but will process the next music component unit after the current music component unit is parsed to generate the music signal of the next music component unit, that is, the music signal of each audio frame unit contained in the current music component unit is generated only based on the music description data of the current music component unit. After the music signal generation and output corresponding to each audio frame unit contained in the current music component unit are completed, the next music component unit is used as the new current music component unit to generate the music signal.

[0057] In this embodiment, if the music description data corresponding to the current music component unit is consistent with the music description data corresponding to the next music component unit, the continuous generation of the music signal can be achieved, and the continuity of the music signal generation can be improved in this way. If they are inconsistent, the terminal only generates the music signal of the current music component unit, and the accuracy of the music signal generation can be guaranteed in this way.

[0058] In one embodiment, the music description data corresponding to each of the music composition units includes event description information of at least one audio event, and the event description information includes an audio event note and a duration of the audio event note; as shown in FIG3 , step S102 may further include:

[0059] Step S301, for any music component unit, determine whether each audio frame unit included in the music component unit corresponds to an audio event according to the duration of the audio event note corresponding to the music component unit and the arrangement order of multiple audio frame units included in the music component unit.

[0060] In this embodiment, the music signal is generated based on the audio event as the object, and the music composition unit may include multiple audio events. Therefore, the music description data corresponding to each music composition unit may include event description information of at least one audio event. The event description information can be used to describe the notes of the audio event, that is, the audio event notes, and the duration of the audio event notes. For example, the duration of the audio event notes can be characterized by recording the starting frame number and the continuous frame number of the audio event.

[0061] Specifically, the music description data corresponding to each music component unit may include event description information of all audio events in the music component unit, and then it can be determined whether each audio frame unit corresponds to an audio event according to the arrangement order of multiple audio frame units included in the music component unit. For example, if the starting frame of an audio event is 20 frames and lasts for 10 frames, then the audio frame units from 20 to 29 frames correspond to an audio event.

[0062] Step S302: When the audio frame unit corresponds to an audio event, a music signal corresponding to the audio frame unit is generated according to event description information of the audio event corresponding to the audio frame unit.

[0063] If the current audio frame unit corresponds to audio event description information, the music signal corresponding to the current audio frame unit can be generated according to the audio event description information.

[0064] In this embodiment, in order to realize the generation and playback of streaming music, the generation of music signals can be realized by taking audio events as the objects, and the audio event description information of each audio event contained in the music composition unit is recorded in the music description data, so that the audio event description information can be used to realize the generation of music signals corresponding to each audio frame unit. Since the audio event description information can record the starting frame number of the audio event and the current frame, it can be ensured that the music generation is performed according to the frames. Then, when the user modifies the generation parameters, the music can be generated according to the new parameters in the next frame, so the real-time nature of the modification response can be improved.

[0065] Furthermore, the event description information is stored in the stack; after step S302, it may also include: when the event description information of the audio event corresponding to the audio frame unit represents that the audio frame unit is the event end frame of the audio event corresponding to the audio frame unit, the event description information corresponding to the audio frame unit is deleted from the stack.

[0066] Since the audio event description information may record the start frame number and the duration frame number of the audio event, the terminal may also identify the event end frame of the audio event through the above audio event description information, and since the audio event description information is stored in the stack, in order to reduce the data storage capacity of the stack, after completing the generation of the audio signal of the audio event, the audio event description information may also be deleted from the stack. Specifically, if the terminal recognizes that the current audio frame unit is the event end frame of the audio event, after using the audio event description information to obtain the music signal corresponding to the current audio frame unit, the terminal may also delete the audio event description information from the stack to reduce the data storage capacity.

[0067] In this embodiment, if the terminal recognizes that the current audio frame unit is the event end frame of the corresponding audio event, after completing the generation of the music signal corresponding to the current audio frame ternary, the audio event description information can also be deleted from the stack, thereby reducing the data storage amount of the audio event description information.

[0068] In one embodiment, as shown in FIG. 4 , step S101 may further include:

[0069] Step S401, obtaining the music generation mode parameters indicated by the music generation request;

[0070] Step S402, sending the music generation mode parameters to the background server, and receiving the music level information returned by the background server according to the music generation mode parameters; wherein the music level information includes the music stage included in the music to be generated and the music composition units included in the music stage.

[0071] The music generation mode parameter refers to a parameter used to characterize the music generation mode. The parameter can be generated by the terminal recognizing the music generation mode selected by the user. The selected music generation mode can be a sleep mode, i.e., a sleep mode, and a focus mode, i.e., a focus mode, etc. The background server is a server for generating music level information according to the music generation mode parameter. The music level information can be used to characterize the structural level corresponding to the music to be generated, for example, it may include the number of music stages contained in the music to be generated, and the number of music composition units contained in each music stage, etc.

[0072] Specifically, after the user initiates a music generation request and selects a music generation mode through the terminal, the terminal can obtain music generation mode parameters that match the music generation mode, and can send the music generation mode parameters to the background server. The background server can obtain music level information that matches the music to be generated based on the music generation mode parameters and return it to the terminal.

[0073] Step S403, determining the music stages included in the music to be generated and the music component units included in the music stages as the music structure of the music to be generated.

[0074] The music phase refers to the first hierarchical structure in the music structure hierarchy, for example, it can be the phase of a piece of music. For example, a complete piece of music can contain 8 phases, of which the first phase corresponds to the introduction of the music, the 2nd to 7th phases correspond to the main part of the music, and the 8th phase corresponds to the end of the music. Each music phase can be composed of multiple music components, and the music level information can record the number of music phases contained in the music to be generated, and the number of music components contained in each music phase. Therefore, the terminal can determine the music phases contained in the music to be generated and the music components contained in the music phases according to the music level information, and thus generate the music structure of the music to be generated according to the music phases contained in the music to be generated and the music components contained in the music phases.

[0075] For example, the music level information indicates that the music to be generated includes 8 music stages, and each music stage includes 4 music components. Then the background server can determine that the music structure of the music to be generated is a music structure including 8 music stages, and each music stage includes 4 music components.

[0076] In this embodiment, the background server can obtain matching music level information based on the music generation mode parameters uploaded by the terminal, and then use the music level information to determine the music stage and the music composition units contained in the music stage to construct the music structure of the music to be generated. In this way, the construction efficiency of the music structure of the music to be generated can be improved.

[0077] In addition, as shown in FIG5 , after step S401, the following steps may also be included:

[0078] Step S501, receiving music attribute information of the music to be generated returned by the background server according to the music generation mode parameters, the music attribute information includes common attribute information, attribute information of the music stage and attribute information of the music composition units included in the music stage.

[0079] In the present embodiment, in addition to obtaining the music level information that matches the music to be generated according to the music generation mode parameters, the backend server can also obtain the music attribute information that matches the music to be generated, for example, it can include the public attribute information that matches the music to be generated, the attribute information of the music stage and the attribute information of the music composition unit included in the music stage. Among them, the public attribute information can be shown in Figure 6, which can include the sampling frequency information of the entire music to be generated, and the number of music stages included in the music to be generated, etc. The attribute information of the music stage can be shown in Figure 7, which can include the number of tracks used in each music stage, the music density, and the music composition unit included in the music stage, etc. The attribute description information of the music composition unit is the attribute description information for each music composition unit included in the music stage, as shown in Figure 8, which can include the timbre name of each music composition unit or the chord used, etc.

[0080] Specifically, after the terminal sends the music generation mode parameters to the background server, the background server can also obtain music attribute information matching the music to be generated based on the music generation mode parameters and pre-stored default music attribute values, and return it to the terminal.

[0081] Step S502: For any music component unit, the public attribute information, the attribute information of the music stage to which the music component unit belongs, and the attribute information of the music component unit are integrated to obtain the music description data corresponding to the music component unit.

[0082] Specifically, the terminal can determine the music stage to which each music composition unit belongs based on the music attribute information, and then can combine the public attribute information, the attribute information of the music stage to which the music composition unit belongs, and the attribute information of the music composition unit itself to obtain the music description data corresponding to the music composition unit.

[0083] For example, a music composition unit 1 corresponds to a music stage A, wherein the attribute information corresponding to the music stage A is attribute information A, and the attribute information corresponding to the music composition unit 1 is attribute information 1. Since the music description data corresponding to the music composition unit 1 will inherit the attribute information of the music stage and the public attribute information, the music description data of the music composition unit 1 can be composed of the public attribute information, attribute information 1 and attribute information A.

[0084] In this embodiment, music attribute information can be generated by the background server, and the music attribute description information can include public attribute information, attribute information of the music stage and attribute information of the music composition units included in the music stage. In this way, the amount of repeated storage of music attribute information can be reduced.

[0085] In one embodiment, the music generation method may also include: in response to a music attribute update request, obtaining updated music attribute information and a triggering audio frame unit corresponding to when the music attribute update request is triggered; and updating the music description data corresponding to the audio frame unit that is located after the triggering audio frame unit according to the updated music attribute information.

[0086] A music attribute update request refers to a request for updating the music attributes of the music to be generated, such as a request to update the speed of music generation, or a request to update the density of music generation, etc., and the updated music attribute value is the updated attribute value after triggering the music attribute update request. For example, a request to update the speed of music generation can correspond to updating the bpm of the music to be generated, then the updated attribute value refers to the updated bpm, and a request to update the density of music generation can correspond to an update of the audio density, then the updated attribute value refers to the updated audio density information.

[0087] The specific music attributes that can be updated are as shown in FIG. 9 . For example, the user can update the duration of the music to be generated, the density of the music, the brightness or reverberation of the timbre, the soundscape elements of the music, and the meditation instruments corresponding to the generated music, etc.

[0088] Specifically, when receiving a music attribute update request from a user to update the attributes of the music to be generated, the terminal can respond to the request and obtain the updated music attribute value of the music to be generated, as well as the audio frame unit that is being generated when the music attribute update request is triggered, as a triggering audio frame unit. Thereafter, the music description data corresponding to the audio frame unit that is located after the triggering audio frame unit in the audio frame unit order can be updated according to the updated music attribute value, thereby generating a music signal corresponding to the audio frame unit that is located after the triggering audio frame unit based on the updated music description data. In this way, when the user triggers the music attribute update request to update the attributes of the music to be generated, the music signal corresponding to the subsequent audio frame unit can be updated in real time, thereby improving the real-time nature of the music attribute update.

[0089] In this embodiment, after receiving a request to update the music attributes of the music to be generated, the terminal can also update the music description data corresponding to the audio frame unit that is sequentially located after the triggering audio frame unit, so that the updated music description data can be used to generate an audio signal corresponding to the audio frame unit after the triggering audio frame unit, thereby achieving more detailed real-time music attributes of the music to be generated and improving the real-time nature of the music attribute update.

[0090] In one embodiment, a real-time interactive streaming music generation method for multiple models is also provided, which can realize real-time change of generation parameters by users, and the music generation audio stream will not be interrupted. The generation of some music attributes is carried out by the neural network deployed in the background. After receiving the music attributes, the front end performs more detailed and context-compliant music generation based on the framework, and finally outputs the audio PCM, thereby ensuring the harmony between multiple instruments and the consistency of the time domain context, so that the generated music has integrity. The present embodiment can divide the music generation into several subtasks, that is, connect multiple models in series, and compress them into small-scale data, so as to realize fast front-back transmission, so that each subtask can be completed using the neural network deployed in the background, and the generation framework communication with the front end is completed through some key data. In addition, the input parameters of the user at the front end can also be transmitted to the background as input parameters through the analysis of the sdk, generate new data containing music attribute encoding, and send it back to the sdk of the front end for more detailed generation. This embodiment can not only implement a lightweight front-end to achieve interactive generation by users, but also take advantage of the neural network to make the generated music diverse and unique. The entire task is lightweight and easy to implement. The specific deployment architecture of this embodiment can be shown in FIG10. The specific steps are as follows:

[0091] 1. Division of hierarchical structure

[0092] The real-time generation in this embodiment is based on a hierarchical structure, which is the largest framework of the solution. Taking the structure in the following figure as an example, the overall structure can be divided into three stages: introduction, main body, and ending; some structures can be repeated as needed. The difference between stages is different preset values, such as muting some tracks, opening some tracks, relative value changes of bpm, audio density, etc.

[0093] How many stages does a song have, and what are they? This kind of hierarchical structure information can be preset in a json or csv file, or generated by a neural network deployed in the background, communicating with the front-end SDK through real-time communication, and then randomly selecting and matching when generating. For example, the ABAB structure, or the ABCAB structure, etc., the A paragraph has several voices, several instruments, chord progressions, etc.

[0094] As shown in Figure 11, taking the structure (ABC structure) as an example, the music structure includes an introduction, a main body, and an ending. The duration of the introduction and the ending is set to be shorter than that of the main body. For example, if the overall music structure is divided into phases, a song is composed of 8 phases by default, then the introduction segment contains 1 phase, the main body contains 6 phases, and the ending contains 1 phase. The number of phases of the main body segment can be adjusted by the outermost macro definition. The overall structure is disassembled into track structures, that is, the data structure of a song on each track contains 8 phases, of which 0 is intro, 7 is outro, and the middle is the main segment. This division realizes the internal dynamic changes of the entire music.

[0095] The phase structure can be further divided into sections, for example, a phase consists of n sections. Each section inherits the structural information sent by its upper phase, and adds more music description attributes according to different instrument properties, such as the bpm speed, whether the track is open, the timbre name of the track, audio density, chords used, and other descriptive information.

[0096] These descriptive structures will determine the chords, rhythm, pitch, and timbre of the music controlled by each section. By dividing the structure into blocks, the music is complete in the time domain, ensuring the consistency of the music context and the dynamic progression that conforms to the musicality. So far, the steps of parsing the text information sent by the background and generating a detailed structure have been completed.

[0097] 2. Read the section structure in the stack to generate pcm data

[0098] Read the sections in sequence, and generate PCM data according to the information recorded in the section and the timbre library file (either synthesizer or local sampling file). Here, you can read the next section in advance. If the information of the two sections is consistent, continuous generation can be performed. If not, the sustained part of the previous section is parsed and regenerated according to the description in the new section. Finally, communicate with the next digital signal processing module (for mixing) according to the specified number of points (block). For example, as shown in Figure 12, the bpm is 110, and the actual duration of the section can be calculated. According to the chord information sent from the upper layer, the pitch information used by the current module is filtered out, and the PCM data of the current section can be generated in combination with the timbre information recorded in the section. After completing the parsing of the current section, the section will be streamed and deleted in the stack.

[0099] In order to achieve streaming playback on the client side and open parameters in real time for users to adjust, the audio event is used as the object for generation. As shown in Figure 13, through the analysis of the section, the lower layer PCM generates n audio superpositions, and records the timbre, the sampling point, and the duration of each audio. First, an empty array is generated according to the sampling length calculated by the bpm recorded in the section, and the sampling points are read cyclically with the preset frame length. Here, it is assumed that the frame length is 2048 sampling points. When a certain audio event is triggered by the cyclic reading, the triggered audio event will continue to be read in the streaming manner, and the number of sampling points passed will be deleted in the audio event object. When a certain audio event. In this way, the point where the audio stream is proceeding and where the next frame will continue can be well recorded. When the user changes a certain descriptive information in the outer layer of the client (for example, the audio density is changed, or a track is opened / closed), it will be regenerated according to the changed information, and the frame number point of the current streaming generation is obtained to start spitting out, so that the user's interactive input is effective in real time. This saves running memory and satisfies the client's quick response to short-term data requests. In this step, each track outputs two-channel signals with a specified number of points.

[0100] 3. Interaction processing of update functions

[0101] When creating an instance, different overall structures will be generated according to the mode selected by the user (sleep, focus, etc.); after entering the mode, the user's real-time input will immediately change the information of the ungenerated section and update the audio event of the ongoing section; for example, the emotion input by the user will affect the speed of the overall music generation, that is, the absolute bpm value of the music; if the user wants the notes to be denser, the remaining sections will be traversed, the density value will be modified to dense, and the current section will be regenerated after the density is modified to dense, and it will be spit out in real time according to the current number of frames to achieve seamless connection; if the user wants to add new music elements, such as wooden fish, etc., the new elements will be added to the data structure of the generation framework according to the hierarchical structure and generated. If the user wants to change the mode, all data structures will be cleared and regenerated according to the selected mode. Users can not only modify the generated music, but also choose the sound effects, such as a larger space; a brighter tone, etc. This part of the interface will communicate with the digital signal processing framework and finally output to the upper client communication.

[0102] Among them, the parameters that users can interact with or control may include: (1) music duration, that is, setting the length of the music, (2) music attributes, that is, setting the density of the instrumentation, the brightness of the timbre or the degree of reverberation, and the listening experience of spatial audio, etc., (3) soundscape elements, that is, environmental sounds such as waves and rain, as well as weather, time, etc., and (4) custom elements, such as meditation instruments, etc.

[0103] 4. Processing of the mixing module

[0104] The generation part is generated by track, so the PCM data sent to the mixing module is n-track individual data, such as drums, bass, synthesizer, etc. The mixing module will receive n pairs of two-channel signals with a specified number of points. Here, according to the sound properties of each track, each type of instrument is superimposed with effects, that is, digital signal processing is performed to achieve a balanced state between tracks. At the same time, some parameters of this module are open to users for interaction to complete the music mixing steps.

[0105] The music generation method provided in this embodiment, since the generation framework is deployed on the front end and the neural network is deployed on the back end, real-time generation is completed on the front end by requesting a relatively simple data structure; secondly, the framework structure enables the generated music to maintain harmony between multiple instruments and segmentation between time domain contexts, so that the generated music has integrity; finally, this embodiment also supports real-time interaction of users, and can generate unique and personalized music.

[0106] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0107] Based on the same inventive concept, the embodiment of the present application also provides a music generation device for implementing the music generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more music generation device embodiments provided below can refer to the limitations on the music generation method above, and will not be repeated here.

[0108] In one embodiment, as shown in FIG. 14 , a music generating device is provided, comprising: a music structure acquiring module 1401, a music signal generating module 1402 and a music signal output module 1403, wherein:

[0109] The music structure acquisition module 1401 is used to respond to the music generation request and acquire the music structure matching the music generation request; the music structure includes a plurality of music composition units arranged in sequence, each music composition unit corresponds to music description data, and each music composition unit includes a plurality of audio frame units arranged in sequence;

[0110] The music signal generating module 1402 is used to generate the music signal of each audio frame unit included in at least one music component unit based on the music description data of at least one music component unit in accordance with the arrangement order of the multiple music component units in the music structure;

[0111] The music signal output module 1403 is used to output the music signals corresponding to the audio frame units according to the arrangement order of the audio frame units in the music structure.

[0112] Each module in the above-mentioned music generation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0113] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG15. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a music generation method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0114] Those skilled in the art will understand that the structure shown in FIG. 15 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0115] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0116] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0117] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0118] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0119] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0120] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0121] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A music generation method, characterized in that: The method comprises: In response to a music generation request, a music structure matching the music generation request is obtained; the music structure comprises a plurality of music composition units arranged in sequence, each of the music composition units corresponds to music description data, and each of the music composition units comprises a plurality of audio frame units arranged in sequence; Generate a music signal of each audio frame unit included in the at least one music composition unit based on the music description data of the at least one music composition unit in accordance with the arrangement order of the multiple music composition units in the music structure; According to the arrangement order of the audio frame units in the music structure, the music signals respectively corresponding to the audio frame units are output.

2. The method according to claim 1, characterized in that The step of generating a music signal of each audio frame unit included in the at least one music composition unit based on the music description data of the at least one music composition unit in accordance with the arrangement order of the plurality of music composition units in the music structure comprises: According to the arrangement order of the multiple music composition units in the music structure, obtain the current music composition unit and the next music composition unit sequentially following the current music composition unit; In a case where the music description data of the current music composition unit is consistent with the music description data corresponding to the next music composition unit, based on the consistent music description data, a music signal of each audio frame unit included in the current music composition unit and a music signal of the audio frame unit included in the next music composition unit are generated; When the music description data of the current music composition unit is inconsistent with the music description data corresponding to the next music composition unit, a music signal of each audio frame unit included in the current music composition unit is generated based on the music description data of the current music composition unit.

3. The method according to claim 1, characterized in that The music description data corresponding to each of the music composition units includes event description information of at least one audio event, wherein the event description information includes an audio event note and a duration of the audio event note; The step of generating a music signal of each audio frame unit contained in the at least one music composition unit based on the music description data of the at least one music composition unit comprises: For any of the music composition units, determining whether each of the audio frame units included in the music composition unit corresponds to the audio event according to the duration of the audio event note corresponding to the music composition unit and the arrangement order of the multiple audio frame units included in the music composition unit; In the case where the audio frame unit corresponds to the audio event, a music signal corresponding to the audio frame unit is generated according to event description information of the audio event corresponding to the audio frame unit.

4. The method according to claim 3, characterized in that The event description information is stored in a stack; After generating a music signal corresponding to the audio frame unit according to the event description information of the audio event corresponding to the audio frame unit, the method further includes: When the event description information of the audio event corresponding to the audio frame unit indicates that the audio frame unit is an event end frame of the audio event corresponding to the audio frame unit, the event description information corresponding to the audio frame unit is deleted from the stack.

5. The method according to claim 1, characterized in that The obtaining of a music structure matching the music generation request includes: Obtaining music generation mode parameters indicated by the music generation request; Sending the music generation mode parameters to a backend server, and receiving music level information returned by the backend server according to the music generation mode parameters; wherein the music level information includes the music stage included in the music to be generated and the music component units included in the music stage; The music stages included in the music to be generated and the music component units included in the music stages are determined as the music structure of the music to be generated.

6. The method according to claim 5, characterized in that After sending the music generation mode parameters to the backend server, the method further includes: Receiving music attribute information of the music to be generated returned by the backend server according to the music generation mode parameters, the music attribute information including common attribute information, attribute information of the music stage and attribute information of the music composition units included in the music stage; For any of the music composition units, the public attribute information, the attribute information of the music stage to which the music composition unit belongs, and the attribute information of the music composition unit are integrated to obtain the music description data corresponding to the music composition unit.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to a music attribute update request, acquiring updated music attribute information and a triggering audio frame unit corresponding to when the music attribute update request is triggered; According to the updated music attribute information, the music description data corresponding to the audio frame unit that is sequentially located after the triggering audio frame unit is updated.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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 steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Synthetic song processing method, computer equipment and storage medium

    CN119649778A

  • Synthetic song processing method, computer device and storage medium

    CN119649778B