|
@@ -71,6 +71,7 @@ const formatTimes = () => {
|
|
|
// console.log("🚀 ~ times", times)
|
|
|
}
|
|
|
let measureIndex = -1
|
|
|
+ let recordMeasure = -1
|
|
|
for (let index = 0; index < times.length; index++) {
|
|
|
const item = times[index]
|
|
|
const note = getNoteByMeasuresSlursStart(item)
|
|
@@ -99,9 +100,11 @@ const formatTimes = () => {
|
|
|
if (note.noteElement.isRestFlag && !!note.stave && !!nextNote && nextNote.noteElement.isRestFlag) {
|
|
|
skip = true
|
|
|
}
|
|
|
- if (note.measureOpenIndex != measureIndex){
|
|
|
+ if (note.measureOpenIndex != recordMeasure){
|
|
|
measureIndex++
|
|
|
+ recordMeasure = note.measureOpenIndex
|
|
|
}
|
|
|
+ // console.log(note.measureOpenIndex , measureIndex, note.noteElement.sourceMeasure.measureListIndex)
|
|
|
const data = {
|
|
|
timeStamp: (start * 1000) / rate,
|
|
|
duration: ((end * 1000) / rate - (start * 1000) / rate) * noteRate,
|
|
@@ -109,16 +112,15 @@ const formatTimes = () => {
|
|
|
nextFrequency: formatPitch(item.noteElement?.pitch?.nextFrequency),
|
|
|
prevFrequency: formatPitch(item.noteElement?.pitch?.prevFrequency),
|
|
|
// 重复的情况index会自然累加,render的index是谱面渲染的index
|
|
|
- measureIndex: measureIndex,//note.measureOpenIndex, //note.measureOpenIndex,
|
|
|
+ measureIndex: measureIndex,//note.measureOpenIndex,
|
|
|
measureRenderIndex: note.noteElement.sourceMeasure.measureListIndex,
|
|
|
dontEvaluating: ListenMode || dontEvaluatingMode || item.skipMode,
|
|
|
- musicalNotesIndex: index,//item.i,
|
|
|
+ musicalNotesIndex: index, //item.i,
|
|
|
denominator: note.noteElement?.Length.denominator,
|
|
|
isOrnament: !!note?.voiceEntry?.ornamentContainer,
|
|
|
}
|
|
|
datas.push(data)
|
|
|
}
|
|
|
- console.log("🚀 ~ datas", datas)
|
|
|
return datas
|
|
|
}
|
|
|
const connect = async () => {
|
|
@@ -411,7 +413,7 @@ const canSubmit = ref(false)
|
|
|
/**接受websocket返回的信息 */
|
|
|
const sendResult = (evt?: IPostMessage) => {
|
|
|
const { body, header } = evt?.content || {}
|
|
|
- console.log('评测返回', { body, header })
|
|
|
+ console.log('评测返回', body)
|
|
|
if (body && header) {
|
|
|
const data = evt?.content?.body
|
|
|
if (evt?.content.header.commond === 'overall') {
|