Browse Source

feat: "allargando", "molto allargando"识别为渐变

TIANYONG 3 months ago
parent
commit
a88ad803dd
2 changed files with 2 additions and 4 deletions
  1. 2 1
      src/helpers/calcSpeed.ts
  2. 0 3
      src/helpers/metronome.ts

+ 2 - 1
src/helpers/calcSpeed.ts

@@ -41,6 +41,7 @@ export const speedInfo: { [key in string]: number } = {
 	slow: 1.333333333,
 	slowly: 1.333333333,
 	faster: 1.333333333,
+	"molto allargando": 1.333333333,
 };
 
 /**
@@ -184,7 +185,7 @@ export const getGradualLengthByXml = (xml: string) => {
 		}
 		const isKeyWork = keys.find((k) => {
 			const ks = k.split(" ");
-			return textContent && ks.includes(textContent);
+			return textContent && ks.includes(textContent) || k === textContent;
 		});
 		if (ele.type === "metronome" || (ele.type === "words" && (textContent.startsWith("a tempo") || isKeyWork)) || isLastNoteAndNotClosed) {
 			const indexOf = gradualNotes.findIndex((item) => item.length === 1);

+ 0 - 3
src/helpers/metronome.ts

@@ -151,9 +151,6 @@ class Metronome {
 
 	// 播放
 	sound = (currentTime: number) => {
-		if (!state.sectionStatus){
-			currentTime = setCurrentTime(currentTime);
-		}
 		let index = -1;
 		let activeMetro = -1;
 		for (let i = 0; i < metronomeData.metroList.length; i++) {