CN117765902A - Method, apparatus, device, storage medium and program product for generating accompaniment of music - Google Patents
Method, apparatus, device, storage medium and program product for generating accompaniment of music Download PDFInfo
- Publication number
- CN117765902A CN117765902A CN202311824499.3A CN202311824499A CN117765902A CN 117765902 A CN117765902 A CN 117765902A CN 202311824499 A CN202311824499 A CN 202311824499A CN 117765902 A CN117765902 A CN 117765902A
- Authority
- CN
- China
- Prior art keywords
- music
- accompaniment
- melody
- data
- data information
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/18—Selecting circuits
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/36—Accompaniment arrangements
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/36—Accompaniment arrangements
- G10H1/38—Chord
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Electrophonic Musical Instruments (AREA)
Abstract
Description
技术领域Technical field
本申请实施例涉及计算机技术领域,特别涉及一种乐曲伴奏的生成方法、装置、设备、存储介质及程序产品。Embodiments of the present application relate to the field of computer technology, and in particular to a method, device, equipment, storage medium and program product for generating musical accompaniment.
背景技术Background technique
艺术创作一直以来被认为是艺术家的专属领域,然而近几年来随着计算机技术的发展,艺术创作逐渐打破了传统壁垒,借助计算机技术可以人工制作音乐作品,使得音乐类型以及音乐内容拥有了更大的提升空间。Artistic creation has always been considered the exclusive domain of artists. However, in recent years, with the development of computer technology, artistic creation has gradually broken down traditional barriers. With the help of computer technology, music works can be manually produced, making music types and music content have greater scope. room for improvement.
相关技术中,若希望基于音乐生成对应的音乐伴奏,通常采用基于深度学习的方法进行伴奏生成,借助样本音乐与对应的样本伴奏对模型进行训练,以使得模型学习到生成伴奏的方法;之后将需要生成伴奏的音乐输入训练后的模型,得到音乐伴奏。In related technologies, if you want to generate corresponding music accompaniment based on music, you usually use a method based on deep learning to generate accompaniment, and train the model with the help of sample music and corresponding sample accompaniment, so that the model learns the method of generating accompaniment; and then The music that needs to generate accompaniment is input into the trained model to obtain the music accompaniment.
上述过程过分依赖于样本音乐与样本伴奏之间准确的对应关系,该种方式虽然能够在一定程度上得到良好的音乐伴奏,但是忽略了音乐本身具有的乐理信息,容易导致音乐伴奏的乐曲风格与音乐本身存在较大差距,影响音乐伴奏在音乐领域的准确性。The above process relies too much on the accurate correspondence between sample music and sample accompaniment. Although this method can obtain good music accompaniment to a certain extent, it ignores the music theory information of the music itself, which can easily lead to the style of the music accompaniment being different from that of the sample accompaniment. There are large gaps in the music itself, which affects the accuracy of music accompaniment in the field of music.
发明内容Contents of the invention
本申请实施例提供了一种乐曲伴奏的生成方法、装置、设备、存储介质及程序产品,能够通过对乐曲节拍以及乐曲音符进行量化处理,在乐曲旋律的限定将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,提高乐曲伴奏的生成稳定性以及生成效果。所述技术方案如下。Embodiments of the present application provide a method, device, equipment, storage medium and program product for generating music accompaniment, which can incorporate beats and chords into the accompaniment melody generation process within the limits of the music melody by performing quantification processing on the music beat and music notes. , so that the music accompaniment data can be presented in more detail through music parameters, improving the stability and generation effect of the music accompaniment. The technical solution is as follows.
一方面,提供了一种乐曲伴奏的生成方法,所述方法包括:On the one hand, a method for generating musical accompaniment is provided, and the method includes:
获取乐曲数据,所述乐曲数据被划分为多个乐曲节拍,所述乐曲节拍中包括乐曲音符;Obtaining music data, the music data is divided into a plurality of music beats, and the music beats include music notes;
对所述乐曲数据进行乐曲信息提取,得到节拍数据信息、和弦数据信息以及旋律数据信息,所述节拍数据信息用于表征所述多个乐曲节拍的变化速度,所述和弦数据信息用于描述以所述乐曲节拍为单位提取的和弦单元,所述旋律数据信息用于描述多个乐曲音符之间的音符变化情况;Extract music information from the music data to obtain beat data information, chord data information and melody data information. The beat data information is used to represent the changing speed of the beats of the multiple music pieces. The chord data information is used to describe the The music beat is a chord unit extracted in units, and the melody data information is used to describe note changes between multiple music notes;
以所述旋律数据信息为所述乐曲伴奏的生成限制条件,通过所述节拍数据信息和所述和弦数据信息生成乐曲伴奏数据,所述旋律数据信息用于以所述乐曲数据的乐曲旋律限定所述乐曲伴奏的伴奏旋律,所述乐曲伴奏数据通过音乐参数描述所述乐曲数据的伴奏情况;The melody data information is used as a restriction condition for the generation of the music accompaniment, and the music accompaniment data is generated through the beat data information and the chord data information, and the melody data information is used to limit the music accompaniment with the music melody of the music data. The accompaniment melody of the music accompaniment, the music accompaniment data describes the accompaniment of the music data through music parameters;
基于乐曲伴奏数据进行音频数据渲染,得到所述乐曲数据对应的所述乐曲伴奏。Audio data rendering is performed based on the music accompaniment data to obtain the music accompaniment corresponding to the music data.
另一方面,提供了一种乐曲伴奏的生成装置,所述装置包括:On the other hand, a device for generating musical accompaniment is provided, and the device includes:
数据获取模块,用于获取乐曲数据,所述乐曲数据被划分为多个乐曲节拍,所述乐曲节拍中包括乐曲音符;A data acquisition module, used to obtain music data, the music data is divided into a plurality of music beats, and the music beats include music notes;
信息提取模块,用于对所述乐曲数据进行乐曲信息提取,得到节拍数据信息、和弦数据信息以及旋律数据信息,所述节拍数据信息用于表征所述多个乐曲节拍的变化速度,所述和弦数据信息用于描述以所述乐曲节拍为单位提取的和弦单元,所述旋律数据信息用于描述多个乐曲音符之间的音符变化情况;An information extraction module is used to extract music information from the music data to obtain beat data information, chord data information and melody data information. The beat data information is used to represent the changing speed of the beats of the multiple music pieces. The chord The data information is used to describe the chord units extracted in units of the beat of the music piece, and the melody data information is used to describe note changes between multiple music notes;
数据生成模块,用于以所述旋律数据信息为所述乐曲伴奏的生成限制条件,通过所述节拍数据信息和所述和弦数据信息生成乐曲伴奏数据,所述旋律数据信息用于以所述乐曲数据的乐曲旋律限定所述乐曲伴奏的伴奏旋律,所述乐曲伴奏数据通过音乐参数描述所述乐曲数据的伴奏情况;A data generation module, configured to use the melody data information as a generation restriction condition for the music accompaniment, and generate music accompaniment data based on the beat data information and the chord data information, where the melody data information is used to use the music accompaniment The music melody of the data defines the accompaniment melody of the music accompaniment, and the music accompaniment data describes the accompaniment situation of the music data through music parameters;
伴奏生成模块,用于基于乐曲伴奏数据进行音频数据渲染,得到所述乐曲数据对应的所述乐曲伴奏。The accompaniment generation module is used for rendering audio data based on the music accompaniment data to obtain the music accompaniment corresponding to the music data.
另一方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如上述本申请实施例中任一所述乐曲伴奏的生成方法。On the other hand, a computer device is provided. The computer device includes a processor and a memory. The memory stores at least one instruction, at least a program, a code set or an instruction set. The at least one instruction, the at least A program, the code set or the instruction set is loaded and executed by the processor to implement the method for generating musical accompaniment as described in any of the above embodiments of the present application.
另一方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如上述本申请实施例中任一所述的乐曲伴奏的生成方法。On the other hand, a computer-readable storage medium is provided. The storage medium stores at least one instruction, at least one program, a code set or an instruction set. The at least one instruction, the at least one program, the code The set or instruction set is loaded and executed by the processor to implement the method for generating musical accompaniment as described in any of the above embodiments of the present application.
另一方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述实施例中任一所述的乐曲伴奏的生成方法。In another aspect, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for generating musical accompaniment described in any of the above embodiments.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided by the embodiments of this application at least include:
对获取的乐曲数据进行乐曲信息提取,得到节拍数据信息、和弦数据信息以及旋律数据信息;以旋律数据信息生成限制条件通过节拍数据信息和和弦数据信息生成乐曲伴奏数据,进而基于乐曲伴奏数据渲染得到乐曲伴奏。在通过乐曲数据生成乐曲伴奏数据的过程中,通过乐曲信息提取过程对乐曲节拍以及乐曲音符进行量化处理,提升对乐曲数据的分析精准性,使得伴奏数据生成过程更加具有针对性;进而综合旋律数据信息、节拍数据信息以及和弦数据信息,在乐曲旋律的限定下将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,进而通过乐曲伴奏数据渲染得到能够更精准呈现乐曲数据的乐曲伴奏,提高乐曲伴奏的生成稳定性以及生成效果。Extract music information from the acquired music data to obtain beat data information, chord data information and melody data information; use the melody data information generation constraints to generate music accompaniment data through beat data information and chord data information, and then render based on the music accompaniment data to obtain Musical accompaniment. In the process of generating music accompaniment data from music data, the music beat and music notes are quantified through the music information extraction process to improve the accuracy of the analysis of the music data, making the accompaniment data generation process more targeted; and then integrating the melody data information, beat data information and chord data information. Under the limitations of the music melody, the beat and chords are included in the accompaniment melody generation process, so that the music accompaniment data can be presented in more detail through music parameters, and then more detailed information can be obtained through the music accompaniment data rendering. Accurately presents the music accompaniment of the music data, improving the stability and effect of the music accompaniment generation.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative efforts.
图1是本申请一个示例性实施例提供的实施环境示意图;Figure 1 is a schematic diagram of the implementation environment provided by an exemplary embodiment of the present application;
图2是本申请一个示例性实施例提供的乐曲伴奏的生成方法的流程图;Figure 2 is a flow chart of a method for generating musical accompaniment provided by an exemplary embodiment of the present application;
图3是本申请另一个示例性实施例提供的乐曲伴奏的生成方法的流程图;Figure 3 is a flow chart of a method for generating musical accompaniment provided by another exemplary embodiment of the present application;
图4是本申请再一个示例性实施例提供的乐曲伴奏的生成方法的流程图;Figure 4 is a flow chart of a method for generating musical accompaniment provided by yet another exemplary embodiment of the present application;
图5是本申请又一个示例性实施例提供的乐曲伴奏的生成方法的流程图;Figure 5 is a flow chart of a method for generating musical accompaniment provided by yet another exemplary embodiment of the present application;
图6是本申请一个示例性实施例提供的乐曲伴奏的生成方法整体框架示意图;Figure 6 is a schematic diagram of the overall framework of a method for generating musical accompaniment provided by an exemplary embodiment of the present application;
图7是本申请一个示例性实施例提供的伴奏生成方法的输入示意图;Figure 7 is an input schematic diagram of the accompaniment generation method provided by an exemplary embodiment of the present application;
图8是本申请一个示例性实施例提供的乐曲伴奏的生成方法的处理流程图;Figure 8 is a processing flow chart of a method for generating musical accompaniment provided by an exemplary embodiment of the present application;
图9是本申请一个示例性实施例提供的钢琴简谱示意图;Figure 9 is a schematic diagram of piano musical notation provided by an exemplary embodiment of the present application;
图10是本申请一个示例性实施例提供的乐曲伴奏的生成装置的结构框图;Figure 10 is a structural block diagram of a device for generating musical accompaniment provided by an exemplary embodiment of the present application;
图11是本申请一个示例性实施例提供的服务器的结构框图。Figure 11 is a structural block diagram of a server provided by an exemplary embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
首先,针对本申请实施例中涉及的名词进行简单介绍。First, a brief introduction will be given to the terms involved in the embodiments of this application.
符号域:在音乐理论中,符号域指的是计算机在处理音乐时使用的符号或数值的范围,也即:符号域指代生成过程中计算机读取、处理的音乐格式为数字音乐格式。在数字音乐格式中,音符、音高、音量等音乐元素通常以数字形式进行表示。例如:数字音乐格式实现为数字音乐接口(Musical Instrument Digital Interface,MIDI)格式、音乐可标记扩展语言(Music Extensible Markup Language,MusicXML)格式等。例如,MIDI使用数字表示音符、音高、音量和其他音乐参数。在MIDI文件中,不同的数值代表不同的音符,而音符的强度(velocity)可以用数字来表示。符号域在这里可能包括了诸如音符值(表示音符时值的数字,如:4代表四分音符,8代表八分音符等)、音高(使用数字或编码表示音符的音高,在MIDI中每个音符都有一个对应的音高值)、音量(以数字形式表示音符或乐器的音量级别,较大的数值通常表示更高的音量)等。这些数字或符号构成了计算机在音乐生成过程中所使用的符号域,通过这些符号,计算机能够读取、处理和生成音乐。在这个背景下,符号域的定义涉及到数字表示音乐元素的范围和方式。Symbolic domain: In music theory, the symbolic domain refers to the range of symbols or values used by computers when processing music. That is, the symbolic domain refers to the digital music format that the music format read and processed by the computer during the generation process. In digital music formats, musical elements such as notes, pitch, and volume are usually represented in digital form. For example, digital music formats are implemented as Digital Music Interface (Musical Instrument Digital Interface, MIDI) format, Music Extensible Markup Language (MusicXML) format, etc. For example, MIDI uses numbers to represent notes, pitch, volume, and other musical parameters. In MIDI files, different values represent different notes, and the velocity of the notes can be represented by numbers. The symbol field here may include things such as note value (number representing the value of the note, such as: 4 represents a quarter note, 8 represents an eighth note, etc.), pitch (using numbers or codes to represent the pitch of the note, in MIDI Each note has a corresponding pitch value), volume (a numerical representation of the volume level of the note or instrument, a larger value usually indicates a higher volume), etc. These numbers or symbols constitute the symbolic field used by computers in the music generation process. Through these symbols, computers can read, process and generate music. In this context, the definition of the semiotic domain concerns the scope and manner in which musical elements are digitally represented.
钢琴翻弹:指将音频格式的带人声演唱和完整伴奏的原曲用钢琴曲的形式进行改编并演奏。Piano cover: refers to the adaptation and performance of the original song in audio format with vocal singing and complete accompaniment in the form of piano music.
相关技术中,若希望基于音乐生成对应的音乐伴奏,通常采用基于深度学习的方法进行伴奏生成,借助样本音乐与对应的样本伴奏对模型进行训练,以使得模型学习到生成伴奏的方法;之后将需要生成伴奏的音乐输入训练后的模型,得到音乐伴奏。上述过程过分依赖于样本音乐与样本伴奏之间准确的对应关系,该种方式虽然能够在一定程度上得到良好的音乐伴奏,但是忽略了音乐本身具有的乐理信息,容易导致音乐伴奏的乐曲风格与音乐本身存在较大差距,影响音乐伴奏在音乐领域的准确性。In related technologies, if you want to generate corresponding music accompaniment based on music, you usually use a method based on deep learning to generate accompaniment, and train the model with the help of sample music and corresponding sample accompaniment, so that the model learns the method of generating accompaniment; and then The music that needs to generate accompaniment is input into the trained model to obtain the music accompaniment. The above process relies too much on the accurate correspondence between sample music and sample accompaniment. Although this method can obtain good music accompaniment to a certain extent, it ignores the music theory information of the music itself, which can easily lead to the style of the music accompaniment being different from that of the sample accompaniment. There are large gaps in the music itself, which affects the accuracy of music accompaniment in the field of music.
在本申请实施例中,介绍了一种乐曲伴奏的生成方法,能够通过乐曲信息提取过程对乐曲节拍以及乐曲音符进行量化处理,提升对乐曲数据的分析精准性;进而综合多个量化信息,在乐曲旋律的限定下将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,提高乐曲伴奏的生成稳定性以及生成效果。乐曲伴奏的生成方法可以应用于音乐制作领域、音乐创作领域、游戏制作领域、广告制作领域、虚拟现实(Virtual Reality,VR)领域和增强现实(Augmented Reality,AR)领域等,本申请实施例对此不加以限定。In the embodiment of this application, a method of generating musical accompaniment is introduced, which can perform quantitative processing on the music beat and musical notes through the music information extraction process, thereby improving the accuracy of the analysis of the music data; and then integrating multiple quantified information, in Under the limitation of the music melody, beats and chords are included in the accompaniment melody generation process, so that the music accompaniment data can be presented in more detail through music parameters, improving the stability and generation effect of the music accompaniment. The method of generating music accompaniment can be applied to the fields of music production, music creation, game production, advertising production, virtual reality (Virtual Reality, VR) and augmented reality (Augmented Reality, AR). The embodiments of this application are This is not limited.
需要说明的是,本申请所涉及的信息(包括但不限于用户设备信息、用户个人信息等)、数据(包括但不限于用于分析的数据、存储的数据、展示的数据等)以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关地区的相关法律法规和标准。例如,本申请中涉及到的乐曲数据、乐曲信息提取等内容都是在充分授权的情况下获取的。It should be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application, All are authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant regions. For example, the music data, music information extraction and other contents involved in this application were all obtained with full authorization.
其次,对本申请实施例中涉及的实施环境进行说明,本申请实施例提供的乐曲伴奏的生成方法可以由终端单独执行实现,也可以由服务器执行实现,或者由终端和服务器通过数据交互实现,本申请实施例对此不加以限定。可选地,以终端和服务器交互执行乐曲伴奏的生成方法为例进行说明。Secondly, the implementation environment involved in the embodiments of the present application is explained. The method for generating musical accompaniment provided by the embodiments of the present application can be implemented by the terminal alone, by the server, or by the terminal and the server through data interaction. This method The application examples do not limit this. Optionally, the method of generating a music accompaniment by the terminal and the server interactively is used as an example for description.
示意性的,请参考图1,该实施环境中涉及终端110、服务器120,终端110和服务器120之间通过通信网络130连接。Schematically, please refer to Figure 1. This implementation environment involves a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a communication network 130.
在一些实施例中,终端110具有乐曲数据采集功能,能够通过录制、人工制作等方式获取得到乐曲数据。例如:将一首歌作为乐曲数据。In some embodiments, the terminal 110 has a music data collection function, and can obtain music data through recording, manual production, etc. For example: use a song as music data.
可选地,终端110将乐曲数据通过通信网络130发送至服务器120,服务器120获取得到乐曲数据。其中,乐曲数据被划分为多个乐曲节拍,乐曲节拍中包括乐曲音符。Optionally, the terminal 110 sends the music data to the server 120 through the communication network 130, and the server 120 obtains the music data. The music data is divided into a plurality of music beats, and the music beats include music notes.
在一些实施例中,服务器120对乐曲数据进行乐曲信息提取,得到节拍数据信息、和弦数据信息以及旋律数据信息。In some embodiments, the server 120 extracts music information from the music data to obtain beat data information, chord data information and melody data information.
其中,节拍数据信息用于表征多个乐曲节拍的变化速度,和弦数据信息用于描述以乐曲节拍为单位提取的和弦单元,旋律数据信息用于描述多个乐曲音符之间的音符变化情况。Among them, the beat data information is used to represent the changing speed of the beats of multiple music pieces, the chord data information is used to describe the chord units extracted in units of music beats, and the melody data information is used to describe the note changes between the notes of multiple music pieces.
在一些实施例中,服务器120以旋律数据信息为乐曲伴奏的生成限制条件,通过节拍数据信息和和弦数据信息生成乐曲伴奏数据。In some embodiments, the server 120 uses melody data information as a restriction condition for the generation of music accompaniment, and generates music accompaniment data based on beat data information and chord data information.
其中,旋律数据信息用于以乐曲数据的乐曲旋律限定乐曲伴奏的伴奏旋律,乐曲伴奏数据通过音乐参数描述乐曲数据的伴奏情况。旋律数据信息作为展现乐曲数据整体的乐曲旋律内容,有利于在乐曲伴奏生成过程中起到整体限定效果,从而在乐曲旋律限定伴奏旋律的基础上,通过节拍数据信息表征的节拍速度以及和弦数据信息表征的局部乐曲音符情况,生成精准性更高的乐曲伴奏数据。Among them, the melody data information is used to define the accompaniment melody of the music accompaniment with the melody of the music data, and the music accompaniment data describes the accompaniment of the music data through music parameters. The melody data information, as the melody content of the overall music data that represents the music data, is conducive to the overall limiting effect in the music accompaniment generation process. Therefore, on the basis of the music melody limiting the accompaniment melody, the beat data information represents the beat speed and chord data information. Characterize the local music note conditions to generate more accurate music accompaniment data.
在一些实施例中,服务器120基于乐曲伴奏数据进行音频数据渲染,得到乐曲数据对应的乐曲伴奏。In some embodiments, the server 120 performs audio data rendering based on the music accompaniment data to obtain the music accompaniment corresponding to the music data.
其中,乐曲伴奏数据作为通过音乐参数描述的伴奏情况,是以符号域形式展现的音乐数据内容,因此若需要获取乐曲数据对应的乐曲伴奏,需要对乐曲伴奏数据进行音频数据渲染,从而得到播放的乐曲伴奏。例如:通过特定的音频数据解码软件对乐曲伴奏数据进行分析,从而得到对乐曲伴奏数据进行音频数据呈现的乐曲伴奏。Among them, the music accompaniment data, as the accompaniment described by music parameters, is the music data content displayed in the form of a symbolic domain. Therefore, if you need to obtain the music accompaniment corresponding to the music data, you need to perform audio data rendering on the music accompaniment data to obtain the playback Musical accompaniment. For example, specific audio data decoding software is used to analyze the music accompaniment data, thereby obtaining the music accompaniment that represents the audio data of the music accompaniment data.
可选地,服务器120将乐曲伴奏数据通过通信网络发送至终端110,从而由终端110对乐曲伴奏数据进行音频数据渲染,得到乐曲伴奏;或者,服务器对乐曲伴奏数据进行音频数据渲染,得到便于终端进行直接播放的伴奏数据文件,并将伴奏数据文件通过通信网络发送至终端110,终端110基于伴奏数据文件进行下载并播放乐曲伴奏等。Optionally, the server 120 sends the music accompaniment data to the terminal 110 through the communication network, so that the terminal 110 performs audio data rendering on the music accompaniment data to obtain the music accompaniment; or, the server performs audio data rendering on the music accompaniment data to obtain the music accompaniment data that is convenient for the terminal. The accompaniment data file is directly played, and the accompaniment data file is sent to the terminal 110 through the communication network. The terminal 110 downloads and plays the musical accompaniment based on the accompaniment data file.
值得注意的是,上述终端包括但不限于手机、平板电脑、便携式膝上笔记本电脑、智能语音交互设备、智能家电、车载终端等移动终端,也可以实现为台式电脑等;上述服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是云服务器。It is worth noting that the above-mentioned terminals include but are not limited to mobile terminals such as mobile phones, tablet computers, portable laptops, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, etc., and can also be implemented as desktop computers, etc.; the above-mentioned servers can be independent A physical server can also be a server cluster or distributed system composed of multiple physical servers, or a cloud server.
在一些实施例中,上述服务器还可以实现为区块链系统中的节点。In some embodiments, the above-mentioned server can also be implemented as a node in the blockchain system.
结合上述名词简介和应用场景,对本申请提供的乐曲伴奏的生成方法进行说明,以该方法应用于服务器为例进行说明,如图2所示,该方法包括如下步骤210至步骤240。Combining the above noun introduction and application scenarios, the method for generating music accompaniment provided by this application will be described, taking the method applied to the server as an example. As shown in Figure 2, the method includes the following steps 210 to 240.
步骤210,获取乐曲数据。Step 210: Obtain music data.
示意性的,乐曲数据是指通过音频形式表现的数据,用于包含音乐的实际音频内容。Illustratively, music data refers to data expressed in audio form and is used to contain the actual audio content of the music.
可选地,乐曲数据可以实现以波形音频文件格式(Waveform Audio File Format,WAV)、动态影像专家压缩标准音频层面(Moving Picture Experts Group Audio LayerIII,MP3)、自由无损音频压缩编码(Free Lossless Audio Codec,FLAC)等格式存储,基于其中包含声波信号,因此乐曲数据可用于播放音乐内容。Optionally, the music data can be implemented in Waveform Audio File Format (WAV), Moving Picture Experts Group Audio Layer III (MP3), Free Lossless Audio Codec , FLAC) and other formats, which contain sound wave signals, so the music data can be used to play music content.
例如:乐曲数据实现为一首人声歌曲,如:歌手演唱的专辑音乐,或者个人演唱的歌曲,或者个人哼唱的歌曲等;乐曲数据还可以实现为广播电台的节目、电视节目、新闻广播等;乐曲数据还可以实现为音乐会录音或者演唱会录音;乐曲数据还可以实现为电话录音等。For example: the music data is implemented as a vocal song, such as: album music sung by a singer, or a song sung by an individual, or a song hummed by an individual, etc.; the music data can also be implemented as a radio station program, TV program, news broadcast etc.; the music data can also be implemented as concert recording or concert recording; the music data can also be implemented as telephone recording, etc.
其中,乐曲数据被划分为多个乐曲节拍,乐曲节拍中包括乐曲音符。The music data is divided into a plurality of music beats, and the music beats include music notes.
示意性的,乐曲节拍是音乐中的一个基本组织元素,乐曲节拍决定了乐曲音符在时间上的排列和强调情况,作为能够表达音乐时间感的内容,一首音乐通常由强拍和弱拍交替组成。乐曲节拍的强弱关系创建了乐曲数据的节奏感,在不同的音乐风格和文化中,乐曲节拍的使用方式和强调可能各不相同,乐曲节拍是创作者表达音乐情感和传达音乐信息的重要手段之一。Schematically, the beat of a piece of music is a basic organizational element in music. The beat of a piece of music determines the arrangement and emphasis of the notes of the piece in time. As a content that can express the sense of time in music, a piece of music usually alternates between strong beats and weak beats. composition. The strong and weak relationship between the beats of a piece of music creates the sense of rhythm of the piece of music. In different music styles and cultures, the use and emphasis of the beat of the piece of music may be different. The beat of the piece of music is an important means for creators to express musical emotions and convey musical information. one.
示意性的,乐曲节拍是拍子中的一个时间单位,每个拍子都有一个强拍(通常是第一拍),其他拍子则被称为弱拍。拍子作为乐谱上表示音乐节奏的符号,由两个数字组成,上面的数字表示每小节中拍子的数量,下面的数字表示每个拍子的时值,时值代表乐曲节拍中乐曲音符的持续时长。例如:4/4拍子表示每小节有4个拍子,每个拍子被称为一个四分音符的时间长度。Schematically, the tempo of a piece of music is a time unit in the beats. Each beat has a strong beat (usually the first beat), and other beats are called weak beats. As a symbol representing the rhythm of music on the score, beats consist of two numbers. The upper number represents the number of beats in each section, and the lower number represents the duration of each beat. The duration represents the duration of the musical notes in the beat of the music. For example: 4/4 time means that there are 4 beats in each measure, and each beat is called a quarter note in time.
也即:乐曲节拍是音乐中一个基本的时间单位,包括在其中的乐曲音符决定了这个时间单位内的音乐信息。在一个拍子内,可以容纳不同时值的乐曲音符,这些音符的组合和排列形成了乐曲的节奏。That is to say: the beat of music is a basic time unit in music, and the music notes included in it determine the music information within this time unit. Within a beat, musical notes of different durations can be accommodated, and the combination and arrangement of these notes form the rhythm of the music.
步骤220,对乐曲数据进行乐曲信息提取,得到节拍数据信息、和弦数据信息以及旋律数据信息。Step 220: Extract music information from the music data to obtain beat data information, chord data information and melody data information.
示意性的,乐曲信息提取用于对乐曲数据进行量化处理,以将通过音频形式展现的乐曲数据以数据形式进行展现。Illustratively, the music information extraction is used to perform quantization processing on the music data, so as to present the music data presented in audio form in the form of data.
可选地,对乐曲数据进行乐曲信息提取,能够获取表征乐曲数据节奏变化的节拍数据信息,还能够获取表征乐曲数据中不同和弦的和弦数据信息,还能够获取表征乐曲数据整体旋律变化的旋律数据信息。Optionally, extracting music information from the music data can obtain beat data information that represents rhythm changes in the music data, chord data information that represents different chords in the music data, and melody data that represents overall melody changes in the music data. information.
也即:节拍数据信息用于表征多个乐曲节拍的变化速度,和弦数据信息用于描述以乐曲节拍为单位提取的和弦单元,旋律数据信息用于描述多个乐曲音符之间的音符变化情况。That is, the beat data information is used to represent the changing speed of the beats of multiple music pieces, the chord data information is used to describe the chord units extracted in units of music beats, and the melody data information is used to describe the note changes between the notes of multiple music pieces.
示意性的,乐曲节拍作为乐曲数据中的基本时间单位,创造了乐曲数据的基本节奏结构,并定义了乐曲音符在时间轴上的排序情况。乐曲节拍在由拍子(Time Signature)表示时,指定每小节中有多少拍子以及每个拍子的时值。在获取节拍数据信息时,可以首先确定乐曲数据对应的多个乐曲节拍,进而通过多个乐曲节拍的分布变化情况确定节拍数据信息。Schematically, as the basic time unit in the music data, the music beat creates the basic rhythm structure of the music data and defines the ordering of the music notes on the time axis. When the beat of the music is represented by a beat (Time Signature), specify how many beats there are in each measure and the duration of each beat. When obtaining the beat data information, multiple music beats corresponding to the music data may be first determined, and then the beat data information may be determined based on the distribution changes of the multiple music beats.
示意性的,和弦是同时演奏的至少两个音符的集合,通过以固定的音程关系进行排列。和弦是音乐中的和声基础,对于创造以及强调和谐感十分重要。和弦可以包含基音、第三音、第五音等乐曲音符,从而形成不同的和声质感。也即:和弦关注同时发生的音的组合,其侧重在垂直方向上表示音高关系。在获取和弦数据信息时,可以以乐曲节拍为单位,确定每个乐曲节拍中的乐曲音符,进而将乐曲音频分组为和弦(或称和弦单元)。Schematically, a chord is a collection of at least two notes played simultaneously, arranged in a fixed interval relationship. Chords are the basis of harmony in music and are important for creating and emphasizing harmony. Chords can contain musical notes such as fundamentals, thirds, and fifths, creating different harmonic textures. That is to say: chords focus on the combination of sounds that occur at the same time, and their emphasis is on expressing pitch relationships in the vertical direction. When obtaining the chord data information, the music notes in each music beat can be determined based on the music beat as a unit, and then the music audio is grouped into chords (or chord units).
示意性的,旋律是一系列有机联系的音符,按照时间的顺序演奏,形成具有旋律线索的音乐表达。旋律是音高和时值的组合,是音乐中最易识别和记忆的部分,通常由主旋律和次旋律组成。也即:旋律侧重关注的是水平方向上的音高和时值的组合。在获取旋律数据信息时,侧重于关注多个乐曲音符分别对应的音高变化情况以及多个乐曲音符分别对应的时值,从而综合确定与乐曲数据对应的旋律数据信息。Schematically, a melody is a series of organically connected notes, played in time sequence, forming a musical expression with melodic clues. Melody is a combination of pitch and duration. It is the easiest part to recognize and remember in music. It usually consists of main melody and sub-melody. That is to say: the melody focuses on the combination of pitch and duration in the horizontal direction. When acquiring the melody data information, focus on the pitch changes corresponding to the multiple music notes and the corresponding durations of the multiple music notes, thereby comprehensively determining the melody data information corresponding to the music data.
在一个乐曲数据中,节拍、和弦以及旋律这三个元素通常相互交织,共同创造出复杂而有趣的音乐体验。通过乐曲节拍提供了时间框架,通过和弦提供了和声基础,通过旋律给予乐曲引导线索,从而对乐曲数据进行更细致地呈现。In a piece of music data, the three elements of beat, chord, and melody are often intertwined to create a complex and interesting musical experience. The beat of the music provides a time frame, the chords provide a harmonic foundation, and the melody gives guidance clues to the music, thereby presenting the music data in more detail.
借助乐曲信息提取过程,将乐曲节拍量化为节拍数据信息,将和弦量化为和弦数据信息,将旋律量化为旋律数据信息,以便基于信息提取后的多个量化信息对乐曲数据进行分析。With the help of the music information extraction process, the beat of the music is quantified into beat data information, the chords are quantified into chord data information, and the melody is quantified into melody data information, so that the music data can be analyzed based on multiple quantified information after information extraction.
步骤230,以旋律数据信息为乐曲伴奏的生成限制条件,通过节拍数据信息和和弦数据信息生成乐曲伴奏数据。Step 230: Use the melody data information as a restriction condition for the generation of music accompaniment, and generate music accompaniment data based on the beat data information and chord data information.
示意性的,在得到旋律数据信息后,基于旋律数据信息表征乐曲数据的整体旋律情况,因此以旋律数据信息为生成限制条件,以在旋律数据信息表征的乐曲旋律内生成乐曲数据对应的乐曲伴奏。Schematically, after obtaining the melody data information, the overall melody situation of the music data is represented based on the melody data information. Therefore, the melody data information is used as the generation restriction condition to generate the music accompaniment corresponding to the music data within the music melody represented by the melody data information. .
也即:旋律数据信息用于以乐曲数据的乐曲旋律限定乐曲伴奏的伴奏旋律。That is, the melody data information is used to define the accompaniment melody of the music accompaniment based on the music melody of the music data.
示意性的,乐曲旋律用于表征一系列有机联系的乐曲音符,按照时间的顺序演奏以形成具有旋律线索的音乐表达,属于乐曲数据中最易识别和记忆的部分;旋律数据信息是指表示旋律的数字、符号或计算机可读的形式,可以包括音高序列、时值信息、音符持续时间等,通常以数字或符号的形式进行编码,是用于计算机分析、音乐生成或其他数字音乐处理任务的信息。也即:旋律数据信息与乐曲旋律存在对应关系,旋律数据信息是乐曲旋律的数字形式。Schematically, the music melody is used to represent a series of organically connected music notes, which are played in time order to form a musical expression with melody clues. It is the easiest part to identify and remember in the music data; melody data information refers to the representation of the melody. Numerical, symbolic or computer-readable form, which can include pitch sequences, timing information, note duration, etc., usually encoded in the form of numbers or symbols, and is used for computer analysis, music generation or other digital music processing tasks Information. That is to say: there is a corresponding relationship between the melody data information and the melody of the music piece, and the melody data information is the digital form of the music melody.
同理,伴奏旋律用于表征一系列有机联系的乐曲音符,按照时间的顺序演奏以形成具有旋律线索的乐曲伴奏。因此,在以旋律数据信息为乐曲伴奏的生成限制条件时,通过旋律数据信息对应的乐曲旋律限定乐曲伴奏对应的伴奏旋律。In the same way, the accompaniment melody is used to represent a series of organically connected musical notes, which are played in time order to form a musical accompaniment with melodic clues. Therefore, when the melody data information is used as a restriction condition for the generation of music accompaniment, the accompaniment melody corresponding to the music accompaniment is limited by the music melody corresponding to the melody data information.
其中,乐曲伴奏数据通过音乐参数描述乐曲数据的伴奏情况。Among them, the music accompaniment data describes the accompaniment of the music data through music parameters.
示意性的,乐曲伴奏数据与伴奏旋律存在对应关系,乐曲伴奏数据是伴奏旋律的数字形式;在通过节拍数据信息和和弦数据信息进行生成时,生成与伴奏旋律对应的乐曲伴奏数据,该乐曲伴奏数据作为与伴奏旋律对应的数字形式,是通过众多音乐参数对乐曲数据的伴奏进行描述后生成的内容。Schematically, there is a corresponding relationship between the music accompaniment data and the accompaniment melody, and the music accompaniment data is the digital form of the accompaniment melody; when generated through the beat data information and the chord data information, the music accompaniment data corresponding to the accompaniment melody is generated, and the music accompaniment data is generated. The data is a digital form corresponding to the accompaniment melody, and is generated by describing the accompaniment of the music data through numerous musical parameters.
基于乐曲伴奏不仅与乐曲数据对应的乐曲旋律相关,也与和弦与节拍相关,因此在生成乐曲伴奏数据时,不仅会通过与旋律相关的音高、时值、音色等音乐参数表达,还会通过与和弦相关的音高、和声等音乐参数相关,也会通过与节拍相关的音量、节奏模式等音乐参数相关。也即:用于描述乐曲数据伴奏情况的音乐参数包括音高、音色、音量、节奏模式、和声部分等多种与乐曲伴奏相关的参数内容。Based on the fact that the music accompaniment is not only related to the melody corresponding to the music data, but also related to the chords and beats, when generating the music accompaniment data, it will not only be expressed through the pitch, duration, timbre and other music parameters related to the melody, but also through It is related to musical parameters such as pitch and harmony related to chords, and also related to music parameters such as volume and rhythm pattern related to beats. That is to say: the music parameters used to describe the accompaniment of the music data include pitch, timbre, volume, rhythm pattern, harmony part and other parameters related to the music accompaniment.
步骤240,基于乐曲伴奏数据进行音频数据渲染,得到乐曲数据对应的乐曲伴奏。Step 240: Perform audio data rendering based on the music accompaniment data to obtain the music accompaniment corresponding to the music data.
可选地,在得到乐曲伴奏数据后,基于乐曲伴奏数据是乐曲伴奏对应的数字形式,因此可以对乐曲伴奏数据进行数据解码,以将乐曲伴奏数据以音频形式进行呈现。也即:对乐曲伴奏数据进行音频数据渲染,从而得到与乐曲数据对应的乐曲伴奏。Optionally, after obtaining the music accompaniment data, based on the fact that the music accompaniment data is a digital form corresponding to the music accompaniment, the music accompaniment data can be data decoded to present the music accompaniment data in audio form. That is, audio data rendering is performed on the music accompaniment data to obtain the music accompaniment corresponding to the music data.
示意性的,乐曲伴奏数据实现为描述乐曲数据的数字表示——MIDI文件形式,在需要获取乐曲伴奏数据对应的乐曲伴奏时,基于MIDI文件包含音符、音高、时值等音乐信息,但本身并不包含声音波形,因此需要将MIDI文件转换为用于渲染得到乐曲伴奏的伴奏数据。也即:首先基于乐曲伴奏数据进行音频转换,得到伴奏音频;针对伴奏音频进行音频渲染,得到乐曲伴奏。Schematically, the music accompaniment data is implemented in the form of a MIDI file, a digital representation of the music accompaniment data. When it is necessary to obtain the music accompaniment corresponding to the music accompaniment data, the MIDI file contains music information such as notes, pitches, and durations, but it itself It does not contain sound waveforms, so the MIDI file needs to be converted into accompaniment data for rendering the music accompaniment. That is to say: first perform audio conversion based on the music accompaniment data to obtain the accompaniment audio; perform audio rendering on the accompaniment audio to obtain the music accompaniment.
可选地,对乐曲伴奏数据进行音频转换并得到伴奏数据的方式包括如下步骤。Optionally, the method of performing audio conversion on the music accompaniment data and obtaining the accompaniment data includes the following steps.
(1)软件工具:借助使用专门的音乐制作软件或MIDI编辑器将MIDI文件转换为伴奏数据。MIDI编辑器实现为专业音序器(Ableton Live)、果味循环工作室(Fruity LoopsStudio,FL Studio)、逻辑增强器(Logic Pro)、流体合成器(Fluid Synth)、Timidity++等。(1) Software tools: Use specialized music production software or MIDI editor to convert MIDI files into accompaniment data. MIDI editors are implemented as professional sequencers (Ableton Live), Fruity Loops Studio (FL Studio), logic enhancers (Logic Pro), fluid synthesizers (Fluid Synth), Timidity++, etc.
(2)虚拟乐器或音源:在上述软件中选择或加载虚拟乐器或音源插件。这些插件充当虚拟乐器,能够根据MIDI文件的信息生成相应的音频波形。(2) Virtual instruments or sound sources: Select or load virtual instruments or sound source plug-ins in the above software. These plug-ins act as virtual instruments, capable of generating corresponding audio waveforms based on information from MIDI files.
(3)连接MIDI文件:将MIDI文件导入到软件中,通常通过拖放文件或导入功能。MIDI文件包含了音乐的音符、音高、时值等信息。(3) Connect MIDI files: Import MIDI files into the software, usually through drag-and-drop files or the import function. MIDI files contain music notes, pitch, duration and other information.
(4)分配音色:为MIDI文件或音符分配合适的音色(instrument),确定使用何种乐器模拟MIDI文件中的音符。该过程通常在虚拟乐器或音源插件的界面中完成。(4) Assign timbre: Assign appropriate timbre (instrument) to MIDI files or notes, and determine which instrument to use to simulate the notes in the MIDI file. This process is usually done within the interface of a virtual instrument or sound module plug-in.
(5)渲染为音频:借助预设软件的“导出”或“渲染”功能,将MIDI文件渲染为音频文件,通常是WAV、MP3、音频文件格式(Audio Interchange File Format,AIFF)等;预设软件会根据MIDI文件生成相应的音频波形。(5) Render to audio: Use the "export" or "render" function of the preset software to render the MIDI file into an audio file, usually WAV, MP3, Audio Interchange File Format (AIFF), etc.; preset The software will generate corresponding audio waveforms based on MIDI files.
(6)调整效果:根据需要可以在软件中添加音频效果、混响、均衡器等,以调整音频的最终效果。(6) Adjust effects: You can add audio effects, reverberation, equalizer, etc. in the software as needed to adjust the final effect of the audio.
值得注意的是,上述将MIDI文件转换至伴奏音频的转换过程中,音质和表现力取决于使用的虚拟乐器或音源的质量。一些专业的虚拟乐器库提供高质量的音色和逼真的音频生成;借助上述流程能够将MIDI文件中的音乐信息转换为计算机可识别的音频格式(伴奏音频),从而实现在计算机或其他音频设备上打开伴奏音频,以实现播放音乐的目的。It is worth noting that in the above conversion process of converting MIDI files to accompaniment audio, the sound quality and expressiveness depend on the quality of the virtual instrument or sound source used. Some professional virtual instrument libraries provide high-quality timbres and realistic audio generation; with the above process, the music information in the MIDI file can be converted into a computer-recognizable audio format (accompaniment audio), so that it can be played on a computer or other audio device Turn on the accompaniment audio for the purpose of playing music.
可选地,对音频转换后的伴奏音频进行渲染,以得到乐曲伴奏。例如:通过终端打开伴奏音频,从而播放乐曲伴奏等。Optionally, the audio-converted accompaniment audio is rendered to obtain the music accompaniment. For example: open the accompaniment audio through the terminal to play the music accompaniment, etc.
值得注意的是,以上仅为示意性的举例,本申请实施例对此不加以限定。It is worth noting that the above are only illustrative examples, and the embodiments of the present application are not limited thereto.
综上所述,对获取的乐曲数据进行乐曲信息提取,得到节拍数据信息、和弦数据信息以及旋律数据信息;以旋律数据信息生成限制条件通过节拍数据信息和和弦数据信息生成乐曲伴奏数据,进而基于乐曲伴奏数据渲染得到乐曲伴奏。在通过乐曲数据生成乐曲伴奏数据的过程中,通过乐曲信息提取过程对乐曲节拍以及乐曲音符进行量化处理,提升对乐曲数据的分析精准性,使得伴奏数据生成过程更加具有针对性;进而综合旋律数据信息、节拍数据信息以及和弦数据信息,在乐曲旋律的限定下将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,进而通过乐曲伴奏数据渲染得到能够更精准呈现乐曲数据的乐曲伴奏,提高乐曲伴奏的生成稳定性以及生成效果。To sum up, the music information is extracted from the acquired music data to obtain the beat data information, the chord data information and the melody data information; the music accompaniment data is generated through the beat data information and the chord data information based on the melody data information generation constraints, and then based on The music accompaniment data is rendered to obtain the music accompaniment. In the process of generating music accompaniment data from music data, the music beat and music notes are quantified through the music information extraction process to improve the accuracy of the analysis of the music data, making the accompaniment data generation process more targeted; and then integrating the melody data information, beat data information and chord data information. Under the limitations of the music melody, the beat and chords are included in the accompaniment melody generation process, so that the music accompaniment data can be presented in more detail through music parameters, and then more detailed information can be obtained through the music accompaniment data rendering. Accurately presents the music accompaniment of the music data, improving the stability and effect of the music accompaniment generation.
在一个可选的实施例中,借助多个乐曲节拍在单位时间内的数量确定节拍数据信息,通过旋律轨和和弦轨获取乐曲数据分别对应的旋律数据信息和和弦数据信息。示意性的,如图3所示,上述图2所示出的步骤220还可以实现为如下步骤310至步骤330。In an optional embodiment, beat data information is determined based on the number of beats of a plurality of music pieces in unit time, and melody data information and chord data information respectively corresponding to the music piece data are obtained through the melody track and the chord track. Schematically, as shown in Figure 3, the above step 220 shown in Figure 2 can also be implemented as the following steps 310 to 330.
步骤310,基于多个乐曲节拍在单位时间内的数量,确定乐曲数据对应的节拍数据信息。Step 310: Determine the beat data information corresponding to the music data based on the number of multiple music beats in unit time.
示意性的,单位时间是预先设定的单位时长。例如:单位时间为1分钟;或者,单位时间为半分钟;或者,单位时间为5秒钟等。Illustratively, the unit time is a preset unit duration. For example: the unit time is 1 minute; or the unit time is half a minute; or the unit time is 5 seconds, etc.
可选地,以每分钟节拍数(Beat Per Minute,BPM)作为乐曲数据对应的数据节拍信息;BPM是音乐中用于表示节奏速度的单位,用于表征每分钟内有多少个拍子。在确定BPM的过程中,可以采用手动计算的方式,也可以依赖音乐制作软件等工具。例如:采用手动计算方式时,如果能感受到音乐的节奏则可以使用手表或计时器在一分钟内确定拍子的次数,如在一分钟内数到120下则BPM为120;或者,采用音乐节拍检测器确定BPM,可以显示歌曲的BPM等。Optionally, Beats Per Minute (BPM) is used as the data beat information corresponding to the music data; BPM is a unit used to express rhythm speed in music and is used to represent how many beats there are per minute. In the process of determining BPM, you can use manual calculation or rely on tools such as music production software. For example: when using manual calculation, if you can feel the rhythm of the music, you can use a watch or timer to determine the number of beats in one minute. If you count 120 beats in one minute, the BPM is 120; or, use the music beat The detector determines the BPM and can display the BPM of a song, etc.
步骤320,对乐曲数据进行乐曲信息提取,确定乐曲数据对应的和弦轨和旋律轨。Step 320: Extract music information from the music data to determine the chord track and melody track corresponding to the music data.
其中,和弦轨用于描述具有时序关系的多个乐曲音符以和弦形式构建的音群。Among them, the chord track is used to describe a sound group constructed in the form of a chord by multiple musical notes with a temporal relationship.
示意性的,和弦轨(Chord Track)是音乐制作软件中的一个功能,用于表示音乐中的和弦进度。Schematically, the chord track (Chord Track) is a function in music production software, used to represent the chord progression in music.
可选地,和弦轨通常会被分割成小节,以便更好地组织和理解音乐的结构。和弦轨的小节的数量取决于音乐的结构和编排;在音乐制作软件中,可以在和弦轨上创建和编辑和弦,每个小节通常对应音乐中的一个小节,从而有助于在整个曲目中保持一致的和弦进度,便于调整和组织音乐。Optionally, chord tracks are often split into bars to better organize and understand the structure of the music. The number of bars in a chord track depends on the structure and arrangement of the music; in music production software, chords can be created and edited on the chord track, with each bar typically corresponding to a bar in the music, helping to maintain consistency throughout the track. Consistent chord progressions make it easy to adjust and organize your music.
其中,旋律轨用于描述多个乐曲音符依照时序关系构成的主旋律。Among them, the melody track is used to describe the main melody composed of multiple music notes according to the time sequence relationship.
示意性的,在音乐制作软件中,旋律轨(Melody Track)是音乐制作中的一个概念,它指的是包含主旋律的音轨或轨道。主旋律是音乐中最突出、最引人注目的旋律线,通常由乐器或歌唱(如人声歌唱)演出。在音乐制作软件中,制作者可以使用旋律轨录制、编辑和排列主旋律。Schematically, in music production software, melody track (Melody Track) is a concept in music production, which refers to the audio track or track containing the main melody. The main melody is the most prominent and eye-catching melody line in music, usually performed by instruments or singing (such as vocal singing). In music production software, producers can use melody tracks to record, edit, and arrange main melodies.
其中,旋律轨作为用于容纳主旋律的音轨,可以将乐曲数据中最重要的、最易记的旋律线进行记录。因为主旋律是音乐中吸引听众注意力的关键元素之一。通过旋律轨使得制作者可以精确地塑造和控制音乐的核心元素,从而创造出具有独特风格和情感的作品。Among them, the melody track is a track used to accommodate the main melody, and can record the most important and most memorable melody line in the music data. Because the main melody is one of the key elements in music that attracts the audience's attention. Melody tracks allow producers to precisely shape and control the core elements of music to create works with unique style and emotion.
可选地,和弦轨通常也会被分割成小节。旋律轨小节的数量取决于音乐的结构、编曲和制作者的创作风格。Optionally, chord tracks are often split into bars as well. The number of bars in a melody track depends on the structure of the music, its arrangement, and the creative style of the producer.
步骤330,基于旋律轨和和弦轨获取乐曲数据分别对应的旋律数据信息以及和弦数据信息。Step 330: Obtain melody data information and chord data information respectively corresponding to the music data based on the melody track and the chord track.
在一个可选的实施例中,分别确定旋律轨中小节的数量以及和弦轨中小节的数量,得到旋律轨对应的第一数量以及和弦轨对应的第二数量。In an optional embodiment, the number of bars in the melody track and the number of bars in the chord track are respectively determined to obtain a first number corresponding to the melody track and a second number corresponding to the chord track.
其中,第一数量用于表征旋律轨中小节的数量,即:旋律轨中包括第一数量的小节;第二数量用于表征和弦轨中小节的数量,即:和弦轨中包括第人数量的小节。Among them, the first quantity is used to represent the number of bars in the melody track, that is: the melody track includes the first number of bars; the second quantity is used to represent the number of bars in the chord track, that is: the chord track includes the third number of bars. section.
示意性的,旋律轨和和弦轨通常均会被各自分割成小节;将旋律轨分割为小节后,得到第一数量的小节;将和弦轨分割为小节后,得到第二数量的小节。Illustratively, the melody track and the chord track are usually divided into measures respectively; after dividing the melody track into measures, a first number of measures is obtained; after dividing the chord track into measures, a second number of measures is obtained.
可选地,预先获取音乐特征提取模型,音乐特征提取模型是预先训练的模型,用于对乐曲数据进行诸如乐曲节拍、和弦、旋律等特征的分析过程。借助音乐特征提取模型对旋律轨和和弦轨分别进行小节提取,从而得到旋律轨中第一数量的小节,以及得到和弦轨中第二数量的小节。Optionally, a music feature extraction model is obtained in advance. The music feature extraction model is a pre-trained model and is used to analyze music data such as music beat, chord, melody and other features. The music feature extraction model is used to extract measures from the melody track and the chord track respectively, thereby obtaining the first number of measures in the melody track and the second number of measures in the chord track.
示意性的,第一数量和第二数量可能相等;或者,第一数量和第二数量不同,如:第一数量小于第二数量,或者第二数量小于第一数量等。Illustratively, the first quantity and the second quantity may be equal; or, the first quantity and the second quantity may be different, such as: the first quantity is smaller than the second quantity, or the second quantity is smaller than the first quantity, etc.
在一个可选的实施例中,以第一数量为基准,对和弦轨的第二数量进行调整,得到调整后的和弦轨作为和弦数据信息。In an optional embodiment, the second number of chord tracks is adjusted based on the first number, and the adjusted chord track is obtained as the chord data information.
可选地,响应于第二数量小于第一数量,基于第一数量对和弦轨进行补齐操作,得到补齐后的和弦轨作为和弦数据信息。补齐后的和弦轨即为上述调整后的和弦轨。Optionally, in response to the second number being less than the first number, a completion operation is performed on the chord track based on the first number, and the completed chord track is obtained as the chord data information. The completed chord track is the adjusted chord track mentioned above.
示意性的,若第二数量小于第一数量,则代表对和弦轨进行小节划分后得到小节的数量较少,对旋律轨进行小节划分后得到小节的数量较多;基于旋律轨能够更好地表征乐曲数据的整体效果,因此以旋律轨对应的第一数量为准,对第二数量进行补齐操作,从而得到补齐后的和弦轨作为和弦数据信息。Schematically, if the second number is smaller than the first number, it means that the number of bars obtained after dividing the chord track into bars is smaller, and the number of bars obtained after dividing the melody track into bars is greater; based on the melody track, it can be better It represents the overall effect of the music data, so based on the first number corresponding to the melody track, the second number is complemented, thereby obtaining the completed chord track as the chord data information.
示意性的,在补齐操作过程中,通过复制和弦轨中需要补齐小节的前一小节的和弦,得到补齐后的和弦轨作为和弦数据信息。Illustratively, during the completion operation, by copying the chord in the chord track in the previous section of the section that needs to be completed, the completed chord track is obtained as the chord data information.
在一些实施例中,对补齐后的和弦轨中的每一小节进行检测,为避免伴奏有过长时间的休止,当存在小节没有任何和弦时,复制上一小节的和弦;若该小节为第一小节,则复制后面第一个不为全休止的小节的和弦。In some embodiments, each bar in the completed chord track is detected. In order to avoid a long pause in the accompaniment, when there is a bar without any chords, the chord of the previous bar is copied; if the bar is In the first measure, copy the chord of the first measure that is not a full rest.
可选地,响应于第二数量等于第一数量,将和弦轨作为和弦数据信息;响应于第二数量大于第一数量,将旋律轨与和弦轨进行对齐操作,得到与旋律轨对应的对齐和弦轨作为和弦数据信息等。Optionally, in response to the second number being equal to the first number, using the chord track as chord data information; in response to the second number being greater than the first number, performing an alignment operation on the melody track and the chord track to obtain an aligned chord corresponding to the melody track tracks as chord data information, etc.
在一个可选的实施例中,基于旋律轨中多个乐曲音符分别对应的音符音高,对旋律轨进行旋律变换处理,得到更新后的旋律轨作为旋律数据信息。In an optional embodiment, based on the note pitches respectively corresponding to multiple music notes in the melody track, the melody track is subjected to melody transformation processing to obtain the updated melody track as melody data information.
示意性的,旋律轨描述了多个乐曲音符分别对应的音符特征,音高是音乐中一个基本而重要的概念,它决定了乐曲音符的相对高低。Schematically, the melody track describes the note characteristics corresponding to multiple music notes. Pitch is a basic and important concept in music, which determines the relative height of the music notes.
可选地,对于部分歌曲旋律普遍音高较低的情况,为提升听感同时防止与伴奏冲突,可以选择性地对旋律进行高八度处理。Optionally, for some songs whose melody generally has a low pitch, in order to improve the listening experience and prevent conflict with the accompaniment, the melody can be selectively processed to a higher octave.
在一些实施例中,获取预设低音高和预设高音高。In some embodiments, a preset bass pitch and a preset treble pitch are obtained.
其中,预设低音高和预设高音高用于综合限定对旋律轨进行旋律变换处理的处理方式。Among them, the preset bass pitch and the preset treble pitch are used to comprehensively define the melody transformation processing method for the melody track.
在一些实施例中,将旋律轨中多个乐曲音符分别对应的音符音高与预设低音高进行比较,以及将多个乐曲音符分别对应的音符音高与预设高音高进行比较,确定低音音符比例以及高音音符比例。In some embodiments, the note pitches corresponding to the plurality of music notes in the melody track are compared with the preset bass pitch, and the note pitches corresponding to the multiple music notes are compared with the preset treble pitch to determine the bass. Note proportions and treble note proportions.
其中,低音音符比例用于表示低音音符占多个乐曲音符的音符比例,低音音符用于表示低于预设低音高的乐曲音符;高音音符比例用于表示高音音符占多个乐曲音符的音符比例,高音音符用于表示高于预设高音高的乐曲音符。Among them, the bass note ratio is used to represent the proportion of bass notes accounting for multiple music notes, and the bass note is used to represent music notes lower than the preset bass pitch; the treble note ratio is used to represent the ratio of high pitch notes accounting for multiple music notes. , treble note is used to represent music notes that are higher than the preset treble pitch.
在一些实施例中,基于低音音符比例以及高音音符比例对旋律轨进行旋律变换处理,得到更新后的旋律轨作为旋律数据信息。In some embodiments, the melody track is subjected to melody transformation processing based on the bass note ratio and the treble note ratio to obtain the updated melody track as melody data information.
示意性的,在获取得到旋律轨后,确定其中多个乐曲音符分别对应的音符音高;获取预设低音高和预设高音高,将多个乐曲音符分别与预设低音高和预设高音高进行比较,以分别计算低音音符比例以及高音音符比例。Schematically, after obtaining the melody track, determine the note pitches corresponding to multiple music notes; obtain the preset bass pitch and the preset treble pitch, and compare the multiple music notes with the preset bass pitch and preset treble pitch respectively. High is compared to calculate the bass note ratio and the treble note ratio respectively.
例如:以预设低音高为56,预设高音高为70为例,在确定多个乐曲音符分别对应的音符音高后,将多个音符音高与56和70分别进行比较,若乐曲音符对应的音符音高低于56,视为该乐曲音符为低音音符;若乐曲音符对应的音符音高高于70,视为该乐曲音符为高音音符;从而能够确定低音音符的第一音符数量和高音音符的第二音符数量,进而综合第一音符数量与乐曲音符的乐曲音符数量确定低音音符比例,综合第二音符数量与乐曲音符数量确定高音音符比例。For example: Take the preset bass pitch as 56 and the preset treble pitch as 70. After determining the note pitches corresponding to multiple music notes, compare the multiple note pitches with 56 and 70 respectively. If the music notes If the pitch of the corresponding note is lower than 56, it is considered that the note of the music is a bass note; if the pitch of the note corresponding to the note of the music is higher than 70, it is considered that the note of the music is a treble note; thus, the number of the first note of the bass note and the number of treble notes can be determined The number of second notes of the notes is then combined to determine the bass note ratio by combining the number of first notes and the number of music notes of the music notes, and the ratio of treble notes is determined by combining the number of second notes and the number of music notes.
示意性的,在低音音符比例和高音音符比例同时符合预设条件的情况下,不对旋律轨进行调整。Illustratively, when the bass note ratio and the treble note ratio meet the preset conditions at the same time, the melody track will not be adjusted.
例如:当高音音符比例超过10%且低音音符比例低于20%时,则不对旋律轨进行高八度处理;当不符合上述预设条件的情况,对旋律轨进行调整。For example: when the proportion of treble notes exceeds 10% and the proportion of bass notes is less than 20%, the melody track will not be processed an octave higher; when the above preset conditions are not met, the melody track will be adjusted.
在一些实施例中,为了使得乐曲有完整度和终止感,可以为每首乐曲加上尾奏,长度范围为一个小节到三个小节。由于不同乐曲旋律结尾小节不同,有的结尾为一个长音,有的结尾有长时间的休止,有的则没有足够的时间来加尾奏。因此需要借助旋律轨的情况,提前判断是否对伴奏轨加上尾奏小节。In some embodiments, in order to make the music have a sense of completeness and ending, an ending may be added to each piece of music, with a length ranging from one measure to three measures. Because the melodies of different pieces of music have different ending measures, some end with a long note, some end with a long rest, and some do not have enough time to add an ending. Therefore, you need to use the melody track to determine in advance whether to add an ending measure to the accompaniment track.
示意性的,当旋律轨的结尾小节的最后一个音符结束在第二拍以后,且不是长音情况,则在生成伴奏轨时,预先加上一个空白的尾奏小节,且和弦复制上一小节的和弦;从而在对尾奏进行织体转换时,如果选择的织体超过四拍,则会在写入MIDI时扩展至两到三个小节。Illustratively, when the last note of the ending measure of the melody track ends after the second beat and is not a long tone, a blank ending measure is added in advance when generating the accompaniment track, and the chords copy the previous measure. chord; thus when converting the texture of the ending, if the selected texture exceeds four beats, it will be extended to two to three measures when written to MIDI.
可选地,借助上述过程基于旋律轨和和弦轨获取得到旋律数据信息以及和弦数据信息,该旋律数据信息和和弦数据信息用于综合节拍数据信息对乐曲数据进行数字形式的表达。Optionally, melody data information and chord data information are obtained based on the melody track and chord track through the above process, and the melody data information and chord data information are used to express the music data in digital form by integrating the beat data information.
值得注意的是,以上仅为示意性的举例,本申请实施例对此不加以限定。It is worth noting that the above are only illustrative examples, and the embodiments of the present application are not limited thereto.
综上所述,在通过乐曲数据生成乐曲伴奏数据的过程中,通过乐曲信息提取过程对乐曲节拍以及乐曲音符进行量化处理,提升对乐曲数据的分析精准性,使得伴奏数据生成过程更加具有针对性;进而综合旋律数据信息、节拍数据信息以及和弦数据信息,在乐曲旋律的限定下将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,进而通过乐曲伴奏数据渲染得到能够更精准呈现乐曲数据的乐曲伴奏,提高乐曲伴奏的生成稳定性以及生成效果。To sum up, in the process of generating music accompaniment data from music data, the music beat and music notes are quantified through the music information extraction process to improve the accuracy of the analysis of the music data and make the accompaniment data generation process more targeted. ; Then, the melody data information, beat data information and chord data information are integrated, and the beat and chords are included in the accompaniment melody generation process under the limitation of the music melody, so that the music accompaniment data can be presented in more detail through the music parameters, and then through the music accompaniment Data rendering results in music accompaniment that can more accurately present music data, improving the stability and effect of music accompaniment generation.
在一个可选的实施例中,首先获取乐曲数据中多个乐曲小节分别对应的伴奏织体,进而根据伴奏织体对对应乐曲小节进行调整,从而综合多个调整后的乐曲小节组合生成乐曲伴奏数据。示意性的,如图4所示,上述图2所示出的步骤230还可以实现为如下步骤410至步骤430。In an optional embodiment, the accompaniment texture corresponding to multiple music pieces in the music data is first obtained, and then the corresponding music sections are adjusted according to the accompaniment texture, so as to generate a music accompaniment by combining the multiple adjusted music sections. data. Schematically, as shown in Figure 4, the above-mentioned step 230 shown in Figure 2 can also be implemented as the following steps 410 to 430.
步骤410,在以乐曲小节为单位的情况下,以旋律数据信息为乐曲伴奏的生成限制条件,基于节拍数据信息和和弦数据信息,确定与多个乐曲小节分别对应的伴奏织体。Step 410: In the case of music bars as units, melody data information is used as a restriction condition for the generation of music accompaniment, and accompaniment textures corresponding to multiple music bars are determined based on beat data information and chord data information.
其中,乐曲小节又称小节,其中包括预设数量的乐曲节拍,是对乐曲数据进行细化分析时的一种基本组织单元,用于划分和组织音乐片段;引入小节对乐曲数据进行分析,便于提升对乐曲小节的理解程度。Among them, music sections are also called sections, which include a preset number of music beats. They are a basic organizational unit for detailed analysis of music data and are used to divide and organize music segments. Introducing sections to analyze music data is convenient for Improve your understanding of music sections.
以乐曲小节为单位用于表示对乐曲数据的每个乐曲小节分别进行分析。针对每个乐曲小节,以旋律数据信息为乐曲伴奏的生成限制条件,从而综合基于节拍数据信息和和弦数据信息确定伴奏织体。The unit of music bar is used to indicate that each music bar of the music data is analyzed separately. For each section of the music, the melody data information is used as the restriction condition for the generation of the music accompaniment, so that the accompaniment texture is determined based on the beat data information and the chord data information.
其中,伴奏织体是用于衬托旋律数据信息对应的主旋律的声音元素。示意性的,伴奏织体是指乐曲中负责支持和衬托主旋律的声音层,这一层通常包括和弦、低音、鼓点、打击乐等元素,它们的组合形成了音乐的基础和背景。伴奏织体在音乐中的作用是为主旋律提供支持,增添音乐的层次和丰富度。合理运用伴奏织体可以使音乐更加完整、丰富,并增强听众的音乐体验。不同类型的音乐可能会有不同的伴奏织体构建方式,以适应不同的风格和情感表达。Among them, the accompaniment texture is a sound element used to set off the main melody corresponding to the melody data information. Schematically, the accompaniment texture refers to the sound layer in the music that is responsible for supporting and setting off the main melody. This layer usually includes elements such as chords, bass, drum beats, and percussion. Their combination forms the basis and background of the music. The role of accompaniment texture in music is to provide support for the main melody and add layer and richness to the music. Reasonable use of accompaniment texture can make the music more complete and rich, and enhance the listener's musical experience. Different types of music may have different ways of constructing accompaniment textures to accommodate different styles and emotional expressions.
在一些实施例中,确定与多个乐曲小节分别对应的伴奏织体,以通过伴奏织体对该乐曲小节内的乐曲音符进行调整,从而丰富该乐曲小节的表现形式。In some embodiments, accompaniment textures respectively corresponding to multiple sections of the music piece are determined, so that the music notes in the section of the music piece are adjusted through the accompaniment texture, thereby enriching the expression form of the section of the music piece.
可选地,在确定伴奏织体时,综合旋律、节拍以及和弦进行统筹调整,以确定便于提升该乐曲小节音乐表现效果的伴奏织体。Optionally, when determining the accompaniment texture, the melody, beat, and chords are comprehensively adjusted to determine an accompaniment texture that is convenient for improving the musical performance of the section of the piece of music.
在一个可选的实施例中,在以乐曲小节为单位的情况下,获取织体确定规则。In an optional embodiment, the texture determination rule is obtained in units of music bars.
其中,织体确定规则用于通过乐曲信息提取结果确定与乐曲小节对应的伴奏织体。Among them, the texture determination rule is used to determine the accompaniment texture corresponding to the music measure through the music information extraction results.
示意性的,乐曲信息提取结果用于表示通过乐曲信息提取过程提取得到的结果,乐曲信息提取结果包括旋律数据信息、节拍数据信息以及和弦数据信息。Schematically, the music information extraction result is used to represent the result extracted through the music information extraction process. The music information extraction result includes melody data information, beat data information and chord data information.
也即:获取的织体确定规则用于综合乐曲小节内的旋律数据信息、节拍数据信息以及和弦数据信息,确定与该乐曲小节对应的伴奏织体。That is to say: the obtained texture determination rule is used to synthesize the melody data information, beat data information and chord data information within the music section to determine the accompaniment texture corresponding to the music section.
在一个可选的实施例中,在织体确定规则的限定下,通过旋律数据信息限定乐曲伴奏的音符变化幅度,通过节拍数据信息限定乐曲伴奏的节奏变化情况,通过和弦数据信息限定乐曲伴奏的音符协调程度,确定与乐曲小节分别对应的伴奏织体。In an optional embodiment, under the limitation of texture determination rules, the note change amplitude of the music accompaniment is defined through melody data information, the rhythm changes of the music accompaniment are defined through beat data information, and the rhythm changes of the music accompaniment are defined through chord data information. The degree of note coordination determines the accompaniment texture corresponding to the measures of the music.
示意性的,旋律数据信息与乐曲音符息息相关,因此可以通过旋律数据信息辅助确定乐曲伴奏中伴奏音符的音高、变化等,也即:可以通过旋律数据信息限定乐曲伴奏的音符变化幅度。Schematically, the melody data information is closely related to the notes of the music. Therefore, the melody data information can be used to assist in determining the pitch and changes of the accompaniment notes in the music accompaniment. That is, the melody data information can be used to limit the range of note changes in the music accompaniment.
可选地,旋律数据信息用于通过音高范围、音高密度以及最低音的音高值,限定乐曲伴奏对应的音符变化幅度。Optionally, the melody data information is used to define the range of note changes corresponding to the musical accompaniment through the pitch range, pitch density, and the lowest pitch value.
示意性的,节拍数据信息与乐曲音符组成的乐曲节拍息息相关,因此可以通过节拍数据信息辅助确定乐曲伴奏中伴奏音符的音符节奏、音符变化速率等情况。Schematically, the beat data information is closely related to the beat of the music composed of the notes of the music. Therefore, the beat data information can be used to assist in determining the note rhythm, note change rate, etc. of the accompaniment notes in the music accompaniment.
可选地,节拍数据信息用于通过单位时间内乐曲节拍的数量,确定乐曲伴奏对应的节奏类型,节奏类型包括慢速、中速和快速等。Optionally, the beat data information is used to determine the rhythm type corresponding to the music accompaniment based on the number of music beats per unit time. The rhythm types include slow, medium, fast, etc.
示意性的,和弦数据信息作为通过至少两个音符组成的和弦内容确定的信息,与乐曲音符本身息息相关,因此可以通过和弦数据信息辅助确定乐曲伴奏中伴奏音符的音符形式,即:确定乐曲伴奏中应当采用的音符,从而更细致地提高乐曲伴奏的准确性。Schematically, the chord data information, as information determined by the chord content composed of at least two notes, is closely related to the music notes themselves. Therefore, the chord data information can be used to assist in determining the note form of the accompaniment notes in the music accompaniment, that is: determining the music accompaniment. The notes that should be used to more precisely improve the accuracy of the musical accompaniment.
可选地,和弦数据信息用于通过和弦位置辅助旋律数据信息确定音符协调程度。Optionally, the chord data information is used to determine the degree of note coordination through the chord position auxiliary melody data information.
在一些实施例中,对每个乐曲小节进行分析,获取得到与每个乐曲小节分别对应的伴奏织体。In some embodiments, each section of the music is analyzed to obtain an accompaniment texture corresponding to each section of the music.
可选地,伴奏织体的分类常见于乐曲中不同声部(例如:和声、低音、打击乐等)的组合,以及它们在乐曲中的作用。伴奏织体包括:和声伴奏(以和弦为基础,负责支持主旋律)、节奏伴奏(以鼓点和打击乐为基础,负责提供节奏感)、低音伴奏(以低音乐器为基础,为音乐提供稳定的低音基础)、旋律伴奏(与主旋律相伴奏,通过和声、音色或音乐装饰来衬托主旋律)等。Optionally, the classification of accompaniment textures is commonly seen in the combination of different parts (such as harmony, bass, percussion, etc.) in the music, and their roles in the music. Accompaniment textures include: harmonic accompaniment (based on chords, responsible for supporting the main melody), rhythm accompaniment (based on drums and percussion, responsible for providing a sense of rhythm), bass accompaniment (based on bass instruments, providing a stable sound for the music) Bass basics), melody accompaniment (accompanying the main melody, and setting off the main melody through harmony, timbre or musical decoration), etc.
也即:根据旋律、和弦以及节拍,综合确定每一个乐曲小节分别对应的伴奏织体类型,以便通过伴奏织体对对应乐曲小节进行调整。That is to say: based on the melody, chords and beats, the accompaniment texture type corresponding to each music section is comprehensively determined, so that the corresponding music section can be adjusted through the accompaniment texture.
在一些实施例中,以小节为单位进行织体转换时,对每一首歌从前往后循环处理。为了适配不同速度的歌曲,根据BPM设计了三套织体转换程序。BPM不超过90判断为慢速,BPM超过90但低于120判断为中速,BPM达到120则判断为快速。慢速歌曲的织体有最丰富的节奏类型,而中速歌曲大部分情况下音符最小时值为八分音符,快速歌曲则为四分音符。In some embodiments, when performing texture conversion in units of bars, each song is processed in a loop from front to back. In order to adapt to songs of different speeds, three sets of texture conversion programs were designed based on BPM. If the BPM does not exceed 90, it is judged as slow, if the BPM exceeds 90 but is lower than 120, it is judged as medium, and if the BPM reaches 120, it is judged as fast. The texture of slow songs has the richest rhythm types, while in most cases the minimum value of notes in medium-tempo songs is eighth notes, and in fast songs the minimum value is quarter notes.
速度判断完成后,进入该小节的旋律判断。计算旋律的音高范围、音符密度以及最低音的音高,选择高或低、稀疏或稠密的伴奏织体。在每种情况下,从满足条件的备选中选取伴奏织体也具有一定的随机性。对于第一小节需要判断是否满足为弱起小节且是否加前奏。判断规则为:非弱起小节或第一个音符开始在第二拍之前按正常小节处理,弱起小节但第一个音符出现在第三拍之前不配伴奏,弱起小节但第一个音符出现在第三拍及以后则随机选择不配伴奏或配前奏,前奏只根据第一个和弦来选择伴奏织体。After the speed judgment is completed, enter the melody judgment of this section. Calculate the melody's pitch range, note density, and lowest pitch, and choose a high or low, sparse or dense accompaniment texture. In each case, there is also a certain degree of randomness in selecting the accompaniment texture from the candidates that meet the conditions. For the first measure, you need to judge whether it is a weak starting measure and whether to add a prelude. The judgment rules are: non-softly started measures or the first note starts before the second beat will be treated as normal measures; weakly started measures but the first note appears before the third beat will not be accompanied by accompaniment; weakly started measures but the first note appears before On the third beat and beyond, it is randomly selected to have no accompaniment or to have a prelude. The prelude only selects the accompaniment texture based on the first chord.
伴奏织体选择完成后,为避免本小节音符总时值发生错误,从而导致偏差累计,因此可以设置每小节节拍数的限制:在有限的循环次数下,判断当前小节所有音符的时值之和是否等于4拍,超过则移除最后一个音符或休止,不足则补上休止。为避免破坏设计好的伴奏织体,需要配前奏的小节和结尾小节没有此限制。After the accompaniment texture is selected, in order to avoid errors in the total duration of the notes in this section, which will lead to accumulation of deviations, you can set a limit on the number of beats in each section: within a limited number of cycles, determine the sum of the durations of all notes in the current section. Whether it is equal to 4 beats. If it exceeds, the last note or rest will be removed. If it is insufficient, the rest will be added. In order to avoid destroying the designed accompaniment texture, there are no such restrictions on the bars that require intro and ending bars.
对最后一个伴奏小节,可以首先判断旋律:空小节则直接配尾奏;休止达到三拍且最后一个音结束时间在第一拍及以前,或拖长音,加一拍和弦再配尾奏;其余加两拍和弦再配尾奏。For the last accompaniment measure, you can first judge the melody: if there is an empty measure, directly match the ending; the rest reaches three beats and the end time of the last note is on the first beat or before, or drag out the sound, add a beat of chords, and then match the ending; Add two beats of chords to the rest and then add the ending.
值得注意的是,以上仅为示意性的举例,本申请实施例对此不加以限定。It is worth noting that the above are only illustrative examples, and the embodiments of the present application are not limited thereto.
步骤420,通过伴奏织体对对应乐曲小节内乐曲音符的音符时值进行调整,得到与多个乐曲小节分别对应的调整小节。Step 420: Adjust the note durations of the music notes in the corresponding music sections through the accompaniment texture to obtain adjustment sections corresponding to multiple music sections.
示意性的,获取得到与每个乐曲小节分别对应的伴奏织体后,通过伴奏织体能够对乐曲小节内的乐曲音符进行调整。Schematically, after obtaining the accompaniment texture corresponding to each music section, the music notes within the music section can be adjusted through the accompaniment texture.
可选地,通过伴奏织体对乐曲音符对应的音符时值进行调整,音符时值用于表示乐曲音符的持续时长。Optionally, the note duration corresponding to the music note is adjusted through the accompaniment texture, and the note duration is used to represent the duration of the music note.
示意性的,在乐曲小节内修改乐曲音符的时值,使乐曲音符变得更短或更长。该过程可以通过将乐曲音符拆分成较短的音符或将多个乐曲音符合并成一个较长的音符实现。例如:将一个四分音符分解为两个八分音符,或将两个八分音符合并为一个四分音符等。Illustratively, the duration of the music notes is modified within the music bar, making the music notes shorter or longer. This process can be achieved by splitting the composition notes into shorter notes or by merging multiple composition notes into one longer note. For example: decompose a quarter note into two eighth notes, or merge two eighth notes into one quarter note, etc.
此外,在修改乐曲音符的时值时,还可以使用连音或断音调整音符时值。也即:通过连音将相邻的乐曲音符连接起来,使它们在时间上更紧密;通过断音则在乐曲音符之间创建短暂的间隔,增加一些空白感。In addition, when modifying the duration of music notes, you can also use legato or staccato to adjust the note duration. That is: connecting adjacent music notes through legato to make them closer in time; using staccato to create short intervals between music notes, adding some sense of blankness.
可选地,还可以通过伴奏织体对乐曲小节中的乐曲音符增加装饰音,如:颤音、滑音、连音等,可以使原有的乐曲音符更具表现力,这些装饰音可以在不改变基本旋律的情况下增加音乐的变化。Optionally, you can also add decorative sounds to the music notes in the music bars through the accompaniment texture, such as vibrato, portamento, legato, etc., which can make the original music notes more expressive. These decorative sounds can be added without changing Add musical variations to the basic melody.
可选地,还可以通过伴奏织体在乐曲小节中引入新的节奏图案,例如:引入更复杂的鼓点、弱拍的强调或交叉节奏,该过程可以通过在伴奏织体中的鼓点或其他打击乐器上进行变化实现。Optionally, you can also introduce new rhythmic patterns into the music bars through the accompaniment texture, such as introducing more complex drum beats, emphasis on downbeats, or cross-rhythms. This process can be done through drum beats or other percussion in the accompaniment texture. Implement changes on the instrument.
可选地,还可以通过伴奏织体在乐曲小节中强调弱拍或拍子的其他部分,使乐曲伴奏更富有动感。Optionally, you can also use the accompaniment texture to emphasize the downbeat or other parts of the beat in the music bar to make the music accompaniment more dynamic.
可选地,还可以通过伴奏织体在乐曲小节的末尾加速或减速,从而创造出一种渐进的变化等。Optionally, you can also use the accompaniment texture to speed up or slow down at the end of the music measure to create a gradual change, etc.
示意性的,上述内容基于乐曲小节对应的伴奏织体确定,伴奏织体借助织体确定规则、旋律、和弦以及节拍综合确定。Schematically, the above content is determined based on the accompaniment texture corresponding to the music section, and the accompaniment texture is comprehensively determined with the help of texture determination rules, melody, chords and beats.
其中,调整小节中包括多个调整后的乐曲音符。Among them, the adjusted section includes multiple adjusted musical notes.
示意性的,通过伴奏织体对对应乐曲小节中的乐曲音符进行调整,从而得到多个调整后的乐曲音符,从而确定每个乐曲小节内调整后的乐曲音符,并将每个调整后的乐曲小节称为调整小节。Schematically, the music notes in the corresponding music sections are adjusted through the accompaniment texture to obtain multiple adjusted music notes, thereby determining the adjusted music notes in each music section, and each adjusted music note is Measures are called adjustment measures.
步骤430,以多个调整小节组合生成乐曲伴奏数据。Step 430: Generate music accompaniment data by combining multiple adjusted measures.
示意性的,确定多个乐曲小节在乐曲数据内的时序关系;依照时序关系对多个调整小节进行组合,从而生成乐曲伴奏数据。Schematically, the timing relationship of multiple music sections within the music data is determined; multiple adjustment sections are combined according to the timing relationship to generate music accompaniment data.
可选地,基于调整小节是通过伴奏织体对乐曲音符进行调整后得到的,因此调整小节侧重于表达乐曲伴奏的数字信息,由多个调整小节生成的乐曲伴奏数据也侧重于表达乐曲伴奏的数字信息。例如:乐曲伴奏数据是以MIDI文件形式表达的信息。Optionally, the adjustment measures are obtained by adjusting the music notes through the accompaniment texture, so the adjustment measures focus on expressing the digital information of the music accompaniment, and the music accompaniment data generated by multiple adjustment measures also focus on expressing the music accompaniment. digital information. For example: music accompaniment data is information expressed in the form of MIDI files.
值得注意的是,以上仅为示意性的距离,本申请实施例对此不加以限定。It is worth noting that the above distances are only illustrative, and are not limited by the embodiments of the present application.
综上所述,在通过乐曲数据生成乐曲伴奏数据的过程中,通过乐曲信息提取过程对乐曲节拍以及乐曲音符进行量化处理,提升对乐曲数据的分析精准性,使得伴奏数据生成过程更加具有针对性;进而综合旋律数据信息、节拍数据信息以及和弦数据信息,在乐曲旋律的限定下将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,进而通过乐曲伴奏数据渲染得到能够更精准呈现乐曲数据的乐曲伴奏,提高乐曲伴奏的生成稳定性以及生成效果。To sum up, in the process of generating music accompaniment data from music data, the music beat and music notes are quantified through the music information extraction process to improve the accuracy of the analysis of the music data and make the accompaniment data generation process more targeted. ; Then, the melody data information, beat data information and chord data information are integrated, and the beat and chords are included in the accompaniment melody generation process under the limitation of the music melody, so that the music accompaniment data can be presented in more detail through the music parameters, and then through the music accompaniment Data rendering results in music accompaniment that can more accurately present music data, improving the stability and effect of music accompaniment generation.
在一个可选的实施例中,在通过乐曲伴奏数据进行音频数据渲染时,为了能够提高乐曲伴奏数据的旋律准确性,可以将旋律数据信息和乐曲伴奏数据进行混音处理,进而通过对混音结果进行音频数据渲染的过程得到乐曲结果。示意性的,如图4所示,上述图2所示出的实施例还可以实现为如下步骤510至步骤550;上述图2所示出的步骤240还可以实现为如下步骤540至步骤550。In an optional embodiment, when rendering audio data through music accompaniment data, in order to improve the melody accuracy of the music accompaniment data, the melody data information and the music accompaniment data can be mixed, and then through the mixing As a result, the audio data rendering process is performed to obtain the music result. Schematically, as shown in Figure 4, the embodiment shown in Figure 2 can also be implemented as the following steps 510 to 550; the step 240 shown in the above Figure 2 can also be implemented as the following steps 540 to 550.
步骤510,获取乐曲数据。Step 510: Obtain music data.
其中,乐曲数据被划分为多个乐曲节拍,乐曲节拍中包括乐曲音符。The music data is divided into a plurality of music beats, and the music beats include music notes.
示意性的,步骤510已经在上述步骤210进行了说明,此处不再赘述。Illustratively, step 510 has been described in step 210 above, and will not be described again here.
步骤520,对乐曲数据进行乐曲信息提取,得到节拍数据信息、和弦数据信息以及旋律数据信息。Step 520: Extract music information from the music data to obtain beat data information, chord data information and melody data information.
其中,节拍数据信息用于表征多个乐曲节拍的变化速度,和弦数据信息用于描述以乐曲节拍为单位提取的和弦单元,旋律数据信息用于描述多个乐曲音符之间的音符变化情况。Among them, the beat data information is used to represent the changing speed of the beats of multiple music pieces, the chord data information is used to describe the chord units extracted in units of music beats, and the melody data information is used to describe the note changes between the notes of multiple music pieces.
示意性的,步骤520已经在上述步骤220以及步骤310至步骤330中进行了说明,此处不再赘述。Illustratively, step 520 has been described in the above-mentioned step 220 and step 310 to step 330, and will not be described again here.
步骤530,以旋律数据信息为乐曲伴奏的生成限制条件,通过节拍数据信息和和弦数据信息生成乐曲伴奏数据。Step 530: Use the melody data information as a restriction condition for the generation of music accompaniment, and generate music accompaniment data based on the beat data information and chord data information.
其中,旋律数据信息用于以乐曲数据的乐曲旋律限定乐曲伴奏的伴奏旋律,乐曲伴奏数据通过音乐参数描述乐曲数据的伴奏情况。Among them, the melody data information is used to define the accompaniment melody of the music accompaniment with the melody of the music data, and the music accompaniment data describes the accompaniment of the music data through music parameters.
示意性的,步骤530已经在上述步骤230以及步骤410至步骤430中进行了说明,此处不再赘述。Illustratively, step 530 has been described in the above-mentioned step 230 and step 410 to step 430, and will not be described again here.
步骤540,对旋律数据信息和乐曲伴奏数据进行混音处理,得到混音结果。Step 540: Perform mixing processing on the melody data information and music accompaniment data to obtain a mixing result.
示意性的,为了在体现伴奏的同时能够更贴切地展现乐曲旋律,将乐曲旋律对应的旋律数据信息与生成的乐曲伴奏数据进行混音处理。Schematically, in order to more appropriately display the melody of the music piece while reflecting the accompaniment, the melody data information corresponding to the music melody is mixed with the generated music accompaniment data.
其中,混音是指将不同音频轨道(如:旋律和伴奏)合并在一起,以创造出整体音乐的过程。混音的目的是在保持音频清晰度和平衡的同时,将各个音轨结合成一个完整的音乐作品。将旋律数据信息和乐曲伴奏数据进行混音处理,目的在于创造音乐的整体感,使得乐曲数据本身对应的乐曲旋律数据以及生成的乐曲伴奏数据成为一个有机的整体,使得混音后能够相互衬托而不互相压制,形成均衡、压缩、混响的音频效果等。Among them, mixing refers to the process of merging different audio tracks (such as melody and accompaniment) together to create the overall music. The purpose of mixing is to combine the individual tracks into a complete musical composition while maintaining audio clarity and balance. The purpose of mixing melody data information and music accompaniment data is to create an overall sense of music, so that the music melody data corresponding to the music data itself and the generated music accompaniment data become an organic whole, so that they can complement each other after mixing. They do not suppress each other and form audio effects such as equalization, compression, and reverberation.
在一个可选的实施例中,通过音源混响器对旋律数据信息和乐曲伴奏数据进行混音处理,生成混音结果。In an optional embodiment, the melody data information and the music accompaniment data are mixed through a sound source reverberator to generate a mixing result.
示意性的,旋律数据信息和乐曲伴奏数据均实现为MIDI文件,将混音处理所涉及的旋律数据信息和乐曲伴奏数据合并在一起,创造出一个整体的MIDI文件。这可以在音符、音量、音色等方面进行调整,以创造出更为复杂和丰富的音乐作品。Schematically, both melody data information and music accompaniment data are implemented as MIDI files, and the melody data information and music accompaniment data involved in the mixing process are merged together to create an overall MIDI file. This can be adjusted in terms of notes, volume, timbre, etc. to create more complex and rich musical compositions.
在一些实施例中,确定旋律数据信息对应的乐曲旋律轨,以及乐曲伴奏数据对应的乐曲伴奏轨;在音频轨对齐的条件下,对乐曲旋律轨和乐曲伴奏轨进行混音处理,生成混音结果。In some embodiments, the music melody track corresponding to the melody data information and the music accompaniment track corresponding to the music accompaniment data are determined; under the condition that the audio tracks are aligned, the music melody track and the music accompaniment track are mixed to generate a mix result.
示意性的,旋律数据信息表征乐曲旋律轨,其中包括乐曲音符基于旋律数据信息的表现情况;乐曲伴奏数据表征乐曲伴奏轨,其中包括乐曲音符基于乐曲伴奏数据的表现情况。音频轨对齐即用于表征乐曲旋律轨和乐曲伴奏轨对齐的条件下,对乐曲旋律轨和乐曲伴奏轨进行混音处理,从而生成混音结果。Schematically, the melody data information represents the melody track of the music, which includes the performance of the music notes based on the melody data information; the music accompaniment data represents the music accompaniment track, which includes the performance of the music notes based on the music accompaniment data. Audio track alignment is used to represent the conditions under which the melody track of the song and the accompaniment track of the song are aligned, and the melody track and the accompaniment track of the song are mixed, thereby generating a mixing result.
可选地,混音处理可以实现为如下步骤。Optionally, the mixing process can be implemented as the following steps.
(1)导入旋律数据信息和乐曲伴奏数据:将两个需要混音的信息导入到MIDI编辑软件或数字音频工作站(Digital Audio Workstation,DAW)中,确保它们在时间轴上正确对齐。(1) Import melody data information and music accompaniment data: Import the two information that need to be mixed into MIDI editing software or Digital Audio Workstation (Digital Audio Workstation, DAW), and ensure that they are correctly aligned on the timeline.
(2)调整起始点:确保旋律数据信息和乐曲伴奏数据在时间轴上从相同的起始点开始,这样它们能够同步。(2) Adjust the starting point: Ensure that the melody data information and the music accompaniment data start from the same starting point on the timeline so that they can be synchronized.
(3)音符编辑:对旋律数据信息和乐曲伴奏数据中的乐曲音符进行编辑。如删除或调整一些音符,使它们更好地相互融合。也可以考虑将一些音符的时值进行调整,以创造更丰富的和弦或旋律变化。(3) Note editing: Edit the music notes in the melody data information and music accompaniment data. Such as deleting or adjusting some notes to make them blend into each other better. Also consider adjusting the duration of some notes to create richer chord or melody variations.
(4)音量平衡:调整旋律数据信息和乐曲伴奏数据的音量,确保它们在混合后能够保持平衡,这可以通过调整旋律数据信息和乐曲伴奏数据分别对应的通道上的音量控制器实现。(4) Volume balance: Adjust the volume of the melody data information and the music accompaniment data to ensure that they can maintain balance after mixing. This can be achieved by adjusting the volume controllers on the channels corresponding to the melody data information and the music accompaniment data respectively.
(5)音色和表情:在混音过程中,可以调整旋律数据信息和乐曲伴奏数据分别对应的通道上的音色(乐器选择)以及表达力控制器(如音量、音符长度、音色等),以使整体音乐更富有表现力。(5) Timbre and expression: During the mixing process, you can adjust the timbre (instrument selection) and expression controller (such as volume, note length, timbre, etc.) on the channels corresponding to the melody data information and the music accompaniment data to Make the overall music more expressive.
(6)节奏和时间感:调整旋律数据信息和乐曲伴奏数据的节奏和时间感觉,使它们在混合后更好地协调,如:乐曲音符的时间偏移、加入一些人为的微时值变化等。(6) Rhythm and time sense: Adjust the rhythm and time sense of melody data information and music accompaniment data to make them better coordinated after mixing, such as: time offset of music notes, adding some artificial micro-time value changes, etc. .
(7)效果处理:应用一些变换效果,如:合并效果、延迟效果、合唱效果等,以增加混音的复杂性和层次感。(7) Effect processing: Apply some transformation effects, such as merge effects, delay effects, chorus effects, etc., to increase the complexity and layering of the mix.
(8)混音和导出:在混音过程的最后阶段,确保旋律数据信息和乐曲伴奏数据的混合效果达到预设要求后,导出混音后的混音结果,混音结果实现为MIDI文件形式。(8) Mixing and exporting: In the final stage of the mixing process, after ensuring that the mixing effect of melody data information and music accompaniment data meets the preset requirements, export the mixing result after mixing, and the mixing result is implemented in the form of a MIDI file .
步骤550,对混音结果进行音频数据渲染,得到乐曲数据对应的乐曲结果。Step 550: Perform audio data rendering on the mixing result to obtain the music result corresponding to the music data.
其中,乐曲结果中以乐曲伴奏为伴奏内容。Among them, the music results include music accompaniment as the accompaniment content.
示意性的,得到混音结果后,对混音结果进行音频数据渲染,以得到表达完整乐曲内容的乐曲结果,基于乐曲结果生成时依赖乐曲伴奏数据,因此该乐曲结果中包括乐曲伴奏数据对应的乐曲伴奏,从而有利于在生成乐曲伴奏的同时通过旋律数据信息更真实地展现乐曲内容。Schematically, after the mixing result is obtained, the audio data is rendered on the mixing result to obtain a music result that expresses the complete music content. The music result is generated based on the music accompaniment data, so the music result includes the music accompaniment data corresponding to the music result. Music accompaniment, which is conducive to generating music accompaniment and displaying the content of the music more realistically through melody data information.
可选地,混音数据实现为描述乐曲数据的数字表示——MIDI文件形式,在需要获取混音数据对应的乐曲结果时,基于MIDI文件包含音符、音高、时值等音乐信息,但本身并不包含声音波形,因此需要将MIDI文件转换为用于渲染得到乐曲结果的数据。也即:首先基于混音结果进行音频转换,得到乐曲结果音频;针对乐曲结果音频进行音频渲染,得到乐曲结果。Optionally, the mixing data is implemented in the form of a MIDI file, a digital representation of the music data. When it is necessary to obtain the music result corresponding to the mixing data, the MIDI file contains music information such as notes, pitches, and durations, but it itself It does not contain sound waveforms, so the MIDI file needs to be converted into data for rendering the music result. That is to say: first perform audio conversion based on the mixing result to obtain the music result audio; perform audio rendering on the music result audio to obtain the music result.
可选地,对音频转换后的乐曲结果音频进行渲染,以得到乐曲结果。例如:通过终端打开乐曲结果音频,从而播放具有乐曲伴奏的乐曲结果等。Optionally, the audio-converted music composition result audio is rendered to obtain the music composition result. For example: open the music result audio through the terminal, thereby playing the music result with music accompaniment, etc.
值得注意的是,以上仅为示意性的举例,本申请实施例对此不加以限定。It is worth noting that the above are only illustrative examples, and the embodiments of the present application are not limited thereto.
综上所述,在通过乐曲数据生成乐曲伴奏数据的过程中,通过乐曲信息提取过程对乐曲节拍以及乐曲音符进行量化处理,提升对乐曲数据的分析精准性,使得伴奏数据生成过程更加具有针对性;进而综合旋律数据信息、节拍数据信息以及和弦数据信息,在乐曲旋律的限定下将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,进而通过乐曲伴奏数据渲染得到能够更精准呈现乐曲数据的乐曲伴奏,提高乐曲伴奏的生成稳定性以及生成效果。To sum up, in the process of generating music accompaniment data from music data, the music beat and music notes are quantified through the music information extraction process to improve the accuracy of the analysis of the music data and make the accompaniment data generation process more targeted. ; Then, the melody data information, beat data information and chord data information are integrated, and the beat and chords are included in the accompaniment melody generation process under the limitation of the music melody, so that the music accompaniment data can be presented in more detail through the music parameters, and then through the music accompaniment Data rendering results in music accompaniment that can more accurately present music data, improving the stability and effect of music accompaniment generation.
在一个可选的实施例中,上述乐曲数据可以实现为任何一首流行歌曲,将乐曲伴奏的生成方法应用于流行音乐的伴奏生成过程中,该方法还可以称为“一种流行歌曲的符号域钢琴翻弹自动生成方法”,如图6所示,对本申请实施例的整体框架图。In an optional embodiment, the above music data can be implemented as any popular song, and the method of generating music accompaniment is applied to the accompaniment generation process of pop music. This method can also be called "a symbol of a popular song". "Automatic generation method of domain piano flipping", as shown in Figure 6, which is an overall framework diagram of the embodiment of the present application.
示意性的,在获取得到原曲音频文件610(即上述乐曲数据)后,首先采用预设算法(如神经网络transform)对原曲音频文件610进行旋律提取、节拍跟踪以及和弦提取,以获取音乐信息,其中包括旋律提取后的旋律音符621、节拍跟踪后的节拍信息622、和弦提取后的和弦序列623。Illustratively, after the original music audio file 610 (i.e., the above-mentioned music data) is obtained, a preset algorithm (such as neural network transform) is first used to perform melody extraction, beat tracking, and chord extraction on the original music audio file 610 to obtain the music. Information, including melody notes after melody extraction 621, beat information after beat tracking 622, and chord sequence 623 after chord extraction.
提取出的旋律音符621由起点、偏移点和音高表示;将旋律音符621再与从原曲音频文件610中检测出的节拍信息622对齐并量化到十六分音符,得到旋律MIDI文件(即上述旋律数据信息)。The extracted melody note 621 is represented by a starting point, an offset point and a pitch; the melody note 621 is then aligned with the beat information 622 detected from the original music audio file 610 and quantized to sixteenth notes to obtain a melody MIDI file (i.e. the above melody data information).
和弦提取中以一拍为最小单位,包括大三、小三和弦,得到和弦序列623。In chord extraction, one beat is used as the minimum unit, including major and minor chords, and the chord sequence 623 is obtained.
将旋律与和弦序列删除没有旋律的小节后合成MIDI文件,拍号为4/4拍。The melody and chord sequence are synthesized into a MIDI file after deleting the measures without melody, with a time signature of 4/4.
此外,进一步从节拍信息622中估计出原曲音频文件610的速度信息,即BPM,对原曲音频文件610的平均速度做轻微降速处理;其次,在以旋律为条件控制伴奏的音域、疏密程度等的同时,伴奏生成算法根据和弦级数、种类等生成与旋律匹配的织体,输出钢琴伴奏MIDI文件(即:乐曲伴奏数据)。最后,将旋律、伴奏两轨MIDI通过批量化的音乐制作方法,渲染出钢琴翻弹的音频文件(即用于渲染得到乐曲伴奏的乐曲音频)。In addition, the speed information of the original music audio file 610, that is, BPM, is further estimated from the beat information 622, and the average speed of the original music audio file 610 is slightly slowed down; secondly, the range and sparseness of the accompaniment are controlled based on the melody. At the same time, the accompaniment generation algorithm generates a texture that matches the melody based on the chord progression, type, etc., and outputs the piano accompaniment MIDI file (ie: music accompaniment data). Finally, the two-track MIDI of melody and accompaniment is rendered through a batch music production method to render the audio file of the piano rendition (that is, the music audio used to render the music accompaniment).
在一些实施例中,伴奏生成算法的输入示例如图7所示,其中包括多个音符710,输入文件为“.mid”格式,即:MIDI文件,其中存储旋律轨与和弦轨两轨,包含拍号(均为4/4拍)、调号元信息。和弦预处理为具体音高而非“C”、“Am”等和弦标记形式,输入和弦的音高范围在默认音区(从小字一组开始),仅考虑原位大、小三和弦,但织体中包含转位以及七音、九音等。In some embodiments, an input example of the accompaniment generation algorithm is shown in Figure 7, which includes multiple notes 710, and the input file is in ".mid" format, that is: a MIDI file, which stores two tracks, a melody track and a chord track, including Time signature (both in 4/4 time) and key signature information. The chord preprocessing is specific pitches instead of chord markings such as "C" and "Am". The pitch range of the input chords is in the default range (starting from the small group). Only major and minor triads in position are considered, but the weaving The body includes transpositions, seventh tones, ninth tones, etc.
借助伴奏生成算法执行伴奏生成方法,如图8所示,其中主要包括如下五个流程:(1)输入读取810:输入MIDI及BPM读取;(2)预处理820:和弦轨预处理;(3)织体转换830;(4)后处理840:旋律及伴奏后处理;(5)写入MIDI文件850。The accompaniment generation method is executed with the help of the accompaniment generation algorithm, as shown in Figure 8, which mainly includes the following five processes: (1) input reading 810: input MIDI and BPM reading; (2) preprocessing 820: chord track preprocessing; (3) Texture conversion 830; (4) Post-processing 840: melody and accompaniment post-processing; (5) Writing MIDI file 850.
(1)输入读取810(1)Input read 810
示意性的,读取输入MIDI文件,将旋律、和弦分两轨存入两个声部,输入估算的原曲BPM作为选择伴奏织体的条件之一。Schematically, the input MIDI file is read, the melody and chords are divided into two tracks and stored in two parts, and the estimated BPM of the original song is input as one of the conditions for selecting the accompaniment texture.
(2)预处理820(2) Preprocessing 820
分别计算旋律轨、和弦轨的小节的数量,若和弦轨中小节的数量少于旋律轨中小节的数量,则补齐,补上的小节复制前一小节的和弦。此外对每一小节进行检测,为避免伴奏有过长时间的休止,当有小节没有任何和弦时,算法将复制上一小节的和弦;若该小节为第一小节,则复制后面第一个不为全休止的小节的和弦。Calculate the number of bars in the melody track and the chord track respectively. If the number of bars in the chord track is less than the number of bars in the melody track, fill them in. The filled bars copy the chords of the previous bar. In addition, each measure is detected. In order to avoid a long pause in the accompaniment, when there is a measure without any chords, the algorithm will copy the chord of the previous measure; if the measure is the first measure, the algorithm will copy the first chord that does not follow. A chord that is a full rest measure.
对于部分歌曲旋律普遍音高较低的情况,为提升听感同时防止与伴奏冲突,可以将旋律高八度处理。具体判断方法为以MIDI音高56和70为阈值,分别计算低音音符比例和高音音符比例,当高音音符比例超过10%且低音音符比例低于20%时,则不做高八度处理。For some songs whose melody is generally low-pitched, in order to improve the listening experience and prevent conflict with the accompaniment, the melody can be raised an octave. The specific judgment method is to use MIDI pitches 56 and 70 as thresholds to calculate the proportion of bass notes and the proportion of treble notes respectively. When the proportion of treble notes exceeds 10% and the proportion of bass notes is less than 20%, no higher octave processing is performed.
为使乐曲有完整度和终止感,可以为每首乐曲都会加上尾奏,长度范围为一个小节到三个小节。由于不同乐曲旋律结尾小节不同,有的结尾为一个长音,有的结尾有长时间的休止,有的则没有足够的时间来加尾奏。因此需要提前判断是否对伴奏轨加上尾奏小节。具体判断规则为:当旋律结尾小节的最后一个音符结束在第二拍以后,且不是长音情况,则预先加上一个空白的尾奏小节,和弦复制上一小节的和弦。在对尾奏进行织体转换时,如果选择的织体超过四拍,则会在写入MIDI时扩展至两到三个小节。In order to make the music complete and complete, you can add an ending to each piece of music, with the length ranging from one measure to three measures. Because the melodies of different pieces of music have different ending measures, some end with a long note, some end with a long rest, and some do not have enough time to add an ending. Therefore, you need to determine in advance whether to add an ending measure to the accompaniment track. The specific judgment rule is: when the last note of the ending measure of the melody ends after the second beat, and it is not a long tone, a blank ending measure is added in advance, and the chords copy the chords of the previous section. When texturing the ending, if the selected texture exceeds four beats, it will be expanded to two or three bars when written to MIDI.
(3)织体转换830(3) Texture conversion 830
以小节为单位进行织体转换,对每一首歌从前往后循环处理。为了适配不同速度的歌曲,根据BPM设计了三套织体转换程序。BPM不超过90判断为慢速,BPM超过90但低于120判断为中速,BPM达到120则判断为快速。慢速歌曲的织体有最丰富的节奏类型,而中速歌曲大部分情况下音符最小时值为八分音符,快速歌曲则为四分音符。The texture conversion is performed in units of measures, and each song is processed from the beginning to the end in a loop. In order to adapt to songs of different speeds, three sets of texture conversion programs are designed according to BPM. BPM not exceeding 90 is judged as slow, BPM exceeding 90 but below 120 is judged as medium speed, and BPM reaching 120 is judged as fast. The texture of slow songs has the richest rhythm types, while the minimum note value of medium-speed songs is mostly eighth notes, and fast songs are quarter notes.
速度判断完成后,进入该小节的旋律判断。计算旋律的音高范围、音符密度以及最低音的音高,选择高或低、稀疏或稠密的伴奏织体。在每种情况下,从满足条件的备选中选取织体也具有一定的随机性。对于第一小节需要判断是否满足为弱起小节且是否加前奏。具体规则为:非弱起小节或第一个音符开始在第二拍之前按正常小节处理,弱起小节但第一个音符出现在第三拍之前不配伴奏,弱起小节但第一个音符出现在第三拍及以后则随机选择不配伴奏或配前奏,前奏只根据第一个和弦来选择织体。After the speed judgment is completed, enter the melody judgment of this section. Calculate the melody's pitch range, note density, and lowest pitch, and choose a high or low, sparse or dense accompaniment texture. In each case, there is also a certain degree of randomness in selecting textures from candidates that meet the conditions. For the first measure, you need to judge whether it is a weak starting measure and whether to add a prelude. The specific rules are: non-softly started measures or the first note starts before the second beat are treated as normal measures; weakly started measures but the first note appears before the third beat are not accompanied by accompaniment; weakly started measures but the first note appears before On the third beat and beyond, it is randomly selected to have no accompaniment or to have a prelude, and the prelude only selects the texture based on the first chord.
织体选择完成后,为避免本小节音符总时值发生错误,从而导致偏差累计,因此设置了每小节节拍数的限制:在有限的循环次数下,判断当前小节所有音符的时值之和是否等于4拍,超过则移除最后一个音符或休止,不足则补上休止。为避免破坏设计好的织体,需要配前奏的小节和结尾小节没有此限制。After the texture selection is completed, in order to avoid errors in the total duration of the notes in this section, which will lead to accumulation of deviations, a limit on the number of beats in each section is set: under a limited number of cycles, determine whether the sum of the durations of all notes in the current section is It is equal to 4 beats. If it exceeds, the last note or rest will be removed. If it is insufficient, the rest will be added. In order to avoid destroying the designed texture, there are no such restrictions on the bars that require intro and ending bars.
对最后一个伴奏小节,算法首先判断旋律:空小节则直接配尾奏;休止达到三拍且最后一个音结束时间在第一拍及以前,或拖长音,加一拍和弦再配尾奏;其余加两拍和弦再配尾奏。For the last accompaniment measure, the algorithm first determines the melody: if there is an empty measure, it will be directly paired with the outro; if the rest reaches three beats and the last note ends at the first beat or before, or the sound will be prolonged, a one-beat chord will be added and the outro will be added; Add two beats of chords to the rest and then add the ending.
在一些实施例中,织体类型包括柱式、半分解式、全分解式,节奏型有四分、二八、十六、切分、附点、五连音等多种,并包含琶音等装饰音,具有丰富的多样性。在输入只有大三、小三和弦的情况下,根据旋律的音域及疏密程度,选择性地增加七音、九音、十三音以及和弦转位,扩展和弦类型。在考虑歌曲速度的情况下,各种专门设计的织体可以涵盖抒情慢歌、中速歌曲、快速热歌各种风格的歌曲,同时保持舒缓的整体风格。此外,还针对休止达到三拍的弱起小节设计了前奏的织体,与弱起小节不配伴奏两种情况随机选取。为使乐曲有终止感,还设计了多种尾奏,根据旋律结尾小节的音符时值、结束位置等信息来选取。In some embodiments, the texture types include columnar, semi-decomposed, and fully decomposed, and the rhythm patterns include quarter, 28, 16, syncopated, dotted, quintuplets, etc., and include arpeggios. and other decorative tones, with rich diversity. When the input is only major and minor chords, the seventh, ninth, thirteenth and chord inversions are selectively added according to the range and density of the melody to expand the chord types. Taking the song speed into consideration, various specially designed textures can cover various styles of songs, including slow lyrical songs, medium-tempo songs, and fast hot songs, while maintaining a soothing overall style. In addition, the texture of the prelude is also designed for the weak attack measure where the rest reaches three beats, and the texture of the prelude is randomly selected from the two cases of the weak attack measure without accompaniment. In order to make the music have a sense of ending, a variety of endings are also designed, which are selected based on the note duration, ending position and other information of the final section of the melody.
织体转换分为函数和文件两种转换方式。函数转换简单稳定可以适用于所有输入和弦类型的情况,而文件转换则更利于扩展。函数转换指有相关的织体转换函数针对小节内各种和弦时值的情况,直接从和弦中选取基本音符,并根据和声学设计音高、时值,组合单音以及和弦,生成完整的织体小节并返回。文件转换指使用数字乐谱文件,即“.mxl”文件存储各个小节的织体,按大三和弦、小三和弦两种情况,以及和弦时值为四拍、三拍、两拍、一拍四种情况,每一类织体共分为八个文件。乐谱文件中每个小节存储一种织体,均为C或Cm和弦及其变体,使用时根据当前和弦根音与C4音高的音程关系来移调。如图9其中示出多个乐曲音符910,多个乐曲音符910表征Cadd9和弦,时值为4拍的织体文件示例。Texture conversion is divided into two conversion methods: function and file. Function conversion is simple and stable and can be applied to all input chord types, while file conversion is more conducive to expansion. Function conversion means that the relevant texture conversion function directly selects basic notes from the chord according to the various chord durations within the bar, and designs the pitch and duration according to the harmony, combines single notes and chords, and generates a complete texture. body section and return. File conversion refers to using digital score files, that is, ".mxl" files to store the texture of each measure, in two situations: major triad and minor triad, and the chord durations are four beats, three beats, two beats, and one beat. Each type of texture is divided into eight files. Each section of the score file stores a texture, which is a C or Cm chord and its variations. When used, the key is transposed according to the interval relationship between the root note of the current chord and the C4 pitch. As shown in FIG. 9 , a plurality of music notes 910 are shown. The plurality of music notes 910 represent the Cadd9 chord and a texture file example with a duration of 4 beats.
(4)后处理840(4) Post-processing 840
完成织体转换后,算法首先将估算的原曲BPM插入当前乐谱,除首尾小节外,再对伴奏进行音高调整,以获得更好听感:低于G2的单音高八度,和弦中低于A2的音高八度。而比旋律还高的伴奏音符,将会低八度处理。其次,比较旋律和伴奏中起始点接近的音,调整不和谐的大、小二度音及完全相同的音。此外,对于伴奏中重复的相同音,则加上连音符(不包括和弦)。最后,调整旋律和伴奏的力度,以便后期音频制作。After completing the texture conversion, the algorithm first inserts the estimated BPM of the original song into the current score. In addition to the first and last bars, it then adjusts the pitch of the accompaniment to obtain a better listening experience: a single note is an octave higher than G2, and the chord is mid-low. An octave above the pitch of A2. Accompaniment notes that are higher than the melody will be processed an octave lower. Secondly, compare the sounds with close starting points in the melody and accompaniment, and adjust the discordant major and minor second sounds and the identical sounds. In addition, for the same sound repeated in the accompaniment, a tuplet (excluding chords) is added. Finally, adjust the intensity of the melody and accompaniment for post-audio production.
(5)写入MIDI文件850(5)Write MIDI file 850
完成上述所有步骤后,将旋律和伴奏分别保存为两个MIDI文件,便于后期批量渲染音频。After completing all the above steps, save the melody and accompaniment as two MIDI files respectively to facilitate batch rendering of audio later.
值得注意的是,以上仅为示意性的举例,本申请实施例对此不加以限定。It is worth noting that the above are only illustrative examples, and the embodiments of the present application are not limited thereto.
综上所述,在通过乐曲数据生成乐曲伴奏数据的过程中,通过乐曲信息提取过程对乐曲节拍以及乐曲音符进行量化处理,提升对乐曲数据的分析精准性,使得伴奏数据生成过程更加具有针对性;进而综合旋律数据信息、节拍数据信息以及和弦数据信息,在乐曲旋律的限定下将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,进而通过乐曲伴奏数据渲染得到能够更精准呈现乐曲数据的乐曲伴奏,提高乐曲伴奏的生成稳定性以及生成效果。To sum up, in the process of generating music accompaniment data from music data, the music beat and music notes are quantified through the music information extraction process to improve the accuracy of the analysis of the music data and make the accompaniment data generation process more targeted. ; Then, the melody data information, beat data information and chord data information are integrated, and the beat and chords are included in the accompaniment melody generation process under the limitation of the music melody, so that the music accompaniment data can be presented in more detail through the music parameters, and then through the music accompaniment Data rendering results in music accompaniment that can more accurately present music data, improving the stability and effect of music accompaniment generation.
图10是本申请一个示例性实施例提供的乐曲伴奏的生成装置的结构框图,如图10所示,该装置包括如下部分:Figure 10 is a structural block diagram of a device for generating musical accompaniment provided by an exemplary embodiment of the present application. As shown in Figure 10, the device includes the following parts:
数据获取模块1010,用于获取乐曲数据,所述乐曲数据被划分为多个乐曲节拍,所述乐曲节拍中包括乐曲音符;The data acquisition module 1010 is used to obtain music data, the music data is divided into a plurality of music beats, and the music beats include music notes;
信息提取模块1020,用于对所述乐曲数据进行乐曲信息提取,得到节拍数据信息、和弦数据信息以及旋律数据信息,所述节拍数据信息用于表征所述多个乐曲节拍的变化速度,所述和弦数据信息用于描述以所述乐曲节拍为单位提取的和弦单元,所述旋律数据信息用于描述多个乐曲音符之间的音符变化情况;The information extraction module 1020 is used to extract music information from the music data to obtain beat data information, chord data information and melody data information. The beat data information is used to represent the changing speed of the beats of the multiple music pieces. The chord data information is used to describe the chord units extracted in units of the beat of the music piece, and the melody data information is used to describe the note changes between multiple music notes;
数据生成模块1030,用于以所述旋律数据信息为所述乐曲伴奏的生成限制条件,通过所述节拍数据信息和所述和弦数据信息生成乐曲伴奏数据,所述旋律数据信息用于以所述乐曲数据的乐曲旋律限定所述乐曲伴奏的伴奏旋律,所述乐曲伴奏数据通过音乐参数描述所述乐曲数据的伴奏情况;The data generation module 1030 is configured to use the melody data information as a generation restriction condition for the music accompaniment, and generate music accompaniment data based on the beat data information and the chord data information, and the melody data information is used to use the melody data information as the generation restriction condition for the music accompaniment. The music melody of the music data defines the accompaniment melody of the music accompaniment, and the music accompaniment data describes the accompaniment of the music data through music parameters;
伴奏生成模块1040,用于基于乐曲伴奏数据进行音频数据渲染,得到所述乐曲数据对应的所述乐曲伴奏。The accompaniment generation module 1040 is configured to perform audio data rendering based on the music accompaniment data to obtain the music accompaniment corresponding to the music data.
在一个可选的实施例中,所述信息提取模块1020还用于基于所述多个乐曲节拍在单位时间内的数量,确定所述乐曲数据对应的所述节拍数据信息;对所述乐曲数据进行乐曲信息提取,确定所述乐曲数据对应的和弦轨和旋律轨,所述和弦轨用于描述所述多个乐曲音符以和弦形式构建的音群,所述旋律轨用于描述所述多个乐曲音符依照时序关系构成的主旋律;基于所述旋律轨和所述和弦轨获取所述乐曲数据分别对应的所述旋律数据信息以及所述和弦数据信息。In an optional embodiment, the information extraction module 1020 is further configured to determine the beat data information corresponding to the music data based on the number of the multiple music beats in unit time; for the music data Extract music information, and determine the chord track and melody track corresponding to the music data. The chord track is used to describe the sound group composed of the multiple music notes in the form of chords, and the melody track is used to describe the multiple music notes. The main melody composed of the musical notes according to the time sequence relationship; the melody data information and the chord data information respectively corresponding to the music data are obtained based on the melody track and the chord track.
在一个可选的实施例中,所述信息提取模块1020还用于分别确定所述旋律轨中小节的数量以及所述和弦轨中小节的数量,得到所述旋律轨对应的第一数量,以及所述和弦轨对应的第二数量,所述第一数量用于表征所述旋律轨中小节的数量,所述第二数量用于表征所述和弦轨中小节的数量;以所述第一数量为基准,对所述和弦轨的所述第二数量进行调整,得到调整后的和弦轨作为所述和弦数据信息;基于所述旋律轨中所述多个乐曲音符分别对应的音符音高,对所述旋律轨进行旋律变换处理,得到更新后的旋律轨作为所述旋律数据信息。In an optional embodiment, the information extraction module 1020 is further configured to determine the number of bars in the melody track and the number of bars in the chord track, respectively, to obtain the first number corresponding to the melody track, and The second number corresponding to the chord track, the first number is used to represent the number of bars in the melody track, the second number is used to represent the number of bars in the chord track; with the first number as a reference, adjust the second number of the chord track to obtain the adjusted chord track as the chord data information; based on the note pitches respectively corresponding to the plurality of music notes in the melody track, The melody track undergoes melody transformation processing to obtain an updated melody track as the melody data information.
在一个可选的实施例中,所述信息提取模块1020还用于获取预设低音高和预设高音高,所述预设低音高和所述预设高音高用于综合限定对所述旋律轨进行旋律变换处理的处理方式;将所述旋律轨中所述多个乐曲音符分别对应的音符音高与所述预设低音高进行比较,以及将所述多个乐曲音符分别对应的音符音高与所述预设高音高进行比较,确定低音音符比例以及高音音符比例;所述低音音符比例用于表示低音音符占所述多个乐曲音符的音符比例,所述低音音符用于表示低于所述预设低音高的乐曲音符;所述高音音符比例用于表示高音音符占所述多个乐曲音符的音符比例,所述高音音符用于表示高于所述预设高音高的乐曲音符;基于所述低音音符比例以及所述高音音符比例对所述旋律轨进行旋律变换处理,得到更新后的旋律轨作为所述旋律数据信息。In an optional embodiment, the information extraction module 1020 is also used to obtain a preset bass pitch and a preset treble pitch, and the preset bass pitch and the preset treble pitch are used to comprehensively define the melody. The processing method of performing melody transformation processing on the track; comparing the note pitches respectively corresponding to the plurality of music notes in the melody track with the preset bass pitch, and comparing the note pitches respectively corresponding to the plurality of music notes in the melody track. The high pitch is compared with the preset treble pitch to determine the bass note ratio and the treble note ratio; the bass note ratio is used to represent the bass note ratio of the multiple music notes, and the bass note is used to represent the lower The music notes of the preset low pitch; the treble note ratio is used to represent the ratio of treble notes to the plurality of music notes, and the treble notes are used to represent music notes that are higher than the preset treble pitch; Perform melody transformation processing on the melody track based on the bass note ratio and the treble note ratio to obtain an updated melody track as the melody data information.
在一个可选的实施例中,所述数据生成模块1030还用于在以乐曲小节为单位的情况下,以所述旋律数据信息为所述乐曲伴奏的生成限制条件,基于所述节拍数据信息和所述和弦数据信息,确定与多个乐曲小节分别对应的伴奏织体;其中,一个乐曲小节中包括预设数量的乐曲节拍,所述伴奏织体是用于衬托所述旋律数据信息对应的主旋律的声音元素;通过所述伴奏织体对对应乐曲小节内乐曲音符的音符时值进行调整,得到与多个乐曲小节分别对应的调整小节,所述音符时值用于表示所述乐曲音符的持续时长,所述调整小节中包括多个调整后的乐曲音符;以多个调整小节组合生成所述乐曲伴奏数据。In an optional embodiment, the data generation module 1030 is also configured to use the melody data information as the generation restriction condition for the music accompaniment based on the beat data information in the case of music bars as the unit. and the chord data information to determine accompaniment textures corresponding to multiple music sections; wherein, one music section includes a preset number of music beats, and the accompaniment texture is used to set off the corresponding melody data information. The sound element of the main melody; the note duration of the musical notes in the corresponding music section is adjusted through the accompaniment texture to obtain adjustment sections corresponding to multiple music sections respectively, and the note duration is used to represent the musical note. Duration, the adjustment section includes a plurality of adjusted music notes; the music accompaniment data is generated by combining multiple adjustment sections.
在一个可选的实施例中,所述数据生成模块1030还用于在以所述乐曲小节为单位的情况下,获取织体确定规则,所述织体确定规则用于通过乐曲信息提取结果确定与所述乐曲小节对应的所述伴奏织体,所述乐曲信息提取结果包括所述节拍数据信息、所述和弦数据信息以及所述旋律数据信息;在所述织体确定规则的限定下,通过所述旋律数据信息限定所述乐曲伴奏的音符变化幅度,通过所述节拍数据信息限定所述乐曲伴奏的节奏变化情况,通过所述和弦数据信息限定所述乐曲伴奏的音符协调程度,确定与所述多个乐曲小节分别对应的所述伴奏织体。In an optional embodiment, the data generation module 1030 is also configured to obtain texture determination rules based on the music piece section, and the texture determination rules are used to determine based on music piece information extraction results. The accompaniment texture corresponding to the music section, the music information extraction result includes the beat data information, the chord data information and the melody data information; under the constraints of the texture determination rules, by The melody data information defines the note change amplitude of the musical accompaniment, the beat data information defines the rhythm change of the musical accompaniment, and the chord data information defines the degree of coordination of the musical accompaniment with the musical accompaniment. The accompaniment texture corresponding to the plurality of music sections respectively.
在一个可选的实施例中,所述旋律数据信息用于通过音高范围、音高密度以及最低音的音高值,限定所述乐曲伴奏对应的所述音符变化幅度;In an optional embodiment, the melody data information is used to define the change amplitude of the notes corresponding to the musical accompaniment through the pitch range, pitch density and the lowest pitch value;
所述节拍数据信息用于通过单位时间内乐曲节拍的数量,确定所述乐曲伴奏对应的节奏类型,所述节奏类型包括慢速、中速和快速;The beat data information is used to determine the rhythm type corresponding to the music accompaniment based on the number of music beats per unit time, and the rhythm type includes slow, medium and fast;
所述和弦数据信息用于通过和弦位置辅助所述旋律数据信息确定所述音符协调程度。The chord data information is used to assist the melody data information in determining the degree of coordination of the notes through chord positions.
在一个可选的实施例中,所述伴奏生成模块1040还用于对所述旋律数据信息和所述乐曲伴奏数据进行混音处理,得到混音结果;对所述混音结果进行音频数据渲染,得到所述乐曲数据对应的乐曲结果,所述乐曲结果中以所述乐曲伴奏为伴奏内容。In an optional embodiment, the accompaniment generation module 1040 is also configured to perform mixing processing on the melody data information and the music accompaniment data to obtain a mixing result; and perform audio data rendering on the mixing result. , obtain the music result corresponding to the music data, and the music result uses the music accompaniment as the accompaniment content.
在一个可选的实施例中,所述伴奏生成模块1040还用于确定所述旋律数据信息对应的乐曲旋律轨,以及所述乐曲伴奏数据对应的乐曲伴奏轨;在音频轨对齐的条件下,对所述乐曲旋律轨和所述乐曲伴奏轨进行混音处理,生成所述混音结果。In an optional embodiment, the accompaniment generation module 1040 is also used to determine the music melody track corresponding to the melody data information, and the music accompaniment track corresponding to the music accompaniment data; under the condition that the audio tracks are aligned, Perform mixing processing on the music melody track and the music accompaniment track to generate the mixing result.
综上所述,在通过乐曲数据生成乐曲伴奏数据的过程中,通过乐曲信息提取过程对乐曲节拍以及乐曲音符进行量化处理,提升对乐曲数据的分析精准性,使得伴奏数据生成过程更加具有针对性;进而综合旋律数据信息、节拍数据信息以及和弦数据信息,在乐曲旋律的限定下将节拍和和弦纳入伴奏旋律生成过程中,使得乐曲伴奏数据能够通过音乐参数进行更细致地呈现,进而通过乐曲伴奏数据渲染得到能够更精准呈现乐曲数据的乐曲伴奏,提高乐曲伴奏的生成稳定性以及生成效果。To sum up, in the process of generating music accompaniment data from music data, the music beat and music notes are quantified through the music information extraction process to improve the accuracy of the analysis of the music data and make the accompaniment data generation process more targeted. ; Then, the melody data information, beat data information and chord data information are integrated, and the beat and chords are included in the accompaniment melody generation process under the limitation of the music melody, so that the music accompaniment data can be presented in more detail through the music parameters, and then through the music accompaniment Data rendering results in music accompaniment that can more accurately present music data, improving the stability and effect of music accompaniment generation.
需要说明的是:上述实施例提供的乐曲伴奏的生成装置,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的乐曲伴奏的生成装置与乐曲伴奏的生成方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that the device for generating music accompaniment provided in the above embodiments is only illustrated by taking the division of the above functional modules. In practical applications, the above function allocation can be completed by different functional modules as needed, that is, the device The internal structure is divided into different functional modules to complete all or part of the functions described above. In addition, the musical accompaniment generating device and the musical accompaniment generating method embodiment provided in the above embodiments belong to the same concept. The specific implementation process can be found in the method embodiment and will not be described again here.
图11示出了本申请一个示例性实施例提供的服务器的结构示意图。该服务器1100包括中央处理单元(Central Processing Unit,CPU)1101、包括随机存取存储器(RandomAccess Memory,RAM)1102和只读存储器(Read Only Memory,ROM)1103的系统存储器1104,以及连接系统存储器1104和中央处理单元1101的系统总线1105。服务器1100还包括用于存储操作系统1113、应用程序1114和其他程序模块1115的大容量存储设备1106。Figure 11 shows a schematic structural diagram of a server provided by an exemplary embodiment of the present application. The server 1100 includes a central processing unit (Central Processing Unit, CPU) 1101, a system memory 1104 including a random access memory (Random Access Memory, RAM) 1102 and a read only memory (Read Only Memory, ROM) 1103, and a connection system memory 1104 and the system bus 1105 of the central processing unit 1101. Server 1100 also includes a mass storage device 1106 for storing operating system 1113, applications 1114, and other program modules 1115.
大容量存储设备1106通过连接到系统总线1105的大容量存储控制器(未示出)连接到中央处理单元1101。大容量存储设备1106及其相关联的计算机可读介质为服务器1100提供非易失性存储。也就是说,大容量存储设备1106可以包括诸如硬盘或者紧凑型光盘只读存储器(Compact Disc Read Only Memory,CD-ROM)驱动器之类的计算机可读介质(未示出)。Mass storage device 1106 is connected to central processing unit 1101 through a mass storage controller (not shown) connected to system bus 1105 . Mass storage device 1106 and its associated computer-readable media provide non-volatile storage for server 1100 . That is, mass storage device 1106 may include computer-readable media (not shown) such as a hard disk or a Compact Disc Read Only Memory (CD-ROM) drive.
失一般性,计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。上述的系统存储器1104和大容量存储设备1106可以统称为存储器。Without a loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. The above-mentioned system memory 1104 and mass storage device 1106 may be collectively referred to as memory.
根据本申请的各种实施例,服务器1100还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即服务器1100可以通过连接在系统总线1105上的网络接口单元1111连接到网络1112,或者说,也可以使用网络接口单元1111来连接到其他类型的网络或远程计算机系统(未示出)。According to various embodiments of the present application, the server 1100 may also run on a remote computer connected to a network through a network such as the Internet. That is, the server 1100 can be connected to the network 1112 through the network interface unit 1111 connected to the system bus 1105, or the network interface unit 1111 can also be used to connect to other types of networks or remote computer systems (not shown).
上述存储器还包括一个或者一个以上的程序,一个或者一个以上程序存储于存储器中,被配置由CPU执行。The above-mentioned memory also includes one or more programs. One or more programs are stored in the memory and configured to be executed by the CPU.
本申请的实施例还提供了一种计算机设备,该计算机设备包括处理器和存储器,该存储器中存储有至少一条指令、至少一段程序、代码集或指令集,至少一条指令、至少一段程序、代码集或指令集由处理器加载并执行以实现上述各方法实施例提供的乐曲伴奏的生成方法。Embodiments of the present application also provide a computer device. The computer device includes a processor and a memory. The memory stores at least one instruction, at least a program, a code set or an instruction set. At least one instruction, at least a program, code. The set or instruction set is loaded and executed by the processor to implement the method for generating musical accompaniment provided by the above method embodiments.
本申请的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有至少一条指令、至少一段程序、代码集或指令集,至少一条指令、至少一段程序、代码集或指令集由处理器加载并执行,以实现上述各方法实施例提供的乐曲伴奏的生成方法。Embodiments of the present application also provide a computer-readable storage medium, which stores at least one instruction, at least a program, a code set or an instruction set, at least one instruction, at least a program, a code set or a set of instructions. The instruction set is loaded and executed by the processor to implement the method for generating musical accompaniment provided by the above method embodiments.
本申请的实施例还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述实施例中任一所述的乐曲伴奏的生成方法。Embodiments of the present application also provide a computer program product or computer program. The computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for generating musical accompaniment described in any of the above embodiments.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection of the present application. within the range.
Claims (13)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311824499.3A CN117765902B (en) | 2023-12-27 | 2023-12-27 | Method, device, equipment, storage medium and program product for generating music accompaniment |
| PCT/CN2024/137646 WO2025139724A1 (en) | 2023-12-27 | 2024-12-06 | Music accompaniment generation method and apparatus, device, storage medium and program product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311824499.3A CN117765902B (en) | 2023-12-27 | 2023-12-27 | Method, device, equipment, storage medium and program product for generating music accompaniment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN117765902A true CN117765902A (en) | 2024-03-26 |
| CN117765902B CN117765902B (en) | 2025-09-23 |
Family
ID=90316224
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311824499.3A Active CN117765902B (en) | 2023-12-27 | 2023-12-27 | Method, device, equipment, storage medium and program product for generating music accompaniment |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN117765902B (en) |
| WO (1) | WO2025139724A1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118942481A (en) * | 2024-07-25 | 2024-11-12 | 小芒电子商务有限责任公司 | Audio processing method and device |
| WO2025139724A1 (en) * | 2023-12-27 | 2025-07-03 | 广州酷狗计算机科技有限公司 | Music accompaniment generation method and apparatus, device, storage medium and program product |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012163827A (en) * | 2011-02-08 | 2012-08-30 | Brother Ind Ltd | Music data modification device |
| CN104380371A (en) * | 2012-06-04 | 2015-02-25 | 索尼公司 | Device, system and method for generating an accompaniment of input music data |
| CN109166566A (en) * | 2018-08-27 | 2019-01-08 | 北京奥曼特奇科技有限公司 | A kind of method and system for music intelligent accompaniment |
| CN116645957A (en) * | 2023-07-27 | 2023-08-25 | 腾讯科技(深圳)有限公司 | Music generation method, device, terminal, storage medium and program product |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103443849B (en) * | 2011-03-25 | 2015-07-15 | 雅马哈株式会社 | Accompaniment Data Generating Device |
| JP6040809B2 (en) * | 2013-03-14 | 2016-12-07 | カシオ計算機株式会社 | Chord selection device, automatic accompaniment device, automatic accompaniment method, and automatic accompaniment program |
| US11037537B2 (en) * | 2018-08-27 | 2021-06-15 | Xiaoye Huo | Method and apparatus for music generation |
| JP7419830B2 (en) * | 2020-01-17 | 2024-01-23 | ヤマハ株式会社 | Accompaniment sound generation device, electronic musical instrument, accompaniment sound generation method, and accompaniment sound generation program |
| CN112382257B (en) * | 2020-11-03 | 2023-11-28 | 腾讯音乐娱乐科技(深圳)有限公司 | Audio processing method, device, equipment and medium |
| CN112528631B (en) * | 2020-12-03 | 2022-08-09 | 上海谷均教育科技有限公司 | Intelligent accompaniment system based on deep learning algorithm |
| CN113611268B (en) * | 2021-06-29 | 2024-04-16 | 广州酷狗计算机科技有限公司 | Musical composition generating and synthesizing method and device, equipment, medium and product thereof |
| CN117765902B (en) * | 2023-12-27 | 2025-09-23 | 广州酷狗计算机科技有限公司 | Method, device, equipment, storage medium and program product for generating music accompaniment |
-
2023
- 2023-12-27 CN CN202311824499.3A patent/CN117765902B/en active Active
-
2024
- 2024-12-06 WO PCT/CN2024/137646 patent/WO2025139724A1/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012163827A (en) * | 2011-02-08 | 2012-08-30 | Brother Ind Ltd | Music data modification device |
| CN104380371A (en) * | 2012-06-04 | 2015-02-25 | 索尼公司 | Device, system and method for generating an accompaniment of input music data |
| CN109166566A (en) * | 2018-08-27 | 2019-01-08 | 北京奥曼特奇科技有限公司 | A kind of method and system for music intelligent accompaniment |
| CN116645957A (en) * | 2023-07-27 | 2023-08-25 | 腾讯科技(深圳)有限公司 | Music generation method, device, terminal, storage medium and program product |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2025139724A1 (en) * | 2023-12-27 | 2025-07-03 | 广州酷狗计算机科技有限公司 | Music accompaniment generation method and apparatus, device, storage medium and program product |
| CN118942481A (en) * | 2024-07-25 | 2024-11-12 | 小芒电子商务有限责任公司 | Audio processing method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2025139724A1 (en) | 2025-07-03 |
| CN117765902B (en) | 2025-09-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Ji et al. | A comprehensive survey on deep music generation: Multi-level representations, algorithms, evaluations, and future directions | |
| US10854180B2 (en) | Method of and system for controlling the qualities of musical energy embodied in and expressed by digital music to be automatically composed and generated by an automated music composition and generation engine | |
| US5663517A (en) | Interactive system for compositional morphing of music in real-time | |
| WO2020000751A1 (en) | Automatic composition method and apparatus, and computer device and storage medium | |
| CN117765902B (en) | Method, device, equipment, storage medium and program product for generating music accompaniment | |
| JP2018537727A (en) | Automated music composition and generation machines, systems and processes employing language and / or graphical icon based music experience descriptors | |
| Osborn | Understanding through-composition in post-rock, math-metal, and other post-millennial rock genres | |
| CN107301857A (en) | A kind of method and system to melody automatically with accompaniment | |
| Pachet | A joyful ode to automatic orchestration | |
| Atanacković | Artificial intelligence: Duality in applications of generative AI and assistive AI in music | |
| Nugroho et al. | The use of AI in creating music compositions: A case study on Suno application | |
| WO2025130664A1 (en) | Melody adaptation method and apparatus, device, storage medium, and program product | |
| CN112528631B (en) | Intelligent accompaniment system based on deep learning algorithm | |
| Davis | Compute and resonate: An ongoing experiment in creating acid music using accessible artificial intelligence and computer-based generative tools | |
| Müller et al. | Computational methods for melody and voice processing in music recordings (Dagstuhl seminar 19052) | |
| Wolkowicz et al. | Midivis: Visualizing music pieces structure via similarity matrices | |
| Dai | Towards Artificial Musicians: Modeling Style for Music Composition, Performance, and Synthesis via Machine Learning | |
| US20240038205A1 (en) | Systems, apparatuses, and/or methods for real-time adaptive music generation | |
| CN118942481B (en) | Audio processing method and device | |
| Chen et al. | Learned String Quartet Music with Variational Auto Encoder | |
| Freed | Harmonic Data: AI Music, EDM Transcription, & Minimalist Jazz | |
| Colton et al. | Neuro-Symbolic Composition of Music with Talking Points | |
| Bahn | Composition, improvisation and meta-composition | |
| Duarte | Towards a Style-driven Music Generator | |
| Jaeger | Expanded Song: Intersecting Genre and Gender through Digital Compositional Practice |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |