Chord generation method and device, equipment and readable storage medium

CN122531337APending Publication Date: 2026-08-07HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
Filing Date
2026-05-06
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003]然而,在实际部署与应用过程中,现有技术方案存在显著的计算机领域技术缺陷:一方面,深度学习模型在处理长序列生成任务时,需要维护庞大的隐状态信息和自回归计算图,导致终端设备的内存占用显著增加,且随着序列长度扩展,模型的计算复杂度和推理时延呈指数级增长,给服务器的实时计算资源带来较大压力;另一方面,由于现有方法缺乏有效的结构化约束机制,生成长序列时容易出现状态不稳定的情况,需要频繁触发后处理修正逻辑,进一步加重了处理器的运算负荷和功耗

Benefits of technology

[0019]本申请提供的和弦生成方法,通过利用描述处于不同节拍位置上的和弦信息之间的转移规律的和弦结构约束模型,也即描述了从一个节拍位置的和弦信息转变为到下一个节拍位置的和弦信息的可能性的模型,来对目标旋律的初始和弦信息处理,从而生成多条可能的且符合音乐中和弦变化规律的第一和弦序列,以从中进一步确定与目标旋律匹配的第二和弦序列。通过本申请所提供的方案,通过构造节拍这一音乐结构信息对和弦的显示约束,利用描述处于不同节拍位置上的和弦信息之间的转移规律的和弦结构约束模型来生成和弦序列,在生成序列长度增加时,也能基于和弦信息之间的转移规律避免和弦结构出现偏移的问题,且输出多条符合音乐规律的可能和弦序列,也避免了最终所生成的和弦序列的单一、同质化严重等问题,提高了和弦的生成效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122531337A_ABST
    Figure CN122531337A_ABST
Patent Text Reader

Abstract

The application discloses a chord generation method, device and equipment and a readable storage medium. The method comprises the following steps: obtaining a target melody and determining initial chord information; generating a plurality of first chord sequences based on the initial chord information and a chord structure constraint model, wherein the chord structure constraint model is constructed based on music work data and is used for describing the transition rule between chord information at different beat positions; and determining a second chord sequence matched with the target melody from the first chord sequences. The chord structure constraint model is used for generating chord sequences, and the transition rule between chord information at different beat positions is used to avoid the problem of chord structure deviation when the length of the generated sequence increases. In addition, a plurality of possible chord sequences conforming to the music rule are output, and the problems of single chord sequence and serious homogeneity of the finally generated chord sequence are avoided, thereby improving the chord generation effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio processing technology, specifically to a chord generation method, apparatus, device, and readable storage medium. Background Technology

[0002] In related technologies, with the popularization of digital music composition tools, chord generation methods based on deep learning models have been widely adopted. These methods typically utilize neural networks to perform end-to-end modeling of the mapping relationship between melody and chords to achieve automatic chord generation.

[0003] However, in practical deployment and application, existing technical solutions exhibit significant shortcomings in the computer science field: On the one hand, when processing long sequence generation tasks, deep learning models need to maintain massive amounts of hidden state information and autoregressive computation graphs, leading to a significant increase in memory usage on terminal devices. Furthermore, as the sequence length expands, the computational complexity and inference latency of the model increase exponentially, placing considerable pressure on the real-time computing resources of servers. On the other hand, due to the lack of effective structured constraint mechanisms in existing methods, unstable states are prone to occur when generating long sequences, requiring frequent triggering of post-processing correction logic, further increasing the processor's computational load and power consumption. In addition, existing methods often rely on sampling and generation based on a single probability distribution, resulting in insufficient diversity of output results, making it difficult to meet the diverse needs of complex music creation scenarios. Summary of the Invention

[0004] This application provides a chord generation method, apparatus, device, and readable storage medium, aiming to improve the effect of generating matching chord sequences through melody, so as to at least partially solve the above-mentioned technical problems.

[0005] Firstly, this application provides a chord generation method, including: Obtain the target melody for which chords are to be generated, and determine the initial chord information; Based on the initial chord information and the chord structure constraint model, multiple first chord sequences are generated; wherein, the chord structure constraint model is a model constructed based on musical work data to describe the transition rules between chord information at different beat positions; Determine the second chord sequence that matches the target melody from the first chord sequence.

[0006] In one embodiment of this application, the chord structure constraint model includes various chord state information, wherein the chord state information includes chord type information and its beat position information; Based on the initial chord information and the chord structure constraint model, multiple first chord sequences are generated, including: Based on the initial chord information and chord structure constraints, chord state information at each beat position is generated sequentially to obtain multiple first chord sequences.

[0007] In one embodiment of this application, the chord structure constraint model further includes transition probabilities between various chord state information, and determining the second chord sequence matching the target melody from the first chord sequence includes: The path transition probability of each of the first chord sequences is determined based on the transition probability, and the path transition probability is used to indicate the rationality of the first chord sequence in the time structure dimension; Based on the path transition probability, a second chord sequence matching the target melody is determined from the first chord sequence.

[0008] In one embodiment of this application, the chord structure constraint model includes an initial state distribution of each chord state information, the initial state distribution being used to indicate the probability of each chord state information being a starting beat position; The determination of initial chord information includes: Based on the initial state distribution, the initial chord information matching the starting melody in the target melody is determined from the chord state information.

[0009] In one embodiment of this application, the method further includes: The melody and chord information in a musical work are processed to obtain the associated data of the melody and chord information; Based on the associated data, a matching score is determined to indicate the degree of chord and melody matching; Determining the second chord sequence matching the target melody from the first chord sequence includes: Based on the target melody, determine the target matching score between each chord in the first chord sequence and the target melody; The second chord sequence for matching the target melody is determined based on the target matching score.

[0010] In one embodiment of this application, determining the second chord sequence for matching the target melody based on the target matching score includes: The second chord sequence for matching the target melody is determined based on the target matching score and the path transition probability of each of the first chord sequences.

[0011] In one embodiment of this application, determining the second chord sequence matching the target melody from the first chord sequence includes: Obtain the target rule, which is determined based on a knowledge base containing music theory; Based on the target rule, the first chord sequence is detected to determine abnormal information in the first chord sequence; The score of the first chord sequence is corrected based on the abnormal information, so as to determine the second chord sequence matching the target melody according to the corrected score of the first chord sequence, wherein the score of the first chord sequence is determined based on the path transition probability of the first chord sequence and / or the target matching score with the target melody.

[0012] In one embodiment of this application, the method further includes: The second chord sequence is used as constraint information for the target melody and input into the generation model along with the target melody. The generation model then generates a third chord sequence that matches the target melody.

[0013] In one embodiment of this application, the method further includes: Determine the score of the second chord sequence; If the score is higher than a preset score threshold, the step of inputting the second chord sequence as constraint information of the target melody and the target melody into the generation model, and generating a third chord sequence matching the target melody through the generation model is performed.

[0014] In one embodiment of this application, the method further includes: Chord marking information is extracted from music work data. The chord marking includes chord type information and the start and end information of the chord type information on the timeline of the music work. The chord marking information is processed according to the preset beat structure to obtain a chord structure sequence; The chord structure sequence is sliced ​​according to a preset time granularity to obtain chord information corresponding to different beat positions, and the chord structure constraint model is generated based on the statistical results of the chord information at different beat positions.

[0015] In one embodiment of this application, the method further includes: Melody track information is extracted from music work data. The melody track information includes note attribute information of each note in the melody. The note attribute information includes at least one of pitch, start time, and duration. The melody track information is processed according to the preset beat structure to obtain a melody sequence that is aligned with the chord structure sequence in the time dimension; The melody sequence is sliced ​​according to a preset time granularity to obtain melody information corresponding to different beat positions, so as to generate structured information of melody and chord aligned in the time dimension.

[0016] Secondly, this application provides a chord generation device, comprising: The acquisition module is used to acquire the target melody for which chords to be generated and to determine the initial chord information; The generation module is used to generate multiple first chord sequences based on the initial chord information and the chord structure constraint model; wherein, the chord structure constraint model is a model constructed based on musical work data to describe the transition rules between chord information at different beat positions; A determining module is used to determine a second chord sequence that matches the target melody from the first chord sequence.

[0017] Thirdly, this application provides a computer device, the computer device comprising: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the chord generation method as described in any of the preceding claims.

[0018] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the chord generation method as described in any of the preceding claims.

[0019] The chord generation method provided in this application utilizes a chord structure constraint model that describes the transition rules between chord information at different beat positions. This model describes the possibility of chord information from one beat position to the next, processing the initial chord information of the target melody to generate multiple possible first chord sequences that conform to the chord change rules in music. From these, a second chord sequence matching the target melody is further determined. By constructing explicit constraints on chords using beat-based musical structure information and utilizing a chord structure constraint model describing the transition rules between chord information at different beat positions to generate chord sequences, the method avoids chord structure shifts even as the generated sequence length increases, based on the transition rules between chord information. Furthermore, it outputs multiple possible chord sequences that conform to musical rules, avoiding problems such as the final generated chord sequences being monotonous and highly homogeneous, thus improving the chord generation effect. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating the steps of a chord generation method provided in an embodiment of this application; Figure 2 A schematic diagram illustrating the effect of a directed state transition graph describing the transition probabilities between chord states, provided in an embodiment of this application; Figure 3 This application provides a schematic flowchart illustrating the steps for determining a chord sequence based on chord and melody matching degree in an embodiment of the present application. Figure 4 This application provides a schematic flowchart illustrating the steps involved in processing a musical work to obtain a state transition model. Figure 5 This is a schematic diagram of the structure of a chord generation device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0024] To clearly understand the chord generation method, apparatus, device, and readable storage medium provided in the embodiments of this application, the relevant application scenarios of the chord generation method provided in this application will be described below. Specifically, the chord generation method provided in this application is applied to the field of music generation, particularly allowing the generation of matching chords from a melody provided by a user, improving the listening experience of the generated musical works, effectively lowering the threshold for song creation, and enabling users to create their own popular songs even without professional music knowledge. Specifically, to better understand the relevant embodiments provided in this application, the basic technical terms in the music field, especially those involved in this application, will be explained below. The details are as follows: Melody: refers to a musical line composed of a series of notes in chronological order. Each note contains attributes such as pitch, duration (duration), and intensity. Essentially, it can be understood as a time sequence of notes. Pitch is an attribute measured by the frequency of sound wave vibration. The higher the frequency, the higher the pitch, and the lower the frequency, the lower the pitch. The unit is Hertz (Hz). Chord: Generally refers to a group of notes formed by the simultaneous sounding of three or more notes. It is usually composed of the root note, the third note, the fifth note, etc., and can generally be represented by chord types (such as major triad, minor triad, seventh chord, etc.). Sequence: A set of elements arranged in a certain order, where the elements can be musical notes, chords, or other symbolic events; Beat: The basic unit of time in music, used to organize and measure musical time; Time Signature: A symbol used to indicate the number of beats in each measure and the time value of each beat, such as 4 / 4, 3 / 4, 6 / 8, etc. Granularity: The degree of refinement in dividing the music timeline, specifically time slices implemented in units such as measures, beats, half beats, quarter beats, etc.

[0025] In subsequent related embodiments of this application, the content involving the above-mentioned technical terms can be referred to the above-mentioned explanations unless otherwise stated, and will not be repeated in the embodiments of this application.

[0026] Building upon the aforementioned foundations, current chord sequence generation primarily relies on music theory rules. With the advancement of artificial intelligence, deep learning models have been proposed to model the mapping relationship between melody and chords. Through training samples, the model learns this relationship, enabling direct prediction of the output chord sequence after inputting a melody. However, this approach suffers from several drawbacks. Due to the lack of explicit constraints on musical structure, especially as the generated sequence length increases, the model's output chord sequences often exhibit chord structure drift and functional confusion. Furthermore, the generated chord sequences are often monotonous, rigid, and highly homogeneous, negatively impacting the final chord generation quality.

[0027] To address the aforementioned technical problems, this application provides a chord generation method. By employing the concept of a Hidden Markov Model state space, it utilizes prior statistics on chord information at adjacent beat positions in musical work data to obtain a chord structure constraint model that can describe the transition rules between chord information at different beat positions. Thus, given the initial chord information, it can infer paths for further possible chord structure states, generating multiple possible first chord sequences that conform to the chord change rules in music. From these, a matching second chord sequence can be determined, thus avoiding the problem of chord structure shifts when the generated sequence length increases. Furthermore, while ensuring that the chord structure conforms to statistical laws and music theory constraints, multiple structurally reasonable candidate paths are introduced, thereby avoiding problems such as the singleness and severe homogenization of the generated chord sequences. To facilitate understanding of the above, specific embodiments will be described below.

[0028] For details, please refer to Figure 1 , Figure 1 This application provides a flowchart illustrating the steps of a chord generation method, specifically including steps S110-S130: S110: Obtain the target melody for the chords to be generated and determine the initial chord information.

[0029] In one embodiment of this application, the target melody for generating chords can typically be a musical piece containing only a melody uploaded by a user on a music platform. It should be noted that a complete musical piece usually contains multiple melodies, such as the common verse melody and chorus melody. However, with the increasing accessibility of songwriting, many compositions now exist that only contain partial melodies. Whether it's a complete musical piece or a fragment, it does not affect the implementation of the technical solution of this application. For each melody in the work, a corresponding chord sequence can be generated using the chord generation method provided in this application. For ease of description, subsequent embodiments of this application will use a single melody fragment as an example. Specifically, these melody fragments can be obtained by dividing the musical piece (or musical composition fragment) according to a preset time granularity. For example, as a feasible implementation, a musical fragment containing 16 bars can be used as a melody. Of course, based on the actual musical style or application requirements, it is also feasible to use other time granularities to obtain melody fragments of different durations from the musical piece. This application embodiment does not limit this.

[0030] Based on the determination of the melody for which chords need to be generated, the embodiments of this application further determine the initial chord information that matches the target melody. Specifically, the initial chord information can be understood as the chord information at the starting beat position within a time granularity. For example, it can be the chord information of the first beat in the first measure, or it can be the chord information of more beat positions in the first measure. The embodiments of this application do not limit this.

[0031] There are several ways to determine the initial chord information. For example, in one possible implementation, the initial chord information can be provided by the user. For instance, the user can input a C7 (dominant seventh chord, a type of chord with C as the root note) chord information in the music platform as the initial chord information specified for the target melody. Of course, the initial chord information can also be determined based on the target melody, that is, a chord sequence that matches the starting melody at the starting beat position in the target melody. In addition, the initial chord information can also be determined based on the probability of each chord information as the starting beat position obtained by statistically analyzing the musical work. This application embodiment does not limit this, and the specific implementation scheme will be described in the subsequent related embodiments.

[0032] S120, based on the initial chord information and the chord structure constraint model, generate multiple first chord sequences.

[0033] In this embodiment, the chord structure constraint model can refer to a state transition model constructed based on the Hidden Markov Model, used to describe the transition rules between chord information at different beat positions. Specifically, the chord structure constraint model can be obtained based on the processing of musical work data. In one possible implementation, the chord structure constraint model can be obtained by statistically analyzing the chord information at adjacent beat positions in the musical work data. To facilitate a clear understanding of the solution provided in this embodiment, specific embodiments will be described below.

[0034] Specifically, in one embodiment of this application, the chord structure constraint model includes multiple chord state information, wherein the chord state information includes chord type information and its beat position information. That is, in this embodiment, each chord state in the chord structure constraint model is obtained by jointly modeling the chord type information and its beat position information, used to describe the structural state of a specific chord at a specific beat position. This allows the model to distinguish the functional differences of the same chord at different beat positions during the modeling process, thereby more accurately reflecting the structural rules of chord progressions in real music. Specifically, the beat position information here is typically used to represent the relative position of a chord in the musical time structure, such as the measure start position, strong beat position, or weak beat position, etc. That is, a C7 chord at the measure start position, a C7 chord at the strong beat position, and a C7 chord at the weak beat position are represented by different chord states in the chord structure constraint model, i.e., each chord state information s in the chord structure constraint model is represented by a different chord state. t This can be expressed by the following formula: S t =(C t B t ) Among them, C t For chord type information, B t This is chord type C. t The beat position.

[0035] Building upon the aforementioned foundation, by statistically analyzing the chord information at each beat position in a musical work, particularly the chord information at adjacent beat positions, we can obtain chord information describing different beat positions, i.e., the transition patterns between different chord states. Specifically, the musical work data can be retrieved from the music database of a music platform. In other words, the musical works can be existing works, and more specifically, they can be a selection of high-quality musical works with a wide audience and good listening experience, filtered according to certain methods, such as user preferences. Of course, this embodiment does not limit the musical work data used for chord information statistics. To facilitate understanding of the specific statistical process, the relevant implementation schemes for processing the musical work data will be described in subsequent embodiments.

[0036] At this point, given the initial chord information, the chord structure constraint model, which describes the transition rules between chord information at different beat positions, can generate the chord state information for the next beat position. Based on the generated chord state information for the next beat position, and through the transition rules between chord information described by the chord structure constraint model, the chord state information for subsequent beat positions, i.e., the chord type, is generated, thus obtaining the final chord sequence. In other words, in one embodiment of this application, generating multiple first chord sequences based on the initial chord information and the chord structure constraint model includes: Based on the initial chord information and the chord structure constraint model, chord state information at each beat position is generated sequentially to obtain multiple first chord sequences.

[0037] To facilitate understanding of the above, a simplified example will be used below. For instance, if the starting beat of the first measure is determined to be a C7 chord based on statistical results of chord information from adjacent beat positions in a musical work, the subsequent adjacent beats may transition to a major triad (symbol: C) or a minor triad (symbol: Cm). For a major triad (symbol: C), the subsequent adjacent beats may transition to a diminished triad (symbol: Cdim); for a minor triad (symbol: Cm), the subsequent adjacent beats may transition to an augmented triad (symbol: C+). Therefore, the resulting chord sequence includes (C7, C, Cdim) and (C7, Cm, C+). It should be noted that the above-described scheme is merely a simplified description of chord sequence generation and does not represent the actual transition rules, nor should it be construed as a limitation on the technical solution of this application. In fact, musical works involve many more chord types, such as the dominant seventh chord G7 with G as the root note, or the minor seventh chord Am7 with A as the root note, or the minor seventh chord Dm7 with D as the root note, and so on. Furthermore, based on the actual time granularity, the final generated chord sequence usually contains even more chord information, that is, chord information at more beat positions. This application embodiment does not limit the amount of chord type information and beat position information.

[0038] Building upon the foregoing, to more accurately depict the structural patterns of chord progressions in real music, in one embodiment of this application, the transition patterns between chord information at different beat positions in the chord structure constraint model can be determined by transition probabilities. For example, if the starting beat of the first measure is a C7 chord, the subsequent adjacent beats may transition to a major triad (symbol: C) or a minor triad (symbol: Cm). In many musical works, the subsequent adjacent beats are major triads (symbol: Cm). In some musical works, the subsequent adjacent beats are minor triads (symbol: Cm). Based on statistical results of musical works, such as counting the number of chord information in adjacent beat positions, it can be further determined that when the starting beat of the first measure is a C7 chord, there is a 0.7 probability that it will change to a major triad and a 0.3 probability that it will change to a minor triad. Similarly, for a major triad, there is an 80% probability that the subsequent beats will change to a diminished triad, and so on. In other words, in one embodiment of this application, the chord structure constraint model can be improved by transitioning probabilities. To indicate the state of the previous chord Transition to the current state under certain conditions The probability of.

[0039] Specifically, for ease of understanding, the transition probability can be represented by a state transition matrix or a directed state transition graph. For example, in a state transition matrix, the horizontal axis represents different preceding chord states. The vertical axis represents different current states. The values ​​at the corresponding x and y coordinates represent the state of the previous chord. Transition to the current state under certain conditions transition probability Alternatively, please refer to Figure 2 , Figure 2 This diagram illustrates the effect of a directed state transition graph describing the probability of transitions between chord states. It should be noted that the directed state transition graph in the diagram is primarily used to illustrate the transition probabilities between chord type information at different beat positions, that is, how likely the chord type information at each beat position will change to another chord type in the next beat position. It should not be construed as a limitation on the technical solution of this application. In fact, the transition probabilities shown are merely illustrative, and the specific transition probabilities are usually obtained through analysis and processing of musical work data in a database. This application does not impose any limitations on this.

[0040] Based on the foregoing, after determining the final first chord sequence, the path transition probability of the complete first chord sequence can be determined by combining the transition probabilities between chord state information indicated in the chord structure constraint model. The path transition probability can be used to indicate the rationality of the first chord sequence in the temporal structure dimension, thereby facilitating the subsequent determination of a second chord sequence that is more compatible with the target melody, i.e., more in line with the rationality of the chord sequence in the temporal structure dimension, based on the path transition probability. The specific implementation scheme will be described in subsequent related embodiments.

[0041] Furthermore, in some embodiments of this application, the chord structure constraint model, in addition to including various chord state information and the transition probabilities between various chord state information, may also include an initial state distribution for each chord state information. This initial state distribution indicates the probability that each chord state information is a starting beat position; that is, the initial state distribution can be used to describe the structural tendency of the chord sequence at the starting beat position. For example, it may include chord states... The probability distribution of chords as the starting beat position Similarly, it can also include the distribution probability of chords with other chord states as the starting beat position. This distribution probability can be used to determine the initial chord information that better matches the starting melody in the target melody from the chord state information. That is to say, the process of determining the initial chord information mentioned above specifically includes: Based on the initial state distribution, the initial chord information matching the starting melody in the target melody is determined from the chord state information.

[0042] For example, in one possible implementation, one or more chord information with higher distribution probabilities in the initial state distribution can be used as the initial chord information. Alternatively, the chord information that best matches the starting melody at the starting beat position in the target melody can be determined from the multiple chord information with higher distribution probabilities and used as the initial chord information. Of course, the matching degree between the melody and chord information can also be obtained by processing relevant information in the musical work. Specific implementation schemes will be described in subsequent related embodiments.

[0043] Specifically, to facilitate understanding of how the path transition probability of the first chord sequence is calculated, the first chord sequence is used as an example. For example, at this time, the corresponding path transition probability It can be determined using the following formula:

[0044] In other words, the path transition probability of the first chord sequence is obtained by multiplying the transition probabilities of adjacent chords in the sequence. This can be understood as chord states. The distribution probability of chords at the starting beat position will not be repeated in the embodiments of this application.

[0045] S130, determine the second chord sequence that matches the target melody from the first chord sequence.

[0046] Building upon the aforementioned foundation, after generating multiple first chord sequences based on the chord structure constraint model, a second chord sequence matching the target melody will be further determined from the first chord sequences. Specifically, there are various methods for determining the second chord sequence from the first chord sequences, which will be explained below with reference to specific embodiments.

[0047] Specifically, in one embodiment of this application, taking the transition probabilities between chord state information contained in the aforementioned chord structure constraint model as an example, the path transition probability of each first chord sequence can be determined based on the transition probability. This path transition probability can be understood as indicating the rationality of the first chord sequence in the temporal structure dimension. For example, a higher path transition probability indicates a higher rationality of the first chord sequence in the temporal structure dimension, meaning that the initial chord information has a higher probability of sequentially transitioning to the chord states in the first chord sequence at the corresponding beat position. At this point, the second chord sequence matching the target melody can be determined from the first chord sequence based on the path transition probability. For example, the first chord sequence with a higher path transition probability can be used as the second chord sequence matching the target melody.

[0048] In addition to determining the second chord sequence that matches the target melody from the first chord sequence based on the path transition probability, in some embodiments of this application, a matching score indicating the degree of matching between a specific chord and a specific melody can also be obtained by statistical processing of the melody information and chord information in the musical work.

[0049] Specifically, melody and chord information at the same time granularity in a musical work can be aligned to obtain structured information composed of melody and chord information. The matching score of chord and melody can then be determined based on the correlation between the melody and chord information. For example, if a certain melody and a certain chord appear simultaneously in more musical works, it indicates a higher degree of matching, and thus a higher matching score. For details, please refer to [link to relevant documentation]. Figure 3 , Figure 3 This application provides a flowchart illustrating the steps for determining a chord sequence based on chord-melody matching, specifically including steps S310-S340: S310 processes the melody and chord information in the musical work to obtain the associated data of the melody and chord information.

[0050] In the embodiments of this application, the associated data of melody information and chord information can generally be understood as a type of structured information of melody and chord aligned in the time dimension by aligning the melody information and chord information according to the time axis. For example, melody A and chord B appear at a certain beat position. Based on this, by processing multiple different musical works, multiple sets of structured information of melody and chord can be obtained, that is, the associated data.

[0051] For details on extracting melody and chord information from musical works and aligning the melody and chord information, please refer to the description of the subsequent related embodiments.

[0052] S320, Based on the associated data, determine a matching score to indicate the degree of chord and melody matching.

[0053] In the embodiments of this application, based on the associated data obtained by processing multiple musical works, such as the aforementioned alignment of melody information and chord information to obtain multiple sets of structured information of melody and chord aligned in the time dimension, the frequency or statistical distribution of the occurrence of chords and various melody combinations can be further determined by statistical analysis of this structured information. Thus, a matching score for indicating the matching degree of chords and various melodies can be obtained based on the frequency or statistical distribution of the occurrence of chords and various melody combinations. For example, it should be noted that the matching degree of chords and melodies here usually refers to the matching degree of chords and melodies at a certain beat position, rather than the matching degree of chords and the entire melody.

[0054] S330, based on the target melody, determine the target matching score between each chord in the first chord sequence and the target melody.

[0055] Building upon the aforementioned foundation, and having established a matching score to indicate the degree of chord-melody compatibility, the melodic information of the target melody at each beat position is compared with the chord information at the corresponding beat positions in the first chord sequence. This determines the chord-melody matching score at each beat position. The final target matching score can then be determined based on these matching scores. For example, this can be achieved by summing or weighted summing the matching scores at each beat position, ultimately yielding the target matching score describing the overall compatibility between the first chord sequence and the target melody. It is understood that this target matching score can reflect the prevalence of the first chord sequence in real musical works, thus avoiding the decrease in listenability caused by the generated result deviating from common musical styles.

[0056] S340, determine the second chord sequence for matching the target melody based on the target matching score.

[0057] Based on the aforementioned foundation, and using the target matching score that describes the overall matching degree between the first chord sequence and the target melody, the first chord sequence with the highest target matching score can be used as the second chord sequence that matches the target melody in a certain way, for example.

[0058] Of course, in addition to the aforementioned schemes for determining the second chord sequence using path transition probabilities (indicating the rationality of the first chord sequence in the temporal structure dimension) and target matching scores (describing the overall matching degree between the first chord sequence and the target melody), in one embodiment of this application, the second chord sequence can be further determined by combining path transition probabilities and target matching scores. That is, determining the second chord sequence matching the target melody based on the target matching score includes: The second chord sequence for matching the target melody is determined based on the target matching score and the path transition probability of each of the first chord sequences.

[0059] Specifically, in one embodiment of this application, the target matching score and path transition probability can be weighted according to a preset weighting coefficient to obtain the final score of each first chord sequence. Then, based on the final score, the one or more first chord sequences with the highest final score are selected as the second chord sequences that match the target melody. Here, the preset weighting coefficient can be a pre-set value, or it can be a weighting coefficient set based on the musical style of the target melody.

[0060] Furthermore, in some embodiments of this application, to avoid violations of basic music theory in the generated chord sequence, target rules can be determined based on a knowledge base containing music theory. These target rules can be understood as constraints on the chord sequence, such as whether there are unreasonable functional jumps or defects lacking chord cadence structures. This allows for a penalty mechanism to reduce the priority of the generated chord sequence. In one embodiment, determining the second chord sequence matching the target melody from the first chord sequence includes: Obtain the target rule, which is determined based on a knowledge base containing music theory; Based on the target rule, the first chord sequence is detected to determine abnormal information in the first chord sequence; The score of the first chord sequence is corrected based on the abnormal information, so as to determine the second chord sequence matching the target melody based on the corrected score of the first chord sequence.

[0061] Specifically, the target rule determined based on a knowledge base containing music theory can be to detect the character identifiers of each chord information contained in the first chord sequence through string detection, thereby determining whether there are unreasonable function jumps or defects such as lack of chord termination structures. In general, the target rule can be obtained by pre-configuration by the user, and this application embodiment does not limit this.

[0062] Based on this, the scores of the detected chord sequences containing abnormal information, such as unreasonable functional transitions or first chord sequences lacking chord cadence structures, can be corrected based on the detected abnormal information, i.e. the type of violation of music theory rules. Thus, based on the corrected scores, a second chord sequence that is more compatible with the target melody and does not violate music theory rules can be determined.

[0063] It should be noted that the score of the first chord sequence can be determined by the path transition probability of the first chord sequence, or it can be determined based on the target matching score of each chord in the first chord sequence with the target melody. Of course, it can also be the final score determined based on the path transition probability and the target matching score. This application embodiment does not limit this.

[0064] By combining the path transition probability, chord and melody matching scores, and the constraint rules based on music theory to achieve the final second chord sequence, it is possible to maintain the stability of the chord structure while incorporating considerations of commonly used musical patterns and music theory constraints. This achieves a balance between diversity and listenability, further improving the generation effect of subsequent chord sequences.

[0065] Furthermore, in order to further enhance the richness of chord configurations and musical expressiveness, in some embodiments of this application, after completing the comprehensive scoring, sorting and selection of the first chord sequence based on the aforementioned steps, and obtaining the second chord sequence, this application can also continue to perform generative harmonic editing on the selected second chord sequence while ensuring that the established chord structure remains unchanged.

[0066] Specifically, generative harmonic editing of the selected second chord sequence can involve inputting the second chord sequence as constraint information of the target melody along with the target melody into a generative model to generate a third chord sequence constrained by the second chord sequence. In other words, the method further includes: The second chord sequence is used as constraint information for the target melody and input into the generation model along with the target melody. The generation model then generates a third chord sequence that matches the target melody.

[0067] Specifically, using the second chord sequence as constraint information for the target melody can be used to limit the harmonic function range and time alignment of the generative model during the editing process. This allows the generative editing of the generative model to only affect the internal chord configuration or local harmonic details of the second chord sequence, without changing the chord type or its overall arrangement in the beat structure.

[0068] Generative editing of the generative model typically includes, but is not limited to, the following operations: reconfiguring notes within a chord, introducing chord extensions or ornaments, and refining local harmonics without violating the established chord function. Through these generative editing methods, the generated result, i.e., the third chord sequence, can achieve richer harmonic layers while maintaining the stability of the original chord structure.

[0069] Specifically, the generative editing process can be implemented using a sequence-based generative model. This means that the generative model must be constrained by the structural constraints provided by the second chord sequence during the generation process, thereby preventing the generated result from deviating from the original harmonic framework. Here, the structural constraints can be used to limit the selectable note set, harmonic function range, or time alignment of the generative model, making the generative editing process controllable.

[0070] For example, in some possible implementations, the generative model can perform a "terminating" determination on the last beat of each time segment. If the current time segment is the end of a melody, the last chord within that segment will be forcibly corrected to a "terminating chord," that is, a chord type that gives the user the feeling that the music has ended. Alternatively, for some dissonant musical combinations, such as a melody of Do but generating a chord with D# as the root note, this chord will be corrected to a chord with a natural pitch order, for example, correcting a chord with D# as the root note to a chord with C as the root note.

[0071] The generative harmony editing method based on a predetermined chord structure provided in this application allows for flexible adjustment of harmonic details without destroying the overall chord progression structure. This improves the diversity of generated chord results and musical expression while ensuring structural stability and theoretical rationality.

[0072] Furthermore, it should be noted that in some embodiments of this application, the aforementioned scoring results of the first chord sequence can be used to determine the confidence level of the corresponding chord sequence, wherein the confidence level is used to reflect the comprehensive credibility of the chord sequence in terms of structural rationality, statistical commonality, and music theory constraints.

[0073] Therefore, in one embodiment of this application, when the confidence level is higher than a preset threshold, the chord result after generative harmony editing can be output; while when the confidence level is lower than the threshold, the system does not execute or use the generative harmony editing result, but only outputs the second chord sequence obtained above as a fallback output result. That is, in one embodiment of this application, the method further includes: Determine the score of the second chord sequence; If the score is higher than a preset score threshold, the step of inputting the second chord sequence as constraint information of the target melody and the target melody into the generation model, and generating a third chord sequence matching the target melody through the generation model is performed.

[0074] Furthermore, if the score is lower than a preset score threshold, the second chord sequence is output.

[0075] The method provided in this application embodiment can automatically revert to a structurally stable chord output form when the reliability of the generated result is insufficient, thereby avoiding obvious music theory errors or structural distortions caused by unstable generative editing. The second chord sequence, as the fallback output, maintains the chord type and its overall arrangement order in the beat structure, which can meet the basic harmonic function requirements.

[0076] By introducing a result control and fallback output mechanism based on confidence threshold, this invention improves the stability and engineering usability of the overall system output while ensuring the diversity of generated results, enabling the chord generation process to remain controllable and reliable under different input conditions.

[0077] Furthermore, it should be noted that the methods provided in this application, whether it is the chord structure constraint model obtained by statistically analyzing chord information at adjacent beat positions in a musical work, or the processing of the alignment structure information between beats and melody in a musical work, both require prior processing of the musical work data. Specifically, to facilitate understanding of the above, the following will provide a detailed explanation of the musical work data processing to determine the state transition model used to describe the transition rules between chord information at different beat positions, and to determine the structured information of chords and melody.

[0078] Please see Figure 4 , Figure 4 This application provides a flowchart illustrating the steps for processing a musical work to obtain a state transition model, specifically including steps S410-S430: S410, extract chord marker information from the music work data, wherein the chord marker includes chord type information and the start and end information of the chord type information on the time axis of the music work.

[0079] In one embodiment of this application, the musical work in the database may exist in a music data format that can simultaneously represent melody information and chord markers, such as, but not limited to, MIDI, MusicXML, ABC, etc. This application embodiment does not limit this.

[0080] Based on this, by extracting the chord markings in a musical work, we can obtain the chord types in the musical work and their start and end positions on the timeline.

[0081] S420, The chord marking information is processed according to the preset beat structure to obtain a chord structure sequence.

[0082] In one embodiment of this application, the extracted chord marker information is processed according to a preset rhythm structure. Specifically, the chord type is divided according to the start and end positions on the time axis and a certain rhythm structure to obtain a chord structure sequence containing multiple chord information.

[0083] S430, the chord structure sequence is sliced ​​according to a preset time granularity to obtain chord information corresponding to different beat positions, and the chord structure constraint model is generated based on the statistical results of the chord information at different beat positions.

[0084] In one embodiment of this application, based on the foregoing, by slicing the chord structure sequence according to a preset time granularity, such as beat, measure or combination thereof as the basic unit, chord information corresponding to different beat positions can be obtained. At this time, the chord information of these different beat positions will be further statistically analyzed to obtain a state transition model describing the transition law between chord information at different beat positions.

[0085] In addition to the aforementioned processing of chord information, some embodiments of this application also include synchronous alignment processing of melody information in musical works, specifically including the following steps: Melody track information is extracted from music work data. The melody track information includes note attribute information of each note in the melody. The note attribute information includes at least one of pitch, start time, and duration. The melody track information is processed according to the preset beat structure to obtain a melody sequence that is aligned with the chord structure sequence in the time dimension; The melody sequence is sliced ​​according to a preset time granularity to obtain melody information corresponding to different beat positions, so as to generate structured information of melody and chord aligned in the time dimension.

[0086] Specifically, in one embodiment of this application, melody track information is extracted from the symbolic music data of a musical work, wherein the melody track can be used to represent the main melody in the music. For the extracted melody track, attributes such as pitch, start time, and duration of each note in the melody can be further obtained, and the melody is mapped into a melody sequence representation with a uniform time granularity based on the time signature and tempo information of the music.

[0087] At this point, by extracting the chord marking information corresponding to the melody track from the symbolic music data of the same musical work, the chord sequence can be mapped to a chord structure sequence aligned with the melody sequence in the time dimension based on the chord marking information and the rhythmic structure of the music.

[0088] In one embodiment, the melody sequence and chord structure sequence are sliced ​​according to a preset time granularity, so that the melody information and chord information within the same time slice can correspond one-to-one, thereby forming a structured representation of melody and chord. Then, the melody sequences and chord structure sequences from multiple musical works are uniformly represented and stored to construct a melody and chord structure database. This database will be used to statistically analyze the distribution of chord occurrences and their transition relationships at different time positions, thus providing structural priors for subsequent chord modeling and generation based on sequence structures.

[0089] The chord generation method provided in this application statistically analyzes the chord information at adjacent beat positions in a musical work to obtain a chord structure constraint model describing the transition rules between chord information at different beat positions. This model represents the probability of a chord information from one beat position transforming into chord information at the next. Based on the initial chord information determined by the target melody, multiple possible first chord sequences conforming to the chord change rules in music can be generated using this chord structure constraint model. From these, a second chord sequence matching the target melody can be further determined. By constructing explicit constraints on chords using beat information (a musical structural information), and utilizing the chord structure constraint model describing the transition rules between chord information at different beat positions to generate chord sequences, this method avoids chord structure shifts even as the generated sequence length increases, based on the transition rules between chord information. Furthermore, it outputs multiple possible chord sequences conforming to musical rules, avoiding problems such as the final generated chord sequences being monotonous and highly homogeneous, thus improving the chord generation effect.

[0090] Based on the chord generation method provided in this application, this application also provides a chord generation device; for details, please refer to [link to device description]. Figure 5 , Figure 5 A schematic diagram of a chord generation device provided in this application embodiment includes: The acquisition module 510 is used to acquire the target melody of the chords to be generated and to determine the initial chord information; The generation module 520 is used to generate multiple first chord sequences based on the initial chord information and the chord structure constraint model; wherein, the chord structure constraint model is a model constructed based on a musical work to describe the transition rules between chord information at different beat positions; The determining module 530 is used to determine a second chord sequence that matches the target melody from the first chord sequence.

[0091] In one embodiment of this application, the generation module 520 is further configured to generate chord state information at each beat position sequentially based on the initial chord information and the chord structure constraint model, thereby obtaining multiple first chord sequences.

[0092] In one embodiment of this application, the determining module 530 is further configured to determine the path transition probability of each of the first chord sequences based on the transition probability, wherein the path transition probability is used to indicate the rationality of the first chord sequence in the time structure dimension; Based on the path transition probability, a second chord sequence matching the target melody is determined from the first chord sequence.

[0093] In one embodiment of this application, the determining module 530 is further configured to determine, based on the initial state distribution, initial chord information matching the starting melody in the target melody from the chord state information.

[0094] In one embodiment of this application, the determining module 530 is further configured to process the melody information and chord information in the musical work to obtain the association data between the melody information and the chord information; Based on the associated data, a matching score is determined to indicate the degree of chord and melody matching; Based on the target melody, determine the target matching score between each chord in the first chord sequence and the target melody; The second chord sequence for matching the target melody is determined based on the target matching score.

[0095] In one embodiment of this application, the determining module 530 is further configured to determine the second chord sequence matching the target melody based on the target matching score and the path transition probability of each of the first chord sequences.

[0096] In one embodiment of this application, the determining module 530 is further configured to obtain a target rule, the target rule being determined based on a knowledge base containing music theory; Based on the target rule, the first chord sequence is detected to determine abnormal information in the first chord sequence; The score of the first chord sequence is corrected based on the abnormal information, so as to determine the second chord sequence matching the target melody according to the corrected score of the first chord sequence, wherein the score of the first chord sequence is determined based on the path transition probability of the first chord sequence and / or the target matching score with the target melody.

[0097] In one embodiment of this application, the determining module 530 is further configured to input the second chord sequence as constraint information of the target melody and the target melody into the generation model, and generate a third chord sequence matching the target melody through the generation model.

[0098] In one embodiment of this application, the determining module 530 is further configured to determine the score of the second chord sequence; If the score is higher than a preset score threshold, the step of inputting the second chord sequence as constraint information of the target melody and the target melody into the generation model, and generating a third chord sequence matching the target melody through the generation model is performed.

[0099] In one embodiment of this application, the acquisition module 510 is further configured to extract chord mark information from the music work data, wherein the chord mark includes chord type information and start and end information of the chord type information on the time axis of the music work; The chord marking information is processed according to the preset beat structure to obtain a chord structure sequence; The chord structure sequence is sliced ​​according to a preset time granularity to obtain chord information corresponding to different beat positions, and the chord structure constraint model is generated based on the statistical results of the chord information at different beat positions.

[0100] In one embodiment of this application, the acquisition module 510 is further configured to extract melody track information from music work data, the melody track information including note attribute information of each note in the melody, the note attribute information including at least one of pitch, start time, and duration; The melody track information is processed according to the preset beat structure to obtain a melody sequence that is aligned with the chord structure sequence in the time dimension; The melody sequence is sliced ​​according to a preset time granularity to obtain melody information corresponding to different beat positions, so as to generate structured information of melody and chord aligned in the time dimension.

[0101] The chord generation device provided in this application utilizes a chord structure constraint model that describes the transition rules between chord information at different beat positions—that is, a model that describes the possibility of chord information from one beat position to the next—to process the initial chord information of the target melody. This generates multiple possible first chord sequences that conform to the chord change rules in music, from which a second chord sequence matching the target melody is further determined. By constructing explicit constraints on chords using the musical structure information of beat, and utilizing a chord structure constraint model that describes the transition rules between chord information at different beat positions to generate chord sequences, the device avoids chord structure deviations even when the generated sequence length increases, based on the transition rules between chord information. Furthermore, it outputs multiple possible chord sequences that conform to musical rules, avoiding problems such as the final generated chord sequences being monotonous and highly homogeneous, thus improving the chord generation effect.

[0102] In some embodiments of this application, the chord generation method can be implemented as a computer program, which can be implemented in, for example... Figure 6 It runs on the computer device shown. The computer device's memory can store the various program modules that make up the chord generation device, for example, Figure 5 The acquisition module 510, generation module 520, and determination module 530 are shown. The computer program comprised of these modules causes the processor to execute the steps in the chord generation methods of the various embodiments of this application described in this specification.

[0103] For example, Figure 6 The computer equipment shown can be used as follows Figure 5 The acquisition module 510 in the illustrated chord generation device executes step S110. The computer device can execute step S120 via the generation module 520. The computer device can execute step S130 via the determination module 530. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computational and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with external computer devices via a network connection. When the computer program is executed by the processor, it implements a chord generation method.

[0104] Those skilled in the art will understand that Figure 6The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0105] In some embodiments of this application, a computer device is provided, including one or more processors; memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to perform the following steps: Obtain the target melody for which chords are to be generated, and determine the initial chord information; Based on the initial chord information and the chord structure constraint model, multiple first chord sequences are generated; wherein, the chord structure constraint model is a model constructed based on musical work data to describe the transition rules between chord information at different beat positions; Determine the second chord sequence that matches the target melody from the first chord sequence.

[0106] In some embodiments of this application, a computer-readable storage medium is provided, storing a computer program that is loaded by a processor, causing the processor to perform the following steps: Obtain the target melody for which chords are to be generated, and determine the initial chord information; Based on the initial chord information and the chord structure constraint model, multiple first chord sequences are generated; wherein, the chord structure constraint model is a model constructed based on musical work data to describe the transition rules between chord information at different beat positions; Determine the second chord sequence that matches the target melody from the first chord sequence.

[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0108] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0109] The chord generation method, apparatus, device, and storage medium provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A chord generation method, characterized in that, include: Obtain the target melody for which chords are to be generated, and determine the initial chord information; Based on the initial chord information and the chord structure constraint model, multiple first chord sequences are generated; wherein, the chord structure constraint model is a model constructed based on musical work data to describe the transition rules between chord information at different beat positions; Determine the second chord sequence that matches the target melody from the first chord sequence.

2. The method according to claim 1, characterized in that, The chord structure constraint model contains various chord state information, including chord type information and its beat position information; Based on the initial chord information and the chord structure constraint model, multiple first chord sequences are generated, including: Based on the initial chord information and chord structure constraints, chord state information at each beat position is generated sequentially to obtain multiple first chord sequences.

3. The method according to claim 2, characterized in that, The chord structure constraint model also includes transition probabilities between various chord state information, and determining the second chord sequence matching the target melody from the first chord sequence includes: The path transition probability of each of the first chord sequences is determined based on the transition probability, and the path transition probability is used to indicate the rationality of the first chord sequence in the time structure dimension; Based on the path transition probability, a second chord sequence matching the target melody is determined from the first chord sequence.

4. The method according to claim 2, characterized in that, The chord structure constraint model includes an initial state distribution of each chord state information, which is used to indicate the probability of each chord state information being the starting beat position; The determination of initial chord information includes: Based on the initial state distribution, the initial chord information matching the starting melody in the target melody is determined from the chord state information.

5. The method according to claim 1, characterized in that, The method further includes: The melody and chord information in a musical work are processed to obtain the associated data of the melody and chord information; Based on the associated data, a matching score is determined to indicate the degree of chord and melody matching; Determining the second chord sequence matching the target melody from the first chord sequence includes: Based on the target melody, determine the target matching score between each chord in the first chord sequence and the target melody; The second chord sequence for matching the target melody is determined based on the target matching score.

6. The method according to claim 1, characterized in that, Determining the second chord sequence matching the target melody from the first chord sequence includes: Obtain the target rule, which is determined based on a knowledge base containing music theory; Based on the target rule, the first chord sequence is detected to determine abnormal information in the first chord sequence; The score of the first chord sequence is corrected based on the abnormal information, so as to determine the second chord sequence matching the target melody according to the corrected score of the first chord sequence, wherein the score of the first chord sequence is determined based on the path transition probability of the first chord sequence and / or the target matching score with the target melody.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Chord marking information is extracted from music work data. The chord marking includes chord type information and the start and end information of the chord type information on the timeline of the music work. The chord marking information is processed according to the preset beat structure to obtain a chord structure sequence; The chord structure sequence is sliced ​​according to a preset time granularity to obtain chord information corresponding to different beat positions, and the chord structure constraint model is generated based on the statistical results of the chord information at different beat positions.

8. A chord generation device, characterized in that, include: The acquisition module is used to acquire the target melody for which chords to be generated and to determine the initial chord information; The generation module is used to generate multiple first chord sequences based on the initial chord information and the chord structure constraint model; wherein, the chord structure constraint model is a model constructed based on musical work data to describe the transition rules between chord information at different beat positions; A determining module is used to determine a second chord sequence that matches the target melody from the first chord sequence.

9. A computer device, characterized in that, The computer device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the chord generation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the chord generation method as described in any one of claims 1 to 7.