Chord prediction method, system, computer-readable storage medium, and musical instrument
By training chord transition probability models and note probability distribution models, and combining them with HMM models, chord states are dynamically predicted, solving the problem of real-time chord arrangement in existing technologies. This enables efficient arrangement and creation of automatic accompaniment instruments, improving the user experience.
Patent Information
- Application Number
- CN202011634023.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2040-12-31
AI Technical Summary
Existing technology cannot provide users with reasonable and pleasant chord backgrounds in real time, resulting in a high barrier to entry for composing and creating music for automatic accompaniment instruments and a poor user experience.
By training chord transition probability models and note probability distribution models, chord states are predicted in real time. The Baum-Welch algorithm of the HMM model is used to calculate the chord transition probability matrix and note probability distribution matrix. Combined with the note information and chord information of the music, the chord states are predicted dynamically.
It achieves real-time, reasonable, and pleasing chord background prediction, lowers the barrier to arrangement and creation for automatic accompaniment instruments, improves user experience, and expands the breadth of chord thinking.
Smart Images

Figure CN114694622B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of music artificial intelligence technology, and relates to a prediction method and system, particularly to a chord prediction method, system, computer-readable storage medium, and musical instrument. Background Technology
[0002] Automatic accompaniment technology is a standard feature of electronic keyboards and some other musical instruments. When playing the electronic keyboard, the right hand plays the melody, and the left hand controls the chords. However, this requires users to understand chords, know which right-hand chords should be paired with which left-hand chords, and be able to coordinate both hands effectively. This creates a certain learning curve.
[0003] Previously, some research institutions had worked on non-real-time solutions for automatic chord arrangement, where chords were arranged for each measure after the entire piece had been played. Since a chord needs to be determined at the beginning of each measure, and in real-time performance, the content of each measure is unknown, only the first note is known. Therefore, real-time automatic chord arrangement, also known as chord prediction, has long been considered an impossible task and a blank area of research.
[0004] Therefore, how to provide a chord prediction method, system, computer-readable storage medium, and instrument to solve the shortcomings of existing technologies, such as the inability to arrange a reasonable and pleasant chord background for users in real time when they play or sing a melody, which greatly lowers the threshold for tasks such as composing and creating music with instruments that require automatic accompaniment functions and results in a poor user experience, has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a chord prediction method, system, computer-readable storage medium, and musical instrument to solve the problem that the prior art cannot provide a reasonable and pleasant chord background for users when they play or sing a melody in real time, which greatly lowers the threshold for tasks such as composing and creating music with instruments that require automatic accompaniment functions, resulting in a poor user experience.
[0006] To achieve the above and other related objectives, the present invention provides a chord prediction method, comprising: when a piece of music is sensed, reading the note information of the piece; the note information includes note states corresponding to a time sequence; detecting whether the piece has been played to a specific moment; if so, predicting the chord state at the current moment based on the chord state output at the previous moment and the note state played at the current moment; if not, continuing to detect whether the piece has been played to a specific moment.
[0007] In one embodiment of the present invention, the step of detecting whether the piece has been played to a specific moment includes: acquiring a chord transition probability model and a note probability distribution model; the chord transition probability model and the note probability distribution model are obtained by training with training data of note information and training data of chord information; wherein, the chord transition probability model is used to determine whether the chord state at the previous moment is s. i Under the given conditions, calculate the chord state at the current moment as s. j Probability value; chord state s i and s j Belongs to the set of chord states; the note probability distribution model is used to determine the chord state s at the current moment. j Under the condition that the note state at the current moment is calculated as v j The probability value; the note state v j It belongs to the set of note states.
[0008] In one embodiment of the present invention, the chord transition probability model is a chord transition probability matrix comprising N rows and N columns; the note probability distribution model is a note probability distribution matrix comprising N rows and M columns; M is the number of notes, and N is the number of chords.
[0009] In one embodiment of the present invention, N is a positive integer greater than or equal to 3; M is a positive integer greater than or equal to 7.
[0010] In one embodiment of the present invention, the step of predicting the chord state at the current moment based on the chord state output at the previous moment and the note state played at the current moment further includes: using the note probability distribution matrix to calculate the chord state when the chord state at the previous moment is known to be s. i Under the condition that the note state at the current moment is calculated as v j The probability value; calculate the chord state at the current moment as s. j The probability value; based on the known chord state s at the previous moment. i And the current note state is v j Under the given conditions and at the current moment, the chord state is s j The probability value is used to calculate the chord state at the current moment as s. j The predicted probability value; trigger the corresponding chord state based on the predicted probability value.
[0011] In one embodiment of the present invention, the chord state at the current moment is s. j The probability value is based on the chord transition probability matrix and the chord state s at the previous moment. i The probability value is calculated.
[0012] Another aspect of the present invention provides a chord prediction system, comprising: a reading module for reading note information of a piece of music when a piece of music is to be sensed; the note information includes note states corresponding to a time sequence; and a prediction module for detecting whether the piece of music has been played to a specific moment; if so, predicting the chord state at the current moment based on the chord state output at the previous moment and the note state played at the current moment; if not, continuing to detect whether the piece of music has been played to a specific moment.
[0013] In one embodiment of the present invention, the chord prediction system further includes a storage module for storing a chord transition probability model and a note probability distribution model; the chord transition probability model and the note probability distribution model are trained using training data of note information and training data of chord information; wherein, the chord transition probability model is used to predict the chord state s given the previous time step. i Under the given conditions, calculate the chord state at the current moment as s. j Probability value; chord state s i and s j Belongs to the set of chord states; the note probability distribution model is used to determine the chord state s at the current moment. j Under the condition that the note state at the current moment is calculated as v j The probability value; the note state v j It belongs to the set of note states.
[0014] Another invention provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the chord prediction method.
[0015] A final aspect of the present invention provides a musical instrument, comprising: a processor and a memory; the memory for storing a computer program, and the processor for executing the computer program stored in the memory to cause the musical instrument to perform the chord prediction method.
[0016] As described above, the chord prediction method, system, computer-readable storage medium, and musical instrument of the present invention have the following beneficial effects:
[0017] The chord prediction method, system, computer-readable storage medium, and musical instrument described in this invention can automatically predict a reasonable and pleasant chord background for a user in real time when the user plays or sings a melody. This significantly lowers the barrier to entry for tasks such as composing and creating music using instruments with automatic accompaniment functions, such as electronic keyboards, improves the user experience of musical instruments, and further expands the breadth of human chord thinking. Attached Figure Description
[0018] Figure 1 The diagram shown is a flowchart of one embodiment of the chord prediction method of the present invention.
[0019] Figure 2 The diagram shown illustrates the principle structure of the chord prediction system of the present invention in one embodiment.
[0020] Figure 3 The diagram shown is a schematic representation of the principle structure of the musical instrument of the present invention in one embodiment.
[0021] Component designation explanation
[0022] 2 Chord Prediction System 20 Storage module 21 First reading module 22 Second reading module 23 Prediction module 24 Synthesis Module 3 musical instruments 31 Keyboard sensor 32 signal receiver 33 processor 34 memory S11~S15 step Detailed Implementation
[0023] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0024] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0025] Example 1
[0026] This embodiment provides a chord prediction method, including:
[0027] When the piece is detected to be played, the note information of the piece is read; the note information includes the note states corresponding to the time sequence.
[0028] The system checks if the piece has reached a specific moment in the music; if so, it predicts the chord state for the current moment based on the chord state output at the previous moment and the state of the notes played at the current moment; otherwise, it continues with the step of checking if the piece has reached a specific moment in the music.
[0029] The chord prediction method provided in this embodiment will be described in detail below with reference to the illustrations. The chord prediction method described in this embodiment is applied to instruments with automatic accompaniment functionality. Before executing the chord prediction method described in this embodiment, it is necessary to read the note information and chord information of each piece from the music library. The note information includes the note state corresponding to the time sequence. t o t This represents the note state value at time t. For each t, o t∈V. V represents the set of note states V = v1, v2, v3, ..., v M .
[0030] In this embodiment, the note state is considered as the observation state. There are 12 possible observation states, which are labeled with solfège names to avoid confusion with chord names. The 12 notes are do, #do, re, #re, mi, fa, #fa, so, #so, la, #la, ti, numbered 1 to 12 in sequence, so the set of states is {1, 2, ..., 12}.
[0031] In this embodiment, the chord information at the measure transition of each track is read. Specifically, this includes new notes that start within 50ms before and after the chord transition, or notes that are currently in progress. For example, the note information corresponding to the chords in the song is read to obtain the note and chord information shown in Table 1.
[0032] Table 1: Examples of Note and Chord Information
[0033]
[0034]
[0035] Using the acquired training database, the forward and backward Baum-Welch algorithm of the HMM model can be repeatedly applied to calculate the chord transition probability matrix A, the note probability distribution matrix B, and the initial chord distribution π = π1, π2, π3, ... π. N The Baum-Welch algorithm can be implemented using the standard HMM toolkit HTK.
[0036] Please see Figure 1 The diagram shows a flowchart of a chord prediction method in one embodiment. Figure 1 As shown, the chord prediction method specifically includes the following steps:
[0037] S11, when a piece of music is sensed, the note information of that piece is read. The note information includes the note states corresponding to the time sequence. t o t This represents the note state value at time t. For each t, o t ∈V.
[0038] S12, Obtain the chord transition probability model, note probability distribution model, and initial probability distribution. In this embodiment, the chord transition probability model and note probability distribution model are obtained through training data of note information and training data of chord information.
[0039] The chord transition probability model is used when the chord state at the previous time step is known to be s. iUnder the given conditions, calculate the chord state at the current moment as s. j Probability value; chord state s i and s j It belongs to the set of chord states.
[0040] In this embodiment, the chord transition probability model is a chord transition probability matrix A comprising N rows and N columns (where N is the number of chords and N is a positive integer greater than or equal to 3). In this embodiment, N = 24.
[0041] Among them, A=a 11 ,a 12 ,a 13 ,...,a ij ..,a NN a ij This refers to the situation where the chord state at the previous moment is known to be s. i Under the given conditions, the chord state at the current moment is s. j The probability value P.
[0042] Specifically, a ij =P(q) t =s j |q t-1 =s i That is, given the chord state at the previous moment as s i Under the given conditions, the chord state at the current moment is s. j The probability value of q. t Let q represent the chord state value at time t. For each t, q t ∈S. S represents the set of chord states S = s1, s2, s3, ..., s N .
[0043] In this embodiment, chord states are considered implicit states. Chord states include 12 major triads (C, C#, D, D#, E, F, F#, G, G#, A, A#, B) and 12 minor triads (Cm, C#, Dm, D#, Em, Fm, F#, Gm, G#, Am, Am#, Bm). These 24 chords are labeled with numbers 1 to 24, so q1 to q24 correspond to 1 to 24 respectively.
[0044] The note probability distribution model is used when the chord state at the current moment is s. j Under the condition that the note state at the current moment is calculated as v j The probability value; the note state v j It belongs to the set of note states.
[0045] In this embodiment, the note probability distribution model is a note probability distribution matrix comprising N rows and M columns (where N is the number of chords, M is the number of notes, N is a positive integer greater than or equal to 3, and M is a positive integer greater than or equal to 7). In this embodiment, N = 24, M = 12.
[0046] Where B = b 11 ,b 12 ,b 13 ,...,b ij ..,b NM b ij This refers to the situation where the chord state at the previous moment is known to be s. i Under the given conditions, calculate the note state q at the current moment. t For v j The probability value P.
[0047] Specifically, b ij =P(o t =v j |q t =s i That is, given the current chord state as s j Under the given conditions, calculate the note state at the current moment. t For v j The probability value P.
[0048] The initial probability distribution is π = π1, π2, π3, ..., π. N This refers to the probability distribution of each state of the system at the first moment.
[0049] Using the training database obtained from S11, the forward and backward Baum-Welch algorithm of the HMM model can be repeatedly applied to calculate the chord transition probability matrix A, the note probability distribution matrix B, and the initial chord distribution π = π1, π2, π3, ... π. N The Baum-Welch algorithm can be implemented using the standard HMM toolkit HTK.
[0050] S13 checks if the piece has reached a specific moment in the music; if so, proceed to S14; otherwise, return to S13 and continue checking if the piece has reached a specific moment in the music. This specific moment can be preset or determined based on the rhythm of the playing, the performer's actions, etc., such as fixed intervals, measure transitions, the moment of note input or output, or the moment the performer presses the pedal.
[0051] S14: Based on the chord state output in the previous moment and the note state played in the current moment, predict the chord state in the current moment.
[0052] S14 includes the following steps:
[0053] S141, using the note probability distribution matrix B, given the current chord state q... t For s j Under the given conditions, calculate the note state at the current moment. t For v j probability value
[0054] In this embodiment,
[0055] S142, calculate the chord state at the current moment as s j The probability value, i.e., P(q) t =s j ).
[0056] In this embodiment, the chord state q at the current moment t For s j The probability value is based on the chord transition probability matrix A and the chord state s at the previous time step. i The probability value P(q) t-1 =s i ) was calculated.
[0057] Specifically,
[0058] S143, based on the known chord state at the previous moment as s i And the current note state is v j Under the given conditions, and with the chord state at the current moment being s j The probability value is used to calculate the state of the note being played at the current moment. t =v j Meanwhile, the chord state at the current moment is s. j The predicted probability value.
[0059] Specifically, the state of the notes played at the initial moment is known. t =v j Meanwhile, the initial chord state is s. i The predicted probability value is P(q) t =s i ,o t =v j )=b ij π i .
[0060] Next, the state of the notes played in the second moment is known. t =v j Meanwhile, the chord state at the second moment is s. i The predicted probability value is
[0061] in,
[0062] And so on, predicting probability values in,
[0063] S144, based on the predicted probability value P(q) t =s i By triggering the corresponding chord state (O), a dynamic and richly user-friendly real-time chord arrangement is achieved.
[0064] S15 synthesizes the timbre of the predicted current chord and the current note.
[0065] The chord prediction method described in this embodiment can automatically predict a reasonable and pleasant chord background for the user in real time when the user plays or sings a melody. This greatly reduces the threshold for tasks such as arranging and composing music using instruments with automatic accompaniment functions, such as electronic keyboards, improves the user experience of instruments, and further expands the breadth of human chord thinking.
[0066] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described chord prediction method.
[0067] Those skilled in the art will understand that a computer-readable storage medium can be used to implement all or part of the steps of the above-described method embodiments, which can be accomplished by hardware related to a computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0068] Example 2
[0069] This embodiment provides a chord prediction system, including:
[0070] The reading module is used to read the note information of a piece of music when it is to be played; the note information includes the note states corresponding to the time sequence.
[0071] The prediction module is used to detect whether the piece has reached a specific moment in the music. If so, it predicts the chord state at the current moment based on the chord state output at the previous moment and the note state played at the current moment. If not, it continues to detect whether the piece has reached a specific moment in the music.
[0072] The chord prediction system provided in this embodiment will be described in detail below with reference to the illustrations. Please refer to... Figure 2The diagram shows a schematic representation of the principle structure of a chord prediction system in one embodiment. Figure 2 As shown, the chord prediction system 2 includes a storage module 21, a reading module 22, a prediction module 23, and a synthesis module 24.
[0073] The storage module 21 is used to store the chord transition probability model and the note probability distribution model. In this embodiment, the chord transition probability model and the note probability distribution model are obtained by training with training data of note information and training data of chord information.
[0074] The chord transition probability model is used when the chord state at the previous time step is known to be s. i Under the given conditions, calculate the chord state at the current moment as s. j Probability value; chord state s i and s j Belongs to the set of chord states; the note probability distribution model is used to determine the chord state s at the current moment. j Under the condition that the note state at the current moment is calculated as v j The probability value; the note state v j This belongs to the note state set. The chord transition probability model is a chord transition probability matrix comprising N rows and N columns (where N is the number of chords, and M is the number of notes). In this embodiment, N = 24; the note probability distribution model is a note probability distribution matrix comprising N rows and M columns (where N is the number of chords, M is the number of notes, N is a positive integer greater than or equal to 3, and M is a positive integer greater than or equal to 7). In this embodiment, N = 24, M = 12. N represents 12 major triads and 12 minor triads; M represents 12 vocal notes.
[0075] The reading module 22 is used to read the note information of a piece of music when it is to be sensed; the note information includes the note states corresponding to the time sequence. t o t This represents the note state value at time t. For each t, o t ∈V. V represents the set of note states V = v1, v2, v3, ..., v M .
[0076] In this embodiment, the note states are considered as observation states. The set of observation states has only 12 possibilities, and to avoid confusion with chord names, they are labeled using solfège syllables. The 12 notes are do, #do, re, #re, mi, fa, #fa, so, #so, la, #la, ti, numbered sequentially from 1 to 12, so the set of states is {1, 2, ..., 12}.
[0077] In this embodiment, the note information at a specific moment in the piece is read, specifically, new notes that start within 50ms before or after the chord switching moment, or notes that are currently in progress.
[0078] The prediction module 23, which is connected to the storage module 21 and the reading module 22, is used to detect whether the piece has been played to a specific moment. If so, it predicts the chord state at the current moment based on the chord state output at the previous moment and the note state played at the current moment. If not, it continues to detect whether the piece has been played to a specific moment.
[0079] Specifically, the prediction module 22 acquires the chord transition probability model and the note probability distribution model, and uses the note probability distribution matrix to calculate the chord state s given the previous time step. i Under the condition that the note state at the current moment is calculated as v j The probability value; calculate the chord state at the current moment as s. j The probability value; based on the known chord state s at the previous moment. i Under the given conditions, and with the note state being v at the current moment. j Under the given conditions and at the current moment, the chord state is s j Given the probability value of the note being played at the current moment, and the chord state at the current moment being s, calculate the probability value of the note being played at the current moment. j The predicted probability value is used to trigger the corresponding chord state. The current chord state is s. j The probability value is based on the chord transition probability matrix and the chord state s at the previous time step. i The probability value is calculated.
[0080] The synthesis module 24, which is connected to the second reading module 22 and the prediction module 23, is used to synthesize the timbre of the predicted current chord and the current note.
[0081] It should be noted that the division of the various modules in the above system is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls, entirely in hardware, or partially in software calls via processing element calls, with some modules implemented in hardware. For example, module x can be a separate processing element or integrated into a chip within the system. Additionally, module x can be stored as program code in the system's memory, invoked and executed by a processing element. The implementation of other modules is similar. These modules can be fully or partially integrated together or implemented independently. The processing element mentioned here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the processor element or through software instructions. These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), one or more Field Programmable Gate Arrays (FPGAs), etc. When a module is implemented through processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. These modules can be integrated together to form a System-on-a-Chip (SOC).
[0082] Example 3
[0083] This embodiment provides a musical instrument; please refer to [link / reference]. Figure 3 The diagram shows a schematic representation of the principle structure of a musical instrument in one embodiment. Figure 3 As shown, the musical instrument 3 includes: a keyboard sensor 31, a signal receiver 32 connected to the keyboard sensor 31, a processor 33 connected to the signal receiver 32, and a memory 34 connected to the processor.
[0084] The keyboard sensor receives performance signals, which are then received by the signal receiver and sent to the processor. The memory stores a computer program, and the processor executes the computer program stored in the memory to cause the instrument to perform the various steps of the chord prediction method described above.
[0085] The system bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. The communication interface is used to enable communication between the database access device and other devices (such as clients, read-write databases, and read-only databases). Memory may include Random Access Memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0086] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0087] The scope of protection of the chord prediction method described in this invention is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this invention is included within the scope of protection of this invention.
[0088] The present invention also provides a chord prediction system, which can implement the chord prediction method described in the present invention. However, the implementation device of the chord prediction method described in the present invention includes, but is not limited to, the structure of the chord prediction system listed in this embodiment. All structural modifications and substitutions of the prior art made in accordance with the principles of the present invention are included within the protection scope of the present invention.
[0089] In summary, the chord prediction method, system, computer-readable storage medium, and musical instrument described in this invention can automatically predict a reasonable and pleasing chord background for a user in real time while the user is playing or singing a melody. This significantly lowers the barrier to entry for tasks such as composing and creating music using instruments with automatic accompaniment functions, such as electronic keyboards, improving the user experience and expanding the breadth of human chord thinking. This invention effectively overcomes the various shortcomings of existing technologies and has high industrial application value.
[0090] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A chord prediction method characterized by, Comprising: reading note information of a played piece when the piece is to be played; the note information comprises note states corresponding to time sequences; detecting whether the piece is played to a specific time point; if yes, predicting a chord state of the current time point according to a chord state output at a previous time point and a note state played at the current time point; if no, continuing to detect whether the piece is played to the specific time point; the step of predicting the chord state of the current time point according to the chord state output at the previous time point and the note state played at the current time point comprises: Using the note probability distribution matrix, the probability value of the note state being at the current time is calculated under the condition that the previous chord state is known. The current time and the probability value of the chord state are calculated as current time and the probability value of the chord state are calculated as According to the conditions that the chord state at a previous time point is and the note state at a current time point is and the probability value of the chord state at the current time point being , a prediction probability value of the chord state at the current time point being is calculated. triggering a chord state corresponding to the prediction probability value; The probability value of the chord state being at the current time is calculated according to the chord transition probability matrix and the probability value of the chord state being at the previous time.
2. The chord prediction method of claim 1, wherein, the chord prediction method further comprises: obtaining a chord transition probability model and a note probability distribution model; the chord transition probability model and the note probability distribution model are obtained by training note information training data and chord information training data; The chord transition probability model is used to calculate a probability value of a chord state at a current time being under the condition that a chord state at a previous time is The chord state and belongs to a chord state set. The note probability distribution model is used to calculate a probability value of a note state being under the condition that a previous time and chord state is The note state belongs to a note state set.
3. The chord prediction method of claim 2, wherein, the chord transition probability model is a chord transition probability matrix comprising N rows and N columns; the note probability distribution model is a note probability distribution matrix comprising N rows and M columns; M is the number of notes, and N is the number of chords.
4. The chord prediction method of claim 3, wherein, N is a positive integer greater than or equal to 3; M is a positive integer greater than or equal to 7.
5. A chord prediction system characterized by, Comprising: a reading module configured to read note information of a played piece when the piece is to be played; the note information comprises note states corresponding to time sequences; a prediction module configured to detect whether the piece is played to a specific time point; if yes, predict a chord state of the current time point according to a chord state output at a previous time point and a note state played at the current time point; if no, continue to detect whether the piece is played to the specific time point; the step of predicting the chord state of the current time point according to the chord state output at the previous time point and the note state played at the current time point comprises: Using the note probability distribution matrix, the probability value of the note state being at the current time is calculated under the condition that the previous chord state is known. The current time and the probability value of the chord state are calculated as current time and the probability value of the chord state are calculated as The prediction probability value of the chord state at the current time is calculated according to the probability value of the chord state at the previous time and the note state at the previous time , the probability value of the note state at the current time , and the probability value of the chord state at the current time . triggering a chord state corresponding to the prediction probability value; The probability value of the chord state being at the current time is calculated according to the chord transition probability matrix and the probability value of the chord state being at the previous time.
6. The chord prediction system of claim 5, wherein, the chord prediction system further comprises a storage module configured to store a chord transition probability model and a note probability distribution model; the chord transition probability model and the note probability distribution model are obtained by training note information training data and chord information training data; The chord transition probability model is used to calculate a probability value of a chord state at a current time being under a condition that a chord state at a previous time is The chord states and belong to a chord state set. The note probability distribution model is used to calculate a probability value of a note state being under the condition that a previous time and chord state is The note state belongs to a note state set.
7. A computer readable storage medium having stored thereon a computer program, characterized in that, the program is executed by the processor to implement the chord prediction method of any one of claims 1 to 4.
8. A musical instrument, characterized by Comprising: a processor and a memory; the memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory, so that the musical instrument performs the chord prediction method of any one of claims 1 to 4.
Citation Information
Patent Citations
Brain wave AI music generation method and system
CN108877749A
Harmony matching method and device, electronic equipment and computer readable medium
CN111681631A