Performance detection method and computer readable storage medium
By determining the optimal matching time in the score and matching pitch values, the system automatically detects missed, extra, and wrong notes in instrument performance, solving the problem of inaccurate detection in existing technologies, achieving efficient marking of performance errors, and enhancing the performer's self-improvement capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies cannot accurately detect instances of playing multiple notes, missing notes, or incorrect notes in musical instrument performances. Relying on manual evaluation introduces errors, and existing software has limited detection capabilities.
By determining the optimal matching moment for the current playing note in the score, matching according to the pitch value, marking missed, extra, and wrong playing situations, and using computer-readable storage media to achieve automatic detection.
It improves the accuracy and comprehensiveness of performance detection, and can display performance errors in real time, helping performers improve their skills.
Smart Images

Figure CN118280320B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of performance testing technology, and in particular to a performance testing method and a computer-readable storage medium. Background Technology
[0002] Currently, the evaluation of a performer's performance typically involves a professional observer listening to the performance and comparing it with the score to identify any errors such as playing too many pieces, omitting pieces, or playing the wrong pieces. However, this method relies on professionals and cannot be evaluated in situations where such professionals are not available, limiting its application. Furthermore, human evaluation can lead to errors or omissions, compromising accuracy.
[0003] Currently, there are some musical instrument playing assistance software programs that can be used to detect whether a user is playing correctly. However, existing detection software can generally only detect the overall correctness of the performance and cannot detect various errors such as playing too many notes, missing notes, or playing the wrong notes. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a performance detection method and a computer-readable storage medium that can accurately detect whether the performer has played too many, missed, or wrong pieces.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a performance detection method, comprising:
[0006] The note being played at the current moment is obtained as the current playing note. Based on the current playing note, the best matching moment is determined from the musical note corresponding to the current moment and the n musical notes adjacent to it on the left and right, where n is a preset value.
[0007] Based on the pitch value, the currently played note is paired with the note at the best matching moment, and unpaired notes are marked as missed or extra notes, and notes with different pitch values in the same pair are marked as playing errors;
[0008] If the optimal matching time is after the time in the score corresponding to the current time, then the note between the current time in the score and the optimal matching time will be marked as a missed note.
[0009] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0010] The beneficial effects of this invention are as follows: By finding the optimal matching moment in the score that is closest to the note played by the performer at the current moment, and judging whether the performer has missed, played too many, or played the wrong note based on the note of the optimal matching moment, and further, if the optimal matching moment is after the corresponding note in the score, it indicates that the performer has skipped notes, and the note in between is marked as missed, thereby improving the accuracy and comprehensiveness of the detection. This invention can detect and mark the wrong, missed, and extra notes played by the performer, allowing the performer to understand their overall performance in the corresponding song, as well as specific performance problems, helping the performer improve their performance level. Attached Figure Description
[0011] Figure 1 This is a flowchart of a performance detection method according to the present invention;
[0012] Figure 2 This is a flowchart of the method according to Embodiment 1 of the present invention;
[0013] Figure 3 This is a schematic diagram of the musical score according to Embodiment 1 of the present invention;
[0014] Figure 4 This is a schematic diagram of a ricocheting bullet according to Embodiment 1 of the present invention;
[0015] Figure 5 This is a flowchart of step S1 in Embodiment 2 of the present invention. Detailed Implementation
[0016] To explain the technical content, objectives, and effects of the present invention in detail, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0017] Please see Figure 1 A performance testing method, comprising:
[0018] The note being played at the current moment is obtained as the current playing note. Based on the current playing note, the best matching moment is determined from the musical note corresponding to the current moment and the n musical notes adjacent to it on the left and right, where n is a preset value.
[0019] Based on the pitch value, the currently played note is paired with the note at the best matching moment, and unpaired notes are marked as missed or extra notes, and notes with different pitch values in the same pair are marked as playing errors;
[0020] If the optimal matching time is after the time in the score corresponding to the current time, then the note between the current time in the score and the optimal matching time will be marked as a missed note.
[0021] As can be seen from the above description, the beneficial effects of the present invention are: it can detect and mark the notes that the performer plays incorrectly, misses, or plays extra notes, allowing the performer to understand their overall performance in the corresponding song, as well as specific performance problems, thus helping the performer improve their performance level.
[0022] Furthermore, the step of obtaining the note played at the current moment as the current playing note, and determining the best matching moment from the musical score corresponding to the current moment and its n adjacent musical scores on the left and right, based on the current playing note, specifically involves:
[0023] Get the note being played at the current moment as the current playing note, and get the musical note corresponding to the current moment in the score. Use the note of the musical note corresponding to the current moment in the score as the musical note corresponding to the current playing note. Notes at the same musical note in the score indicate that more than one note needs to be played at the same time.
[0024] Calculate the similarity rate between the currently played note and its corresponding note in the musical score;
[0025] If the similarity rate between the currently played note and its corresponding note in the musical score is greater than or equal to a preset first threshold, then the musical score moment corresponding to the current moment is taken as the best matching moment.
[0026] If the similarity rate between the currently played note and its corresponding note in the score is less than a preset first threshold, then it is determined whether there is a matching moment among the n adjacent moments in the score corresponding to the current moment, and the similarity rate between the note of the matching moment and the currently played note is greater than or equal to a preset second threshold.
[0027] If it does not exist, the time in the score corresponding to the current time will be taken as the best matching time;
[0028] If a match exists, the optimal match time is determined based on the similarity rate between the notes at each match time and the currently played note.
[0029] As described above, the higher the similarity between the current playing note and the note at a certain moment in the score, the more likely the performer is playing the note at that moment in the score. When performing, performers usually practice a section repeatedly and generally do not miss many notes at certain moments in the score. Therefore, searching for matching moments only near the current moment in the score can improve search efficiency and thus improve recognition efficiency.
[0030] Furthermore, the calculation of the similarity rate between the currently played note and its corresponding musical score note specifically involves:
[0031] Match the pitch values of each note in the currently played note with the pitch values of each note in the corresponding musical score to determine the number of notes with the same pitch value;
[0032] Divide the number of notes with the same pitch value by the total number of notes in the corresponding musical score to obtain the similarity rate between the currently played note and its corresponding musical score note.
[0033] As described above, by calculating the same rate, it can be determined whether the performer is currently playing the note corresponding to the current moment in the score.
[0034] Furthermore, determining the optimal matching time based on the similarity rate between the notes at each matching moment and the currently played note specifically involves:
[0035] If the number of matching moments is one, then that matching moment is taken as the best matching moment;
[0036] If the number of matching moments is at least two, then the matching moment with the highest similarity rate to the currently played note is selected as the first matching moment;
[0037] Determine whether the number of the first matching moments is one;
[0038] If so, then the first matching moment is taken as the best matching moment;
[0039] If not, the first matching moment with the fewest time intervals between it and the current moment in the musical score will be taken as the best matching moment.
[0040] As can be seen from the above description, if the matching time is unique, then the unique matching time is directly taken as the best matching time; if it is not unique, then the time closest to the musical score time corresponding to the current time is taken as the best matching time.
[0041] Furthermore, the step of selecting the first matching moment with the fewest time intervals from the current moment in the musical score as the optimal matching moment specifically involves:
[0042] If the number of first matching moments with the fewest intervals between the current moment and the corresponding moment in the musical score is one, then that first matching moment is taken as the best matching moment;
[0043] If there are two first matching moments that are the fewest time intervals between the current time and the time interval corresponding to the score, then the first matching moment that is after the time interval corresponding to the current time is taken as the best matching moment.
[0044] Furthermore, after determining the optimal matching time from the current musical note and its n adjacent musical notes in the score, based on the current playing note, the process further includes:
[0045] If the number of notes at the best matching moment is one, and the number of notes in the currently played note is one, then determine whether the pitch value of the currently played note is the same as that of the note at the best matching moment.
[0046] If they match, then mark the note at the best matching moment as the correct performance;
[0047] If there is a discrepancy, the note at the best matching moment will be marked as a performance error.
[0048] As described above, if only one note is played at a given moment and the optimal matching moment has only one note, then a difference in pitch value indicates a performance error.
[0049] Furthermore, based on the pitch value, the currently played note is paired with the note at the optimal matching moment, and unpaired notes are marked as missed or extra notes. Notes with different pitch values in the same pair are marked as playing errors. Specifically:
[0050] Based on the pitch value, the currently played notes are sorted to obtain the first sequence, and the notes at the best matching moment are sorted to obtain the second sequence; the notes in the first sequence are taken as the first notes, and the notes in the second sequence are taken as the second notes;
[0051] Pair the first and second notes with the same pitch value to obtain the best pairing, and mark the notes in the best pairing as played correctly.
[0052] If there is no unpaired first note in the first sequence and there is an unpaired second note in the second sequence, then the unpaired second note in the second sequence is marked as a missed note;
[0053] If there is an unpaired first note in the first sequence and there is no unpaired first note in the second sequence, then the unpaired first note in the first sequence will be displayed on the score and marked as played multiple times.
[0054] If there is an unpaired first note in the first sequence and an unpaired second note in the second sequence, then the absolute value of the pitch difference between each unpaired first note and each unpaired second note is calculated, and the unpaired first note and second note are paired again according to the absolute value of the pitch difference and the preset pairing rules.
[0055] Mark the notes in the pairings obtained from the second pairing as playing errors;
[0056] If there is an unpaired first note in the first sequence after the second pairing, then the unpaired first note in the first sequence will be displayed on the score and marked as a multiple-play;
[0057] If there is an unpaired second note in the second sequence after the second pairing, then the unpaired second note in the second sequence is marked as a missed note.
[0058] Further, the step of performing a secondary pairing of the unpaired first and second notes based on the absolute value of the pitch difference and a preset pairing rule includes:
[0059] If the absolute value of the pitch difference between an unpaired first note and an unpaired second note is the smallest, then the first note and the second note are paired first.
[0060] If there are two or more unpaired first notes and an unpaired second note with the same absolute pitch difference and the smallest absolute pitch difference, then the absolute value of the number difference is calculated according to the number of the two or more first notes in the first unpaired sequence and the number of the second note in the second unpaired sequence, and the first note corresponding to the smallest absolute pitch difference is paired with the second note first.
[0061] If there are two or more unpaired second notes with the same absolute pitch difference as an unpaired first note and the pitch difference is the smallest, then the absolute value of the sequence number difference is calculated according to the sequence number of the first note in the first unpaired sequence and the sequence number of the two or more second notes in the second unpaired sequence, and the first note is paired with the second note corresponding to the smallest absolute value of the sequence number difference.
[0062] Wherein, the sound in the first unpaired sequence is the first unpaired sound in the first sequence, and the sound in the second unpaired sequence is the second unpaired sound in the second sequence.
[0063] Furthermore, the step of performing a secondary pairing of the unpaired first and second notes based on the absolute value of the pitch difference and a preset pairing rule further includes:
[0064] If the absolute value of the pitch difference between the first and second notes in the same pair is greater than a preset threshold, then the pairing of the first and second notes in the same pair is cancelled.
[0065] As described above, for a situation where there are multiple notes at the optimal matching moment and the performer has also played multiple notes, the remaining notes, excluding those with the same pitch value, are matched in pairs according to their pitch difference. If the pitch difference between the two pairs of matched notes is small, it indicates that the performer played the wrong note. If the pitch difference between the two pairs of matched notes is large, it indicates that the performer missed or played too many notes.
[0066] Furthermore, the step of performing a secondary pairing of the unpaired first and second notes based on the absolute value of the pitch difference and a preset pairing rule further includes:
[0067] If the first note in the same pair has a lower number in the first sequence than the first note in the best pair or another pair, and the second note in the same pair has a higher number in the second sequence than the second note in the best pair or another pair, then the pairing of the first and second notes in the same pair is cancelled.
[0068] If the first note in the same pair has a higher number in the first sequence than the first note in the best pair or another pair, and the second note in the same pair has a lower number in the second sequence than the second note in the best pair or another pair, then the pairing of the first and second notes in the same pair is cancelled.
[0069] As described above, this method can further improve the accuracy of detecting specific performance errors.
[0070] Furthermore, after determining the optimal matching time from the current musical note and its n adjacent musical notes in the score, based on the current playing note, the process further includes:
[0071] If the best matching moment is before the current moment in the score, it is determined to be a replay, and the markings of the notes between the best matching moment and the current moment in the score are reset.
[0072] As described above, the markers are cleared when the instrument is replayed, thus allowing the markers of the latest performance status to be displayed in real time.
[0073] Furthermore, after determining the optimal matching time from the current musical note and its n adjacent musical notes in the score, based on the current playing note, the process further includes:
[0074] The next musical moment of the best matching moment is taken as the musical moment corresponding to the next moment of the current moment.
[0075] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0076] Example 1
[0077] Please refer to Figure 2-4 Embodiment 1 of the present invention is: a performance detection method, which can be applied to a musical instrument performance assistance system.
[0078] First, the following definition is given:
[0079] 1. The currently played note is the note played by the performer at the current moment. For the system, if the playing time between two notes is less than the preset time threshold (which can be set according to the performer's proficiency, such as 100ms), then the two notes are considered to be played at the same time.
[0080] 2. Score note: The score note corresponding to the current time in the score is taken as the score note corresponding to the current playing note.
[0081] 3. Notes at the same time in the score; notes that are to be played simultaneously within the same time period in a musical score represent notes at the same time in the score, such as... Figure 3 As shown, Figure 3 Notes within the same box in a musical score represent the notes at the same moment in the piece. During performance, notes within the same box should be played simultaneously for the best sound.
[0082] 4. The order of notes in the score refers to the sequence in which the notes are played. The notes in the score are arranged in the order of performance, and notes with the same number are played simultaneously.
[0083] 5. Skipping; For example, suppose the current piece is played at the first note of the second measure, but the performer wants to skip the second note of the second measure and play the third note of the second measure; or wants to skip several consecutive notes and start playing from the seventh note of the second measure; or wants to skip the second and third measures and start playing from the fourth measure. This is called skipping.
[0084] like Figure 2 As shown, the method in this embodiment includes the following steps:
[0085] S1: Obtain the note being played at the current moment as the current playing note, and based on the current playing note, determine the best matching moment among the current moment in the score and the n adjacent moments on the left and right, where n is a preset value.
[0086] S2: Determine whether the number of notes at the optimal matching moment is one, and whether the number of notes in the currently played notes is one. If yes, proceed to step S3. If no, it means that there are two or more notes at the optimal matching moment, or that there are two or more notes in the currently played notes. Proceed to step S6.
[0087] S3: Determine whether the pitch value of the currently played note is consistent with the pitch value of the note at the best matching moment. If yes, proceed to step S4; otherwise, proceed to step S5.
[0088] S4: Mark the note at the best matching moment as played correctly.
[0089] S5: Mark the note at the best matching moment as a performance error.
[0090] S6: Based on the pitch value, pair the currently played note with the note at the best matching moment, and mark unpaired notes as missed or extra notes, and mark notes with different pitch values in the same pair as playing errors.
[0091] Specifically, firstly, the currently played notes are sorted according to their pitch values to obtain a first sequence M, and the notes at the best matching moment are sorted to obtain a second sequence N; wherein, the notes in the first sequence are taken as the first notes, and the notes in the second sequence are taken as the second notes.
[0092] Then, the first and second notes with the same pitch value are paired to obtain the best pairing, and the notes in the best pairing are marked as played correctly.
[0093] After the optimal pairing is completed, if there are no unpaired notes in the first sequence M and the second sequence N, it means that there are no extra, missed, or wrong notes played at that moment.
[0094] If there is no unpaired first note in the first sequence M and there is an unpaired second note in the second sequence N, then the unpaired second note in the second sequence N is marked as a missed note.
[0095] If there is no unpaired second note in the second sequence N at this time, and there is still an unpaired first note in the first sequence M, then the unpaired first note in the first sequence M will be displayed on the score and marked as a multiple note.
[0096] If there are still unpaired notes in both the first sequence M and the second sequence N, then the absolute value of the pitch difference between each unpaired first note and each unpaired second note is calculated, and the unpaired first notes and second notes are paired a second time according to the absolute value of the pitch difference and the preset pairing rules.
[0097] In this embodiment, the pairing rules include the following rules:
[0098] a. Pair according to the absolute value of the pitch difference from smallest to largest, prioritizing pairing the first and second notes with the smallest absolute value of the pitch difference, and the best pair and those already paired will not be paired again.
[0099] That is, if the absolute value of the pitch difference between an unpaired first note and an unpaired second note is the smallest, then the first note and the second note are paired first.
[0100] For example, suppose the pitch values of the unpaired first note in the first sequence M are {60, 62, 65}, and the pitch values of the unpaired second note in the second sequence N are {58, 63, 68}. The absolute value of the pitch difference between the first note in M with a pitch value of 62 and the second note in N with a pitch value of 63 is 1, which is the smallest absolute value of pitch difference, so it is paired first. Then the first note in M with a pitch value of 60 is paired with the second note in N with a pitch value of 58, and finally the first note in M with a pitch value of 65 is paired with the second note in N with a pitch value of 68.
[0101] b. If two first notes in the first sequence M have the same absolute pitch difference with one second note in the second sequence N and the pitch difference is the smallest, then pairing should be prioritized according to the smallest absolute pitch difference between the unpaired numbers.
[0102] If there are two or more unpaired first notes and one unpaired second note with the same absolute pitch difference and the smallest absolute pitch difference, then the absolute value of the number difference is calculated according to the number of the two or more first notes in the first unpaired sequence and the number of the second note in the second unpaired sequence, and the first note corresponding to the smallest absolute value of the number difference is paired with the second note.
[0103] Wherein, the sound in the first unpaired sequence is the first unpaired sound in the first sequence, and the sound in the second unpaired sequence is the second unpaired sound in the second sequence.
[0104] For example, suppose the pitch of the unpaired first note in the first sequence M is {60, 62}, and the pitch of the unpaired second note in the second sequence N is {61, 64}. Since the absolute values of the pitch differences between the first notes with pitch values of 60 and 62 in M and the second note with pitch value of 61 in N are the same, pairing is based on the smallest absolute value of the difference in index. The indexes of the first notes with pitch values of 60 and 62 in the unpaired first notes of M are 1 and 2 respectively, and the index of the second note with pitch value of 61 in the unpaired second notes of N is 1. Obviously, the absolute value of the difference in index between the first note with pitch value of 60 in M and the second note with pitch value of 61 in N is the smallest, so the first note with pitch value of 60 in M is paired with the second note with pitch value of 61 in N firstly.
[0105] c. If two second notes in the second sequence N have the same absolute pitch difference with one first note in the first sequence M and the difference is the smallest, then, similar to b, pairing should be prioritized according to the smallest absolute pitch difference between the unpaired notes.
[0106] If there are two or more unpaired second notes with the same absolute pitch difference as an unpaired first note and the pitch difference is the smallest, then the absolute value of the number difference is calculated according to the number of the first note in the first unpaired sequence and the number of the two or more second notes in the second unpaired sequence, and the first note is paired with the second note corresponding to the smallest absolute value of the number difference.
[0107] d. The absolute value of the pitch difference between the first note in the first sequence M and the second note in the second sequence N should not exceed a preset threshold.
[0108] In other words, even if the absolute value of the pitch difference between an unpaired first note in M and an unpaired second note in N is the smallest, if the absolute value of the pitch difference is greater than a preset threshold, the two notes will not be paired.
[0109] e. The sequence numbers of the first note in the first sequence M and the second note in the second sequence N are not allowed to cross the best pairing and the already paired notes.
[0110] That is, if the first note in the same pair has a lower number in the first sequence than the first note in the first sequence of an optimal pair or another pair, and the second note in the same pair has a higher number in the second sequence than the second note in the first sequence of an optimal pair or another pair, then the pairing of the first and second notes in the same pair is cancelled; if the first note in the same pair has a higher number in the first sequence than the first note in the first sequence of an optimal pair or another pair, and the second note in the same pair has a lower number in the second sequence than the second note in the first sequence of an optimal pair or another pair, then the pairing of the first and second notes in the same pair is cancelled.
[0111] For example, suppose the pitch of the first note in the first sequence M is {60, 61}, and the pitch of the second note in the second sequence N is {61, 62}. The first note in M with pitch 61 and the second note in N with pitch 61 are the best pairing. The index of the first note in M with pitch 61 is 2, and the index of the second note in N with pitch 61 is 1. Therefore, it is not allowed to pair the first note in M with pitch 60 (index 1) with the second note in N with pitch 62 (index 2), because this pairing would cross the best pairing.
[0112] A second pairing is performed using the above matching rules, and the notes in the resulting pairings are marked as playing errors.
[0113] If there are still unpaired first notes in the first sequence M after the second pairing, then these unpaired first notes are displayed on the score and marked as multiple notes.
[0114] If there are still unpaired second notes in the second sequence N after the second pairing, then these unpaired second notes are marked as missed notes.
[0115] S7: Determine whether the best matching time is after the time in the score corresponding to the current time. If yes, it means that a bounce has occurred, and proceed to step S8. If no, proceed to step S9.
[0116] S8: Mark the note between the current time in the score and the best matching time as a missed note.
[0117] For example, such as Figure 4 As shown, assuming the performer played the note at the time indicated by the first small square in the previous moment (i.e., the note at the 7th moment of the first measure), then the note at the current moment should be the 8th moment of the first measure. However, the best matching moment is detected as the note at the time indicated by the last small square in the figure (i.e., the note at the 1st moment of the 4th measure). This means that the performer skipped the notes in the middle large square. In this case, all notes in the middle large square are marked as missed.
[0118] S9: Determine whether the best matching time is before the time in the score corresponding to the current time. If so, it means that a bounce has occurred, and proceed to step S10.
[0119] S10: Reset the markings of the notes between the best matching moment and the current moment in the score, that is, cancel the markings of the notes between the best matching moment and the current moment.
[0120] Furthermore, in this embodiment, different colors are used to mark notes that were played incorrectly, missed, or were played incorrectly. For example, the initial color of the notes in the score can be black; correctly played notes can be marked in green; incorrectly played notes can be marked in red; missed notes can be marked in gray; and repeated notes can be displayed as musical notes at the corresponding positions on the score and marked in yellow. In other optional embodiments, text can also be used to mark these notes to distinguish between correctly played, incorrectly played, missed, and repeated notes. By marking these notes, the performer's performance details and overall performance effect can be displayed more intuitively on the score.
[0121] Furthermore, steps S7-S10 are executed in any order from steps S2-S6.
[0122] In this embodiment, if only one note is played at a given moment and there is only one note at the optimal matching moment, then a difference in pitch value indicates a performance error. If there are multiple notes at the optimal matching moment and the performer also plays multiple notes, then, excluding the notes with the same pitch value, the remaining notes are paired according to their pitch difference. If the pitch difference between the paired notes is small, it indicates that the performer played the wrong note. If the pitch difference between the paired notes is large, it indicates that the performer missed or played too many notes.
[0123] This embodiment can detect and mark the notes that the performer plays incorrectly, misses, or plays extra notes, allowing the performer to understand their overall performance in the corresponding song, as well as specific performance problems, and helping the performer improve their performance level.
[0124] Example 2
[0125] Please refer to Figure 5 This embodiment is a further extension of step S1 in embodiment one.
[0126] like Figure 5 As shown, step S1 includes the following steps:
[0127] S101: Obtain the note being played at the current moment as the current playing note, and obtain the musical note corresponding to the current moment in the score. Use the note of the musical note corresponding to the current moment in the score as the musical note corresponding to the current playing note.
[0128] One approach is to use multi-tone audio recognition to obtain the note being played at the current moment, or to use MIDI signal input. When the performer plays a single note or multiple notes within a unit of time, the performance signal is converted into a MIDI signal and transmitted to the recognition algorithm. MIDI signal transmission can transmit multiple MIDI signals within a unit of time.
[0129] Furthermore, in this embodiment, at the very beginning of the performance, the first musical moment in the score is taken as the musical moment corresponding to the first performance moment. After the best matching moment for the current moment is determined, the next musical moment of the best matching moment is taken as the musical moment corresponding to the next moment of the current moment.
[0130] In other words, for each moment during the performance, there is a corresponding musical moment in the score, which is the musical moment that the performer should play in the normal performance order. Then, using the method of this embodiment, the best matching moment is determined among the corresponding musical moment and the multiple musical moments on its left and right, which is the musical moment that the performer may actually play.
[0131] S102: Calculate the similarity rate between the currently played note and its corresponding note in the score.
[0132] Specifically, the pitch values of each note in the currently played note are matched with the pitch values of each note in the corresponding musical score to determine the number of notes with the same pitch value; then, the number of notes with the same pitch value is divided by the total number of notes in the corresponding musical score to obtain the similarity rate between the currently played note and its corresponding musical score.
[0133] S103: Determine whether the similarity rate between the current playing note and its corresponding musical note is less than a preset first threshold. If yes, proceed to step S105; otherwise, proceed to step S104.
[0134] S104: Take the current time as the best matching time in the musical score.
[0135] S105: Determine whether there is a matching moment among the n musical moments adjacent to the current moment in the musical score. The similarity rate between the note of the matching moment and the note played at the current moment is greater than or equal to a preset second threshold. If yes, that is, there is a matching moment, then proceed to step S106. If no, that is, there is no matching moment, then proceed to step S104.
[0136] Where n is a preset value. In this embodiment, n = 50, that is, searching within the 50 musical scores before and after the current musical score to determine if there is a matching score among these adjacent musical scores. Further, if the number of musical scores before or after the current musical score is less than 50, then all musical scores before or after it are obtained.
[0137] S106: Determine whether the number of matching moments is one. If yes, proceed to step S107. If no, it means that the number of matching moments is at least two. Proceed to step S108.
[0138] S107: The matching time is taken as the optimal matching time.
[0139] S108: Take the matching moment with the highest similarity rate with the currently played note as the first matching moment, and determine whether the number of the first matching moments is one. If yes, proceed to step S109. If no, it means that the number of the first matching moments is at least two, that is, it means that there are more than two matching moments with the same and highest similarity rate with the currently played note. Proceed to step S110.
[0140] S109: Take the first matching time as the optimal matching time.
[0141] S110: The first matching moment with the fewest time intervals between it and the current time in the musical score is taken as the best matching moment.
[0142] Specifically, if there is only one first matching moment that is the shortest interval between the current time and the time in the score, then that first matching moment is directly taken as the best matching moment; if there are two first matching moments that are the shortest interval between the current time and the time in the score, then the first matching moment that is after the time in the score corresponding to the current time is taken as the best matching moment.
[0143] Furthermore, the first threshold is less than or equal to the second threshold. In this embodiment, the value range of the first threshold is (0,1], and the value range of the second threshold is (0,1).
[0144] This embodiment can achieve multi-note recognition within a unit of time by acquiring the notes played at the same time. By finding the musical note that best matches the note played at the current time in the musical score, the musical note that the performer may actually play can be determined, which is convenient for subsequent detection of the performer's specific performance.
[0145] Example 3
[0146] This embodiment is a computer-readable storage medium corresponding to the above embodiments, which stores a computer program. When the program is executed by a processor, it implements the various steps of the performance detection method in the above embodiments and achieves the same technical effect, which will not be repeated here.
[0147] In summary, the performance detection method and computer-readable storage medium provided by this invention find the best matching moment in the score that is closest to the note played by the performer at the current moment, and determine whether the note played at the current moment has been missed, played multiple times, or played incorrectly based on the note at the best matching moment. Furthermore, if the best matching moment is after the corresponding note in the score, it indicates that the performer has skipped notes, and the note in between is marked as missed, thereby improving the accuracy and comprehensiveness of the detection. This invention can detect and mark the notes played incorrectly, missed, and played multiple times, allowing the performer to understand their overall performance in a given song and specific performance problems, thus helping the performer improve their performance level.
[0148] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A performance detection method characterized by comprising: The method comprises the following steps: acquiring a played note at a current time as a current played note, and determining a best matching time from notes at a score time corresponding to the current time and n score times adjacent to the score time, n being a preset value; pairing the current played note with a note at the best matching time according to a pitch value, marking a note not paired as a missed note or an extra note, and marking a note with a different pitch value in the same pair as a playing error; if the best matching time is after the score time corresponding to the current time, marking notes between the score time corresponding to the current time and the best matching time as missed notes; the acquiring of the played note at the current time as the current played note, and the determining of the best matching time from the notes at the score time corresponding to the current time and the n score times adjacent to the score time according to the current played note is specifically: acquiring a played note at a current time as a current played note, and acquiring a score time corresponding to the current time, taking notes at the score time corresponding to the current time as score notes corresponding to the current played note, wherein the notes at the same score time in the score represent more than one note to be played simultaneously; calculating a same rate of the current played note and the corresponding score note; if the same rate of the current played note and the corresponding score note is greater than or equal to a preset first threshold, taking the score time corresponding to the current time as the best matching time; if the same rate of the current played note and the corresponding score note is less than the preset first threshold, determining whether there is a matching time in n score times adjacent to the score time corresponding to the current time in the score, the same rate of the note at the matching time and the current played note being greater than or equal to a preset second threshold; if not, taking the score time corresponding to the current time as the best matching time; if yes, determining the best matching time according to the same rate of the note at each matching time and the current played note.
2. The performance detection method according to claim 1, characterized by, the calculating of the same rate of the current played note and the corresponding score note is specifically: matching the pitch value of each note in the current played note with the pitch value of each note in the corresponding score note to determine the number of notes with the same pitch value; dividing the number of notes with the same pitch value by the total number of notes in the corresponding score note to obtain the same rate of the current played note and the corresponding score note.
3. The performance detection method according to claim 1, characterized by, the determining of the best matching time according to the same rate of the note at each matching time and the current played note is specifically: if the number of matching times is one, taking the matching time as the best matching time; if the number of matching times is at least two, acquiring a matching time with the highest same rate as the current played note as a first matching time; determining whether the number of first matching times is one; if yes, taking the first matching time as the best matching time; if not, taking a first matching time with the least number of times between the score time corresponding to the current time as the best matching time.
4. The performance detection method according to claim 3, characterized by, the taking of the first matching time with the least number of times between the score time corresponding to the current time as the best matching time is specifically: If the number of the first matching time points with the least number of time points between the score time points corresponding to the current time point is one, the one first matching time point is taken as the best matching time point; If the number of the first matching time points with the least number of time points between the score time points corresponding to the current time point is two, the first matching time point located after the score time point corresponding to the current time point among the two first matching time points is taken as the best matching time point.
5. The performance detection method according to claim 1, characterized by, After determining the best matching time point from the current performance sound among the score time point corresponding to the current time point and the n score time points adjacent to the left and right of the score time point, the method further comprises: If the number of the sounds of the best matching time point is one and the number of the sounds in the current performance sound is one, it is judged whether the pitch values of the current performance sound and the sound of the best matching time point are consistent; If they are consistent, the sound of the best matching time point is marked as correct performance; If they are not consistent, the sound of the best matching time point is marked as incorrect performance.
6. The performance detection method according to claim 1, characterized by, The current performance sound and the sound of the best matching time point are paired according to the pitch values, and the unpaired sounds are marked as missed or multiple, and the sounds with different pitch values in the same pair are marked as incorrect performance, specifically: The current performance sound is sorted according to the size of the pitch value to obtain a first sequence, and the sound of the best matching time point is sorted to obtain a second sequence; wherein the sound in the first sequence is taken as a first sound, and the sound in the second sequence is taken as a second sound; The first sound and the second sound with the same pitch value are paired to obtain the best pair, and the sounds in the best pair are marked as correct performance; If there is no unpaired first sound in the first sequence and there is unpaired second sound in the second sequence, the unpaired second sound in the second sequence is marked as missed; If there is unpaired first sound in the first sequence and there is no unpaired first sound in the second sequence, the unpaired first sound in the first sequence is displayed on the score and marked as multiple; If there is unpaired first sound in the first sequence and there is unpaired second sound in the second sequence, the pitch difference absolute values of each unpaired first sound and each unpaired second sound are calculated respectively, and the unpaired first sound and the second sound are paired again according to the pitch difference absolute values and the preset pairing rule; The sounds in the pair obtained by the second pairing are marked as incorrect performance; If there is unpaired first sound in the first sequence after the second pairing, the unpaired first sound in the first sequence is displayed on the score and marked as multiple; If there is unpaired second sound in the second sequence after the second pairing, the unpaired second sound in the second sequence is marked as missed.
7. The performance detection method according to claim 6, characterized by, The second pairing of the unpaired first sound and the second sound according to the pitch difference absolute value and the preset pairing rule comprises: If the pitch difference absolute value of the unpaired first sound and the unpaired second sound is the smallest, the first sound and the second sound are preferentially paired; If the pitch difference absolute value of the unpaired first sound and the unpaired second sound is the smallest, the first sound and the second sound are preferentially paired; If there are two or more unpaired first tones and one unpaired second tone with the same and smallest absolute value of pitch difference, the absolute value of sequence number difference is calculated according to the sequence numbers of the two or more first tones in the first unpaired sequence and the sequence number of the one second tone in the second unpaired sequence, and the first tone corresponding to the smallest absolute value of sequence number difference and the one second tone are preferentially paired; If there are two or more unpaired second tones and one unpaired first tone with the same and smallest absolute value of pitch difference, the absolute value of sequence number difference is calculated according to the sequence number of the one first tone in the first unpaired sequence and the sequence numbers of the two or more second tones in the second unpaired sequence, and the one first tone and the second tone corresponding to the smallest absolute value of sequence number difference are preferentially paired; The first unpaired tone in the first unpaired sequence is a first tone in the first sequence that is currently unpaired, and the second unpaired tone in the second unpaired sequence is a second tone in the second sequence that is currently unpaired.
8. The performance detection method according to claim 7, characterized by, The secondary pairing of the unpaired first and second tones according to the absolute value of pitch difference and the preset pairing rule further includes: If the absolute value of pitch difference of the first and second tones in the same pairing is greater than a preset threshold value, the pairing of the first and second tones in the same pairing is cancelled.
9. The performance detection method according to claim 7 or 8, characterized by, The secondary pairing of the unpaired first and second tones according to the absolute value of pitch difference and the preset pairing rule further includes: If the sequence number of the first tone in the first sequence in the same pairing is smaller than the sequence number of the first tone in the first sequence in a best pairing or another pairing, and the sequence number of the second tone in the second sequence in the same pairing is greater than the sequence number of the second tone in the second sequence in the best pairing or the other pairing, the pairing of the first and second tones in the same pairing is cancelled. If the sequence number of the first tone in the first sequence in the same pairing is greater than the sequence number of the first tone in the first sequence in a best pairing or another pairing, and the sequence number of the second tone in the second sequence in the same pairing is smaller than the sequence number of the second tone in the second sequence in the best pairing or the other pairing, the pairing of the first and second tones in the same pairing is cancelled.
10. The performance detection method according to claim 1, characterized by, After determining the best matching time from the current time in the score and the n adjacent score times on the left and right of the score time corresponding to the current time, the method further includes: If the best matching time is located before the score time corresponding to the current time, it is determined that the tone is rebounded, and the mark of the tone between the best matching time and the score time corresponding to the current time in the score is reset.
11. A computer readable storage medium having stored thereon a computer program, characterized in that The program is executed by the processor to implement the method of any one of claims 1-10.
Citation Information
Patent Citations
Music playing score matching method, storage medium and smart musical instrument
CN109065008A
Singing or playing evaluation method and device and computer readable storage medium
CN112837698A