Music generation method and apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202310558414.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-05-17
AI Technical Summary
[0004]本公开实施例提供一种音乐生成方法、装置、电子设备及存储介质,以克服制作成本高、制作质量低下的问题
[0017]本实施例提供的音乐生成方法、装置、电子设备及存储介质,通过获取初始音频;获取与所述初始音频对应的第一编曲模板,其中,所述第一编曲模板用于为所述初始音频增加具有目标音乐风格的配乐;基于第一编曲模板,处理所述初始音频,生成目标音乐。在获得用户录入的初始音频后,通过选择与初始音频相匹配的第一编曲模板,并利用该第一编曲模板处理初始音频,为初始音频增加具有目标音乐风格的配乐,从而生成目标音乐,实现了将初始音频直接加工为目标音乐的效果,降低音乐制作的难度、简化制作流程,提高生成的目标音乐的音乐质量。
Smart Images

Figure CN116403549B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet technology, and in particular to a music generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, creating and sharing personal musical works is becoming a popular way of disseminating information. For conventional musical works, it typically requires multiple production stages, including composing, recording, and arranging, using professional equipment to complete a single piece.
[0003] However, traditional methods of music generation and production suffer from high production costs and poor production quality. Summary of the Invention
[0004] This disclosure provides a music generation method, apparatus, electronic device, and storage medium to overcome the problems of high production cost and low production quality.
[0005] In a first aspect, embodiments of this disclosure provide a music generation method, including:
[0006] Obtain initial audio; obtain a first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with a target music style to the initial audio; process the initial audio based on the first arrangement template to generate the target music.
[0007] Secondly, embodiments of this disclosure provide a music generation apparatus, comprising:
[0008] The input module is used to acquire the initial audio.
[0009] The processing module is used to obtain a first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with a target music style to the initial audio;
[0010] The music arrangement module processes the initial audio based on the first music arrangement template to generate the target music.
[0011] Thirdly, embodiments of this disclosure provide an electronic device, including:
[0012] A processor, and a memory communicatively connected to the processor;
[0013] The memory stores computer-executed instructions;
[0014] The processor executes computer execution instructions stored in the memory to implement the music generation method described in the first aspect and various possible designs of the first aspect.
[0015] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the music generation method described in the first aspect and various possible designs of the first aspect.
[0016] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the music generation method as described in the first aspect and various possible designs of the first aspect.
[0017] The music generation method, apparatus, electronic device, and storage medium provided in this embodiment acquire initial audio; acquire a first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with a target music style to the initial audio; and process the initial audio based on the first arrangement template to generate target music. After obtaining the initial audio input by the user, by selecting the first arrangement template that matches the initial audio and processing the initial audio using the first arrangement template to add background music with a target music style to the initial audio, the target music is generated. This achieves the effect of directly processing the initial audio into target music, reducing the difficulty of music production, simplifying the production process, and improving the music quality of the generated target music. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is an application scenario diagram of the music generation method provided in the embodiments of this disclosure;
[0020] Figure 2 Flowchart of the music generation method provided in the embodiments of this disclosure Figure 1 ;
[0021] Figure 3 for Figure 2 A flowchart illustrating the specific implementation of step S101 in the illustrated embodiment;
[0022] Figure 4 A schematic diagram of a first interface provided in an embodiment of this disclosure;
[0023] Figure 5 for Figure 2 A flowchart illustrating the specific implementation of step S102 in the illustrated embodiment;
[0024] Figure 6 for Figure 5 A flowchart illustrating the specific implementation of step S1021 in the illustrated embodiment;
[0025] Figure 7 A schematic diagram of another first interface provided in an embodiment of this disclosure;
[0026] Figure 8 Flowchart of the music generation method provided in the embodiments of this disclosure Figure 2 ;
[0027] Figure 9 A schematic diagram illustrating the display of pre-generated music, provided as an embodiment of this disclosure;
[0028] Figure 10 A schematic diagram of a second interface provided in an embodiment of this disclosure;
[0029] Figure 11 for Figure 8 A flowchart illustrating the specific implementation of step S206 in the illustrated embodiment;
[0030] Figure 12 A schematic diagram illustrating a jump from a second interface to a third interface provided in an embodiment of this disclosure;
[0031] Figure 13 for Figure 11 A flowchart illustrating the specific implementation of step S2062 in the illustrated embodiment;
[0032] Figure 14 for Figure 8 A flowchart illustrating the specific implementation of step S207 in the illustrated embodiment;
[0033] Figure 15 This is a structural block diagram of a music generation apparatus provided in an embodiment of the present disclosure;
[0034] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0035] Figure 17 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0037] 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, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0038] The application scenarios of the embodiments of this disclosure are explained below:
[0039] Figure 1 This diagram illustrates an application scenario of the music generation method provided in this disclosure. The music generation method provided in this disclosure can be applied to scenarios involving the generation of personal musical works. More specifically, for example... Figure 1 As shown, the method provided in this embodiment can be applied to terminal devices, such as smartphones. The music generation method provided in this embodiment is implemented by running a music generation application (APP) on the terminal device. Specifically, for example, after a user triggers the recording component in the music generation application, the terminal device begins to collect the user's voice, such as a softly hummed melody or song. Then, based on the collected user voice, the terminal device automatically generates matching background music, mixes it, generates a musical work, and plays it for the user to preview. Furthermore, if the user is not satisfied with the musical work after previewing, they can further modify the chords and arrangement of the musical work until a satisfactory musical work is generated.
[0040] In existing technologies, the production of conventional musical works typically requires multiple stages, including composition, recording, and arrangement, using specialized equipment. However, traditional music generation and production methods suffer from high production costs and poor quality. This disclosure provides a music generation method to address these issues.
[0041] refer to Figure 2 , Figure 2 Flowchart of the music generation method provided in the embodiments of this disclosure Figure 1The method of this embodiment can be applied in a terminal device. This music generation method includes:
[0042] Step S101: Obtain the initial audio.
[0043] For example, in one possible implementation, refer to Figure 1 The illustrated application scenario diagram shows that the terminal device first collects sound signals through a sound acquisition unit, such as a microphone, to obtain the user's voice, i.e., the initial audio. More specifically, for example, the melody or tune hummed by the user. The initial audio can contain only melody information (i.e., only humming the melody), or it can contain semantic information (i.e., only reciting the lyrics), or it can contain both melody and semantic information (i.e., humming the melody and reciting the lyrics). No specific limitations are made here. The target application that can be used to generate musical works is then run; no specific limitations are made here either.
[0044] Furthermore, in one possible implementation, after the terminal device runs the target application, a recording component is set up within the first interface of the target application. In response to a first trigger operation on the recording component, initial audio acquisition can be achieved. Specifically, for example... Figure 3 As shown, the specific implementation of step S101 includes:
[0045] Step S1011: In response to the first trigger operation within the first interface, collect real-time voice data.
[0046] Step S1012: After the preset conditions are met, generate the initial audio based on the real-time voice data collected at different times.
[0047] Figure 4 This is a schematic diagram of a first interface provided in an embodiment of the present disclosure, which is described below in conjunction with... Figure 4 The above process is described below. For example, the first interface is the audio recording interface. The first triggering operation is, for example, clicking or long-pressing (shown as a long-press operation in the diagram) the recording component within this first interface. Afterward, the terminal device begins to continuously collect sound signals and generates real-time audio data based on a time series. Preset conditions include, for example, releasing the long press on the recording component (shown as a release operation in the diagram), or waiting for a preset time period. Upon reaching the preset conditions, the terminal device saves the real-time audio data collected at different times within the aforementioned time period as input data.
[0048] Optionally, after step S1011, the method further includes:
[0049] Step S1013: Display the waveform corresponding to the real-time voice data in the first interface in real time.
[0050] Optionally, after starting to collect real-time voice data, refer to Figure 4As shown, the waveform corresponding to the current moment is also displayed in the first interface. The waveform consists of the current moment and the real-time voice data from the current moment to the acquisition start time. Specifically, the waveform consists of multiple numerical points, each numerical point corresponds to an acquisition time, and the value of the numerical point represents the audio amplitude corresponding to the real-time voice data.
[0051] In this embodiment, the initial audio is captured in real time by triggering the first interface, enabling flexible control over the recording process of the initial audio. Combined with waveform display, this improves the recording efficiency of the initial audio.
[0052] Furthermore, the first interface also includes a first settings component, which, before obtaining the initial audio, includes:
[0053] Step S100: Receive a first setting operation for a first setting component within the first interface. The first setting operation is used to set the voice effect of the target type.
[0054] Correspondingly, in another possible implementation, step S101 is specifically implemented as follows:
[0055] Step S1014: In response to the first trigger operation, sound acquisition is performed to obtain the original speech.
[0056] Step S1015: Process the original speech to obtain the initial audio with the target type of human voice effect.
[0057] For example, the terminal device first collects sound information using the sound acquisition unit to obtain the original speech. The specific implementation method can be found in steps S1011-S1012 above, and will not be repeated here. Then, based on the original speech, the original speech is processed by, for example, through a voice effect of the target type selected in the first setting operation, thereby changing the sound characteristics of the original speech. The voice effect refers to the timbre of a human voice performance, and the voice effect type can be represented by music genres, such as Pop and Jazz. In other possible implementations, the voice effect type can also be a further refined subtype based on the above classification, such as City Pop and Classic Pop, etc., without specific limitations here.
[0058] Furthermore, the first setting operation may include two sub-operations, which are used to display and trigger different types of voice effects respectively. For example, when the terminal device responds to the user's input of the first setting sub-operation, it triggers the corresponding first setting component to display several voice effect icons. Then, the terminal device responds to the user's input of the second setting sub-operation to select the corresponding target voice effect icon, thereby obtaining the first recording information representing the target type of voice effect. The first recording information may be a weighted coefficient sequence composed of weighted coefficients for different sound frequencies. The frequency values at at least one frequency point of the original speech are weighted and calculated using the first recording information to obtain the initial audio with the target type of voice effect.
[0059] In this embodiment, by obtaining the first recording information before the initial audio acquisition, the initial audio can be adjusted to give it a personalized vocal effect, thereby improving the listening quality of the subsequently generated target music.
[0060] In another possible implementation, step S101 is specifically implemented as follows:
[0061] In response to the first loading operation within the first interface, a voice file is selected; the voice file is loaded to obtain the initial audio. The voice file is a pre-generated file containing sound signals. After the voice file is obtained from a local or remote location through the first loading operation, it is loaded onto the terminal device to obtain the music signal within the voice file, which is equivalent to the original voice obtained in the previous steps. Then, the music signal is processed (e.g., setting vocal effects) to obtain the initial audio. The specific implementation method is similar and will not be described in detail here.
[0062] Step S102: Obtain the first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with the target music style to the initial audio.
[0063] For example, after obtaining the initial audio, a matching arrangement template, namely the first arrangement template, is determined based on the effects of the initial audio, and background music is added to the initial audio using this first arrangement template. Here, arrangement refers to the process of configuring elements such as instruments, chords, bass lines, and harmonies based on the main melody. An arrangement template is template data used to achieve the above-mentioned musical arrangement in a fixed manner. The arrangement template is pre-generated; based on the characteristics of the initial audio, an arrangement template that matches the characteristics of the initial audio is selected, namely the first arrangement template.
[0064] In one possible implementation, such as Figure 5 As shown, the specific implementation of step S102 includes:
[0065] Step S1021: Obtain the first arrangement information of the initial audio. The first arrangement information represents the melodic characteristics of the background music adapted to the initial audio.
[0066] Step S1022: Obtain the first arrangement template based on the first arrangement information.
[0067] For example, the first arrangement information of the initial audio can be user-defined, automatically generated based on the initial audio, or a combination of user-defined and automatically generated information. In one possible implementation, the first arrangement information represents the melodic features of the background music adapted to the initial audio, such as through musical beats. Therefore, based on the speech beats of the initial audio, the first arrangement information representing musical beats similar to or consistent with it can be determined.
[0068] Furthermore, exemplarily, such as Figure 6 As shown, the specific implementation of step S1021 includes:
[0069] Step S1021A: Obtain the speech rhythm of the initial audio based on the pitch changes of the initial audio.
[0070] Step S1021B: Obtain the corresponding background music beat based on the speech beat of the initial audio.
[0071] Step S1021C: Obtain the first arrangement information based on the rhythm of the background music.
[0072] For example, the pitch of the initial audio can be obtained by the amplitude of the digital signal corresponding to the initial audio. The method for obtaining the pitch is existing technology and will not be elaborated here. Then, based on the pitch changes at different time points (i.e., pitch variations), the speech rhythm of the initial audio can be obtained. For example, in a certain frequency dimension, the faster the pitch changes, the faster the speech rhythm, and vice versa. Next, based on the speech rhythm, a similar background music rhythm is matched, and corresponding first arrangement information is generated based on the background music rhythm. The first arrangement information can be a specific rhythm identifier. Simultaneously, a preset arrangement template corresponds to a template rhythm identifier representing its tempo. By comparing the aforementioned rhythm identifier and the target rhythm identifier, the first arrangement template corresponding to the first arrangement information can be determined.
[0073] Furthermore, in one possible implementation, the first interface also includes a second setting component, which is used to set the background music tempo and / or the playback speed of the initial audio. In another possible implementation, step S1021 is specifically implemented as follows:
[0074] Step S1021D: In response to a second setting operation on a second setting component within the first interface, second recording information is obtained, the second recording information representing the playback speed of the background music beat and / or the initial audio.
[0075] Step S1021E: Obtain the first arrangement information based on the second recording information.
[0076] After the terminal device responds to the user's input of a second setting operation for the second setting component, it can obtain second recording information based on the user's personalized selection; wherein, the second recording information represents the playback speed of the background music beat and / or the initial audio. Figure 7 A schematic diagram of another first interface provided in an embodiment of this disclosure, as shown below. Figure 7 As shown, the second setting component in the first interface includes component A and component B. Component A is used to set the background music tempo, and component B is used to set the playback speed. When the user clicks on component A and component B respectively, the corresponding setting interfaces IF_A and IF_B will pop up. After the user makes specific settings in the setting interface, the terminal device obtains the corresponding background music tempo and playback speed, thereby obtaining the second recording information. Then, based on the second recording information, the first arrangement information representing the melody characteristics is obtained.
[0077] In this embodiment, by responding to the second setting operation of the second setting component in the first interface, the personalized setting of the first arrangement information is realized, thereby meeting the user's personalized arrangement needs, improving the matching degree between the initial audio and the first arrangement template, and improving the music quality of the output target music.
[0078] Step S103: Based on the first arrangement template, process the initial audio and generate the target music.
[0079] For example, after obtaining the first arrangement template based on the above steps, in one possible implementation, the first arrangement template can directly generate background music with a target musical style corresponding to the initial audio. For example, the target musical style corresponds to the first arrangement template; when the first arrangement template is determined based on the first arrangement information, its corresponding target musical style is also determined. The background music may include multiple elements such as instrumental sound effects, harmonic sound effects, and chordal melodies. The duration of the background music can be the same as or slightly longer than the duration of the initial audio. After generating the background music corresponding to the initial audio based on the first arrangement template, the background music is mixed with the initial audio to obtain the target music.
[0080] In this embodiment, the process involves acquiring initial audio; acquiring a first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with the target music style to the initial audio; and processing the initial audio based on the first arrangement template to generate the target music. After obtaining the initial audio input by the user, by selecting the first arrangement template that matches the initial audio and processing the initial audio using the first arrangement template to add background music with the target music style, the target music is generated. This achieves the effect of directly processing the initial audio into target music, reducing the difficulty of music production, simplifying the production process, and improving the music quality of the generated target music.
[0081] refer to Figure 8 , Figure 8 Flowchart of the music generation method provided in the embodiments of this disclosure Figure 2 This embodiment is in Figure 2 Based on the illustrated embodiment, step S103 is further refined, and the music generation method includes:
[0082] Step S201: In response to the first trigger operation, sound acquisition is performed to obtain the initial audio.
[0083] Step S202: Obtain the first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with the target music style to the initial audio.
[0084] Step S203: Based on the first arrangement template, obtain the first arrangement with the target music style.
[0085] For example, refer to Figure 2 The illustrated embodiment describes the process of obtaining the first arrangement template. Following this, the terminal device, such as the first arrangement template, processes the input music. Specifically, it inputs the input music as a parameter to the first arrangement template. The first arrangement template, based on the duration of the input music, utilizes its ability to generate background music matching the target musical style to create a first arrangement. This first arrangement is characterized by differences in the chords and musical elements that constitute the background music. Musical elements include instrumental sound effects, harmonic sound effects, and melody sound effects. In other words, the first arrangement has corresponding target chords and / or target musical elements.
[0086] Step S204: Mix the first arrangement and the initial audio to generate pre-generated music.
[0087] Furthermore, after obtaining the first arrangement, the first arrangement and the initial audio are mixed to generate pre-generated music. Mixing the first arrangement and the initial audio means setting the pitch (intensity of sound energy) of the first arrangement and the initial audio based on a mixing coefficient, and playing the first arrangement and the initial audio simultaneously based on the set pitch, thereby achieving the mixing of the first arrangement and the initial audio.
[0088] The generated pre-generated music consists of multiple sound channels. Figure 9 This is a schematic diagram illustrating the display of pre-generated music according to an embodiment of the present disclosure, with reference to... Figure 9 As shown, after generating the pre-generated music, when the corresponding trigger condition is met (e.g., receiving a specific operation command from the user), the pre-generated music will be displayed in the display interface. For example, as shown... Figure 9 As shown, the pre-generated music consists of sound channels chan_1, chan_2, and chan_3. Among them, sound channel chan_1 is the human voice channel, which carries the initial audio. Sound channels chan_2 and chan_3 are instrument channels, where sound channel chan_2 carries drum sound effects and sound channel chan_3 carries keyboard sound effects.
[0089] Optionally, before step S204, the method further includes:
[0090] Step S200A: Display the fifth interface, which is used to set the mixing coefficients of the first arrangement and the initial audio. The mixing coefficients represent the volume values of the first arrangement and the initial audio when they are mixed.
[0091] Step S200B: In response to the fifth setting operation for the fifth interface, obtain the target mixing coefficients.
[0092] For example, the fifth interface can include control components corresponding to the first arrangement and the initial audio, such as slider components and editable text box components. After the user inputs a fifth setting operation on the aforementioned control components, they can edit the mixing coefficients. For example, by setting the slider component to a specified position, a mixing coefficient can be determined. The specific implementation of the fifth setting operation can be set as needed and is not limited here. The specific method by which the terminal device obtains the target mixing coefficient in response to the fifth setting operation also varies depending on the fifth setting operation and the aforementioned control components, and will not be elaborated here.
[0093] Accordingly, the specific implementation of step S204 includes:
[0094] The first arrangement and initial audio are mixed based on the target mixing coefficients to generate pre-generated music. The specific implementation of mixing based on mixing coefficients has been described above and will not be repeated here. It should be noted that the fifth interface is displayed based on user trigger commands. For example, after the user clicks the corresponding trigger component on the fifth interface, they are redirected from the second interface to the fifth interface. Alternatively, they can be redirected from the third interface, fourth interface, etc., to the fifth interface. Steps S200A and S200B can also be executed again based on user actions after step S204 has been completed.
[0095] Optionally, after step S204, the method further includes:
[0096] Step S205A: In the second interface, display the first template identifier corresponding to the first arrangement template and the second template identifier corresponding to at least one alternative arrangement template, wherein the first template identifier and at least one second template identifier are arranged based on the target arrangement order, the target arrangement order is determined at least based on the first arrangement information of the initial audio, and the first arrangement information represents the melodic features of the background music adapted to the initial audio.
[0097] Step S205B: In response to the selection operation for the alternative arrangement template, generate the updated first arrangement.
[0098] In one possible implementation, the pre-generated music is generated by the terminal device after processing the initial audio based on a matched first editing target. In this approach, users can generate both the pre-generated music and the final target music by simply inputting the initial audio (e.g., humming a simple melody), simplifying the process, reducing user complexity and difficulty, and improving the arrangement of melodies. Furthermore, users can listen to the automatically generated pre-generated music and then further edit it with background music, achieving more personalized arrangements. Specifically, for example, after generating the pre-generated music, the tracks can be further edited, such as adding, deleting, or separating tracks. Even more detailed editing is possible, such as changing the chords and instruments.
[0099] Figure 10 A schematic diagram of a second interface provided in an embodiment of this disclosure, such as... Figure 10As shown, the terminal device automatically generates pre-generated music. On one hand, the waveform corresponding to the pre-generated music is displayed in the first area of the second interface. The horizontal axis is the time axis, and the playback position shown in the figure is 00:12, which is the 12th second of the playback timestamp of the pre-generated music. The vertical axis is the amplitude of the pre-generated music at each time point. On the other hand, the currently selected arrangement template, i.e., the first arrangement target, and at least one alternative arrangement target are displayed in the second area of the second interface. The first template identifier and at least one second template identifier are arranged based on the target arrangement order, which is determined at least based on the first arrangement information of the initial audio. In short, they are arranged according to the matching degree between each arrangement template and the initial audio. The higher the matching degree, the earlier the arrangement position (closer to the left edge of the second area). The calculation method of the matching degree of each arrangement template can be found in [reference needed]. Figure 2 The embodiment shown describes how to obtain the first arrangement target.
[0100] Furthermore, when the user clicks on one of the alternative arrangement templates, the terminal device responds to the user's selection operation, determines the selected alternative arrangement target as the first arrangement template, and regenerates the updated first arrangement based on the updated first arrangement template. Then, it returns to step S204 and regenerates a new pre-generated music based on the updated first arrangement and the initial audio mix.
[0101] Optionally, after step S204, the method further includes:
[0102] Step S206: Update the musical elements of the pre-generated music to generate the updated first arrangement.
[0103] For example, in addition to the above steps of updating the arrangement template, the background music elements in the arrangement template can also be updated, which is equivalent to further personalizing the arrangement template, thereby obtaining a first arrangement that better meets the user's needs. For example, the background music elements include at least one of the following: instrumental sound effects, harmonic sound effects, melody sound effects, and background sound effects. For example, such as... Figure 11 As shown, the specific implementation of step S206 includes:
[0104] Step S2061: Based on the target playback position of the pre-generated music, display the third interface. The third interface is used to display the background music elements of the first arrangement corresponding to the pre-generated music at the target playback position.
[0105] Step S2062: In response to the third setting operation for the third interface, the second arrangement is obtained.
[0106] For example, during the display and playback of pre-generated music in the second interface, when the pre-generated music reaches the target playback position, or when the user jumps (seeks) to the target playback position, the terminal device displays the third interface after receiving the user's input to trigger the third interface. The third interface is used to display the background music elements of the first arrangement corresponding to the pre-generated music at the target playback position. Afterwards, the user can perform a third setting operation on the basis of the third interface to set the background music elements, such as changing instrument sound effects, changing harmony sound effects, etc. Figure 12 This is a schematic diagram illustrating a jump from a second interface to a third interface, as provided in an embodiment of this disclosure. Figure 12 As shown, the pre-generated music is displayed in the second interface. When the pre-generated music plays to time t_1 (playback timestamp), the user clicks the editing component in the second interface to jump to the third interface. The third interface displays the background music elements within a time period starting from time t_1 and ending at time t_1+det, where det is a value greater than or equal to the minimum interval, representing the editing range of the background music elements. The background music elements are implemented through sound channels. For example, as shown in the figure, the background music elements include drum sound effects (corresponding element identifier: Rhy_1), background sound effects (corresponding element identifier: Amb_1), bass sound effects (corresponding element identifier: Bas_1), harmony sound effects (corresponding element identifier: Harm_1), and melody sound effects (corresponding element identifier: Lea_1). Each background music element corresponds to a sound channel, and the sound channel carries the specific sound data of the specific background music element, i.e., the implementation method.
[0107] Furthermore, when a user applies a third setting operation to the background music element (corresponding component) in the third interface, the terminal device will change the specific implementation of the background music element according to the setting instruction corresponding to the third setting operation, thereby generating a new arrangement, namely the second arrangement.
[0108] For example, the third setting operation includes at least a first sub-operation and a second sub-operation executed sequentially, such as... Figure 13 As shown, the specific implementation of step S2062 includes:
[0109] Step S2062A: In response to the first sub-operation for the target soundtrack element, display at least two candidate element identifiers corresponding to the target soundtrack element, wherein the candidate element identifiers represent the implementation method of the target soundtrack element.
[0110] Step S2062B: In response to the second sub-operation for the target element identifier among at least two candidate element identifiers, set the target soundtrack element to the target implementation.
[0111] Step S2062C: Based on the target implementation method of the target music element and the corresponding implementation methods of other music elements, the second arrangement is obtained.
[0112] For example, combined Figure 12 In the third interface shown, when the bass sound effect is the selected target background music element, in response to the first sub-operation of the element identifier corresponding to the bass sound effect, multiple candidate element identifiers are displayed in the form of a drop-down menu. Then, based on the second sub-operation, one of the candidate element identifiers is selected as the target element identifier (shown as Bas_1 in the figure) and displayed. At the same time, the target implementation method corresponding to the target element identifier of the bass sound effect, together with the current implementation methods of the drum sound effect, harmony sound effect, background sound effect, and main melody sound effect, are used to obtain the second arrangement.
[0113] Step S2063: And determine the second arrangement as the updated first arrangement.
[0114] For example, by determining the second arrangement as the updated first arrangement, the process can return to step S204 to update the pre-generated music. In this embodiment, by responding to a third setting operation on the third interface, the background music elements are modified to obtain the second arrangement, thereby updating the pre-generated music, further improving the flexibility of the arrangement and meeting the user's personalized needs.
[0115] Step S207: Update the chords of the pre-generated music to generate the updated first arrangement.
[0116] For example, such as Figure 14 As shown, the specific implementation of step S207 includes:
[0117] Step S2071: Based on the target playback position of the pre-generated music, display the fourth interface, which is used to display the chords of the first arrangement corresponding to the pre-generated music at the target playback position.
[0118] Step S2072: In response to the fourth setting operation for the fourth interface, the third arrangement is obtained.
[0119] Step S2073: Mix the third arrangement and the initial audio to obtain the updated pre-generated music.
[0120] For example, similar to setting background music elements, during the display and playback of pre-generated music in the second interface, when the pre-generated music reaches the target playback position, or when the user seeks to the target playback position, the terminal device displays the fourth interface after receiving a user-inputted fourth interface trigger operation. The fourth interface displays the chords of the first arrangement corresponding to the pre-generated music at the target playback position. Afterwards, the user can perform a fourth setting operation based on the fourth interface to set the chords. Specifically, a chord refers to a group of sounds with a certain interval relationship; that is, three or more notes are combined vertically according to a third or non-third interval stacking relationship. Chords typically include triads (three-note chords), seventh chords (four-note chords), ninth chords (five-note chords), etc. Based on different chord implementations, a corresponding number of syllable components can be displayed in the fourth interface. By changing the syllable content corresponding to the syllable components based on the fourth setting operation, different syllable combinations can be achieved, thus realizing different chords. The specific display and settings of the fourth interface can be configured as needed; specific limitations are provided here.
[0121] Once the second arrangement is determined as the updated first arrangement, the process can return to step S204 to update the pre-generated music. In this embodiment, by responding to the fourth setting operation on the fourth interface, the chords are modified to obtain the third arrangement, thereby updating the pre-generated music, further improving the flexibility of the arrangement and meeting the user's personalized needs.
[0122] Step S208: In response to the second trigger operation, export the pre-generated music and generate the target music.
[0123] For example, after the above-described generation steps of at least one pre-generated music, the personalized pre-generated music that meets the user's needs is exported as data, for example through... Figure 12 The export component in the second interface shown will generate target music that can be played directly, such as MP3 or WAV format music files, thus realizing the music production process. Optionally, at the same time, it can further generate a music cover that matches the target music, such as an image or video that matches the background music of the target music, as the music cover, and publish the target application and the music cover. The specific implementation process will not be described in detail here.
[0124] In this embodiment, based on the automatically generated first editing template, the automatically selected editing template can be further modified according to the user's settings, adjusting the background music elements, chords and mixing coefficients to achieve more detailed background music settings, thereby generating a musical work that meets the user's personalized needs.
[0125] In this embodiment, the implementation of steps S201-202 is the same as that in this disclosure. Figure 2 The implementation methods of steps S101-S102 in the illustrated embodiment are the same, and will not be described in detail here.
[0126] Corresponding to the music generation method in the above embodiments, Figure 15 This is a structural block diagram of a music generation apparatus provided in an embodiment of the present disclosure. For ease of explanation, only the parts relevant to the embodiments of the present disclosure are shown.
[0127] Reference Figure 15 The music generation device 3 includes:
[0128] Input module 31 is used to acquire the initial audio;
[0129] Processing module 32 is used to obtain a first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with a target music style to the initial audio;
[0130] Arrangement module 33, based on the first arrangement template, processes the initial audio and generates the target music.
[0131] In one embodiment of this disclosure, the input module 31 is specifically used to: collect real-time voice data in response to a first trigger operation on the first interface; and generate initial audio based on the real-time voice data collected at different times after a preset condition is met; the input module 31 is also used to: display the waveform corresponding to the real-time voice data in the first interface in real time.
[0132] In one embodiment of this disclosure, before acquiring the initial audio, the input module 31 is further configured to: receive a first setting operation for a first setting component within a first interface, the first setting operation being used to set a voice effect of a target type; specifically, the input module 31 is configured to: perform sound acquisition in response to a first trigger operation to obtain the original speech; process the original speech to obtain the initial audio with the voice effect of the target type.
[0133] In one embodiment of this disclosure, the arrangement module 33 is specifically used for: obtaining a first arrangement with a target music style according to a first arrangement template; mixing the first arrangement and the initial audio to generate pre-generated music; and exporting the pre-generated music in response to a second trigger operation to generate the target music.
[0134] In one embodiment of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module 33 is further configured to: display, within a second interface, a first template identifier corresponding to the first arrangement template and a second template identifier corresponding to at least one alternative arrangement template, wherein the first template identifier and at least one second template identifier are arranged based on a target arrangement order, the target arrangement order being determined at least based on the first arrangement information of the initial audio, the first arrangement information representing the melodic features of the background music adapted to the initial audio; and display, within the second interface, the waveform corresponding to the pre-generated music.
[0135] In one embodiment of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module 33 is further configured to: display a third interface based on the target playback position of the pre-generated music, the third interface being used to display the background music elements of the first arrangement corresponding to the pre-generated music at the target playback position; obtain a second arrangement in response to a third setting operation on the third interface; and mix the second arrangement and the initial audio to obtain an updated pre-generated music.
[0136] In one embodiment of this disclosure, the third setting operation includes at least a first sub-operation and a second sub-operation executed sequentially. When the music arrangement module 33 obtains the second arrangement in response to the third setting operation on the third interface, it is specifically used to: in response to the first sub-operation on the target background music element, display at least two candidate element identifiers corresponding to the target background music element, wherein the candidate element identifiers represent the implementation method of the target background music element; in response to the second sub-operation on the target element identifier among the at least two candidate element identifiers, set the target background music element as the target implementation method; and obtain the second arrangement based on the target implementation method of the target background music element and the implementation methods corresponding to other background music elements.
[0137] In one embodiment of this disclosure, the background music elements include at least one of the following: instrumental sound effects, harmony sound effects, and main melody sound effects.
[0138] In one embodiment of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module 33 is further configured to: display a fourth interface based on the target playback position of the pre-generated music, the fourth interface being used to display the chords of the first arrangement corresponding to the pre-generated music at the target playback position; obtain a third arrangement in response to a fourth setting operation on the fourth interface; and mix the third arrangement and the initial audio to obtain an updated pre-generated music.
[0139] In one embodiment of this disclosure, before mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module 33 is further configured to: display a fifth interface, the fifth interface being used to set the mixing coefficients of the first arrangement and the initial audio, the mixing coefficients representing the respective volume values of the first arrangement and the initial audio when they are mixed; and obtain the target mixing coefficients in response to a fifth setting operation on the fifth interface; when mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module 33 is specifically configured to: mix the first arrangement and the initial audio based on the target mixing coefficients to generate pre-generated music.
[0140] In one embodiment of this disclosure, the processing module 32 is specifically used to: obtain first arrangement information of the initial audio, wherein the first arrangement information represents the melodic features of the background music adapted to the initial audio; and obtain a first arrangement template based on the first arrangement information.
[0141] In one embodiment of this disclosure, when the processing module 32 obtains the first arrangement information of the initial audio, it is specifically used to: obtain the speech rhythm of the initial audio based on the pitch changes of the initial audio; obtain the corresponding background music rhythm based on the speech rhythm of the initial audio; and obtain the first arrangement information based on the background music rhythm.
[0142] In one embodiment of this disclosure, when the processing module 32 obtains the first arrangement information of the initial audio, it is specifically used to: obtain second recording information in response to a second setting operation on the second setting component in the first interface, wherein the second recording information represents the beat of the background music and / or the playback speed of the initial audio; and obtain the first arrangement information based on the second recording information.
[0143] The input module 31, processing module 32, and music arrangement module 33 are connected in sequence. The music generation device 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0144] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 16 As shown, the electronic device 4 includes:
[0145] Processor 41, and memory 42 communicatively connected to processor 41;
[0146] Memory 42 stores instructions executed by the computer;
[0147] The processor 41 executes computer execution instructions stored in the memory 42 to achieve, for example, Figures 2-14 The music generation method in the illustrated embodiment.
[0148] Optionally, the processor 41 and the memory 42 are connected via a bus 43.
[0149] For relevant instructions, please refer to the corresponding text. Figures 2-14 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.
[0150] This disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement this disclosure. Figures 2-14 The music generation method provided in any of the corresponding embodiments.
[0151] This disclosure provides a computer program product, including a computer program that, when executed by a processor, implements as follows: Figures 2-14 The music generation method in the illustrated embodiment,
[0152] refer to Figure 17 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 17 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0153] like Figure 17 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0154] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 17 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0155] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0156] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0157] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0158] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0159] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0160] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0161] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0162] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0163] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0164] In a first aspect, according to one or more embodiments of this disclosure, a music generation method is provided, comprising:
[0165] Obtain initial audio; obtain a first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with a target music style to the initial audio; process the initial audio based on the first arrangement template to generate the target music.
[0166] According to one or more embodiments of this disclosure, obtaining the initial audio includes: in response to a first trigger operation on a first interface, acquiring real-time voice data; and after a preset condition is met, generating the initial audio based on the real-time voice data acquired at different times; the method further includes: displaying the waveform corresponding to the real-time voice data in the first interface in real time.
[0167] According to one or more embodiments of this disclosure, before acquiring the initial audio, the method further includes: receiving a first setting operation for a first setting component within a first interface, the first setting operation being used to set a voice effect of a target type; acquiring the initial audio includes: performing sound acquisition in response to a first triggering operation to obtain original speech; processing the original speech to obtain initial audio with the voice effect of the target type.
[0168] According to one or more embodiments of this disclosure, the step of processing the initial audio based on a first arrangement template to generate target music includes: obtaining a first arrangement having the target music style according to the first arrangement template; mixing the first arrangement and the initial audio to generate pre-generated music; and exporting the pre-generated music in response to a second trigger operation to generate the target music.
[0169] According to one or more embodiments of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the method further includes at least one of the following: displaying, in a second interface, a first template identifier corresponding to the first arrangement template and a second template identifier corresponding to at least one alternative arrangement template, wherein the first template identifier and at least one second template identifier are arranged based on a target arrangement order, the target arrangement order being determined at least based on the first arrangement information of the initial audio, the first arrangement information representing the melodic features of the background music adapted to the initial audio; and displaying, in the second interface, the waveform corresponding to the pre-generated music.
[0170] According to one or more embodiments of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the method further includes: displaying a third interface based on the target playback position of the pre-generated music, the third interface being used to display the background music elements of the first arrangement corresponding to the pre-generated music at the target playback position; obtaining a second arrangement in response to a third setting operation on the third interface; and mixing the second arrangement and the initial audio to obtain an updated pre-generated music.
[0171] According to one or more embodiments of this disclosure, the third setting operation includes at least a first sub-operation and a second sub-operation executed sequentially. The step of obtaining a second arrangement in response to the third setting operation on the third interface includes: in response to the first sub-operation on a target musical element, displaying at least two candidate element identifiers corresponding to the target musical element, the candidate element identifiers representing the implementation method of the target musical element; in response to the second sub-operation on a target element identifier among the at least two candidate element identifiers, setting the target musical element as the target implementation method; and obtaining the second arrangement based on the target implementation method of the target musical element and the implementation methods corresponding to other musical elements.
[0172] According to one or more embodiments of this disclosure, the musical elements include at least one of the following: instrumental sound effects, harmony sound effects, and melody sound effects.
[0173] According to one or more embodiments of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the method further includes: displaying a fourth interface based on the target playback position of the pre-generated music, the fourth interface being used to display the chords of the first arrangement corresponding to the pre-generated music at the target playback position; obtaining a third arrangement in response to a fourth setting operation on the fourth interface; and mixing the third arrangement and the initial audio to obtain an updated pre-generated music.
[0174] According to one or more embodiments of this disclosure, before mixing the first arrangement and the initial audio to generate pre-generated music, the method further includes: displaying a fifth interface, the fifth interface being used to set mixing coefficients for the first arrangement and the initial audio, the mixing coefficients representing the respective volume values of the first arrangement and the initial audio when they are mixed; obtaining target mixing coefficients in response to a fifth setting operation on the fifth interface; mixing the first arrangement and the initial audio to generate pre-generated music, including: mixing the first arrangement and the initial audio based on the target mixing coefficients to generate pre-generated music.
[0175] According to one or more embodiments of this disclosure, obtaining the first arrangement template corresponding to the initial audio includes: obtaining first arrangement information of the initial audio, wherein the first arrangement information characterizes the melodic features of the background music adapted to the initial audio; and obtaining the first arrangement template based on the first arrangement information.
[0176] According to one or more embodiments of this disclosure, obtaining the first arrangement information of the initial audio includes: obtaining the speech rhythm of the initial audio based on the pitch changes of the initial audio; obtaining the corresponding background music rhythm based on the speech rhythm of the initial audio; and obtaining the first arrangement information based on the background music rhythm.
[0177] According to one or more embodiments of this disclosure, obtaining the first arrangement information of the initial audio includes: in response to a second setting operation on a second setting component within a first interface, obtaining second recording information, wherein the second recording information characterizes the beat of the background music and / or the playback speed of the initial audio;
[0178] The first arrangement information is obtained based on the second recording information.
[0179] Secondly, according to one or more embodiments of this disclosure, a music generation apparatus is provided, comprising:
[0180] The input module is used to acquire the initial audio.
[0181] The processing module is used to obtain a first arrangement template corresponding to the initial audio, wherein the first arrangement template is used to add background music with a target music style to the initial audio;
[0182] The music arrangement module processes the initial audio based on the first music arrangement template to generate the target music.
[0183] According to one or more embodiments of this disclosure, the input module is specifically configured to: collect real-time voice data in response to a first trigger operation within the first interface; and generate the initial audio based on the real-time voice data collected at different times after a preset condition is met; the input module 31 is further configured to: display the waveform corresponding to the real-time voice data in the first interface in real time.
[0184] According to one or more embodiments of this disclosure, before acquiring the initial audio, the input module is further configured to: receive a first setting operation for a first setting component within a first interface, the first setting operation being used to set a voice effect of a target type; the input module is specifically configured to: perform sound acquisition in response to a first trigger operation to obtain original speech; process the original speech to obtain initial audio with the voice effect of the target type.
[0185] According to one or more embodiments of this disclosure, the music arrangement module is specifically configured to: obtain a first arrangement having the target music style according to the first music arrangement template; mix the first arrangement and the initial audio to generate pre-generated music; and export the pre-generated music in response to a second trigger operation to generate the target music.
[0186] According to one or more embodiments of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module is further configured to: display, in a second interface, a first template identifier corresponding to the first arrangement template and a second template identifier corresponding to at least one alternative arrangement template, wherein the first template identifier and at least one second template identifier are arranged based on a target arrangement order, the target arrangement order being determined at least based on the first arrangement information of the initial audio, the first arrangement information representing the melodic features of the background music adapted to the initial audio; and display, in the second interface, the waveform corresponding to the pre-generated music.
[0187] According to one or more embodiments of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module is further configured to: display a third interface based on the target playback position of the pre-generated music, the third interface being used to display the background music elements of the first arrangement corresponding to the pre-generated music at the target playback position; obtain a second arrangement in response to a third setting operation on the third interface; and mix the second arrangement and the initial audio to obtain an updated pre-generated music.
[0188] According to one or more embodiments of this disclosure, the third setting operation includes at least a first sub-operation and a second sub-operation executed sequentially. When the music arrangement module obtains a second arrangement in response to the third setting operation on the third interface, it is specifically configured to: in response to the first sub-operation on the target music element, display at least two candidate element identifiers corresponding to the target music element, the candidate element identifiers representing the implementation method of the target music element; in response to the second sub-operation on the target element identifier among the at least two candidate element identifiers, set the target music element as the target implementation method; and obtain the second arrangement based on the target implementation method of the target music element and the implementation methods corresponding to other music elements.
[0189] According to one or more embodiments of this disclosure, the musical elements include at least one of the following: instrumental sound effects, harmony sound effects, and melody sound effects.
[0190] According to one or more embodiments of this disclosure, after mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module is further configured to: display a fourth interface based on the target playback position of the pre-generated music, the fourth interface being used to display the chords of the first arrangement corresponding to the pre-generated music at the target playback position; obtain a third arrangement in response to a fourth setting operation on the fourth interface; and mix the third arrangement and the initial audio to obtain an updated pre-generated music.
[0191] According to one or more embodiments of this disclosure, before mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module is further configured to: display a fifth interface, the fifth interface being used to set the mixing coefficients of the first arrangement and the initial audio, the mixing coefficients representing the respective volume values of the first arrangement and the initial audio when they are mixed; and obtain a target mixing coefficient in response to a fifth setting operation on the fifth interface; when mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module is specifically configured to: mix the first arrangement and the initial audio based on the target mixing coefficients to generate pre-generated music.
[0192] According to one or more embodiments of this disclosure, the processing module is specifically configured to: obtain first arrangement information of the initial audio, wherein the first arrangement information characterizes the melodic features of the background music adapted to the initial audio; and obtain the first arrangement template based on the first arrangement information.
[0193] According to one or more embodiments of this disclosure, when the processing module obtains the first arrangement information of the initial audio, it is specifically used to: obtain the speech rhythm of the initial audio based on the pitch changes of the initial audio; obtain the corresponding background music rhythm based on the speech rhythm of the initial audio; and obtain the first arrangement information based on the background music rhythm.
[0194] According to one or more embodiments of this disclosure, when the processing module obtains the first arrangement information of the initial audio, it is specifically configured to: obtain second recording information in response to a second setting operation on a second setting component within a first interface, wherein the second recording information characterizes the beat of the background music and / or the playback speed of the initial audio; and obtain the first arrangement information based on the second recording information.
[0195] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, including: a processor, and a memory communicatively connected to the processor;
[0196] The memory stores computer-executed instructions;
[0197] The processor executes computer execution instructions stored in the memory to implement the music generation method described in the first aspect and various possible designs of the first aspect.
[0198] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, implement the music generation method described in the first aspect and various possible designs of the first aspect.
[0199] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the music generation method as described in the first aspect and various possible designs of the first aspect.
[0200] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0201] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0202] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for generating music, characterized in that, include: Receive a first setting operation for a first setting component within a first interface, the first setting operation being used to set a voice effect of a target type; wherein, the voice effect type is represented by a music type; The system performs sound acquisition in response to the first trigger operation, obtaining the original speech. The original speech is processed to obtain an initial audio with the target type of human voice effect; Based on the pitch changes of the initial audio, the speech rhythm of the initial audio is obtained; based on the speech rhythm of the initial audio, the corresponding background music rhythm is obtained; based on the background music rhythm, first arrangement information is obtained, the first arrangement information characterizes the melodic features of the background music adapted to the initial audio; based on the first arrangement information, a first arrangement template is obtained, wherein the first arrangement template is used to add background music with a target music style to the initial audio; Based on the first arrangement template, a first arrangement with the target music style is obtained; The fifth interface is displayed, which is used to set the mixing coefficients of the first arrangement and the initial audio. The mixing coefficients represent the volume values of the first arrangement and the initial audio when they are mixed. In response to the fifth setting operation for the fifth interface, the target mixing coefficient is obtained; The first arrangement and the initial audio are mixed based on the target mixing coefficients to generate pre-generated music; Within the second interface, a first template identifier corresponding to the first arrangement template and a second template identifier corresponding to at least one alternative arrangement template are displayed. The first template identifier and at least one second template identifier are arranged based on a target arrangement order, which is determined at least based on the first arrangement information of the initial audio. The first arrangement information represents the melodic features of the background music adapted to the initial audio. In response to the selection operation for the alternative arrangement template, an updated first arrangement is generated, and the updated first arrangement is mixed with the initial audio to obtain an updated pre-generated music. The method further includes: Based on the target playback position of the pre-generated music, a third interface is displayed. The third interface is used to display the background music elements of the first arrangement corresponding to the pre-generated music at the target playback position. The background music elements include at least one of instrument sound effects, harmony sound effects, and melody sound effects. In response to a third setting operation on the third interface, a second arrangement is obtained; wherein the third setting operation includes: in response to a first sub-operation on a target background music element, displaying at least two candidate element identifiers corresponding to the target background music element; in response to a second sub-operation on a target element identifier among the at least two candidate element identifiers, setting the target background music element as the target implementation mode; Based on the second arrangement and the initial audio, the music is mixed to obtain the updated pre-generated music; In response to the second triggering operation, the pre-generated music, which has been updated at least once, is exported to generate the target music.
2. The method according to claim 1, characterized in that, The process of acquiring sound in response to a first trigger operation to obtain the original speech includes: In response to the first triggered operation within the first interface, real-time voice data is collected; After the preset conditions are met, the initial audio is generated based on the real-time voice data collected at different times. The method further includes: The waveform corresponding to the real-time voice data is displayed in the first interface in real time.
3. The method according to claim 1, characterized in that, Before generating the target music, the method further includes: The pre-generated music is edited to obtain the updated pre-generated music.
4. The method according to claim 3, characterized in that, After mixing the first arrangement and the initial audio to generate pre-generated music, the process further includes: The second interface displays the waveform corresponding to the pre-generated music.
5. The method according to claim 3, characterized in that, The third setting operation includes at least a first sub-operation and a second sub-operation executed sequentially. The step of obtaining the second arrangement in response to the third setting operation on the third interface includes: In response to a first sub-operation on a target soundtrack element, at least two candidate element identifiers corresponding to the target soundtrack element are displayed, wherein the candidate element identifiers represent the implementation of the target soundtrack element; In response to a second sub-operation on the target element identifier among the at least two candidate element identifiers, the target soundtrack element is set as the target implementation. The second arrangement is obtained based on the target implementation method of the target musical element and the corresponding implementation methods of other musical elements.
6. The method according to claim 3, characterized in that, After mixing the first arrangement and the initial audio to generate pre-generated music, the process further includes: Based on the target playback position of the pre-generated music, a fourth interface is displayed, which is used to display the chords of the first arrangement corresponding to the pre-generated music at the target playback position. In response to the fourth setting operation for the fourth interface, a third arrangement is obtained; The third arrangement and the initial audio are mixed to obtain the updated pre-generated music.
7. A music generation device, characterized in that, include: The input module is configured to receive a first setting operation for a first setting component within a first interface, the first setting operation being used to set a voice effect of a target type; wherein the voice effect type is represented by a music type; in response to a first trigger operation, sound is captured to obtain original speech; the original speech is processed to obtain initial audio with the voice effect of the target type; The processing module is configured to: obtain the speech rhythm of the initial audio based on the pitch changes of the initial audio; obtain the corresponding background music rhythm based on the speech rhythm of the initial audio; obtain first arrangement information based on the background music rhythm, wherein the first arrangement information characterizes the melodic features of the background music adapted to the initial audio; and obtain a first arrangement template based on the first arrangement information, wherein the first arrangement template is used to add background music with a target music style to the initial audio. The arrangement module is used to obtain a first arrangement with the target music style based on the first arrangement template; display a fifth interface, which is used to set the mixing coefficients of the first arrangement and the initial audio, the mixing coefficients representing the respective volume values of the first arrangement and the initial audio when they are mixed; obtain the target mixing coefficients in response to a fifth setting operation on the fifth interface; mix the first arrangement and the initial audio based on the target mixing coefficients to generate pre-generated music; and export the pre-generated music after at least one update in response to a second trigger operation to generate the target music. After mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module is further configured to display, in a second interface, a first template identifier corresponding to the first arrangement template and a second template identifier corresponding to at least one alternative arrangement template, wherein the first template identifier and at least one second template identifier are arranged based on a target arrangement order, the target arrangement order being determined at least based on the first arrangement information of the initial audio, the first arrangement information representing the melodic features of the background music adapted to the initial audio; in response to the selection operation for the alternative arrangement template, an updated first arrangement is generated, and the updated first arrangement is mixed with the initial audio to obtain the updated pre-generated music; After mixing the first arrangement and the initial audio to generate pre-generated music, the arrangement module is further configured to display a third interface based on the target playback position of the pre-generated music. The third interface is used to display the background music elements of the first arrangement corresponding to the pre-generated music at the target playback position. The background music elements include at least one of instrument sound effects, harmony sound effects, and melody sound effects. In response to a third setting operation on the third interface, a second arrangement is obtained. The third setting operation includes: in response to a first sub-operation on the target background music element, displaying at least two candidate element identifiers corresponding to the target background music element; in response to a second sub-operation on the target element identifier among the at least two candidate element identifiers, setting the target background music element as the target implementation mode; and mixing the second arrangement and the initial audio to obtain an updated pre-generated music.
8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the music generation method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the music generation method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the music generation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Soundtrack method, mobile terminal, data processing method and soundtrack system
CN110634465A
Audio social voice changing method and device
CN112863466A
Audio determination method and device, electronic equipment and storage medium
CN115831080A