Browse Source

feat: 指法匹配去掉数字和小数点

TIANYONG 2 days ago
parent
commit
4c79dd76c8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/view/fingering/fingering-config.ts

+ 2 - 2
src/view/fingering/fingering-config.ts

@@ -352,11 +352,11 @@ export const matchVoicePart = (id: number | string, type: "SINGLE" | "CONCERT"):
         let pitchKey = sKey;
         if (typeof sKey === "string" && isNaN(Number(sKey)) ) {
           pitchKey = pitchKey.toLocaleLowerCase().replace(/ /g, "");
-          pitchKey = pitchKey.replace(/[_0-9]+$/, '');
+          pitchKey = pitchKey.replace(/[_0-9.]+$/, '');
         }
         if (typeof sKey === "string") {
           // 去掉声轨后面的数字
-          code = code.replace(/[_0-9]+$/, '');
+          code = code.replace(/[_0-9.]+$/, '');
         }
         if (pitchKey === code) {
           _track = subject[sKey];