@@ -1 +1 @@
-Subproject commit 40d3f7b729c40be7190fdd7a2f496f6c1f96d25e
+Subproject commit 626c8e581c9a052c9f245676e171cdb483c86463
@@ -656,6 +656,7 @@ export const formatXML = (xml: string, xmlUrl?: string): string => {
}
const measures = Array.from(xmlParse.getElementsByTagName("measure"));
+ state.firstMeasureNumber = measures[0] ? Number(measures[0].getAttribute('number') || 1) : 1;
const minutes: any = xmlParse.getElementsByTagName("per-minute");
let speeds: any = []
for (const minute of minutes) {
@@ -320,7 +320,7 @@ class Metronome {
// console.log("🚀 ~ note?.noteElement?.sourceMeasure", note?.noteElement?.sourceMeasure)
// console.log("🚀 ~ measureNumberXML", measureNumberXML, note)
// console.log("🚀 ~ measureNumberXML", note)
- const measureListIndex = measureNumberXML - 1;
+ const measureListIndex = state.firstMeasureNumber == 0 ? measureNumberXML : measureNumberXML - 1;
// 当渐快渐慢的时候 不播节拍器
if(isWithinRange(state.gradual, measureListIndex)){
xmlNumber = measureNumberXML;
@@ -604,6 +604,8 @@ const state = reactive({
hasFollowResult: false,
/** 右上角速度图标,根据当前小节的速度是几分音符的动态变化 */
speedIcon: 'speed3', // 默认取1/4拍的图片
+ /** xml的第一个measure标签的number */
+ firstMeasureNumber: 1,
});
const browserInfo = browser();
let offset_duration = 0;