Method and device for judging western major scale and national pentatonic mode

By using audio preprocessing and MLP model judgment, the problems of small mode recognition range and high complexity in existing technologies have been solved, and efficient and accurate judgment of Western major and minor keys and ethnic pentatonic keys has been achieved.

CN119964529BActive Publication Date: 2025-10-17TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510133709.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-10-17
Estimated Expiration
2045-02-06

AI Technical Summary

Technical Problem

Existing technologies have a narrow range of recognition capabilities among pentatonic scales, Western major and minor scales, and other scales, and the recognition methods are highly complex, making it impossible to effectively distinguish and recognize multiple scales.

Method used

By acquiring the target audio and preprocessing it, the basic rhythm information of the music is extracted, the audio tracks are separated, the main instrument track is determined, the pitch duration information is statistically analyzed, the note frequency is calculated by combining the rhythm and accent distribution, an MLP model is constructed to confirm the tonic, and the mode is determined based on the pitch frequency standardization.

Benefits of technology

It improves the accuracy and efficiency of mode determination, simplifies computational complexity, adapts to different mode systems, reduces computational resource requirements, and is suitable for complex music processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119964529B_ABST
    Figure CN119964529B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer music information processing, in particular to a Western major mode and a national five-tone mode judgment method and device, wherein the method comprises the following steps: obtaining a target audio to be judged, and preprocessing the target audio to obtain audio information of the target audio; determining a main tone of the target audio according to the audio information, and confirming a mode category label of the target audio according to the main tone; confirming a mode of the target audio according to the mode category label, and obtaining a mode judgment result by adopting a corresponding strategy in the case that the mode is a Western major mode or a national five-tone mode. Therefore, the problem that the recognition range of the music mode is small and the recognition method is complex in the related art is solved, and the problem that the recognition is only in a certain field or all modes are considered is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer music information processing, in particular to a western major mode and national five-tone mode judgment method and device. BACKGROUND

[0002] In the field of music mode recognition, one is to completely rely on manual processing to judge the tune, and the other is to completely rely on machine learning model to judge the tune relying on the rapid development of machine learning technology. In related technologies, the mode is judged completely relying on the statistics of each note, or the national mode is judged completely based on music knowledge, or only the most basic processing is performed on the national five-tone mode, and the model recognition is generated by machine learning.

[0003] However, in related technologies, the mode is judged completely relying on the statistics of each note, which has a high possibility of error due to the similar situation in different modes from the perspective of note duration; the national mode is judged completely based on music knowledge, which is only effective for national five-tone mode and cannot identify other modes, resulting in a waste of a large amount of pre-processing information; only the most basic processing is performed on the national five-tone mode, and the model recognition is generated by machine learning, which is only in the national five-tone mode, and such machine learning can be replaced by music knowledge that has been summarized, and there is no inevitable advantage. In summary, the existing technology has a small range of music mode recognition between five-tone mode, western major mode and other modes, or completely focuses on a certain field, or generally considers all modes, resulting in a small range of music mode recognition and high complexity of recognition method, which needs to be improved. SUMMARY

[0004] The present application provides a western major mode and national five-tone mode judgment method and device to solve the problem of related technologies in the recognition between five-tone mode, western major mode and other modes, or completely focusing on a certain field, or generally considering all modes, resulting in a small range of music mode recognition and high complexity of recognition method.

[0005] The first aspect embodiment of the present application provides a western major mode and national five-tone mode judgment method, comprising the following steps: obtaining a target audio to be judged, and pre-processing the target audio to obtain audio information of the target audio; determining a main tone of the target audio according to the audio information, and confirming a mode category label of the target audio according to the main tone; confirming a mode of the target audio according to the mode category label, and in the case that the mode is a western major mode or a national five-tone mode, taking a corresponding strategy to obtain a mode judgment result.

[0006] By the technical solution, the target audio can be acquired and preprocessed to obtain audio information, remove noise and other interference, and accurately extract effective music features, thereby providing high-quality data basis for subsequent accurate judgment. The main tone is determined based on the audio information by comprehensively considering various music elements, so that the main tone judgment is more accurate and reliable; then the mode category label is confirmed according to the main tone, the mode range is efficiently narrowed, and the judgment workload is reduced; finally, corresponding strategies are adopted to obtain the judgment result for the Western major mode and the national five-tone mode, the uniqueness of different mode systems is fully considered, and the accuracy and adaptability of the judgment are improved.

[0007] Optionally, in an embodiment of the present application, the pre-processing of the target audio to obtain audio information of the target audio comprises: extracting basic beat information in a music piece based on the target audio; separating audio tracks in the target audio, determining a main instrument track according to a time length proportion of each audio track in the target audio and uniqueness of the each audio track, and extracting time length information of all pitches according to the main instrument track; and performing a single melody reservation and repetition removal operation based on the time length information to obtain a non-repeated sequence in the main instrument track.

[0008] By the technical solution, the basic beat information of the music piece can be extracted to provide a key rhythm basis for subsequent processing, so that the entire music processing process is more in line with the rhythm characteristics of the music itself, and the music theoretical basis of the scheme is enhanced. The main instrument track is determined according to the total time length proportion and the uniqueness of each separated audio track, so that the core melody source can be accurately positioned, other audio track interference can be avoided, and subsequent analysis can be focused on key music elements. The single melody reservation and repetition removal operation based on the time length information simplifies the data, reduces the influence of redundant information on judgment, not only reduces the computational complexity and improves the processing efficiency, but also makes the extracted non-repeated sequence more accurately represent the essential melody characteristics of the music piece, thereby laying a solid and reliable data basis for subsequent accurate determination of the main tone and judgment of the mode, and improving the accuracy and effectiveness of the entire mode judgment technical solution.

[0009] Optionally, in an embodiment of the present application, the determination of the main tone of the target audio according to the audio information comprises: calculating the frequency of notes under different beats of the same music piece according to the beat distribution of different beat information; and determining the main tone based on the note with the highest frequency and the frequency of the note after adjustment to standardized twelve notes based on the frequency of the notes.

[0010] By the technical solution, the embodiment of the present application can calculate the note frequency according to the distribution of the different beat information, so that the calculation result is more consistent with the actual performance and auditory perception of music. Based on this, the highest note frequency after the standardization of the twelve notes and the frequency of the highest note are used to determine the tonic, which comprehensively integrates the rhythm and pitch frequency information, and avoids the limitations of determining the tonic by a single factor. When dealing with music with complex rhythm changes or irregular melody trends, the tonic can be more accurately locked, providing a solid and reliable foundation for subsequent mode judgment, and improving the accuracy and stability of the entire mode judgment process.

[0011] Optionally, in an embodiment of the present application, when the mode is the Western major mode or the national five-tone mode, a corresponding strategy is adopted to obtain the mode judgment result, including: when the mode is the Western major mode, all the first pitches in the main instrument track are counted; the tonic is taken as a reference, all the first pitches are standardized to be within 12 semitone sequences above the tonic, the first frequency of the duration of each first pitch is counted; the major mode, the mode number and the mode are confirmed according to the first frequency of the duration of each first pitch, so as to obtain the mode judgment result.

[0012] By the technical solution, the embodiment of the present application can count all the first pitches in the main instrument track and standardize the processing, so that the pitch data is unified in a standard framework convenient for analysis, so that the subsequent frequency-based analysis is more consistent and comparable. According to the first frequency of the duration of each first pitch, the major mode, the mode number and the mode are confirmed, which fully utilizes the pitch duration frequency information. This quantitative analysis method is more scientific and accurate than the traditional qualitative or experiential judgment. It can more carefully capture the distribution characteristics of different pitches in the time dimension in music, so as to accurately determine the mode related attributes, whether it is to distinguish the subtle differences of major modes, or to determine the mode number and judge the mode, it is more reliable, which greatly improves the accuracy and efficiency of the Western major mode judgment.

[0013] Optionally, in an embodiment of the present application, when the mode is the Western major mode or the national five-tone mode, a corresponding strategy is adopted to obtain the mode judgment result, including: when the mode is the Western major mode, all the first pitches in the main instrument track are counted; the tonic is taken as a reference, all the first pitches are standardized to be within 12 semitone sequences above the tonic, the first frequency of the duration of each first pitch is counted; the major mode, the mode number and the mode are confirmed according to the first frequency of the duration of each first pitch, so as to obtain the mode judgment result.

[0014] By the technical solution, the embodiment of the present application can standardize the pitch data to a unified system by counting and standardizing the second pitch in the main musical instrument track, so as to facilitate accurate analysis. The mode category and mode are confirmed according to the second frequency of the duration of each pitch, the pitch duration frequency information is fully mined, and the judgment process is more objective and scientific. This analysis method based on quantitative data can effectively capture the time distribution characteristics of the melody pitch in national music, so as to accurately judge the mode category.

[0015] The second aspect embodiment of the present application provides a Western major mode and national five-pitch mode judgment device, comprising: a preprocessing module configured to obtain a target audio to be judged and preprocess the target audio to obtain audio information of the target audio; an identification module configured to determine a main tone of the target audio according to the audio information and confirm a mode category label of the target audio according to the main tone; and a judgment module configured to confirm a mode of the target audio according to the mode category label, and obtain a mode judgment result by taking a corresponding strategy in the case that the mode is a Western major mode or a national five-pitch mode.

[0016] By the technical solution, the embodiment of the present application can obtain a target audio and preprocess it to obtain audio information, remove noise and other interference, and accurately extract effective music features, thereby providing a high-quality data basis for subsequent accurate judgment. The main tone is determined based on the audio information by comprehensively considering various music elements, so that the main tone judgment is more accurate and reliable; then the mode category label is confirmed according to the main tone, the mode range is efficiently narrowed, and the judgment workload is reduced; finally, the corresponding strategy is taken to obtain the judgment result for the Western major mode and the national five-pitch mode, the uniqueness of different mode systems is fully considered, and the accuracy and adaptability of the judgment are improved.

[0017] Optionally, in an embodiment of the present application, the preprocessing module comprises: a first extraction unit configured to extract basic beat information in a music piece based on the target audio; a second extraction unit configured to separate tracks in the target audio, determine a main musical instrument track according to a duration proportion of each track in the target audio and uniqueness of the each track, and extract duration information of all pitches according to the main musical instrument track; and a deduplication unit configured to perform a single melody reservation and repeated sequence removal operation based on the duration information, to obtain a non-repeated sequence in the main musical instrument track.

[0018] By the technical solution, the embodiment of the present application can extract basic beat information of a music piece to provide a key rhythm basis for subsequent processing, so that the entire music processing process is more in line with the rhythm characteristics of the music itself, and the music theory basis of the scheme is enhanced. Determining the main instrument track according to the beat information can accurately locate the source of the core melody, avoid interference of other tracks, and ensure that subsequent analysis focuses on key music elements. Based on the length information, the operation of retaining a single melody and removing repetition is performed, which simplifies the data and reduces the influence of redundant information on judgment, not only reduces the computational complexity and improves the processing efficiency, but also makes the extracted non-repetitive sequence more accurately represent the essential melody characteristics of the music piece, lays a solid and reliable data foundation for subsequent accurate determination of the main tone and judgment of the mode, and improves the accuracy and effectiveness of the entire mode judgment technical scheme.

[0019] Optionally, in an embodiment of the present application, the identification module comprises: a calculation unit configured to calculate the note frequency of the same music piece under different beat information according to the distribution of the different beat information; and a pitch determination unit configured to determine the main tone based on the note frequency statistics of the highest frequency note and its frequency after being adjusted to standardized twelve notes.

[0020] By the technical solution, the embodiment of the present application can calculate the note frequency according to the distribution of different beat information, so that the calculation result is more in line with the actual performance and auditory perception of music. Based on this, the main tone is determined based on the highest frequency note and its frequency after standardizing twelve notes, which comprehensively integrates rhythm and pitch frequency information and avoids the limitations of single factor judgment of the main tone. When processing music with complex rhythm changes or irregular melody trends, the main tone can be more accurately locked, providing a solid and reliable foundation for subsequent mode judgment and improving the accuracy and stability of the entire mode judgment process.

[0021] Optionally, in an embodiment of the present application, the judgment module comprises: a first statistics unit configured to, in the case that the mode is the Western major mode, count all first pitches in the main instrument track; a second statistics unit configured to, taking the main tone as a reference, standardize all first pitches to be within 12 semitones above the main tone, and count the first frequency of the duration of each first pitch; and a first judgment unit configured to confirm the major mode, the mode number, and the mode according to the first frequency of the duration of each first pitch, to obtain the mode judgment result.

[0022] By the technical solution, the embodiment of the present application can count all the first pitches in the main instrument track and perform standardization processing, unify the pitch data in a standard framework convenient for analysis, make the subsequent frequency-based analysis more consistent and comparable, confirm key elements such as major and minor keys and key signatures according to the first frequency of the duration of each pitch, fully utilize the pitch duration frequency information, and the quantitative analysis method is more scientific and accurate than the traditional qualitative or empirical judgment. It can more carefully capture the distribution characteristics of different pitches in the time dimension in music, thereby accurately determining the modal related attributes, whether it is to distinguish the subtle differences between major and minor keys or to determine the key signature and judge the tonality, and it is more reliable, thereby greatly improving the accuracy and efficiency of the Western major modal judgment.

[0023] Optionally, in an embodiment of the present application, the determining module comprises: a third statistical unit, configured to, in the case that the mode is the national five-tone mode, count all the second pitches in the main instrument track; a fourth statistical unit, configured to take the main pitch as a reference, standardize all the second pitches into the 12 semitone sequences above the main pitch, and count the second frequency of the duration of each pitch; and a second determining unit, configured to confirm the modal category and the mode according to the second frequency of the duration of each pitch, so as to obtain the mode determination result.

[0024] By the technical solution, the embodiment of the present application can count the second pitches in the main instrument track and perform standardization, standardize the pitch data to a unified system, and facilitate accurate analysis. The modal category and the mode are confirmed according to the second frequency of the duration of each pitch, the pitch duration frequency information is fully mined, and the judgment process is more objective and scientific. The analysis method based on quantitative data can effectively capture the time distribution characteristics of the melody pitch in national music, thereby accurately judging the modal category.

[0025] The third aspect embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the Western major and national five-tone mode determination method as described in the above embodiments.

[0026] The fourth aspect embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the above Western major and national five-tone mode determination method.

[0027] The fifth aspect embodiment of the present application provides a computer program product, comprising a computer program, and the computer program is executed to implement the above Western major and national five-tone mode determination method.

[0028] The embodiment of the present application can obtain the target audio and pre-process it to extract audio information at the initial stage of audio processing, effectively remove noise interference, accurately refine music features, and lay a solid foundation for high-quality data for subsequent judgments. When determining the main tone, a variety of musical elements are integrated, and the note frequency is calculated based on the audio information and the beat distribution combined with the beat information. Then, the highest frequency note and its frequency after the standardized twelve tones are statistically analyzed, which overcomes the limitations of single-factor judgment. In particular, in complex music processing, the main tone can be accurately locked, the accuracy and reliability of the main tone judgment are enhanced, and a solid foundation is laid for mode judgment. The main instrument track is determined based on beat information to avoid interference, ensure focus on key melodic elements, and retain a single melody and deduplication operations based on duration information, simplifying data, reducing computational complexity, and improving processing efficiency. The extracted non-repetitive sequence can better reflect the essential melodic characteristics of the music. Confirming the mode category label based on the tonic can effectively narrow the scope and reduce the workload. Corresponding strategies are adopted for Western major and minor modes and national pentatonic modes. The former confirms major and minor modes, key signatures and tonality based on frequency after statistical pitch standardization, while the latter confirms the mode category and mode based on frequency after statistical pitch standardization. This unified and highly simplified mode confirmation process fully considers the core characteristics and laws of different mode systems. Compared with the traditional complex mode confirmation method that relies more on empirical judgment, it greatly reduces the calculation steps and data processing volume, and effectively improves the accuracy and efficiency of mode confirmation.

[0029] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0031] Figure 1 A flowchart of a method for determining Western major and minor keys and national pentatonic modes according to an embodiment of the present application;

[0032] Figure 2 Schematic diagram of a device for determining Western major and minor keys and national pentatonic modes according to an embodiment of the present application;

[0033] Figure 3 This is a diagram illustrating an example structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] Embodiments of the present application are described below in detail, examples of which are shown in the drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the drawings are exemplary and are intended to explain the present application, and cannot be understood as a limitation of the present application.

[0035] The method and device for determining Western major scale and national pentatonic mode of embodiments of the present application are described below with reference to the accompanying drawings. In view of the problem that the related art mentioned in the background art has a small range of recognizing music mode between pentatonic mode and Western major scale and other modes, or is completely focused on a certain field, or generally considers all modes, resulting in a small range of recognizing music mode and high complexity of the recognition method, the present application provides a method for determining Western major scale and national pentatonic mode, in which the target audio can be obtained and preprocessed to obtain audio information, remove noise and other interference, and accurately extract effective music features to provide a high-quality data basis for subsequent accurate determination. The main tone is determined based on the audio information, making the determination of the main tone more accurate and reliable; then the mode category label is confirmed based on the main tone, the mode range is efficiently narrowed down, and the workload of determination is reduced; finally, corresponding strategies are adopted for Western major mode and national pentatonic mode to obtain the determination result, fully considering the uniqueness of different mode systems, and improving the accuracy and adaptability of the determination. Thus, the problem that the related art has a small range of recognizing music mode between pentatonic mode and Western major scale and other modes, or is completely focused on a certain field, or generally considers all modes, resulting in a small range of recognizing music mode and high complexity of the recognition method, is solved.

[0036] Specifically, Figure 1 A flowchart of a method for determining Western major scale and national pentatonic mode provided by embodiments of the present application is shown in FIG. 1.

[0037] As shown in FIG. 1, the method for determining Western major scale and national pentatonic mode includes the following steps: Figure 1

[0038] In step S101, a target audio to be determined is obtained, and the target audio is preprocessed to obtain audio information of the target audio.

[0039] Optionally, in an embodiment of the present application, the target audio is preprocessed to obtain the audio information of the target audio, including: based on the target audio, extracting basic beat information in the music; separating audio tracks in the target audio, determining a main instrument track according to a time length proportion of each audio track in the target audio and a uniqueness of the each audio track, and extracting time length information of all pitches according to the main instrument track; performing a single melody reservation and a repeated sequence removal operation based on the time length information to obtain a non-repeated sequence in the main instrument track.

[0040] ​Specifically, the basic beat information in the music is extracted, and for singing songs, the vocal or main instrument track is separated from the audio file and the MIDI file is obtained, and the duration information of all pitches is extracted. Among them, the determination method of the main instrument track is as follows:

[0041] 1) Calculate the proportion p of the total duration of the track statistics to the total audio.

[0042] 2) Use the DTW (Dynamic Time Warping) algorithm to get the distance matrix A between different tracks.

[0043] 3) Use the weighted average of the total duration ratio p and the row sum of the kth row of the normalized distance matrix A to confirm the main instrument track.

[0044] The proportion of the total duration of the track statistics to the total audio and the distance matrix between different tracks obtained by using the DTW algorithm are used, and the main instrument track is confirmed by weighted average, which comprehensively considers the track duration factor and the difference between the melody profiles of the tracks. It is essentially different from the traditional method of determining the main instrument track based on single duration or simple pitch comparison, which can more accurately locate the core melody track in multi-track music and effectively reduce the interference data of subsequent mode analysis.

[0045] It should be noted that in music, the main instrument track may contain some repeated melody segments, and these repeated parts may interfere with subsequent music analysis and increase unnecessary computational load. In order to simplify the data and focus on the core melody features of the music, ACF (Autocorrelation Function) is used to remove the repeated parts in the main instrument track to obtain non-repeated sequences. The obtained non-repeated sequences can more accurately represent the essential melody features of the music, reducing the influence of redundant information on subsequent steps such as determining the main pitch and analyzing the mode.

[0046] By ACF analyzing the main instrument track, the non-repeated sequence in it is accurately obtained, simplifying the melody data structure. This method helps to focus on more representative melody segments for subsequent main pitch and mode confirmation, significantly reducing the complexity and computational load of data processing, improving the overall processing efficiency, and distinguishing from the case where the repeated part of the main instrument track is not processed in the prior art.

[0047] The embodiment of the present application can extract basic beat information of a music in an audio preprocessing stage, thereby providing accurate data basis for subsequent determination of a main tone based on beat distribution, so that the main tone determination is more based on music theory and more accurate. For example, in music with complex beat information, the beat information can effectively guide the main tone frequency calculation, avoiding misjudgment of the main tone due to variable rhythm, which helps to improve the reliability of the entire mode identification process. Compared with the traditional method of determining the main instrument track based on the distance matrix row and weighted average obtained by the DTW algorithm, the method of determining the main instrument track based on the distance matrix row and weighted average obtained by the DTW algorithm can more accurately separate the core melody track from the multi-track music. Using the autocorrelation function to remove the repeated part of the main instrument track not only simplifies the melody data and reduces the data processing complexity, but also enables the subsequent main tone and mode confirmation to focus on more representative melody segments.

[0048] In step S102, the main tone of the target audio is determined according to the audio information, and the mode category label of the target audio is confirmed according to the main tone.

[0049] Optionally, in an embodiment of the present application, determining the main tone of the target audio according to the audio information comprises: calculating the note frequency of the same music under different beat information according to the beat distribution of different beat information; and determining the main tone based on the note frequency with the highest frequency after being adjusted to standardized twelve notes and the frequency.

[0050] Specifically, the note frequency of the same music under different beat information is calculated according to the beat distribution of different beat information, and the note with the highest frequency after being adjusted to standardized twelve notes and the frequency are counted, and the maximum value is used to determine the main tone.

[0051] The Western major mode and the national five-tone mode are taken as examples to confirm the mode category without considering the modulation, and the mode category confirmation steps are as follows:

[0052] 1) Feature extraction: the pitch sequence after removing the repetition and the extracted main tone are reserved.

[0053] 2) Model construction: an MLP (Multilayer Perceptron, Multilayer Perceptron) model is constructed, which consists of an input layer, a hidden layer and an output layer.

[0054] The input layer receives an n-dimensional feature vector, and n is the specific selected feature dimension during training.

[0055] The hidden layer includes two hidden layers, and uses a ReLU (Rectified Linear Unit, Rectified Linear Unit) activation function.

[0056] Output layer: contains a number of neurons of mode categories.

[0057] The forward propagation of the model can be represented as: .

[0058] wherein, and are the weight matrices of the first and second layers, and are the bias vectors, is the input feature vector. The cross-entropy loss function is used to measure the difference between the predicted value and the mode category, and the Adam (Adaptive Moment Estimation) optimizer is used to minimize the loss function, and the accuracy is used to evaluate the performance of the model.

[0059] The model structure and parameter settings are obtained through experiments and optimization, which can effectively fit the complex relationship between music features and modes. Compared with traditional mode recognition methods based on simple rules or general neural network structures, the mode recognition accuracy and processing efficiency are significantly improved, and the mode recognition needs of different styles of music can be adapted.

[0060] 3) Mode category recognition: the preprocessed audio is taken as input to obtain the mode category label.

[0061] The embodiments of the present application can calculate the note frequency according to the distribution of different beat information in the main tone confirmation link and determine the main tone in combination with the standardized twelve-tone system. This is different from the previous method of relying on note duration statistics or simple inference of specific interval relationships. This comprehensive consideration of rhythm and pitch frequency has obvious advantages when dealing with music with special rhythm or irregular melody. In the mode category confirmation part, a specific structure of MLP model is constructed for mode recognition. The combination of 2 hidden layers and ReLU activation function can more simply fit the complex relationship between music features and modes.

[0062] In step S103, the mode of the target audio is confirmed according to the mode category label, and in the case of Western major mode or national five-tone mode, the corresponding strategy is adopted to obtain the mode judgment result.

[0063] The following is an example of Western major mode or national five-tone mode without considering modulation.

[0064] Optionally, in an embodiment of the present application, when the mode is Western major mode or national pentatonic mode, the corresponding strategy is adopted to obtain the mode judgment result, including: when the mode is Western major mode, all the first pitches in the main instrument track are counted; the main pitch is taken as the reference, all the first pitches are standardized within 12 semitones above the main pitch, the first frequency of the occurrence time of each first pitch is counted; the major mode, mode number and tonality are confirmed according to the first frequency of the occurrence time of each first pitch, so as to obtain the mode judgment result.

[0065] In the actual execution process, if it is confirmed that the mode is Western major mode, first, all the pitches in the main instrument track are counted, the determined main pitch is taken as the reference, all the pitches are standardized within 12 semitones above the main pitch, and the frequency of the occurrence time of each pitch is counted. Secondly, the interval from the first pitch to the third pitch is calculated, the major third is major mode and the minor third is minor mode. Thirdly, the pitch corresponding to the main pitch is calculated to obtain the corresponding mode number. Finally, the interval between each pitch is calculated, and the minor third is the harmonic mode; the number of main pitches is calculated, when the number of pitches is 10, it is the melody mode; and the above two cases do not exist, it is the natural mode.

[0066] Optionally, in an embodiment of the present application, when the mode is Western major mode or national pentatonic mode, the corresponding strategy is adopted to obtain the mode judgment result, including: when the mode is national pentatonic mode, all the second pitches in the main instrument track are counted; the main pitch is taken as the reference, all the second pitches are standardized within 12 semitones above the main pitch, the second frequency of the occurrence time of each second pitch is counted; the mode category and the mode are confirmed according to the second frequency of the occurrence time of each second pitch, so as to obtain the mode judgment result.

[0067] In the actual execution process, if it is confirmed that the mode is national pentatonic mode, first, all the pitches in the main instrument track are counted, the determined main pitch is taken as the reference, all the pitches are standardized within 12 semitones above the main pitch, and the frequency of the occurrence time of each pitch is counted. Secondly, the interval between each pitch is calculated, if there are 2 small seconds, it is seven-tone mode; if there is 1 small second, it is six-tone mode; and if there is no small second, it is national pentatonic mode. Finally, the corresponding mode name is obtained according to the interval difference sequence between each pitch.

[0068] The embodiments of the present application can adopt a highly simplified processing mode for both Western major modes and national five-tone modes in the mode confirmation process. This unified and highly simplified mode confirmation process fully considers the core characteristics and rules of different mode systems, greatly reduces the calculation steps and data processing amount compared with the traditional complex and experience-dependent mode confirmation method, effectively improves the accuracy and efficiency of mode confirmation, and can quickly and accurately complete the mode analysis task for both Western music and national music, showing excellent performance advantages in large-scale music data processing and real-time music mode analysis scenarios, while reducing the demand and dependence on computing resources.

[0069] The Western major mode and national five-tone mode judgment method according to the embodiments of the present application can obtain target audio and preprocess to obtain audio information, remove noise and other interference, and accurately extract effective music features to provide a high-quality data basis for subsequent accurate judgment. The main tone is determined based on audio information by comprehensively considering various music elements, so that the main tone judgment is more accurate and reliable; then the mode category label is confirmed according to the main tone, the mode range is efficiently narrowed, and the judgment workload is reduced; finally, corresponding strategies are adopted for Western major modes and national five-tone modes to obtain judgment results, fully considering the uniqueness of different mode systems, and improving the accuracy and adaptability of judgment.

[0070] Secondly, the Western major mode and national five-tone mode judgment device according to the embodiments of the present application is described with reference to the accompanying drawings.

[0071] Figure 2 is a block schematic diagram of the Western major mode and national five-tone mode judgment device according to the embodiments of the present application.

[0072] As shown in Figure 2 , the Western major mode and national five-tone mode judgment device 10 includes a preprocessing module 100, an identification module 200, and a judgment module 300.

[0073] Specifically, the preprocessing module 100 is configured to obtain target audio to be judged, and preprocess the target audio to obtain audio information of the target audio.

[0074] The identification module 200 is configured to determine the main tone of the target audio according to the audio information, and confirm the mode category label of the target audio according to the main tone.

[0075] The judgment module 300 is configured to confirm the mode of the target audio according to the mode category label, and adopt a corresponding strategy to obtain a mode judgment result in the case that the mode is a Western major mode or a national five-tone mode.

[0076] Optionally, in an embodiment of the present application, the preprocessing module 100 comprises a first extraction unit, a second extraction unit and a deduplication unit.

[0077] The first extraction unit is configured to extract basic beat information in the music based on the target audio.

[0078] The second extraction unit is configured to determine a main instrument track according to the basic beat information, and extract duration information of all pitches according to the main instrument track.

[0079] The deduplication unit is configured to perform a single melody reservation and a duplicate removal operation based on the duration information, to obtain a non-duplicate sequence in the main instrument track.

[0080] Optionally, in an embodiment of the present application, the recognition module 200 comprises a calculation unit and a key unit.

[0081] The calculation unit is configured to calculate a note frequency of a same piece of music under different beats according to a distribution of the different beats.

[0082] The key unit is configured to determine a key based on a note with the highest frequency and the frequency after adjustment to standardized twelve notes.

[0083] Optionally, in an embodiment of the present application, the judgment module 300 comprises a first statistical unit, a second statistical unit and a first judgment unit.

[0084] The first statistical unit is configured to, in a case where the mode is a Western major mode, count all first pitches in the main instrument track.

[0085] The second statistical unit is configured to, taking the key as a reference, standardize all the first pitches to be within 12 semitone sequences above the key, and count a first frequency of a duration of each first pitch.

[0086] The first judgment unit is configured to confirm a major mode, a mode number and a mode character according to the first frequency of the duration of each first pitch, to obtain a mode judgment result.

[0087] Optionally, in an embodiment of the present application, the judgment module 300 comprises a third statistical unit, a fourth statistical unit and a second judgment unit.

[0088] The third statistical unit is configured to, in a case where the mode is a national five-tone mode, count all second pitches in the main instrument track.

[0089] The fourth statistical unit is configured to, taking the key as a reference, standardize all the second pitches to be within 12 semitone sequences above the key, and count a second frequency of a duration of each second pitch.

[0090] The second determining unit is configured to determine the mode category and the mode according to the second frequency of each second pitch duration, so as to obtain a mode determination result.

[0091] It should be noted that the above description of the embodiment of the method for determining the Western major mode and the national five-tone mode is also applicable to the device for determining the Western major mode and the national five-tone mode, and will not be described here.

[0092] The device for determining the Western major mode and the national five-tone mode according to the embodiment of the present application can obtain target audio and preprocess the target audio to obtain audio information, remove noise and other interference, and accurately extract effective music features, thereby providing high-quality data basis for subsequent accurate determination. The main tone is determined based on the audio information by comprehensively considering various music elements, so that the determination of the main tone is more accurate and reliable; then the mode category label is determined based on the main tone, the mode range is efficiently reduced, and the determination workload is reduced; finally, corresponding strategies are adopted for the Western major mode and the national five-tone mode to obtain the determination result, fully considering the uniqueness of different mode systems, and improving the accuracy and adaptability of the determination.

[0093] Figure 3 The structure schematic diagram of the electronic device provided by the embodiment of the present application is shown. The electronic device can include:

[0094] The memory 301, the processor 302, and the computer program stored in the memory 301 and executable on the processor 302.

[0095] The processor 302 executes the program to implement the method for determining the Western major mode and the national five-tone mode provided in the above embodiment.

[0096] Further, the electronic device further includes:

[0097] The communication interface 303 is configured to communicate between the memory 301 and the processor 302.

[0098] The memory 301 is configured to store the computer program executable on the processor 302.

[0099] The memory 301 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.

[0100] If the memory 301, the processor 302 and the communication interface 303 are implemented independently, the communication interface 303, the memory 301 and the processor 302 can be connected with each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 3 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.

[0101] Optionally, in a specific implementation, if the memory 301, the processor 302 and the communication interface 303 are integrated on a chip, the memory 301, the processor 302 and the communication interface 303 can complete communication between each other through an internal interface.

[0102] The processor 302 can be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0103] The embodiments of the present application further provide a computer readable storage medium, which has a computer program stored thereon, and the program is executed by a processor to implement the above-mentioned Western major and national five-tone mode judgment method.

[0104] The embodiments of the present application further provide a computer program product, which includes a computer program, and the computer program is executed to implement the above-mentioned Western major and national five-tone mode judgment method.

[0105] In the description of the application, reference to "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that a particular feature, structure, material, or characteristic being described is included in at least one embodiment or example of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment or example. Furthermore, the described specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples. In addition, the usage of "N" means at least two, for example, two, three or the like, unless explicitly stated otherwise.

[0106] Furthermore, the terms "first", "second", or the like, are used only to describe the different features and do not imply or suggest relative importance of, or a number of, the indicated technical features. Thus, the features defined with "first", "second" can include at least one of the features explicitly or implicitly. In the description of the application, "N" means at least two, for example, two, three, etc., unless explicitly specified otherwise.

[0107] Any process or method descriptions or descriptions of the flow diagrams in the present application can be understood as representing code modules, segments, or portions of code which include one or more executable instructions for performing specific logic functions or steps in the process, and that the various systems described herein can include one or more circuits, or other means for performing the functions described in conjunction with the different aspects. In some embodiments, the various systems described herein can include, without limitation, hardware, software, and / or embedded logic such as a combination of logic gates in an application specific integrated circuit, or other implementation to carry out the functionality described in conjunction therewith. Furthermore, it should be understood that the functions described herein can be carried out by one or more aspects of the application without necessarily being carried out by a different aspect of the application.

[0108] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of executable instructions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a product of the manufacturing and / or processing. The computer-readable medium can include, but is not limited to, the following: an electronic connection (an electronic device with one or N wires), a portable computer diskette (a magnetic device), a RAM (random access memory), a ROM (read-only memory), an EPROM (erasable programmable ROM) or a Flash memory, an optical fiber, and a portable CD ROM. In addition, the computer-readable medium can even be paper or another suitable medium upon which the program can be printed, because the program can be electronically captured, via the optically scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and stored in the computer memory.

[0109] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware and in another embodiment, the hardware can be implemented using any or a combination of the following technologies, which are all well known in the art: a discrete logic circuit having logic gates for implementing logic functions on data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0110] Those of skill in the art would understand that the steps carried out in the above-mentioned embodiments can be implemented by programs instructing relevant hardware to complete all or part of the steps, and the programs can be stored in a computer-readable storage medium. When the programs are executed, they include one or a combination of the steps of the method embodiments.

[0111] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0112] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. A method for determining Western major and minor keys and national pentatonic modes, characterized in that: The following steps are involved: Acquire target audio to be judged, and preprocess the target audio to obtain audio information of the target audio; Determining the tonic of the target audio according to the audio information, and confirming the mode category label of the target audio according to the tonic; confirming the mode of the target audio according to the mode category label, and adopting a corresponding strategy to obtain a mode determination result when the mode is a Western major or minor mode or a national pentatonic mode; The preprocessing of the target audio to obtain audio information of the target audio includes: Extracting basic beat information from the music based on the target audio; Separating the tracks in the target audio, determining a main instrument track based on the duration of each track in the target audio and the uniqueness of each track, and extracting duration information of all pitches based on the main instrument track; Retaining a single melody and removing repetitions based on the duration information to obtain a non-repetitive sequence in the main instrument track; When the mode is a Western major or minor mode or a national pentatonic mode, a corresponding strategy is adopted to obtain a mode determination result, including: When the mode is the Western major or minor mode, counting all first pitches in the main instrument track; Taking the tonic as a reference, standardize all first pitches to a sequence of 12 semitones above the tonic, and count the first frequency of the duration of occurrence of each first pitch; confirming the major and minor keys, key signatures, and tonality according to the first frequencies of the durations of occurrence of the respective first pitches, so as to obtain the mode determination result; When the mode is a Western major or minor mode or a national pentatonic mode, a corresponding strategy is adopted to obtain a mode determination result, including: When the mode is the national pentatonic mode, counting all second pitches in the main instrument track; Taking the tonic as a reference, all secondary pitches are normalized to a sequence of 12 semitones above the tonic, and the second frequency of the duration of occurrence of each secondary pitch is counted; The mode category and mode are confirmed according to the second frequencies of the durations of occurrence of the respective second pitches to obtain the mode determination result.

2. The method for determining Western major and minor keys and national pentatonic modes according to claim 1, characterized in that: The determining the main sound of the target audio according to the audio information includes: According to the beat distribution of different beat information, the note frequencies of the same piece of music under different beat information are calculated in sequence; The main tone is determined based on the note frequency statistics of the note with the highest frequency after adjustment to the standardized twelve tones and its frequency.

3. A device for determining whether a Western major or minor key or a national pentatonic mode is used, using a method for determining whether a Western major or minor key or a national pentatonic mode is used as claimed in any one of claims 1 to 2, characterized in that: include: A preprocessing module, configured to obtain target audio to be judged and preprocess the target audio to obtain audio information of the target audio; an identification module, configured to determine a tonic of the target audio according to the audio information, and confirm a mode category label of the target audio according to the tonic; The judgment module is used to confirm the mode of the target audio according to the mode category label, and adopt a corresponding strategy to obtain a mode judgment result when the mode is a Western major or minor mode or a national pentatonic mode.

4. The device for determining Western major and minor keys and national pentatonic modes according to claim 3, characterized in that: The preprocessing module includes: A first extraction unit is used to extract basic beat information in the music based on the target audio; a second extraction unit, configured to separate the tracks in the target audio, determine a main instrument track based on a duration ratio of each track in the target audio and a uniqueness of each track, and extract duration information of all pitches based on the main instrument track; The de-duplication unit is used to retain a single melody and remove repetitions based on the duration information to obtain a non-repetitive sequence in the main instrument track.

5. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for determining Western major and minor keys and ethnic pentatonic modes as described in any one of claims 1 to 2.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement the method for determining Western major and minor keys and national pentatonic modes as described in any one of claims 1-2.

7. A computer program product comprising a computer program, characterized in that The computer program is executed to implement the method for determining Western major and minor keys and national pentatonic modes according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Chinese national pentatonic emotion recognition method and system

    CN109273025A

  • Chinese ethnic music style identification method based on template matching

    CN111081209A