liushengqiang 2 lat temu
rodzic
commit
c574b80c8e

+ 24 - 0
src/page-instrument/view-detail/index.tsx

@@ -68,6 +68,29 @@ const resetFrequency = (list: any[]) => {
 	return list;
 };
 
+/**
+ * 乐器指法处理
+ */
+const setNoteHalfTone = (list: any[]) => {
+	const instrumentNames = ['melodica']
+	if (!state.fingeringInfo?.name || !instrumentNames.includes(state.fingeringInfo.name)) return list;
+	for (let i = 0; i < list.length; i++) {
+		const note = list[i];
+		if (note.noteElement?.pitch?.accidentalXml){
+			const accidentalXml = note.noteElement?.pitch?.accidentalXml;
+			if ([]) {
+
+			}
+			if (accidentalXml === 'flat'){
+				// note.realKey = note.realKey + 1;
+			} else if (accidentalXml === 'sharp'){
+				// note.realKey = note.realKey + 1;
+			}
+		}
+	}
+	return list;
+}
+
 export default defineComponent({
 	name: "music-list",
 	setup() {
@@ -217,6 +240,7 @@ export default defineComponent({
 			}
 			state.times = formateTimes(osmd);
 			state.times = resetFrequency(state.times);
+			// state.times = setNoteHalfTone(state.times);
 			console.log("🚀 ~ state.times:", state.times, state.subjectId);
 			try {
 				metronomeData.metro = new Metronome();

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

@@ -464,8 +464,8 @@ const relationships = {
 		55: [2],
 		56: [102],
 		57: [3],
-		58: [103],
-		59: [4],
+		58: [4],
+		59: [103],
 		60: [5],
 		61: [104],
 		62: [6],