Przeglądaj źródła

当休止小节多出一个音符,需要删掉的时候,唱名前一个音符的结束时间需要补齐这个删除的音符时间

黄琪勇 10 miesięcy temu
rodzic
commit
d2b003a515
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      src/helpers/formateMusic.ts

+ 2 - 1
src/helpers/formateMusic.ts

@@ -1264,7 +1264,8 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 				const allowRange = Math.abs(_notes[idx+1]?.note?.noteTimeInfo?.[0]?.begin - _notes[idx-1]?.note?.noteTimeInfo?.[0]?.end) < 10;
 				if (allowRange) {
 					note.maxNoteNum = note.maxNoteNum - 1;
-					// 唱名时间补齐
+					// 唱名时间补齐,唱名上一个音符的结束时候,也需要补上这个时间
+					allNotes[allNotes.length-1].xmlNoteEndTime = retain(xmlNoteTime + noteLength)
 					xmlNoteTime += noteLength
 					continue;
 				}