Meditation music generation method, device, equipment and storage medium
By analyzing multiple parameters in the meditation music generation request, determining the corresponding models and parameters, and generating meditation music audio files, the problem of insufficient flexibility and freedom in the meditation music generation method in the prior art is solved, and more flexible meditation music generation is achieved.
Patent Information
- Application Number
- CN202110301208.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-22
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-03-22
AI Technical Summary
The existing meditation music generation methods have low flexibility and freedom, making it difficult to adapt to the needs of different themes or scenes.
By obtaining the music generation request, parse the theme parameters, rhythm parameters, pitch parameters and tone parameters in the request, determine the corresponding rhythm generation model, pitch generation model, startup parameters, tone codebook and rendering function, and generate a meditation music audio file.
It improves the flexibility and freedom of the meditation music model to generate meditation music, and can adapt more flexibly to the needs of different themes and scenes.
Smart Images

Figure CN113032615B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a meditation music method, device, equipment and storage medium. Background Art
[0002] In recent years, meditation has become one of the important ways for people to relieve work pressure and soothe their spirits. High-quality meditation can bring great sublimation to the soul, and meditation music is an important medium to help people perform high-quality meditation.
[0003] At present, the generation of meditation music is still in the exploratory stage. Because meditation music is out of the scope of music recognized by the public and there is a lack of a clear definition of the style concept of meditation music, the existing methods of generating meditation music are mostly based on specific themes or training specific meditation music generation models based on specific scenarios. This model is not suitable for other themes or application scenarios, resulting in low flexibility and freedom in generating meditation music. Summary of the invention
[0004] The present invention provides a meditation music generation method, device, equipment and storage medium, which improves the flexibility and freedom of a meditation music model in generating meditation music.
[0005] A first aspect of the present invention provides a method for generating meditation music, comprising: obtaining a music generation request, wherein the music generation request is a scene request or a theme request; parsing the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters; determining a rhythm generation model, a pitch generation model, a rhythm generation model startup parameters, a pitch generation model startup parameters, a timbre code book and a rendering function according to the theme parameters, the rhythm parameters, the pitch parameters and the timbre parameters, wherein the timbre code book is a timbre code; generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre code book and the rendering function.
[0006] Optionally, in a first implementation method of the first aspect of the present invention, parsing the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters includes: parsing the music generation request to obtain theme parameters; reading theme attributes corresponding to the theme parameters, and performing parameter parsing in combination with the music generation request to obtain rhythm parameters, pitch parameters and timbre parameters.
[0007] Optionally, in a second implementation manner of the first aspect of the present invention, the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre code book and the rendering function are determined according to the theme parameters, the rhythm parameters, the pitch parameters and the timbre parameters, and the timbre code book for timbre encoding includes: based on a preset rhythm generation model mapping function, determining the rhythm generation model corresponding to the theme parameters in a preset rhythm generation model library; based on a preset pitch generation model mapping function, determining the pitch generation model corresponding to the theme parameters in a preset pitch generation model library; based on a preset rhythm startup mapping function, determining the rhythm generation model startup parameters corresponding to the rhythm parameters in a preset rhythm startup parameter set; based on a preset pitch startup mapping function, determining the pitch rhythm generation model startup parameters corresponding to the pitch parameters in a preset pitch startup parameter set; based on a preset timbre code book mapping function, determining the timbre code book and rendering function corresponding to the timbre parameters in a preset timbre coding table.
[0008] Optionally, in a third implementation method of the first aspect of the present invention, generating a meditation music audio file based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre code book and the rendering function includes: generating a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters and the pitch generation model startup parameters; generating audio data based on the music melody and the timbre code book, and rendering the audio data using the rendering function to obtain a meditation music audio file.
[0009] Optionally, in a fourth implementation method of the first aspect of the present invention, generating a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters and the pitch generation model startup parameters includes: inputting the rhythm generation model startup parameters into the rhythm generation model to generate a rhythm sequence; inputting the rhythm sequence and the pitch generation model startup parameters into the pitch generation model to generate a pitch sequence; and splicing the rhythm sequence and the pitch sequence according to a preset time sequence to obtain a music melody.
[0010] Optionally, in a fifth implementation manner of the first aspect of the present invention, the audio data is generated based on the music melody and the timbre code book, and the audio data is rendered using the rendering function to obtain a meditation music audio file, including: based on a preset timbre material mapping function and the timbre code book, determining a corresponding timbre material for each note in the music melody to obtain a plurality of timbre materials; adding the plurality of timbre materials to the music melody in sequence according to a preset time series to obtain audio data; and using the rendering function to add a preset convolution sound effect algorithm to the audio data to obtain a meditation music audio file.
[0011] Optionally, in a sixth implementation manner of the first aspect of the present invention, before obtaining the music generation request, which is a scene request or a theme request, the meditation music generation method includes: constructing a rhythm generation model library, a pitch generation model library, a timbre material library, a rhythm generation model mapping function, a pitch generation model mapping function, a timbre material mapping function, a rhythm start parameter mapping function and a pitch start mapping function.
[0012] A second aspect of the present invention provides a meditation music generation device, comprising: an acquisition module, used to obtain a music generation request, the music generation request being a scene request or a theme request; a parsing module, used to parse the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters; a determination module, used to determine a rhythm generation model, a pitch generation model, a rhythm generation model startup parameters, a pitch generation model startup parameters, a timbre code book and a rendering function according to the theme parameters, the rhythm parameters, the pitch parameters and the timbre parameters, the timbre code book being timbre coding; a generation module, used to generate a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre code book and the rendering function.
[0013] Optionally, in the first implementation method of the second aspect of the present invention, the analysis module can also be specifically used to: parse the music generation request to obtain theme parameters; read the theme attributes corresponding to the theme parameters, and perform parameter analysis in combination with the music generation request to obtain rhythm parameters, pitch parameters and timbre parameters.
[0014] Optionally, in a second implementation method of the second aspect of the present invention, the determination module can also be specifically used to: determine the rhythm generation model corresponding to the theme parameters in a preset rhythm generation model library based on a preset rhythm generation model mapping function; determine the pitch generation model corresponding to the theme parameters in a preset pitch generation model library based on a preset pitch generation model mapping function; determine the rhythm generation model start parameters corresponding to the rhythm parameters in a preset rhythm start parameter set based on a preset rhythm start mapping function; determine the pitch rhythm generation model start parameters corresponding to the pitch parameters in a preset pitch start parameter set based on a preset pitch start mapping function; determine the timbre code book and rendering function corresponding to the timbre parameters in a preset timbre coding table based on a preset timbre code book mapping function.
[0015] Optionally, in a third implementation method of the second aspect of the present invention, the generation module includes: a music melody generation unit, used to generate a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters and the pitch generation model startup parameters; a music audio file generation unit, used to generate audio data based on the music melody and the timbre code book, and render the audio data using the rendering function to obtain a meditation music audio file.
[0016] Optionally, in a fourth implementation method of the second aspect of the present invention, the music melody generation unit is specifically used to: input the rhythm generation model startup parameters into the rhythm generation model to generate a rhythm sequence; input the rhythm sequence and the pitch generation model startup parameters into the pitch generation model to generate a pitch sequence; and splice the rhythm sequence and the pitch sequence according to a preset time sequence to obtain a music melody.
[0017] Optionally, in a fifth implementation manner of the second aspect of the present invention, the music audio file generation unit is specifically used to: determine the corresponding timbre material for each note in the music melody based on a preset timbre material mapping function and the timbre code book, to obtain a plurality of timbre materials; add the plurality of timbre materials to the music melody in sequence according to a preset time series, to obtain audio data; and use the rendering function to add a preset convolution sound effect algorithm to the audio data, to obtain a meditation music audio file.
[0018] Optionally, in a fifth implementation of the second aspect of the present invention, the meditation music generating device further includes: a construction module for constructing a rhythm generation model library, a pitch generation model library, a timbre material library, a rhythm generation model mapping function, a pitch generation model mapping function, a timbre material mapping function, a rhythm start parameter mapping function and a pitch start mapping function.
[0019] A third aspect of the present invention provides a meditation music generating device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; the at least one processor calls the instructions in the memory so that the meditation music generating device executes the above-mentioned meditation music generating method.
[0020] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, enable the computer to execute the above-mentioned method for generating meditation music.
[0021] In the technical solution provided by the present invention, a music generation request is obtained, and the music generation request is a scene request or a theme request; the music generation request is parsed to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters; a rhythm generation model, a pitch generation model, a rhythm generation model startup parameters, a pitch generation model startup parameters, a timbre codebook and a rendering function are determined according to the theme parameters, the rhythm parameters, the pitch parameters and the timbre parameters, and the timbre codebook is a timbre code; a meditation music audio file is generated according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre codebook and the rendering function. In an embodiment of the present invention, the corresponding rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre codebook and the rendering function are determined by the theme parameters, the rhythm parameters, the pitch parameters and the timbre parameters, and a meditation music audio file is generated based on the model, the parameters and the rendering function, thereby improving the flexibility and freedom of generating meditation music based on the meditation music model. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 Schematic diagram of an embodiment of a method for generating meditation music in an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of another embodiment of a method for generating meditation music in an embodiment of the present invention;
[0024] Figure 3 Schematic diagram of an embodiment of a device for generating meditation music in an embodiment of the present invention;
[0025] Figure 4 It is a schematic diagram of another embodiment of a device for generating meditation music in an embodiment of the present invention;
[0026] Figure 5 Schematic diagram of an embodiment of a meditation music generating device in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] Embodiments of the present invention provide a meditation music generation method, apparatus, device and storage medium, which are used to improve the flexibility and freedom of generating meditation music based on a meditation music model.
[0028] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the method for generating meditation music in the embodiment of the present invention includes:
[0030] 101. Obtain a music generation request, where the music generation request is a scene request or a theme request;
[0031] The server obtains a music generation request for a scene request or a theme request.
[0032] The music generation request may be a scene request of ethnic music style, such as generating music with Mongolian style and generating music with Tibetan style; the music generation request may also be a theme request such as yoga, meditation, etc., such as generating yoga meditation music or generating Buddhist meditation music.
[0033] It is understandable that the execution subject of the present invention may be a meditation music generating device, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking the server as the execution subject as an example.
[0034] 102. Parse the music generation request to obtain theme parameters, rhythm parameters, pitch parameters, and timbre parameters;
[0035] The server parses the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters.
[0036] For example, if the music generation request is to generate yoga meditation music, the server parses and generates yoga meditation music to obtain theme parameter α, rhythm parameter β, pitch parameter σ, and timbre parameter δ. The theme parameter α is used to control the loading of the rhythm generation model and the pitch generation model, the rhythm parameter β is used to construct the rhythm sequence, the pitch parameter σ is used to generate the pitch sequence, and the timbre parameter δ is used to generate the timbre codebook.
[0037] It should be noted that music with different themes has specific rhythm parameters, pitch parameters and timbre parameters.
[0038] 103. Determine a rhythm generation model, a pitch generation model, a rhythm generation model startup parameter, a pitch generation model startup parameter, a timbre codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the timbre parameter, wherein the timbre codebook is a timbre code;
[0039] The server determines the corresponding rhythm generation model, pitch generation model, rhythm generation model startup parameters, pitch generation model startup parameters, timbre code book and rendering function based on the theme parameters, rhythm parameters, pitch parameters and timbre parameters. The timbre code book is the timbre code.
[0040] After parsing and obtaining the theme parameters, rhythm parameters, pitch parameters and timbre parameters, the server determines the rhythm generation model in the preset rhythm generation model library, determines the pitch generation model in the preset pitch generation model library, determines the rhythm generation model startup parameters in the preset rhythm startup parameter set, determines the pitch generation model startup parameters in the preset pitch startup set, and determines the timbre code book and rendering function in the timbre coding table.
[0041] 104. Generate a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre codebook and the rendering function.
[0042] The server processes the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre code book and the rendering function. The timbre code book is the timbre encoding to generate a meditation music audio file.
[0043] It should be noted that the meditation music audio file is a musical instrument digital interface (MIDI) file. In the process of generating the meditation music audio file in this embodiment, a melody file is first generated, then timbre is added to the melody file to generate an audio file, and finally the audio file is rendered to obtain the meditation music audio file.
[0044] In an embodiment of the present invention, the corresponding rhythm generation model, pitch generation model, rhythm generation model startup parameters, pitch generation model startup parameters, timbre code book and rendering function are determined through theme parameters, rhythm parameters, pitch parameters and timbre parameters, and a meditation music audio file is generated based on the model, parameters and rendering function, thereby improving the flexibility and freedom of generating meditation music based on the meditation music model.
[0045] See also Figure 2 Another embodiment of the method for generating meditation music in the embodiment of the present invention includes:
[0046] 201. Construct a rhythm generation model library, a pitch generation model library, a timbre material library, a rhythm generation model mapping function, a pitch generation model mapping function, a timbre material mapping function, a rhythm start parameter mapping function, and a pitch start mapping function;
[0047] The server integrates the rhythm characteristics of different theme music, which are specifically manifested as the duration weight of the notes and the weight of the proportion of notes of different durations in different measures or paragraphs. The integrated rhythm characteristics are then input into the fitness function of the preset genetic algorithm to generate a rhythm, and the rhythm is used as a rhythm generation model. According to this method, multiple rhythm generation models are obtained, thereby obtaining a rhythm generation model library. The rhythm generation model library can be expressed as: Rhy = {r i |i=1,2,…,m}, where r i represents the rhythm generation model, and m represents the number of rhythm generation models in the rhythm generation model library. The server trains the model by using two bidirectional training networks to form an adversarial generative neural network for different theme music styles, and obtains multiple pitch generation models, thereby obtaining a rhythm generation model library. The pitch generation model library can be expressed as: Pit = {p j |j=1,2,…,n}, where p j represents the pitch generation model, and n represents the number of pitch generation models in the pitch generation model library. The server starts from the existing music material files according to the music characteristics of different theme music, and adjusts and modifies them through the built-in timbre production plug-in in the music production software Logic Pro X to obtain timbre materials under different themes, thereby obtaining a timbre material library, specifically: Tim = {t k |k=1,2,…,o}, where t k is the timbre material, and o is the number of materials in the timbre material library.
[0048] The server then constructs a mapping function from the theme parameters to each rhythm generation model to obtain the rhythm generation model mapping function R; constructs a mapping function from the theme parameters to each pitch generation model to obtain the pitch generation model mapping function P; constructs a mapping function from the timbre code book to each music material to obtain the timbre material mapping function T; constructs a mapping function from the rhythm parameters to the startup parameters of each rhythm generation model to obtain the rhythm startup parameter mapping function F; and constructs a mapping function from the pitch parameters to the startup parameters of each pitch generation model to obtain the pitch startup parameter mapping function G.
[0049] 202. Obtain a music generation request, where the music generation request is a scene request or a theme request;
[0050] The server obtains a music generation request for a scene request or a theme request.
[0051] The music generation request may be a scene request of ethnic music style, such as generating music with Mongolian style and generating music with Tibetan style; the music generation request may also be a theme request such as yoga, meditation, etc., such as generating yoga meditation music or generating Buddhist meditation music.
[0052] 203. Parse the music generation request to obtain theme parameters, rhythm parameters, pitch parameters, and timbre parameters;
[0053] The server parses the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters.
[0054] For example, if the music generation request is to generate yoga meditation music, the server parses and generates yoga meditation music to obtain theme parameter α, rhythm parameter β, pitch parameter σ, and timbre parameter δ. The theme parameter α is used to control the loading of the rhythm generation model and the pitch generation model, the rhythm parameter β is used to construct the rhythm sequence, the pitch parameter σ is used to generate the pitch sequence, and the timbre parameter δ is used to generate the timbre codebook.
[0055] It should be noted that music with different themes has specific rhythm parameters, pitch parameters and timbre parameters.
[0056] Specifically, the music generation request is parsed to obtain theme parameters; theme attributes corresponding to the theme parameters are read, and the parameters are parsed in combination with the music generation request to obtain rhythm parameters, pitch parameters, and timbre parameters.
[0057] The server parses the music generation request and first obtains the theme parameters. For example, the music generation request is to generate yoga meditation music, and the theme parameter corresponding to the generated yoga meditation music is α1. The server combines the theme characteristics of the theme parameter α1 with the generated yoga meditation music to parse and obtain the rhythm parameter β1, pitch parameter σ1 and timbre parameter δ1.
[0058] It should be noted that, since the pitch, rhythm and timbre of yoga-themed meditation music are relatively stable compared to other folk music, the rhythm parameters, pitch parameters and timbre parameters can be determined by combining the theme characteristics of the theme parameters.
[0059] 204. Determine a rhythm generation model, a pitch generation model, a rhythm generation model startup parameter, a pitch generation model startup parameter, a timbre codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the timbre parameter, wherein the timbre codebook is a timbre code;
[0060] The server determines the corresponding rhythm generation model, pitch generation model, rhythm generation model startup parameters, pitch generation model startup parameters, timbre code book and rendering function based on the theme parameters, rhythm parameters, pitch parameters and timbre parameters. The timbre code book is the timbre code.
[0061] After parsing and obtaining the theme parameters, rhythm parameters, pitch parameters and timbre parameters, the server determines the rhythm generation model in the preset rhythm generation model library, determines the pitch generation model in the preset pitch generation model library, determines the rhythm generation model startup parameters in the preset rhythm startup parameter set, determines the pitch generation model startup parameters in the preset pitch startup set, and determines the timbre code book and rendering function in the preset timbre coding table.
[0062] Specifically, the server determines the rhythm generation model corresponding to the theme parameters in a preset rhythm generation model library based on a preset rhythm generation model mapping function; determines the pitch generation model corresponding to the theme parameters in a preset pitch generation model library based on a preset pitch generation model mapping function; determines the rhythm generation model start parameters corresponding to the rhythm parameters in a preset rhythm start parameter set based on a preset rhythm start mapping function; determines the pitch rhythm generation model start parameters corresponding to the pitch parameters in a preset pitch start parameter set based on a preset pitch start mapping function; determines the timbre code book and rendering function corresponding to the timbre parameters in a preset timbre coding table based on a preset timbre code book mapping function.
[0063] Using the example of step 203, the server generates a rhythm model mapping function R in the preset rhythm generation model library Rhy={r i |i=1,2,…,m}, the rhythm generation model r1=R(α1) is determined, and the rhythm generation model matches the theme parameters; based on the preset pitch generation model mapping function P, in the preset pitch generation model library Pit={p j|j=1,2,…,n}, the pitch generation model is determined to be p1=P(α1), and the pitch generation model matches the theme parameters; based on the preset rhythm start parameter mapping function F, the rhythm generation model start parameter x1=F(β1) is determined in the rhythm start parameter set, and the rhythm generation model start parameter matches the rhythm parameter; based on the preset pitch start parameter mapping function G, the pitch generation model start parameter y1=G(σ1) is determined in the pitch start parameter set, and the rhythm generation model start parameter matches the rhythm parameter; the server determines the timbre code book as b1=T(δ1) and the rendering function E1 in the preset timbre coding table based on the preset timbre code book mapping function, wherein the timbre code book matches the rendering function and the timbre parameters.
[0064] 205. Generate a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre codebook and the rendering function.
[0065] The server processes the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre codebook and the rendering function to generate a meditation music audio file, and the timbre codebook is the timbre encoding.
[0066] It should be noted that the meditation music audio file is a musical instrument digital interface MIDI file. In the process of generating the meditation music audio file in this embodiment, a melody file is first generated, then timbre is added to the melody file to generate an audio file, and finally the audio file is rendered to obtain the meditation music audio file.
[0067] Specifically, the server generates a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters and the pitch generation model startup parameters; the server generates audio data based on the music melody and the timbre code book, and uses a rendering function to render the audio data to obtain a meditation music audio file.
[0068] It should be noted that after obtaining the music melody, the server also needs to add timbre materials to the music melody and render the music melody based on the timbre code book and rendering function, and finally obtain the meditation music audio file as a MIDI file.
[0069] The specific process of generating a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters and the pitch generation model startup parameters is as follows:
[0070] The server inputs the rhythm generation model startup parameters into the rhythm generation model to generate a rhythm sequence; then the server inputs the rhythm sequence and the pitch generation model startup parameters into the pitch generation model to generate a pitch sequence; the server splices the rhythm sequence and the pitch sequence according to a preset time sequence to obtain a music melody.
[0071] The server inputs the rhythm generation model startup parameter x1 into the rhythm generation model to generate a rhythm sequence u=r i (x1),u={u1,u2…u l,}, where u={u1,u2,…u l ,} can be regarded as a collection of time series, l is the number of notes in the rhythm sequence. Then the sequence and the pitch generation model startup parameter y1 are input into the pitch generation model to generate the pitch sequence: v = p i (u,y1),v={v1,v2,…v l ,}, where v={v1,v2,…v l ,} represents a set of note sequences. The server concatenates the pitch sequence and rhythm sequence according to the time sequence to obtain the music melody.
[0072] The specific process of generating audio data based on the music melody and timbre codebook and rendering the audio data using the rendering function to obtain the meditation music audio file is as follows:
[0073] Based on a preset timbre material mapping function and a timbre code book, the server determines the corresponding timbre material for each note in the music melody, and obtains multiple timbre materials; the server adds the multiple timbre materials to the music melody in sequence according to a preset time sequence, and obtains audio data; the server uses a rendering function to add a preset convolution sound effect algorithm to the audio data, and obtains a meditation music audio file.
[0074] The server calls the timbre material mapping function T based on the timbre code book in the timbre material library Tim = {t k |k=1,2,…,o} and searches for the timbre material set corresponding to the timbre code book. Since the timbre code book corresponds to the note sequence, the server obtains the timbre material corresponding to each note. Based on the time series, the server adds multiple music materials to the music melody in sequence to obtain audio data. Finally, the server calls the rendering function and applies a convolution sound effect algorithm of a convolution operation to the audio to obtain a meditation music audio file.
[0075] In an embodiment of the present invention, the corresponding rhythm generation model, pitch generation model, rhythm generation model startup parameters, pitch generation model startup parameters, timbre code book and rendering function are determined through theme parameters, rhythm parameters, pitch parameters and timbre parameters, and a meditation music audio file is generated based on the model, parameters and rendering function, thereby improving the flexibility and freedom of generating meditation music based on the meditation music model.
[0076] The above describes the method for generating meditation music in the embodiment of the present invention. The following describes the device for generating meditation music in the embodiment of the present invention. Figure 3 In one embodiment of the present invention, a device for generating meditation music includes:
[0077] An acquisition module 301 is used for acquiring a music generation request, where the music generation request is a scene request or a theme request;
[0078] The parsing module 302 is used to parse the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters;
[0079] A determination module 303 is used to determine a rhythm generation model, a pitch generation model, a rhythm generation model startup parameter, a pitch generation model startup parameter, a timbre codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the timbre parameter, wherein the timbre codebook is a timbre code;
[0080] The generation module 304 is used to generate a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre codebook and the rendering function.
[0081] In an embodiment of the present invention, the corresponding rhythm generation model, pitch generation model, rhythm generation model startup parameters, pitch generation model startup parameters, timbre code book and rendering function are determined through theme parameters, rhythm parameters, pitch parameters and timbre parameters, and a meditation music audio file is generated based on the model, parameters and rendering function, thereby improving the flexibility and freedom of generating meditation music based on the meditation music model.
[0082] See also Figure 4 Another embodiment of the device for generating meditation music in the embodiment of the present invention includes:
[0083] An acquisition module 301 is used for acquiring a music generation request, where the music generation request is a scene request or a theme request;
[0084] The parsing module 302 is used to parse the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters;
[0085] A determination module 303 is used to determine a rhythm generation model, a pitch generation model, a rhythm generation model startup parameter, a pitch generation model startup parameter, a timbre codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the timbre parameter, wherein the timbre codebook is a timbre code;
[0086] The generation module 304 is used to generate a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre codebook and the rendering function.
[0087] Optionally, the parsing module 302 may also be specifically used for:
[0088] Parsing the music generation request to obtain theme parameters;
[0089] The theme attributes corresponding to the theme parameters are read, and the parameters are parsed in combination with the music generation request to obtain rhythm parameters, pitch parameters and timbre parameters.
[0090] Optionally, the determination module 303 may also be specifically configured to:
[0091] Based on a preset rhythm generation model mapping function, determining a rhythm generation model corresponding to the theme parameter in a preset rhythm generation model library;
[0092] Based on a preset pitch generation model mapping function, determining a pitch generation model corresponding to the theme parameter in a preset pitch generation model library;
[0093] Based on a preset rhythm start mapping function, determining a rhythm generation model start parameter corresponding to the rhythm parameter in a preset rhythm start parameter set;
[0094] Based on a preset pitch start mapping function, determining a pitch rhythm generation model start parameter corresponding to the pitch parameter in a preset pitch start parameter set;
[0095] Based on a preset timbre codebook mapping function, a timbre codebook and a rendering function corresponding to the timbre parameter are determined in a preset timbre coding table.
[0096] Optionally, the generating module 304 includes:
[0097] A music melody generating unit 3041, configured to generate a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameter and the pitch generation model startup parameter;
[0098] The music audio file generating unit 3042 is used to generate audio data based on the music melody and the timbre codebook, and render the audio data using the rendering function to obtain a meditation music audio file.
[0099] Optionally, the music melody generating unit 3041 may also be specifically used for:
[0100] Inputting the rhythm generation model startup parameters into the rhythm generation model to generate a rhythm sequence;
[0101] Inputting the rhythm sequence and the pitch generation model startup parameter into the pitch generation model to generate a pitch sequence;
[0102] The rhythm sequence and the pitch sequence are spliced together according to a preset time sequence to obtain a music melody.
[0103] Optionally, the music audio file generating unit 3042 may also be specifically used for:
[0104] Based on a preset timbre material mapping function and the timbre codebook, a corresponding timbre material is determined for each note in the music melody to obtain a plurality of timbre materials;
[0105] Adding the plurality of timbre materials to the music melody in sequence according to a preset time sequence to obtain audio data;
[0106] The rendering function is used to add a preset convolution sound effect algorithm to the audio data to obtain a meditation music audio file.
[0107] Optionally, the meditation music generating device further includes:
[0108] The construction module 305 is used to construct a rhythm generation model library, a pitch generation model library, a timbre material library, a rhythm generation model mapping function, a pitch generation model mapping function, a timbre material mapping function, a rhythm start parameter mapping function and a pitch start mapping function.
[0109] In an embodiment of the present invention, the corresponding rhythm generation model, pitch generation model, rhythm generation model startup parameters, pitch generation model startup parameters, timbre code book and rendering function are determined through theme parameters, rhythm parameters, pitch parameters and timbre parameters, and a meditation music audio file is generated based on the model, parameters and rendering function, thereby improving the flexibility and freedom of generating meditation music based on the meditation music model.
[0110] above Figure 3 and Figure 4 The meditation music generating device in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the meditation music generating device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0111] Figure 51 is a schematic diagram of the structure of a meditation music generating device provided by an embodiment of the present invention. The meditation music generating device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (for example, one or more processors) and a memory 520, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 can be short-term storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the meditation music generating device 500. Furthermore, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the meditation music generating device 500.
[0112] The meditation music generating device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 5 The structure of the meditation music generating device shown does not constitute a limitation on the meditation music generating device, and may include more or less components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0113] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0114] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the method for generating meditation music.
[0115] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0116] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0117] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0118] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating meditation music, characterized in that: The method for generating meditation music comprises: Constructing a rhythm generation model library, a pitch generation model library, a timbre material library, a rhythm generation model mapping function, a pitch generation model mapping function, a timbre material mapping function, a rhythm start parameter mapping function and a pitch start mapping function; Obtaining a music generation request, where the music generation request is a scene request or a theme request; Parsing the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters; Determine a rhythm generation model, a pitch generation model, a rhythm generation model startup parameter, a pitch generation model startup parameter, a timbre codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the timbre parameter, wherein the timbre codebook is a timbre code; Generate a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameter, the pitch generation model startup parameter, the timbre codebook and the rendering function; The construction of the rhythm generation model library, the pitch generation model library, the timbre material library, the rhythm generation model mapping function, the pitch generation model mapping function, the timbre material mapping function, the rhythm start parameter mapping function and the pitch start mapping function includes: Integrate the rhythm characteristics of music with different themes, wherein the rhythm characteristics are expressed as the duration weights of notes and the proportion weights of notes with different durations in different measures or in different paragraphs, and then input the integrated rhythm characteristics into the fitness function in a preset genetic algorithm to generate a rhythm, and use the rhythm as a rhythm generation model. According to the method, multiple rhythm generation models are obtained, thereby obtaining a rhythm generation model library; According to the styles of different theme music, two bidirectional training networks are used to form an adversarial generative neural network to train the model, and multiple pitch generation models are obtained, thereby obtaining a pitch generation model library; According to the musical characteristics of different theme music, starting from the existing music material files, the built-in sound production plug-in in the music production software LogicPro X is used to adjust and modify them to obtain sound materials under different themes, thereby obtaining a sound material library; Construct a mapping function from theme parameters to each rhythm generation model to obtain a rhythm generation model mapping function; construct a mapping function from theme parameters to each pitch generation model to obtain a pitch generation model mapping function; construct a mapping function from a timbre codebook to each music material to obtain a timbre material mapping function; construct a mapping function from rhythm parameters to the start-up parameters of each rhythm generation model to obtain a rhythm start-up parameter mapping function; and construct a mapping function from pitch parameters to the start-up parameters of each pitch generation model to obtain a pitch start-up parameter mapping function.
2. The method for generating meditation music according to claim 1, characterized in that: The parsing of the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters includes: Parsing the music generation request to obtain theme parameters; The theme attributes corresponding to the theme parameters are read, and the parameters are parsed in combination with the music generation request to obtain rhythm parameters, pitch parameters and timbre parameters.
3. The method for generating meditation music according to claim 1, characterized in that: The rhythm generation model, the pitch generation model, the rhythm generation model startup parameters, the pitch generation model startup parameters, the timbre codebook and the rendering function are determined according to the theme parameters, the rhythm parameters, the pitch parameters and the timbre parameters, wherein the timbre codebook is timbre coding and includes: Based on a preset rhythm generation model mapping function, determining a rhythm generation model corresponding to the theme parameter in a preset rhythm generation model library; Based on a preset pitch generation model mapping function, determining a pitch generation model corresponding to the theme parameter in a preset pitch generation model library; Based on a preset rhythm start mapping function, determining a rhythm generation model start parameter corresponding to the rhythm parameter in a preset rhythm start parameter set; Based on a preset pitch start mapping function, determining a pitch rhythm generation model start parameter corresponding to the pitch parameter in a preset pitch start parameter set; Based on a preset timbre codebook mapping function, a timbre codebook and a rendering function corresponding to the timbre parameter are determined in a preset timbre coding table.
4. The method for generating meditation music according to claim 1, characterized in that: Generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameter, the pitch generation model startup parameter, the timbre codebook and the rendering function comprises: Generate a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameter and the pitch generation model startup parameter; Audio data is generated based on the music melody and the timbre codebook, and the audio data is rendered using the rendering function to obtain a meditation music audio file.
5. The method for generating meditation music according to claim 4, characterized in that: Generating a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model startup parameter and the pitch generation model startup parameter comprises: Inputting the rhythm generation model startup parameters into the rhythm generation model to generate a rhythm sequence; Inputting the rhythm sequence and the pitch generation model startup parameter into the pitch generation model to generate a pitch sequence; The rhythm sequence and the pitch sequence are spliced together according to a preset time sequence to obtain a music melody.
6. The method for generating meditation music according to claim 4, characterized in that: The step of generating audio data based on the music melody and the timbre codebook, and rendering the audio data using the rendering function to obtain a meditation music audio file includes: Based on a preset timbre material mapping function and the timbre codebook, a corresponding timbre material is determined for each note in the music melody to obtain a plurality of timbre materials; Adding the plurality of timbre materials to the music melody in sequence according to a preset time sequence to obtain audio data; The rendering function is used to add a preset convolution sound effect algorithm to the audio data to obtain a meditation music audio file.
7. A meditation music generating device, characterized in that: The meditation music generating device comprises: An acquisition module, used for acquiring a music generation request, wherein the music generation request is a scene request or a theme request; A parsing module, used for parsing the music generation request to obtain theme parameters, rhythm parameters, pitch parameters and timbre parameters; A determination module, used for determining a rhythm generation model, a pitch generation model, a rhythm generation model startup parameter, a pitch generation model startup parameter, a timbre codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the timbre parameter, wherein the timbre codebook is a timbre code; A generation module, used for generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model startup parameter, the pitch generation model startup parameter, the timbre codebook and the rendering function; The device also includes a construction module for constructing a rhythm generation model library, a pitch generation model library, a timbre material library, a rhythm generation model mapping function, a pitch generation model mapping function, a timbre material mapping function, a rhythm start parameter mapping function, and a pitch start mapping function; The construction module is also used to integrate the rhythm characteristics of different theme music, the rhythm characteristics are expressed as the duration weights of notes, the proportion weights of notes of different durations in different measures or in different paragraphs, and then the integrated rhythm characteristics are input into the fitness function in the preset genetic algorithm to generate a rhythm, and the rhythm is used as a rhythm generation model. According to the method, multiple rhythm generation models are obtained, thereby obtaining a rhythm generation model library; According to the styles of different theme music, two bidirectional training networks are used to form an adversarial generative neural network to train the model, and multiple pitch generation models are obtained, thereby obtaining a pitch generation model library; According to the musical characteristics of different theme music, starting from the existing music material files, the built-in sound production plug-in in the music production software LogicPro X is used to adjust and modify them to obtain sound materials under different themes, thereby obtaining a sound material library; Construct a mapping function from theme parameters to each rhythm generation model to obtain a rhythm generation model mapping function; construct a mapping function from theme parameters to each pitch generation model to obtain a pitch generation model mapping function; construct a mapping function from a timbre codebook to each music material to obtain a timbre material mapping function; construct a mapping function from rhythm parameters to the start-up parameters of each rhythm generation model to obtain a rhythm start-up parameter mapping function; and construct a mapping function from pitch parameters to the start-up parameters of each pitch generation model to obtain a pitch start-up parameter mapping function.
8. A meditation music generating device, characterized in that: The meditation music generating device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory to enable the meditation music generating device to execute the meditation music generating method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating meditation music as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Brain wave AI music generation method and system
CN108877749A
Audio content generation method, server device and client device
CN110599985A