Browse Source

feat: 音符是否参与评测逻辑修改

TIANYONG 11 tháng trước cách đây
mục cha
commit
5f2a418e01
1 tập tin đã thay đổi với 11 bổ sung2 xóa
  1. 11 2
      src/subpages/colexiu/buttons/evaluating.tsx

+ 11 - 2
src/subpages/colexiu/buttons/evaluating.tsx

@@ -429,6 +429,12 @@ const formatTimes = () => {
       recordMeasure = item.measureOpenIndex
     }
     // console.log(note.measureOpenIndex , measureIndex, note.noteElement.sourceMeasure.measureListIndex)
+    // 是否是需要延续、不停顿演奏的音符
+    let isTenutoSound = false;
+    if (item?.noteElement?.tie && item.noteElement.tie?.StartNote) {
+      const startId = item.noteElement.tie?.StartNote?.NoteToGraphicalNoteObjectId
+      isTenutoSound = item.NoteToGraphicalNoteObjectId === startId ? false : true
+    }
     const data = {
       timeStamp: (start * 1000) / rate,
       duration: ((end * 1000) / rate - (start * 1000) / rate) * noteRate,
@@ -438,10 +444,12 @@ const formatTimes = () => {
       measureIndex: measureIndex, //note.measureOpenIndex,
       // measureRenderIndex: note.noteElement.sourceMeasure.measureListIndex,
       measureRenderIndex: item.measureNumberPrinted >= 1 ? item.measureNumberPrinted - 1 : note.noteElement.sourceMeasure.measureListIndex,
-      dontEvaluating: ListenMode || dontEvaluatingMode || item.skipMode,
+      dontEvaluating: ListenMode || dontEvaluatingMode || !!item?.voiceEntry?.ornamentContainer || !!item.noteElement?.speedInfo?.startWord?.includes('rit.') || !!item.skipMode,
       musicalNotesIndex: index, //item.i,
       denominator: note.noteElement?.Length.denominator,
-      isOrnament: !!note?.voiceEntry?.ornamentContainer,
+      // isOrnament: !!note?.voiceEntry?.ornamentContainer,
+      isTenutoSound,
+      isStaccato: item?.voiceEntry?.isStaccato, // 是否是重音
     }
     // console.log('时间1111', data)
     datas.push(data)
@@ -462,6 +470,7 @@ const connect = async () => {
   const rate = runtime.basePlayRate * runtime.originAudioPlayRate; // 播放倍率
   calculateInfo = formatTimes()
   detailState.firstNoteTime = calculateInfo.firstNoteTime;
+  console.log('评测数据',calculateInfo.datas)
   const content = {
     musicXmlInfos: calculateInfo.datas,
     firstNoteTime: calculateInfo.firstNoteTime,