Browse Source

Merge branch 'feature-12.23' into ktyq-online-new

TIANYONG 2 months ago
parent
commit
ba76a7c4ec

+ 1 - 1
osmd-extended

@@ -1 +1 @@
-Subproject commit a9750e2d69cdef62c365035e86f131586a25aa69
+Subproject commit 134d7aba9db4a46180220ee256d8a4e3f05c1a2e

+ 12 - 1
src/helpers/formateMusic.ts

@@ -1423,7 +1423,8 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 				xmlMp3BeatFixTime,  //xml上节拍器的时间
 				notBeatFixtime: state.isOpenMetronome ? fixtime - xmlMp3BeatFixTime : fixtime, // 不含节拍器的fixtime值 唱名用
 				notBeatTime: state.isEvxml && evNoteStartTime ? retain(evNoteStartTime) : retain(relativeTime + (state.isOpenMetronome ? fixtime - xmlMp3BeatFixTime : fixtime)), // 不含节拍器的 音符开始时间
-				notBeatEndTime: state.isEvxml && evNoteEndTime ? retain(evNoteEndTime) : retain(relaEndtime + (state.isOpenMetronome ? fixtime - xmlMp3BeatFixTime : fixtime)) // 不含节拍器的 音符结束时间
+				notBeatEndTime: state.isEvxml && evNoteEndTime ? retain(evNoteEndTime) : retain(relaEndtime + (state.isOpenMetronome ? fixtime - xmlMp3BeatFixTime : fixtime)), // 不含节拍器的 音符结束时间
+				frequencyList: [note?.pitch?.frequency || -1], // 如果是和弦音符,需要添加多个音符的频率,用于评测
 			};
 			// console.log(i,'当前的小节',nodeDetail.MeasureNumberXML,totalMultipleRestMeasures,multipleRestMeasures)
 			// 如果是妙极客的曲子,并且第二遍循环播放需要等待时间,并且是第二遍循环的第一个小节的第一个音符
@@ -1434,6 +1435,16 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			// 	relativeTime = relativeTime + state.secondEvXmlBeginTime;
 			// }
 			// if (state.isEvxml && nodeDetail.repeatIdx && nodeDetail.i > 0 && nodeDetail.MeasureNumberXML === 1 && nodeDetail.noteId === 0) {
+
+			// 如果是和弦音符,需要添加多个音符的频率,用于评测
+			if (note.voiceEntry.notes.length > 1) {
+				note.voiceEntry.notes.forEach((cnote: any) => {
+					if (cnote?.IsChordNote && cnote?.pitch?.frequency) {
+						nodeDetail.frequencyList.push(cnote.pitch.frequency)
+					}
+				})
+			}
+
 			const firstRepeatNodeId = allNotes.find((item: any) => item.MeasureNumberXML === state.timegapRepeatMeasureIndex)?.noteId || 0;
 			if (state.isEvxml && nodeDetail.repeatIdx && nodeDetail.i > 0 && nodeDetail.MeasureNumberXML === state.timegapRepeatMeasureIndex && nodeDetail.noteId === firstRepeatNodeId) {
 				const currentWaitTime = state.evXmlBeginArr[nodeDetail.repeatIdx] || 0;

+ 9 - 1
src/page-instrument/custom-plugins/recording-time/index.tsx

@@ -4,6 +4,7 @@ import { api_musicPracticeRecordSave } from "../../api";
 import { browser, getBehaviorId, getCampId } from "/src/utils";
 import { getQuery } from "/src/utils/queryString";
 import { storeData } from "/src/store";
+import { getAudioDuration } from "/src/view/audio-list";
 
 const recordData = reactive({
 	starTime: 0,
@@ -15,7 +16,9 @@ const handleRecord = () => {
 	recordData.starTime = Date.now();
 	if (total < 0) total = 0;
 	const totalTime = total / 1000;
-
+	const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率    
+	// 如果是选段,则选选段开头小节的速度
+	const currentSpeed = state.sectionStatus && state.section.length === 2 && state.section[0].measureSpeed ? state.section[0].measureSpeed * state.basePlayRate : state.speed;
 	const body = {
 		clientType: storeData.user.clientType,
 		musicSheetId: state.examSongId,
@@ -25,6 +28,11 @@ const handleRecord = () => {
 		playTime: totalTime,
 		deviceType: browser().android ? "ANDROID" : "IOS",
 		behaviorId: getBehaviorId(),
+		sourceTime: getAudioDuration(), // 音频时长
+		instrumentId: state.instrumentId,
+        playRate: rate,
+		partIndex: state.partIndex, // 音轨
+        speed: currentSpeed, // 速度		
 	};
 	api_musicPracticeRecordSave(body);
 };

+ 1 - 0
src/page-instrument/evaluat-model/index.tsx

@@ -277,6 +277,7 @@ export default defineComponent({
           // isOrnament: !!note?.voiceEntry?.ornamentContainer,
           isTenutoSound,
           isStaccato: item?.voiceEntry?.isStaccato ? true : false, // 是否是重音
+          frequencyList: item.frequencyList, // 如果是和弦音符,需要添加多个音符的频率,用于评测
         };
         datas.push(data);
       }

+ 2 - 2
src/view/fingering/fingering-config.ts

@@ -347,11 +347,11 @@ export const matchVoicePart = (id: number | string, type: "SINGLE" | "CONCERT"):
         let pitchKey = sKey;
         if (typeof sKey === "string" && isNaN(Number(sKey)) ) {
           pitchKey = pitchKey.toLocaleLowerCase().replace(/ /g, "");
-          pitchKey = pitchKey.replace(/[_0-9]+$/, '');
+          pitchKey = pitchKey.replace(/[_0-9.]+$/, '');
         }
         if (typeof sKey === "string") {
           // 去掉声轨后面的数字
-          code = code.replace(/[_0-9]+$/, '');
+          code = code.replace(/[_0-9.]+$/, '');
         }
         if (pitchKey === code) {
           _track = subject[sKey];

+ 9 - 1
src/view/follow-practice/index.tsx

@@ -11,6 +11,7 @@ import { OpenSheetMusicDisplay } from "/osmd-extended/src";
 import { browser, getBehaviorId } from "/src/utils";
 import { api_musicPracticeRecordSave } from "../../page-instrument/api";
 import { getQuery } from "/src/utils/queryString";
+import { getAudioDuration } from "/src/view/audio-list";
 
 const query: any = getQuery();
 
@@ -31,7 +32,9 @@ const handleRecord = (total: number) => {
 	if (query.isCbs) return
 	if (total < 0) total = 0;
 	const totalTime = total / 1000;
-
+	const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率    
+	// 如果是选段,则选选段开头小节的速度
+	const currentSpeed = state.sectionStatus && state.section.length === 2 && state.section[0].measureSpeed ? state.section[0].measureSpeed * state.basePlayRate : state.speed;
 	const body = {
 		clientType: storeData.user.clientType,
 		musicSheetId: state.examSongId,
@@ -41,6 +44,11 @@ const handleRecord = (total: number) => {
 		playTime: totalTime,
 		deviceType: browser().android ? "ANDROID" : "IOS",
 		behaviorId: getBehaviorId(),
+		sourceTime: getAudioDuration(), // 音频时长
+		instrumentId: state.instrumentId,
+        playRate: rate,
+		partIndex: state.partIndex, // 音轨
+        speed: currentSpeed, // 速度		
 	};
 	api_musicPracticeRecordSave(body);
 };