lex 1 year ago
parent
commit
ef21e04431
1 changed files with 13 additions and 10 deletions
  1. 13 10
      src/vexflow-test/index.tsx

+ 13 - 10
src/vexflow-test/index.tsx

@@ -20,7 +20,7 @@ export default defineComponent({
       // xml: '/音符-符杆.xml'
       // xml: '/1.小字一组567练习 - 副本 (2).xml'
       // xml: '/钢琴-测评.xml'
-      xml: 'https://ks3-cn-beijing.ksyuncs.com/cloud-coach/1661242248370尤克里里-测试-音阶.xml',
+      xml: 'https://oss.dayaedu.com/cloud-coach/1661242248370尤克里里-测试-音阶.xml',
     }
   },
   computed: {
@@ -39,7 +39,7 @@ export default defineComponent({
           type: 0,
           color: 'green',
           alpha: 1,
-          follow: true
+          follow: true,
         },
         // {
         //   type: 0,
@@ -47,7 +47,7 @@ export default defineComponent({
         //   alpha: 1,
         //   follow: true
         // }
-      ]
+      ],
     })
     // ;(window as any).osmd = osmd
     osmd.EngravingRules.StaffLineColor = 'rgba(238,128,196,1)'
@@ -126,7 +126,7 @@ export default defineComponent({
       // console.log({...iterator})
       while (!iterator.EndReached) {
         const voices = iterator.CurrentVoiceEntries?.[0] ? [iterator.CurrentVoiceEntries?.[0]] : []
-        const voices2 : any = iterator.CurrentVoiceEntries?.[1]
+        const voices2: any = iterator.CurrentVoiceEntries?.[1]
         for (var i = 0; i < voices.length; i++) {
           const v = voices[i]
           const notes = v.Notes
@@ -137,8 +137,11 @@ export default defineComponent({
               allNotes.push({
                 note: note.halfTone + 12, // see issue #224
                 time: iterator.currentTimeStamp.RealValue * 4,
-                halfTone1: notes.map(n => n.halfTone + 12).filter(Boolean),
-                halfTone2: voices2 && Array.isArray(voices2.notes) ? voices2.notes.map((n: any) => n.halfTone + 12).filter(Boolean) : []
+                halfTone1: notes.map((n) => n.halfTone + 12).filter(Boolean),
+                halfTone2:
+                  voices2 && Array.isArray(voices2.notes)
+                    ? voices2.notes.map((n: any) => n.halfTone + 12).filter(Boolean)
+                    : [],
               })
             }
           }
@@ -165,19 +168,19 @@ export default defineComponent({
         osmd.cursor.show()
       }
     },
-    autoPlay(){
+    autoPlay() {
       clearTimeout(timer)
       let time = 0
       timer = setInterval(() => {
         console.log(osmd.cursor.cursorElement.style.display)
-        if (new Date().getTime() - time > 2000){
+        if (new Date().getTime() - time > 2000) {
           osmd.cursor.next()
         }
         if (1) time = new Date().getTime()
-        
+
         console.log(osmd.cursor.cursorElement.style.display)
       }, 1000)
-    }
+    },
   },
   render() {
     return (