CN113032615A - Meditation music generation method, device, equipment and storage medium - Google Patents

Meditation music generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN113032615A
CN113032615A CN202110301208.7A CN202110301208A CN113032615A CN 113032615 A CN113032615 A CN 113032615A CN 202110301208 A CN202110301208 A CN 202110301208A CN 113032615 A CN113032615 A CN 113032615A
Authority
CN
China
Prior art keywords
parameter
pitch
rhythm
generation model
music
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110301208.7A
Other languages
Chinese (zh)
Inventor
朱照华
韩宝强
肖京
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202110301208.7A priority Critical patent/CN113032615A/en
Publication of CN113032615A publication Critical patent/CN113032615A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/61Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/63Querying
    • G06F16/635Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/27Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique
    • G10L25/30Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Signal Processing (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

The invention relates to the field of artificial intelligence, and discloses a meditation music generation method, a meditation music generation device, meditation music generation equipment and a storage medium, which are used for improving the flexibility and the degree of freedom of generation of meditation music based on a meditation music model. The meditation music generation method includes: acquiring a music generation request, wherein the music generation request is a scene request or a theme request; analyzing the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter and a tone parameter; determining a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter; according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function, the tone color codebook generates a meditation music audio file.

Description

Meditation music generation method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of machine learning, in particular to a meditation music method, a meditation music device, meditation music equipment and a storage medium.
Background
In recent years, meditation has become one of important ways to relieve work pressure and relieve spirit, high-quality meditation can bring great sublimation to soul, and meditation music is an important medium to help people perform high-quality meditation.
At present, the generation of meditation music is still in an exploration stage, the meditation music is separated from the music category which is recognized by the public, and the meditation music lacks of clear style concept definition. Most of the existing meditation music generation methods train a generation model of specific meditation music based on a specific theme or a specific scene, and the model is not suitable for other themes or application scenes, so that the flexibility and the degree of freedom of generation of the meditation music are low.
Disclosure of Invention
The invention provides a meditation music generation method, a device, equipment and a storage medium, which improve the flexibility and the degree of freedom of generation of meditation music by a meditation music model.
The invention provides a meditation music generation method, which comprises the following steps: acquiring a music generation request, wherein the music generation request is a scene request or a theme request; analyzing the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter and a tone parameter; determining a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, wherein the tone codebook is used for tone encoding; and generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function.
Optionally, in a first implementation manner of the first aspect of the present invention, the analyzing the music generation request to obtain a theme parameter, a tempo parameter, a pitch parameter, and a tone parameter includes: analyzing the music generation request to obtain a theme parameter; and reading the theme attributes corresponding to the theme parameters, and performing parameter analysis by combining the music generation request to obtain a rhythm parameter, a pitch parameter and a tone parameter.
Optionally, in a second implementation manner of the first aspect of the present invention, the determining, according to the theme parameter, the rhythm parameter, the pitch parameter, and the tone parameter, a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function, where the tone codebook is used for tone coding and includes: determining a rhythm generating model corresponding to the subject parameter in a preset rhythm generating model library based on a preset rhythm generating model mapping function; determining a pitch generation model corresponding to the subject parameter in a preset pitch generation model library based on a preset pitch generation model mapping function; determining a rhythm generation model starting parameter corresponding to the rhythm parameter in a preset rhythm starting parameter set based on a preset rhythm starting mapping function; determining a pitch rhythm generation model starting parameter corresponding to the pitch parameter in a preset pitch starting parameter set based on a preset pitch starting mapping function; and determining a tone color codebook and a rendering function corresponding to the tone color parameters in a preset tone color coding table based on a preset tone color codebook mapping function.
Optionally, in a third implementation manner of the first aspect of the present invention, the generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook, and the rendering function includes: generating a music melody based on the tempo generation model, the pitch generation model, the tempo generation model start-up parameters, and the pitch generation model start-up parameters; and generating audio data based on the music melody and the tone codebook, and rendering the audio data by adopting the rendering function to obtain a meditation music audio file.
Optionally, in a fourth implementation manner of the first aspect of the present invention, generating the music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, and the pitch generation model starting parameter includes: inputting the rhythm generation model starting parameters into the rhythm generation model to generate a rhythm sequence; inputting the rhythm sequence and the pitch generation model starting 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 the music melody.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the generating audio data based on the music melody and the tone color codebook, and rendering the audio data by using the rendering function to obtain a meditation music audio file includes: determining corresponding tone materials for each note in the music melody based on a preset tone material mapping function and the tone codebook to obtain a plurality of tone materials; sequentially adding the plurality of timbre materials to the music melody according to a preset time sequence to obtain audio data; and adding a preset convolution sound effect algorithm to the audio data by adopting the rendering function to obtain the meditation music audio file.
Optionally, in a sixth implementation manner of the first aspect of the present invention, before the acquiring a music generation request, where the music generation request is a scene request or a theme request, the method for generating meditation music includes: and constructing a rhythm generation model library, a pitch generation model library, a tone material library, a rhythm generation model mapping function, a pitch generation model mapping function, a tone material mapping function, a rhythm starting parameter mapping function and a pitch starting mapping function.
A second aspect of the present invention provides a meditation music generating apparatus comprising: the music generation module is used for generating a music generation request, wherein the music generation request is a scene request or a theme request; the analysis module is used for analyzing the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter and a tone parameter; a determining module, configured to determine a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, where the tone codebook is a tone code; and the generation module is used for generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function.
Optionally, in a first implementation manner of the second aspect of the present invention, the parsing module may be further specifically configured to: analyzing the music generation request to obtain a theme parameter; and reading the theme attributes corresponding to the theme parameters, and performing parameter analysis by combining the music generation request to obtain a rhythm parameter, a pitch parameter and a tone parameter.
Optionally, in a second implementation manner of the second aspect of the present invention, the determining module may be further specifically configured to: determining a rhythm generating model corresponding to the subject parameter in a preset rhythm generating model library based on a preset rhythm generating model mapping function; determining a pitch generation model corresponding to the subject parameter in a preset pitch generation model library based on a preset pitch generation model mapping function; determining a rhythm generation model starting parameter corresponding to the rhythm parameter in a preset rhythm starting parameter set based on a preset rhythm starting mapping function; determining a pitch rhythm generation model starting parameter corresponding to the pitch parameter in a preset pitch starting parameter set based on a preset pitch starting mapping function; and determining a tone color codebook and a rendering function corresponding to the tone color parameters in a preset tone color coding table based on a preset tone color codebook mapping function.
Optionally, in a third implementation manner of the second aspect of the present invention, the generating module includes: a music melody generating unit for generating a music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model start parameter, and the pitch generation model start parameter; and the music audio file generating unit is used for generating audio data based on the music melody and the tone codebook and rendering the audio data by adopting the rendering function to obtain a meditation music audio file.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the music melody generating unit is specifically configured to: inputting the rhythm generation model starting parameters into the rhythm generation model to generate a rhythm sequence; inputting the rhythm sequence and the pitch generation model starting 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 the music melody.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the music audio file generating unit is specifically configured to: determining corresponding tone materials for each note in the music melody based on a preset tone material mapping function and the tone codebook to obtain a plurality of tone materials; sequentially adding the plurality of timbre materials to the music melody according to a preset time sequence to obtain audio data; and adding a preset convolution sound effect algorithm to the audio data by adopting the rendering function to obtain the meditation music audio file.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the meditation music generation apparatus further includes: the construction module is used for constructing a rhythm generation model library, a pitch generation model library, a tone material library, a rhythm generation model mapping function, a pitch generation model mapping function, a tone material mapping function, a rhythm starting parameter mapping function and a pitch starting mapping function.
A third aspect of the present invention provides a meditation music generating apparatus comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line; the at least one processor calls the instructions in the memory to cause the meditation music generation device to perform the meditation music generation method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to execute the meditation music generation method described above.
According to the technical scheme, a music generation request is obtained, wherein the music generation request is a scene request or a theme request; analyzing the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter and a tone parameter; determining a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, wherein the tone codebook is used for tone encoding; and generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function. In the embodiment of the invention, through the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, the corresponding rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone codebook and the rendering function are determined, and the meditation music audio file is generated based on the model, the parameter and the rendering function, so that the flexibility and the degree of freedom of generating meditation music based on the meditation music model are improved.
Drawings
Fig. 1 is a schematic view showing an embodiment of a meditation music generating method according to an embodiment of the present invention;
fig. 2 is a schematic view of another embodiment of a meditation music generation method according to an embodiment of the present invention;
fig. 3 is a schematic view showing an embodiment of a meditation music generating apparatus according to an embodiment of the present invention;
fig. 4 is a schematic view of another embodiment of the meditation music generating apparatus according to the embodiment of the present invention;
fig. 5 is a schematic view showing an embodiment of the meditation music generating apparatus according to the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a meditation music generation method, a meditation music generation device, meditation music generation equipment and a storage medium, which are used for improving the flexibility and the degree of freedom of generation of meditation music based on a meditation music model.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For the sake of understanding, the following describes a specific flow of an embodiment of the present invention, and referring to fig. 1, an embodiment of a meditation music generation method in an embodiment of the present invention includes:
101. acquiring a music generation request, wherein the music generation request is a scene request or a theme request;
the server obtains a music generation request which is a scene request or a theme request.
The music generation request may be a scene request of national 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 for yoga, sedentary, etc., such as generation of yoga meditation music or generation of buddha meditation music.
It is to be understood that the executing subject of the present invention may be the generation device of meditation music, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution topic.
102. Analyzing the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter and a tone parameter;
the server analyzes the music generation request to obtain a theme parameter, a rhythm parameter and a pitch parameter and a tone parameter.
For example, the music generation request is to generate yoga meditation music, and the server analyzes the yoga meditation music to obtain the theme parameter α, the rhythm parameter β, the pitch parameter σ, and the tone parameter δ. The theme parameter alpha is used for controlling the loading of a rhythm generation model and a pitch generation model, the rhythm parameter beta is used for constructing a rhythm sequence, the pitch parameter sigma is used for generating a pitch sequence, and the tone parameter delta is used for generating a tone color codebook.
It should be noted that music of different subjects has specific rhythm parameters, pitch parameters and tone parameters.
103. Determining a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, wherein the tone codebook is used for tone coding;
the server determines a corresponding rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function based on the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, wherein the tone codebook is tone encoding.
After the theme parameters, the rhythm parameters, the pitch parameters and the tone parameters are obtained through analysis, the server determines a rhythm generation model in a preset rhythm generation model library, determines a pitch generation model in a preset pitch generation model library, determines rhythm generation model starting parameters in a preset rhythm starting parameter set, determines pitch generation model starting parameters in a preset pitch starting set and determines a tone codebook and a rendering function in a tone coding table.
104. And generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function.
The server processes the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function, wherein the tone color codebook is used for tone color coding, and a meditation music audio file is generated.
The meditation music audio file is a Musical Instrument Digital Interface (MIDI) file. In the process of generating the meditation music audio file in the present embodiment, the melody file is first generated, then the timbre is added to the melody file, the audio file is generated, and finally the audio file is rendered, resulting in the meditation music audio file.
In the embodiment of the invention, through the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, the corresponding rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone codebook and the rendering function are determined, and the meditation music audio file is generated based on the model, the parameter and the rendering function, so that the flexibility and the degree of freedom of generating meditation music based on the meditation music model are improved.
Referring to fig. 2, another embodiment of the method for generating meditation music according to an embodiment of the present invention includes:
201. constructing a rhythm generation model library, a pitch generation model library, a tone material library, a rhythm generation model mapping function, a pitch generation model mapping function, a tone material mapping function, a rhythm starting parameter mapping function and a pitch starting mapping function;
the server integrates rhythm characteristics of different theme music, wherein the rhythm characteristics are specifically expressed as duration value weight of notes and proportion weight of different duration value notes in different bars or different sections, then the integrated rhythm characteristics are input into a fitness function in a preset genetic algorithm to generate rhythm, the rhythm is used as a rhythm generation model, and according to the method, a plurality of rhythm generation models are obtained, so that a rhythm generation model library is obtained. The library of tempo generation models can be represented as: rhy ═ ri1,2, …, m }, whereinriAnd m represents the number of rhythm generation models in the rhythm generation model library. Aiming at styles of different theme music, the server performs model training by forming a confrontation generation neural network through two bidirectional training networks to obtain a plurality of pitch generation models, so as to obtain a rhythm generation model library, wherein the pitch generation model library can be expressed as: p ═ pj1,2, …, n, where pjRepresenting the pitch-generating model, and n represents the number of pitch-generating models in the pitch-generating model library. The server obtains tone color materials under different themes by adjusting and modifying the existing music material files through a built-in tone color making plug-in the music making software Logic Pro X according to the music characteristics of different themes, and thus obtains a tone color material library, specifically: tim ═ tk1,2, …, o }, where t iskIs the timbre material and o is the number of materials in the timbre material library.
Then the server constructs a mapping function from the theme parameters to each rhythm generation model to obtain a rhythm generation model mapping function R; constructing a mapping function from the theme parameters to each pitch generation model to obtain a pitch generation model mapping function P; constructing a mapping function from a tone codebook to each music material to obtain a tone material mapping function T; constructing a mapping function from the rhythm parameters to the starting parameters of each rhythm generation model to obtain a rhythm starting parameter mapping function F; and constructing a mapping function from the pitch parameters to the starting parameters of each pitch generation model to obtain a pitch starting parameter mapping function G.
202. Acquiring a music generation request, wherein the music generation request is a scene request or a theme request;
the server obtains a music generation request which is a scene request or a theme request.
The music generation request may be a scene request of national 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 for yoga, sedentary, etc., such as generation of yoga meditation music or generation of buddha meditation music.
203. Analyzing the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter and a tone parameter;
the server analyzes the music generation request to obtain a theme parameter, a rhythm parameter and a pitch parameter and a tone parameter.
For example, the music generation request is to generate yoga meditation music, and the server analyzes the yoga meditation music to obtain the theme parameter α, the rhythm parameter β, the pitch parameter σ, and the tone parameter δ. The theme parameter alpha is used for controlling the loading of a rhythm generation model and a pitch generation model, the rhythm parameter beta is used for constructing a rhythm sequence, the pitch parameter sigma is used for generating a pitch sequence, and the tone parameter delta is used for generating a tone color codebook.
It should be noted that music of different subjects has specific rhythm parameters, pitch parameters and tone parameters.
Specifically, the music generation request is analyzed to obtain a theme parameter; and reading the theme attributes corresponding to the theme parameters, and analyzing the parameters by combining with the music generation request to obtain rhythm parameters, pitch parameters and tone parameters.
The server analyzes the music generation request, and first obtains a theme parameter, for example, the music generation request is meditation music for generating yoga, and the theme parameter corresponding to the meditation music for generating yoga is alpha1Server in combination with a theme parameter alpha1The rhythm parameter beta is obtained by analyzing the theme characteristics of the yoga combined with meditation music for generating yoga1Pitch parameter σ1And a timbre parameter delta1
It should be noted that, because the pitch, rhythm and timbre of the yoga theme meditation music are relatively stable compared with other national music, the rhythm parameter, pitch parameter and timbre parameter can be determined by combining the theme characteristics of the theme parameters.
204. Determining a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, wherein the tone codebook is used for tone coding;
the server determines a corresponding rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function based on the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, wherein the tone codebook is tone encoding.
After the theme parameters, the rhythm parameters, the pitch parameters and the tone parameters are obtained through analysis, the server determines a rhythm generation model in a preset rhythm generation model library, determines a pitch generation model in a preset pitch generation model library, determines start parameters of the rhythm generation model in a preset rhythm start parameter set, determines start parameters of the pitch generation model in a preset pitch start parameter set, and determines a tone codebook and a rendering function in a preset tone coding table.
Specifically, the server determines a rhythm generation model corresponding to the theme parameters in a preset rhythm generation model library based on a preset rhythm generation model mapping function; determining a pitch generation model corresponding to the theme parameters in a preset pitch generation model library based on a preset pitch generation model mapping function; determining a rhythm generation model starting parameter corresponding to the rhythm parameter in a preset rhythm starting parameter set based on a preset rhythm starting mapping function; determining a pitch rhythm generation model starting parameter corresponding to the pitch parameter in a preset pitch starting parameter set based on a preset pitch starting mapping function; and determining a tone color codebook and a rendering function corresponding to the tone color parameters in a preset tone color coding table based on a preset tone color codebook mapping function.
Following the example of step 203, the server generates a model mapping function R based on the preset tempo, and generates a model library Rhy { R } in the preset tempoiDetermining a rhythm generation model r in | i ═ 1,2, …, m }1=R(α1) Matching the rhythm generation model with the theme parameters; generating a model library Pit ═ P at a preset pitch based on a preset pitch generation model mapping function PjDetermining pitch generation model as p in 1,2, …, n | j ═1=P(α1) The pitch generation model is matched with the theme parameters; starting a parameter mapping function F based on a preset rhythm, and starting at the rhythmMethod for determining starting parameter x of rhythm generation model in parameter set1=F(β1) Matching the rhythm generation model starting parameter with the rhythm parameter; determining a pitch generation model start parameter y in a pitch start parameter set based on a preset pitch start parameter mapping function G1=G(σ1) Matching the rhythm generation model starting parameter with the rhythm parameter; the server determines the tone color codebook as b in a preset tone color coding table based on a preset tone color codebook mapping function1=T(δ1) And a rendering function E1And matching the tone color codebook and the rendering function with the tone color parameters.
205. And generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function.
The server processes the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function to generate the meditation music audio file, wherein the tone color codebook is tone color coding.
It should be noted that the meditation music audio file is a MIDI file. In the process of generating the meditation music audio file in the present embodiment, the melody file is first generated, then the timbre is added to the melody file, the audio file is generated, and finally the audio file is rendered, resulting in the meditation music audio file.
Specifically, the server generates the music melody based on a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter and a pitch generation model starting parameter; the server generates audio data based on the music melody and the tone codebook, and renders the audio data by adopting a rendering function to obtain a meditation music audio file.
It should be noted that, after obtaining the music melody, the server needs to add tone materials to the music melody based on the tone codebook and the rendering function, and render the music melody, so as to finally obtain a meditation music audio file that is a MIDI file.
The specific process of generating the music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter and the pitch generation model starting parameter is as follows:
the server inputs the starting parameters of the rhythm generation model into the rhythm generation model to generate a rhythm sequence; then the server inputs the rhythm sequence and the starting parameters of the pitch generation model into the pitch generation model to generate a pitch sequence; and the server splices the rhythm sequence and the pitch sequence according to the preset time sequence to obtain the music melody.
The server generates a rhythm generation model starting parameter x1Inputting the rhythm generation model, and generating a rhythm sequence with u-ri(x1),u={u1,u2…ul,Where u is { u ═ u }1,u2,…ulAnd can be viewed as a collection of time series, l being the number of notes in the rhythm series. The sequence and pitch are then modeled as the firing parameter y1Inputting the pitch generation model, and generating a pitch sequence as follows: v ═ pi(u,y1),v={v1,v2,…vlV, where v ═ v }1,v2,…vlAnd the server splices the pitch sequence and the rhythm sequence according to the time sequence so as to obtain the music melody.
The specific process of generating audio data based on the music melody and the tone codebook and rendering the audio data by adopting a rendering function to obtain the meditation music audio file is as follows:
the server determines corresponding tone materials for each note in the music melody based on a preset tone material mapping function and a tone codebook to obtain a plurality of tone materials; the server sequentially adds a plurality of timbre materials into the music melody according to a preset time sequence to obtain audio data; the server adopts a rendering function, and adds a preset convolution sound effect algorithm to the audio data to obtain the meditation music audio file.
The server calls a tone material mapping function T from a tone material library Tim ═ T based on a tone codebookkSearching for the timbre material set corresponding to the timbre codebook corresponding to the note sequence in | k ═ 1,2, …, o |, where the timbre codebook corresponds to the note sequenceThe server obtains tone materials corresponding to each note, the server sequentially adds a plurality of music materials to the music melody on the basis of the time sequence to obtain audio data, and finally the server calls a rendering function and applies a convolution sound effect algorithm of convolution operation to the audio to obtain a meditation music audio file.
In the embodiment of the invention, through the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, the corresponding rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone codebook and the rendering function are determined, and the meditation music audio file is generated based on the model, the parameter and the rendering function, so that the flexibility and the degree of freedom of generating meditation music based on the meditation music model are improved.
The method for generating meditation music in the embodiment of the present invention is described above, and referring to fig. 3, the device for generating meditation music in the embodiment of the present invention is described below, and one embodiment of the device for generating meditation music in the embodiment of the present invention includes:
an obtaining module 301, configured to obtain a music generation request, where the music generation request is a scene request or a theme request;
an analyzing module 302, configured to analyze the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter, and a tone parameter;
a determining module 303, configured to determine, according to the theme parameter, the rhythm parameter, the pitch parameter, and the tone parameter, a rhythm generation model, a pitch generation model, a rhythm generation model start parameter, a pitch generation model start parameter, a tone codebook and a rendering function, where the tone codebook is a tone code;
a generating module 304, configured to generate a meditation music audio file according to the tempo generation model, the pitch generation model, the tempo generation model start parameter, the pitch generation model start parameter, the tone color codebook, and the rendering function.
In the embodiment of the invention, through the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, the corresponding rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone codebook and the rendering function are determined, and the meditation music audio file is generated based on the model, the parameter and the rendering function, so that the flexibility and the degree of freedom of generating meditation music based on the meditation music model are improved.
Referring to fig. 4, another embodiment of the meditation music generating apparatus according to the embodiment of the present invention includes:
an obtaining module 301, configured to obtain a music generation request, where the music generation request is a scene request or a theme request;
an analyzing module 302, configured to analyze the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter, and a tone parameter;
a determining module 303, configured to determine, according to the theme parameter, the rhythm parameter, the pitch parameter, and the tone parameter, a rhythm generation model, a pitch generation model, a rhythm generation model start parameter, a pitch generation model start parameter, a tone codebook and a rendering function, where the tone codebook is a tone code;
a generating module 304, configured to generate a meditation music audio file according to the tempo generation model, the pitch generation model, the tempo generation model start parameter, the pitch generation model start parameter, the tone color codebook, and the rendering function.
Optionally, the parsing module 302 may be further specifically configured to:
analyzing the music generation request to obtain a theme parameter;
and reading the theme attributes corresponding to the theme parameters, and performing parameter analysis by combining the music generation request to obtain a rhythm parameter, a pitch parameter and a tone parameter.
Optionally, the determining module 303 may be further specifically configured to:
determining a rhythm generating model corresponding to the subject parameter in a preset rhythm generating model library based on a preset rhythm generating model mapping function;
determining a pitch generation model corresponding to the subject parameter in a preset pitch generation model library based on a preset pitch generation model mapping function;
determining a rhythm generation model starting parameter corresponding to the rhythm parameter in a preset rhythm starting parameter set based on a preset rhythm starting mapping function;
determining a pitch rhythm generation model starting parameter corresponding to the pitch parameter in a preset pitch starting parameter set based on a preset pitch starting mapping function;
and determining a tone color codebook and a rendering function corresponding to the tone color parameters in a preset tone color coding table based on a preset tone color codebook mapping function.
Optionally, the generating module 304 includes:
a music melody generating unit 3041 for 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;
a music audio file generating unit 3042 configured to generate audio data based on the music melody and the tone color codebook, and render the audio data using the rendering function to obtain a meditation music audio file.
Optionally, the music melody generating unit 3041 may be further specifically configured to:
inputting the rhythm generation model starting parameters into the rhythm generation model to generate a rhythm sequence;
inputting the rhythm sequence and the pitch generation model starting 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 the music melody.
Optionally, the music audio file generating unit 3042 may be further specifically configured to:
determining corresponding tone materials for each note in the music melody based on a preset tone material mapping function and the tone codebook to obtain a plurality of tone materials;
sequentially adding the plurality of timbre materials to the music melody according to a preset time sequence to obtain audio data;
and adding a preset convolution sound effect algorithm to the audio data by adopting the rendering function to obtain the meditation music audio file.
Optionally, the meditation music generating device further includes:
a building module 305, configured to build a rhythm generation model library, a pitch generation model library, a tone material library, a rhythm generation model mapping function, a pitch generation model mapping function, a tone material mapping function, a rhythm starting parameter mapping function, and a pitch starting mapping function.
In the embodiment of the invention, through the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, the corresponding rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone codebook and the rendering function are determined, and the meditation music audio file is generated based on the model, the parameter and the rendering function, so that the flexibility and the degree of freedom of generating meditation music based on the meditation music model are improved.
The meditation music generating apparatus according to the embodiment of the present invention is described in detail in terms of the modular functional entities in the above fig. 3 and 4, and the meditation music generating apparatus according to the embodiment of the present invention is described in detail in terms of the hardware processing.
Fig. 5 is a schematic structural diagram of a generation device for meditation music, which may have relatively large differences due to different configurations or performances, according to an embodiment of the present invention, and may include one or more processors (CPUs) 510 (e.g., one or more processors) and a memory 520, one or more storage media 530 (e.g., one or more mass storage devices) storing applications 533 or data 532. Memory 520 and storage media 530 may be, among other things, transient or persistent storage. The program stored in the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations in the generation apparatus for meditation music 500. Still further, the processor 510 may be configured to communicate with the storage medium 530, and perform a series of instruction operations in the storage medium 530 on the meditation music generating apparatus 500.
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-output interfaces 560, and/or one or more operating systems 531, such as Windows server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art will appreciate that the construction of the meditation music generating device shown in fig. 5 does not constitute a limitation of the meditation music generating device, and may include more or less components than those shown, or combine some components, or a different arrangement of components.
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, which may also be a volatile computer-readable storage medium, having stored therein instructions that, when run on a computer, cause the computer to perform the steps of the meditation music generation method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A meditation music generation method, characterized by comprising:
acquiring a music generation request, wherein the music generation request is a scene request or a theme request;
analyzing the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter and a tone parameter;
determining a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, wherein the tone codebook is used for tone encoding;
and generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function.
2. The meditation music generation method as claimed in claim 1, wherein said parsing the music generation request to obtain a theme parameter, a tempo parameter, a pitch parameter, and a tone parameter comprises:
analyzing the music generation request to obtain a theme parameter;
and reading the theme attributes corresponding to the theme parameters, and performing parameter analysis by combining the music generation request to obtain a rhythm parameter, a pitch parameter and a tone parameter.
3. The meditation music generation method as claimed in claim 1, wherein said determining a tempo generation model, a pitch generation model, a tempo generation model start parameter, a pitch generation model start parameter, a tone color codebook and a rendering function according to the theme parameter, the tempo parameter, the pitch parameter and the tone color parameter, the tone color codebook being a tone color coding comprising:
determining a rhythm generating model corresponding to the subject parameter in a preset rhythm generating model library based on a preset rhythm generating model mapping function;
determining a pitch generation model corresponding to the subject parameter in a preset pitch generation model library based on a preset pitch generation model mapping function;
determining a rhythm generation model starting parameter corresponding to the rhythm parameter in a preset rhythm starting parameter set based on a preset rhythm starting mapping function;
determining a pitch rhythm generation model starting parameter corresponding to the pitch parameter in a preset pitch starting parameter set based on a preset pitch starting mapping function;
and determining a tone color codebook and a rendering function corresponding to the tone color parameters in a preset tone color coding table based on a preset tone color codebook mapping function.
4. The meditation music generation method according to claim 1, wherein the generating a meditation music audio file according to the tempo generation model, the pitch generation model, the tempo generation model start-up parameter, the pitch generation model start-up parameter, the tone color codebook, and the rendering function includes:
generating a music melody based on the tempo generation model, the pitch generation model, the tempo generation model start-up parameters, and the pitch generation model start-up parameters;
and generating audio data based on the music melody and the tone codebook, and rendering the audio data by adopting the rendering function to obtain a meditation music audio file.
5. The meditation music generation method as claimed in claim 4, wherein the generating of the music melody based on the rhythm generation model, the pitch generation model, the rhythm generation model start-up parameter, and the pitch generation model start-up parameter includes:
inputting the rhythm generation model starting parameters into the rhythm generation model to generate a rhythm sequence;
inputting the rhythm sequence and the pitch generation model starting 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 the music melody.
6. The meditation music generation method according to claim 4, wherein the generating of the audio data based on the music melody and the tone color codebook and rendering the audio data using the rendering function to obtain the meditation music audio file comprises:
determining corresponding tone materials for each note in the music melody based on a preset tone material mapping function and the tone codebook to obtain a plurality of tone materials;
sequentially adding the plurality of timbre materials to the music melody according to a preset time sequence to obtain audio data;
and adding a preset convolution sound effect algorithm to the audio data by adopting the rendering function to obtain the meditation music audio file.
7. The meditation music generation method according to any one of claims 1 to 6, wherein the meditation music generation method includes, before the acquisition music generation request, which is a scene request or a subject request:
and constructing a rhythm generation model library, a pitch generation model library, a tone material library, a rhythm generation model mapping function, a pitch generation model mapping function, a tone material mapping function, a rhythm starting parameter mapping function and a pitch starting mapping function.
8. A meditation music generation device, characterized by comprising:
the music generation module is used for generating a music generation request, wherein the music generation request is a scene request or a theme request;
the analysis module is used for analyzing the music generation request to obtain a theme parameter, a rhythm parameter, a pitch parameter and a tone parameter;
a determining module, configured to determine a rhythm generation model, a pitch generation model, a rhythm generation model starting parameter, a pitch generation model starting parameter, a tone codebook and a rendering function according to the theme parameter, the rhythm parameter, the pitch parameter and the tone parameter, where the tone codebook is a tone code;
and the generation module is used for generating a meditation music audio file according to the rhythm generation model, the pitch generation model, the rhythm generation model starting parameter, the pitch generation model starting parameter, the tone color codebook and the rendering function.
9. A meditation music generating apparatus, characterized by comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor calls the instructions in the memory to cause the meditation music generation device to perform the meditation music generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the meditation music generation method according to any one of claims 1 to 7.
CN202110301208.7A 2021-03-22 2021-03-22 Meditation music generation method, device, equipment and storage medium Pending CN113032615A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110301208.7A CN113032615A (en) 2021-03-22 2021-03-22 Meditation music generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110301208.7A CN113032615A (en) 2021-03-22 2021-03-22 Meditation music generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113032615A true CN113032615A (en) 2021-06-25

Family

ID=76472200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110301208.7A Pending CN113032615A (en) 2021-03-22 2021-03-22 Meditation music generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113032615A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023024717A1 (en) * 2021-08-25 2023-03-02 安徽华米健康科技有限公司 Method and apparatus for generating sleep-aid music

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023024717A1 (en) * 2021-08-25 2023-03-02 安徽华米健康科技有限公司 Method and apparatus for generating sleep-aid music

Similar Documents

Publication Publication Date Title
Hadjeres et al. Deepbach: a steerable model for bach chorales generation
US5736666A (en) Music composition
Dubnov et al. Using machine-learning methods for musical style modeling
CN103902642B (en) Utilize the music composition system of the correlation between the lyrics and melody
CN110955786A (en) Dance action data generation method and device
CN109036355B (en) Automatic composing method, device, computer equipment and storage medium
US9378718B1 (en) Methods and system for composing
JPH09293083A (en) Music retrieval device and method
JPWO2008062816A1 (en) Automatic composition system
WO2020170912A1 (en) Generation device, learning device, generation method, and program
JP2020003535A (en) Program, information processing method, electronic apparatus and learnt model
US5418323A (en) Method for controlling an electronic musical device by utilizing search arguments and rules to generate digital code sequences
EP3826000B1 (en) Automatic preparation of a new midi file
Alfonseca et al. A simple genetic algorithm for music generation by means of algorithmic information theory
CN113032615A (en) Meditation music generation method, device, equipment and storage medium
Royal et al. Deep composer: Deep neural hashing and retrieval approach to automatic music generation
JP4971023B2 (en) Music generation method, music generation device, music generation system
JP2010026337A (en) Method, and program and device for creating song, and song providing system
CN112420002A (en) Music generation method, device, electronic equipment and computer readable storage medium
US10431191B2 (en) Method and apparatus for analyzing characteristics of music information
JP2006178104A (en) Method, apparatus and system for musical piece generation
Conklin et al. Modelling and generating music using multiple viewpoints
CN113096624B (en) Automatic creation method, device, equipment and storage medium for symphony music
CN115004294A (en) Composition creation method, composition creation device, and creation program
Vargas et al. Artificial musical pattern generation with genetic algorithms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination