{"record":{"id":"7f669ed6d922841e","repo":"babalae/better-genshin-impact","slug":"keys","errorCode":null,"errorMessage":"音符 {keys} 缺少时值","messagePattern":"音符 (.+?) 缺少时值","errorType":"exception","errorClass":"FormatException","httpStatus":null,"severity":"warning","filePath":"BetterGenshinImpact/GameTask/Music/Service/MusicScoreParser.cs","lineNumber":306,"sourceCode":"            {\n                var end = sheet.IndexOf(')', index + 1);\n                if (end < 0)\n                {\n                    throw new FormatException(\"和弦缺少右括号\");\n                }\n\n                keys = sheet[(index + 1)..end];\n                index = end + 1;\n            }\n            else\n            {\n                keys = sheet[index].ToString();\n                index++;\n            }\n\n            if (index >= sheet.Length || sheet[index] != '[')\n            {\n                throw new FormatException($\"音符 {keys} 缺少时值\");\n            }\n\n            var bracketEnd = sheet.IndexOf(']', index + 1);\n            if (bracketEnd < 0)\n            {\n                throw new FormatException($\"音符 {keys} 的时值缺少右方括号\");\n            }\n\n            var value = sheet[(index + 1)..bracketEnd];\n            index = bracketEnd + 1;\n            if (value is \"^\" or \"&\")\n            {\n                tokens.Add(new YuanQinToken(keys, 0, value));\n                continue;\n            }\n\n            var separator = value.IndexOf('-');\n            var denominatorText = separator >= 0 ? value[..separator] : value;","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/Music/Service/MusicScoreParser.cs#L288-L324","documentation":"Thrown by MusicScoreParser.ParseYuanQinTokens(string) when after parsing a key or chord, the next character is not '['. In yuanqin sheet syntax, every note or chord must be immediately followed by a duration bracket, e.g. Q[1] or (QW)[2]. If the '[' is missing (end of string or wrong character), the note is considered to lack a duration value.","triggerScenarios":"A yuanqin sheet string where a note key is not followed by a '['-delimited duration. For example, 'QW' (missing '[1]') or 'Q[1] W' (W has no duration bracket).","commonSituations":"Manual editing error omitting duration brackets; a score that uses a shorthand notation not supported by the parser; truncated sheet.","solutions":["Ensure every note/chord in the sheet is immediately followed by a duration bracket, e.g. Q[1], (QW)[2].","Review the sheet around the reported keys value to find the missing bracket.","Validate the sheet format against example yuanqin scores."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify each note is followed by a duration bracket\nvar pattern = @\"([A-Z]|\\([^)]+\\))\\[\";\n// Scan the sheet to ensure all notes have [..] brackets","typeGuard":null,"tryCatchPattern":"var score = await parser.ParseAsync(path, rootFolder, ct);\nif (!string.IsNullOrEmpty(score.Error)) { logger.LogWarning(score.Error); }","preventionTips":["Ensure every note/chord in the sheet is followed by a [duration] bracket.","Follow the yuanqin syntax strictly: key(s) immediately followed by [value].","Use example scores to learn the format."],"tags":["music","yuanqin","format-exception","score-syntax","user-content"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}