|
@@ -781,6 +781,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
|
|
const currentTimes = [] as any[];
|
|
const currentTimes = [] as any[];
|
|
let isSetNextNoteReal = false;
|
|
let isSetNextNoteReal = false;
|
|
let differFrom = 0;
|
|
let differFrom = 0;
|
|
|
|
+ // let testIdx = 0;
|
|
while (!iterator.EndReached) {
|
|
while (!iterator.EndReached) {
|
|
// console.log({ ...iterator });
|
|
// console.log({ ...iterator });
|
|
const voiceEntries = iterator.CurrentVoiceEntries?.[0] ? [iterator.CurrentVoiceEntries?.[0]] : [];
|
|
const voiceEntries = iterator.CurrentVoiceEntries?.[0] ? [iterator.CurrentVoiceEntries?.[0]] : [];
|
|
@@ -864,6 +865,8 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
|
|
}
|
|
}
|
|
|
|
|
|
iterator.moveToNextVisibleVoiceEntry(false);
|
|
iterator.moveToNextVisibleVoiceEntry(false);
|
|
|
|
+ // console.log('小节',testIdx,iterator.EndReached,iterator.currentMeasureIndex)
|
|
|
|
+ // testIdx += 1;
|
|
}
|
|
}
|
|
// 是否是变速的曲子
|
|
// 是否是变速的曲子
|
|
const hasVaryingSpeed = _notes.some((item: any) => item.measuresTempoInBPM !== _notes[0].measuresTempoInBPM)
|
|
const hasVaryingSpeed = _notes.some((item: any) => item.measuresTempoInBPM !== _notes[0].measuresTempoInBPM)
|
|
@@ -1298,6 +1301,22 @@ const customizationXml = (xmlParse: any) => {
|
|
const creators: any = Array.from(xmlParse.querySelectorAll('creator'));
|
|
const creators: any = Array.from(xmlParse.querySelectorAll('creator'));
|
|
const graces: any = Array.from(xmlParse.querySelectorAll('grace'));
|
|
const graces: any = Array.from(xmlParse.querySelectorAll('grace'));
|
|
const measures: any[] = Array.from(xmlParse.getElementsByTagName("measure"));
|
|
const measures: any[] = Array.from(xmlParse.getElementsByTagName("measure"));
|
|
|
|
+ const notes: any[] = Array.from(xmlParse.getElementsByTagName("note"));
|
|
|
|
+
|
|
|
|
+ // 获取音符最多的歌词数,用于自定义循环播放次数
|
|
|
|
+ let maxLyricNum = 0;
|
|
|
|
+ if (notes && notes.length) {
|
|
|
|
+ for (const note of notes) {
|
|
|
|
+ if (maxLyricNum < note.getElementsByTagName("lyric").length) {
|
|
|
|
+ maxLyricNum = note.getElementsByTagName("lyric").length
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ state.maxLyricNum = maxLyricNum;
|
|
|
|
+ // state.osmd.EngravingRules.DYCustomRepeatCount = maxLyricNum;
|
|
|
|
+ ;(window as any).DYCustomRepeatCount = state.maxLyricNum;
|
|
|
|
+ console.log('歌词次数',maxLyricNum)
|
|
|
|
+
|
|
if (credits && credits.length) {
|
|
if (credits && credits.length) {
|
|
for (const credit of credits) {
|
|
for (const credit of credits) {
|
|
if (credit.getElementsByTagName("credit-type")?.[0]?.textContent === 'lyricist') {
|
|
if (credit.getElementsByTagName("credit-type")?.[0]?.textContent === 'lyricist') {
|