Intelligent identification and structuring system for ancient works of music
By designing an intelligent structured recognition system for ancient gongche notation, the problem of the difficulty in structural recognition of traditional gongche notation is solved. It realizes the automatic recognition and digital processing of gongche notation images, generating structured music data, which facilitates the data analysis and preservation of traditional music.
Patent Information
- Application Number
- CN202111287864.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-02
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2041-11-02
Abstract
Description
Technical Field
[0001] This invention relates to a computer software system, and more particularly to a structured intelligent recognition system for ancient musical notation texts. Background Technology
[0002] Traditional Chinese operas (such as Kunqu Opera) generally use the unique Chinese gongche notation system for musical notation. The vast amount of gongche notation, containing invaluable information, is a unique intangible cultural heritage of my country. Traditional scores were mostly printed using woodblock printing or handwritten; today, these ancient resources are preserved on paper or as computer images, urgently requiring structured recognition by modern computers. Before this patent invention, structured intelligent recognition of gongche notation was difficult to achieve. This is because the unique notation and layout of gongche notation renders conventional text OCR technology ineffective, making it difficult to transcribe the original, standardized sentences, recitative, lyrics, and music. Therefore, traditional scores are still disseminated through paper or image scanning, and there is still a long way to go before achieving a unified, standardized digital representation. To promptly organize and summarize traditional gongche notation texts into structured data for easy preservation, dissemination, and data-driven research and analysis, this invention patent provides a software system for automatically and intelligently recognizing lyrics and music from gongche notation images. Through this system, the structured storage of gongche notation images can be completed in one step, and they can even be directly used for automatic computer performance. Summary of the Invention
[0003] The purpose of this invention is to provide a structured software system for intelligent recognition of ancient gongche notation texts. To achieve the above objective, the technical solution adopted by this invention is as follows.
[0004] This system includes the following modules: ancient book parameter setting module, traditional Chinese character OCR module, lyrics and tune name identification module, gongche music recognition module, gongche character identification module, and main recognition process.
[0005] The Ancient Book Parameter Settings module, with the assistance of previewing a page of an ancient book image document (e.g., PDF), requires input of the following necessary fields: ancient book name, approximate size of the characters, typical characters in brackets of the tune name, rotation angle of the gongche notation, and typical characters of the gongche symbols. The approximate size of the characters is obtained by selecting at least three characters from the image preview, using a rectangle, and then calculating the average and standard deviation. The typical characters in brackets of the tune name are obtained by selecting at least three upper brackets and three lower brackets from the image preview and using a rectangle; these are used for subsequent bracket recognition in the score. The rotation angle of the gongche notation is obtained by inputting the angle in preview mode; the page will automatically rotate, and confirmation is required once the gongche notation column is vertically aligned. The typical characters of the gongche symbols are obtained by selecting at least three different positions of the gongche notation at the above rotation angle and using a rectangle; these are used for subsequent gongche notation OCR recognition. Extended options in the Ancient Book Parameter Settings module also include: ancient book margins and the height of the longest gongche notation column.
[0006] Among them, the Traditional Chinese character OCR module can be any existing conventional Traditional Chinese character OCR recognition engine or a dedicated Traditional Chinese character OCR recognition engine.
[0007] The lyrics and tune name identification module works as follows: after the intelligent recognition command is activated, the recognition process proceeds from the top right to the bottom, column by column. Based on the built-in tune name bracket recognition engine, it identifies brackets and, with the assistance of the system's built-in tune dataset, uses a traditional Chinese character OCR recognition engine to identify Chinese character combinations from top to bottom. If the combination phrase is below the upper bracket and above the lower bracket and is in the system's built-in tune dataset, it is identified as a tune name. If it is not in the system's built-in tune dataset, it is marked as a suspected tune name, and further manual verification is required. The system's built-in musical score dataset can be edited and expanded as needed. The lyrics recognition feature is that if the size of the recognized Chinese character is within the allowable standard deviation multiplied by a coefficient above and below the approximate size of the lyric character, and a gongche column is found within the specified horizontal size range on the right or within the range of the Chinese character size multiplied by a specified coefficient, then the Chinese character is a lyric character. In accordance with the continuous page-by-page, top-to-bottom and right-to-left running order, if the lyric character is located after the musical score name and no musical score ending event has occurred, then the lyric character belongs to that musical score. The musical score ending event refers to the discovery of a new musical score or the end of all image recognition.
[0008] The gongche music recognition module has the following algorithm features: It rotates the page according to the rotation angle set by the ancient book parameter setting module, identifies multiple vertical gongche column areas, and within these areas, identifies gongche pitch symbols, ornamentation symbols, and rhythmic patterns based on typical characters of the gongche symbols from the ancient book parameter setting module. The algorithm for determining the gongche pitch of a rhythmic pattern is as follows: at the rotation angle, if the center of gravity of the rhythmic pattern on the Y-axis is lower than the highest point of the previous pitch symbol area but higher than the highest point of the next pitch symbol area, and the overlap between the rhythmic pattern area and the previous pitch symbol area is greater than the overlap with the next pitch symbol area along the Y-axis, then the gongche pitch is assigned to the previous pitch symbol. Multiple rhythmic patterns are assigned to pitch symbols in descending order. The algorithm for determining the gongche pitch of an ornamentation symbol is as follows: at the rotation angle, if the center of gravity of the ornamentation symbol on the Y-axis is lower than the center of gravity of the previous pitch symbol area but higher than the center of gravity of the next pitch symbol area, then the gongche pitch is assigned to the previous pitch symbol.
[0009] The algorithm for determining the corresponding syllable in the Gongche notation system includes two algorithms. The first is: under non-rotational conditions, the Y-axis distribution range (from minimum to maximum value) of a certain Gongche notation column area, with the highest point of the range being a quarter- or eighth-quartile (quartile, quintile, septtile, septtile, or octtile). If the range of the Y-axis is contained within the range from the highest to the lowest point of a syllable in the syllable column to its left, then the Gongche notation column area belongs to that syllable. The second is: within any given area, the centroid of the first (highest) Gongche notation pitch symbol in the Gongche notation column area, when connected by a straight line to the centroid of the syllable closest to it, then the Gongche notation column area belongs to that syllable.
[0010] The main recognition process is characterized as follows: After recognition begins, the traditional Chinese character OCR module and the lyrics and tune name identification module are invoked vertically from top to bottom and right to left. Based on the set character size, all characters and tune names are identified, excluding spoken characters. The characters are numbered sequentially from right to left and top to bottom, recording the list of characters and tune names, as well as the region and center of gravity of each character. Simultaneously, the lyrics and tune name identification module determines the tune name, recording the tune name and character in the structured result data. Then, the page is rotated according to the ancient book parameter setting module, and the Gongche music recognition module is invoked. The module records the structured musical score data of each musical scale column area. Next, the original non-rotating page is restored, and the module for determining the syllable to which the musical scale belongs is called to concatenate and record the syllable and its corresponding musical scale structured result within the page, thus obtaining the structured musical scale score result for that page. The next page is then processed in the page list, and the syllable and its corresponding musical scale data on the next page are appended to the end of the structured musical scale score result of the previously unfinished syllable until a new syllable appears, at which point the previous syllable ends. This process continues until all pages have been processed.
[0011] The programming languages used in the aforementioned software systems include: a high-level language (such as Python, C++, Java, etc.) and a combination of multiple high-level languages.
[0012] The above technical solutions enable structured music recognition of numerous gongche notation estimates, generating a large number of digital scores based on individual pieces, which can be conveniently used for aesthetic display, data analysis of traditional music patterns, dissemination, and storage. Specific Implementation
[0013] The preferred embodiments of the present invention are described below. It should be understood that the preferred embodiments described herein are only for illustration and explanation of the present invention, focusing on the process and results of the intelligent recognition structured system for understanding its operating logic, and are not intended to limit the present invention.
[0014] Example 1 is as follows. This example uses JSON format as the structured result of the Gongche notation recognition. Taking the "Zao Luo Pao" tune from "The Peony Pavilion - Strolling in the Garden" as an example. Taking the entire tune of "Strolling in the Garden" from the "Integrated Music Score" as an example, after starting the recognition, the following words are obtained: "Zao Luo Pao" and the lyrics "Originally, the flowers bloomed everywhere, all given to broken wells and ruined walls. What a pity for such a beautiful day. Whose courtyard is this delightful thing? Morning flies and evening rolls of clouds and rosy clouds. Green pavilion, rain threads and wind fragments, smoke and waves, painted boats and brocade screens. People look down on this fleeting time." Database analysis reveals that the phrase "Zao Luo Pao" is one of the music score names. Based on the typical bracket characters in the tune name, an upper bracket is found above the character "Zao" and a lower bracket is found below the character "Pao". Therefore, the tune name is recorded as "Zao Luo Pao", and the lyrics below it are the tune lyrics. After calling the Gongche music recognition module and the Gongche corresponding lyrics judgment module, the final saved JSON structure is as follows.
[0015] {"Play Title": "The Peony Pavilion", "Scene Title": "Garden Tour", "Qupai": "Zaoluo Pao", "Source Ancient Book": "Integrated Qupu", "Qianqiang Yaopian": "1", "Tone Key": "3", "Gongche Notation": ["{"Character": "yuan", "Gongche": ["e00000",0,0,0,0,0,0,0]}", "{"Character": "lai", "Gongche": ["f00000","a00000",0,0,0,0,0,0]}", "{"Character": "cha", "Gongche": ["ly3000","i02000","h00000",0,0,0,0,0]}", "{"Character": "zi", "Gongche": ["f01500","h03500",0,0,0,0,0,0]}", "{"Character": "yan", "Gongche": ["i01000",0,0,0,0,0,0,0]}", "{"Character": "hong", "Gongche": ["h02000","i00000","j00000","i03000",0,0,0,0]}", "{"Character": "kai", "Gongche": ["a02000","i00000","j00000",0,0,0,0,0]}", "{"Character": "bian", "Gongche": ["ly1000","i02000","h00000","f03570",0,0,0,0]}", "{"Character": "si", "Gongche": ["h02000","m00000","l00000",0,0,0,0,0]}", "{"Character": "zhe", "Gongche": ["j03000","i00000",0,0,0,0,0,0]}", "{"Character": "ban", "Gongche": ["a05000",0,0,0,0,0,0,0]}", "{"Character": "dou", "Gongche": ["a00000",0,0,0,0,0,0,0]}", "{"Character": "fu", "Gongche": ["iy1000","h00000",0,0,0,0,0,0]}", "{"Character": "yu", "Gongche": ["f02000","h03000","000000",0,0,0,0,0]}", "{"Character": "duan", "Gongche": ["l01000","o00000","m02000","l00000",0,0,0,0]}", "{"Character": "jing", "Gongche": ["h03000","i00000","j02700",0,0,0,0,0]}", "{"Character": "tui", "Gongche": ["j02000","m06000","o00000","m02000","l00000",0,0,0]}", "{"Character": "yuan","gongche notation": ["j01000", "l02000", 0, 0, 0, 0, 0, 0]}", "{"character": "liang", "gongche notation": ["i03000", 0, 0, 0, 0, 0, 0, 0]}", "{"character": "chen", "gongche notation": ["i03000", 0, 0, 0, 0, 0, 0, 0]}", "{"character": "mei", "gongche notation": ["j01000", "l00000", "j02000", "i00000", 0, 0, 0, 0]}", "{"character": "jing", "gongche notation": ["h01000", "f00000", "h02000", "i00000", 0, 0, 0, 0]}", "{"character": "nai", "gongche notation": ["my1000", 0, 0, 0, 0, 0, 0, 0]}", "{"character": "he", "gongche notation": ["j02000", "l06000", "m00000", "lz2000", 0, 0, 0, 0]}", "{"character": "tian", "gongche notation": ["j01500", 0, 0, 0, 0, 0, 0, 0]}", "{"character": "bian", "gongche notation": ["iy0000", 0, 0, 0, 0, 0, 0, 0]}", "{"character": "shang", "gongche notation": ["h03000", "f00000", "h00000", 0, 0, 0, 0, 0]}", "{"character": "xin", "gongche notation": ["i02000", 0, 0, 0, 0, 0, 0, 0]}", "{"character": "le", "gongche notation": ["j01000", "l02000", 0, 0, 0, 0, 0, 0]}", "{"character": "shi", "gongche notation": ["ly3000", "m00000", "l00000", "j02000", "i00000", "h00000", 0, 0]}", "{"character": "shui", "gongche notation": ["f01000", "i00000", 0, 0, 0, 0, 0, 0]}", "{"character": "jia", "gongche notation": ["h02000", "i03000", "h00000", "f02000", "e00000", 0, 0, 0]}", "{"character": "yuan", "gongche notation": ["e01000", "hz2000", "f03500", 0, 0, 0, 0, 0]}", "{"character": "chao", "gongche notation": ["e01000", 0, 0, 0, 0, 0, 0, 0]}", "{"character": "fei", "gongche notation": ["ex2000", "f03000", "h00000", 0, 0, 0, 0, 0]}", "{"character": "mu", "gongche notation": ["fy2000", "e00000", 0, 0, 0, 0, 0, 0]}", "{"character": "juan","gongche":["c01500","e00000","f03500",0,0,0,0,0]}","{"character":"yun","gongche":["f01000","h00000","i00000","j00000",0,0,0,0]}","{"character":"xia","gongche":["h02000","i00000","j03000","l00000",0,0,0,0]}","{"character":"cui","gongche":["m02000","l00000","j00000","i00000",0,0,0,0]}","{"character":"xuan","gongche":["h01000","i02000","h00000","f03500",0,0,0,0]}","{"character":"yu","gongche":["e01000","c00000",0,0,0,0,0,0]}","{"character":"si","gongche":["e02000","f03000",0,0,0,0,0,0]}","{"character":"feng","gongche":["e02000","fy0000",0,0,0,0,0,0]}","{"character":"pian","gongche":["hy1000","f02000","e00000","j03500",0,0,0,0]}","{"character":"yan","gongche":["i01000",0,0,0,0,0,0,0]}","{"character":"bo","gongche":["i02600","j00000",0,0,0,0,0,0]}","{"character":"hua","gongche":["iy2000","h00000",0,0,0,0,0,0]}","{"character":"chuan","gongche":["f01000",0,0,0,0,0,0,0]}","{"character":"jin","gongche":["lx2000","j00000",0,0,0,0,0,0]}","{"character":"ping","gongche":["i03000",0,0,0,0,0,0,0]}","{"character":"ren","gongche":["i00000","j02000",0,0,0,0,0,0]}","{"character":"tei","gongche":["l00000","m00000",0,0,0,0,0,0]}","{"character":"kan","gongche":["o01000","p00000","o02000","m00000",0,0,0,0]}","{"character":"di","gongche":["l03000","m00000","l00000","j02000",0,0,0,0]}","{"character":"this","gongchi":["i00000","h00000",0,0,0,0,0,0]}","{"character":"shao","gongchi":["f01000","i00000",0,0,0,0,0,0]}","{"character":"light","gongchi":["h02000","i03000","h00000","fx2000","e00000","f00000",0,0]}","{"character":"cheap","gongchi":["e01000","h00000","f02000",0,0,0,0,0]}"]"},
Claims
1. A structured intelligent recognition system for ancient musical notation texts, characterized in that, A software system is provided for intelligently recognizing ancient Chinese musical notation texts into structured musical notation results. The system includes the following modules: an ancient text parameter setting module, a traditional Chinese character OCR module, a lyrics and tune name identification module, a gongche music recognition module, a gongche character identification module, and a main recognition process. The ancient text parameter setting module, with the assistance of previewing a page of the ancient text image document, requires input of the following necessary fields: ancient text name, approximate size of the characters, typical characters in brackets for the tune name, gongche rotation angle, and typical characters for gongche symbols. The lyrics and tune name identification module, after initiating the intelligent recognition command, proceeds as follows: The method of identifying characters column by column from top right to bottom is based on a built-in bracket recognition engine for tune names. It identifies brackets and uses the system's built-in tune dataset, employing a traditional Chinese character OCR recognition engine to identify them as tune names. The lyrics recognition features are: if the size of the identified Chinese characters is within the allowable standard deviation multiplied by a coefficient for approximate sizes of the lyrics, and a gongche (a type of Chinese musical notation) column is found on the right side within the range of the Chinese character size multiplied by a specified coefficient, then the Chinese character is a lyrics character. Furthermore, if, following a continuous, top-to-bottom, right-to-left execution order, the lyrics character is located after the tune name and no tune ending event has occurred, then the lyrics character belongs to that tune. The gongche music recognition module uses a specific algorithm... The process involves rotating the page according to the rotation angle set in the ancient book parameter setting module, identifying multiple vertical gongche (a type of Chinese musical notation) column areas, and within these areas, identifying gongche pitch symbols, ornamentation symbols, and rhythmic patterns based on typical gongche symbol characters from the ancient book parameter setting module. A built-in attribution algorithm is then used to determine the gongche pitch symbols to which the ornamentation symbols and rhythmic patterns belong. Specifically, the algorithm for determining the gongche pitch of a rhythmic pattern is as follows: at this rotation angle, the center of gravity of the rhythmic pattern on the Y-axis is lower than the highest point of the previous pitch symbol area but higher than the highest point of the next pitch symbol area, and in the Y-axis direction, the rhythmic pattern area is adjacent to the previous pitch symbol area. If the overlap of the domains is greater than the overlap with the next pitch symbol region, then the result of assigning the Gongche pitch is that it belongs to the previous pitch symbol. The algorithm for determining the Gongche pitch of the ornamental cavity symbol is as follows: at this rotation angle, if the Y-axis position of the center of gravity of the ornamental cavity symbol is lower than the Y-axis position of the center of gravity of the previous pitch symbol region but higher than the Y-axis position of the center of gravity of the next pitch symbol region, then the result of assigning the Gongche pitch is that it belongs to the previous pitch symbol. The algorithm feature of the Gongche-related character determination module is that it determines the character to which the Gongche column belongs by the Y-axis position of the head of the Gongche column region or the center of gravity of the first Gongche pitch symbol in the Gongche column region.
2. The intelligent structured recognition system for ancient musical notation texts according to claim 1, characterized in that, In the ancient book parameter setting module, the approximate size of the singing characters is obtained by selecting at least three singing characters from the image preview, using a rectangle to frame them, and then calculating the average and standard deviation. The typical characters of the brackets in the tune name are selected by selecting at least three upper brackets and three lower brackets from the image preview and using a rectangle to frame them, which are used for subsequent bracket recognition in the score. The rotation angle of the gongche is obtained by inputting the angle in the preview state, and the page will automatically rotate. Confirmation is made after the gongche column is rotated to a vertical alignment. The typical character of the ruler symbol is obtained by selecting at least three different positions of the ruler symbol under the above rotation angles, and then using a rectangle to capture the ruler symbol in the subsequent ruler OCR recognition. The extended options in the ancient book parameter settings module include: ancient book margins and the height of the longest gongzhi column.
3. The intelligent structured recognition system for ancient Chinese musical notation as described in claim 1, characterized in that, After the intelligent recognition command is activated, the lyrics and tune name identification module uses a column-by-column recognition method from the top right to the bottom. Based on the built-in tune name bracket recognition engine, it identifies brackets and uses the traditional Chinese character OCR recognition engine through the system's built-in tune dataset to identify Chinese character combinations from top to bottom. If the combination phrase is below the upper bracket and above the lower bracket and is in the system's built-in tune dataset, it is identified as a tune name. If it is not in the system's built-in tune dataset, it is marked as a suspected tune name. The system's built-in tune dataset is then manually checked, edited, and expanded.
4. The intelligent structured recognition system for ancient musical notation texts according to claim 1, characterized in that, The gongche music recognition module is characterized by, based on the method described in claim 1, assigning multiple gongche symbols to pitch symbols in a top-to-bottom order.
5. The intelligent structured recognition system for ancient musical notation texts according to claim 1, characterized in that, The algorithm for determining the character to which the gongche (a type of musical scale) belongs includes two algorithms. The first is: in a non-rotational state, if the Y-coordinate of the highest octet, septet, septet, quintile, or quartile of the Y-axis distribution range of a certain gongche column area is included within the range from the highest point to the lowest point of a certain character in the left-hand lyric column, then the gongche column area belongs to that character. The second is: if the centroid of the first gongche pitch symbol in the gongche column area is the closest centroid of the character to which a straight line is drawn within any given area, then the gongche column area belongs to that character.
6. The intelligent structured recognition system for ancient Gongche notation texts according to claim 1, characterized in that, The main recognition process is as follows: After recognition begins, the traditional Chinese character OCR module and the lyrics and tune name identification module are called vertically from top to bottom and right to left. Based on the set character size, all characters and tunes are identified, excluding spoken characters. The characters are numbered from right to left and from top to bottom, and the list of characters and tunes, as well as the area and center of gravity of each character, are recorded. At the same time, the lyrics and tune name identification module determines the tune name and records the tune name and character in the structured result data. The page is rotated according to the rotation angle set by the ancient book parameter setting module, and the gongche music recognition module is called to record the structured gongche music data of each gongche column area. The original non-rotated page is restored, and the gongche character identification module is called to splice and record the characters on the page and the gongche music structured results belonging to the characters, thus obtaining the structured gongche score results for the page. When processing a page in the page list, the next page is accessed. If no new tune is found, the syllables and the associated musical scores on the next page are appended to the end of the previously unfinished tune's musical score. This process continues until a new tune appears, at which point the previous tune ends. This process continues until all pages have been processed.
7. The intelligent structured recognition system for ancient musical notation texts according to claim 1, characterized in that, The programming language types of software systems include: one high-level language or a mixture of multiple high-level languages.
Citation Information
Patent Citations
Computer text entry device oriented to Kunqu opera Gongche notation music score
CN102708094A
Multi-sound-part music score recognition method based on deep learning
CN112686104A
