Explorar el Código

feat: 计算时值过滤掉和弦音符

TIANYONG hace 1 mes
padre
commit
303c3fd8f7
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/helpers/formateMusic.ts

+ 2 - 1
src/helpers/formateMusic.ts

@@ -1164,7 +1164,8 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 				notes.push(...n.Notes);
 				return notes;
 			}, [] as any);
-			voiceNotes = voiceNotes.filter((note: any) => !note.IsGraceNote)
+			// 过滤掉倚音和和弦音符
+			voiceNotes = voiceNotes.filter((note: any) => (!note.IsGraceNote && !note.IsChordNote) )
 			voiceNotes = voiceNotes.sort((a: any, b: any) => a?.length?.realValue - b?.length?.realValue);
 			currentTime = voiceNotes?.[0]?.length?.realValue || 0;