|
@@ -1,6 +1,7 @@
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
-import state from "../state"
|
|
|
|
|
|
+import state, { customData } from "../state"
|
|
import { getQuery } from "/src/utils/queryString";
|
|
import { getQuery } from "/src/utils/queryString";
|
|
|
|
+import { setGlobalData } from "/src/utils";
|
|
const query: any = getQuery();
|
|
const query: any = getQuery();
|
|
|
|
|
|
interface IItem {
|
|
interface IItem {
|
|
@@ -81,7 +82,8 @@ export const resetGivenFormate = () => {
|
|
}
|
|
}
|
|
const tieList = musicList[state.cbsExamSongId as string]
|
|
const tieList = musicList[state.cbsExamSongId as string]
|
|
if (tieList) {
|
|
if (tieList) {
|
|
- const tie = tieList.find((item) => item.parts.includes(query["part-index"] as string))
|
|
|
|
|
|
+ const partIndex = query["part-index"] || '0'
|
|
|
|
+ const tie = tieList.find((item) => item.parts.includes(partIndex))
|
|
if (!tie) return
|
|
if (!tie) return
|
|
// 延音线和连线重叠
|
|
// 延音线和连线重叠
|
|
if (tie.tieId && tie.tieId.length) {
|
|
if (tie.tieId && tie.tieId.length) {
|
|
@@ -523,4 +525,268 @@ const collisionDetection = (a: SVGAElement, b: SVGAElement, distance: number = 0
|
|
w2: bbbox.width,
|
|
w2: bbbox.width,
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/** 全局曲谱配置 */
|
|
|
|
+export const setGlobalMusicSheet = () => {
|
|
|
|
+ const partIndex = query["part-index"] || '0'
|
|
|
|
+ /** 延音线方向问题 start */
|
|
|
|
+ const stavetieList = [
|
|
|
|
+ {id: '12644', part_index: '25', direction: 1}
|
|
|
|
+ ]
|
|
|
|
+ const tieItem = stavetieList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ setGlobalData('tieDirection', tieItem ? tieItem.direction : undefined)
|
|
|
|
+ /** 延音线方向问题 end */
|
|
|
|
+
|
|
|
|
+ const graceList = [
|
|
|
|
+ {id: '3509', part_index: '16', direction: 1}
|
|
|
|
+ ]
|
|
|
|
+ const graceItem = graceList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ if (graceItem){
|
|
|
|
+ setGlobalData('graceCustom', {direction: graceItem.direction})
|
|
|
|
+ }
|
|
|
|
+ const bassDrumList = [
|
|
|
|
+ {id: '3030', part_index: '17', line: 4},
|
|
|
|
+ {id: '12704', part_index: '23', line: 3}
|
|
|
|
+ ]
|
|
|
|
+ const bassDrumItem = bassDrumList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ if (bassDrumItem){
|
|
|
|
+ setGlobalData('customBassDrum', bassDrumItem.line)
|
|
|
|
+ }
|
|
|
|
+ /** 打击乐多声部,双声部休止符重叠 end */
|
|
|
|
+
|
|
|
|
+ /** 符杆朝向 */
|
|
|
|
+ const stemDirectionList = [
|
|
|
|
+ {
|
|
|
|
+ id: '11654',
|
|
|
|
+ part_index: '16',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 124, direction: 0},
|
|
|
|
+ {id: 125, direction: 0},
|
|
|
|
+ {id: 126, direction: 0},
|
|
|
|
+ {id: 127, direction: 0},
|
|
|
|
+ {id: 128, direction: 0}
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '3581',
|
|
|
|
+ part_index: '4',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 380, direction: 1},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '3470',
|
|
|
|
+ part_index: '0',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 36, direction: 1},
|
|
|
|
+ {id: 37, direction: 1},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '3470',
|
|
|
|
+ part_index: '11',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 33, direction: 1},
|
|
|
|
+ {id: 56, direction: 1},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '12644',
|
|
|
|
+ part_index: '22',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 22, direction: 1},
|
|
|
|
+ {id: 26, direction: 1},
|
|
|
|
+ {id: 135, direction: 1},
|
|
|
|
+ {id: 163, direction: 1},
|
|
|
|
+ {id: 199, direction: 1},
|
|
|
|
+ {id: 204, direction: 1},
|
|
|
|
+ {id: 206, direction: 1},
|
|
|
|
+ {id: 208, direction: 1},
|
|
|
|
+ {id: 210, direction: 1},
|
|
|
|
+ {id: 213, direction: 1},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '12303',
|
|
|
|
+ part_index: '18',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 1, direction: 1},
|
|
|
|
+ {id: 4, direction: 1},
|
|
|
|
+ {id: 6, direction: 1},
|
|
|
|
+ {id: 9, direction: 1},
|
|
|
|
+ {id: 12, direction: 1},
|
|
|
|
+ {id: 14, direction: 1},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '12669',
|
|
|
|
+ part_index: '24',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 65, direction: 1},
|
|
|
|
+ {id: 296, direction: 1},
|
|
|
|
+ {id: 298, direction: 1},
|
|
|
|
+ {id: 300, direction: 1},
|
|
|
|
+ {id: 338, direction: 1},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '12420',
|
|
|
|
+ part_index: '21',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 614, direction: 0},
|
|
|
|
+ {id: 617, direction: 0},
|
|
|
|
+ {id: 619, direction: 0},
|
|
|
|
+ {id: 621, direction: 0},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '12711',
|
|
|
|
+ part_index: '22',
|
|
|
|
+ stemNotes: []
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '12973',
|
|
|
|
+ part_index: '21',
|
|
|
|
+ stemNotes: [
|
|
|
|
+ {id: 619, direction: 1},
|
|
|
|
+ {id: 622, direction: 1},
|
|
|
|
+ {id: 745, direction: 1},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ const stemDirectionItem = stemDirectionList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ if (stemDirectionItem) {
|
|
|
|
+ setGlobalData('stemDirectionNote', stemDirectionItem.stemNotes)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** vfcure */
|
|
|
|
+ const vfcurveList = [
|
|
|
|
+ {
|
|
|
|
+ id: '12711',
|
|
|
|
+ part_index: '4',
|
|
|
|
+ vfcurve: [
|
|
|
|
+ {MeasureNumberXML: 25, index: 1, bezierEndControlPt: {y: -2}},
|
|
|
|
+ {MeasureNumberXML: 33, index: 1, bezierEndControlPt: {y: -2}},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '12059',
|
|
|
|
+ part_index: '0',
|
|
|
|
+ vfcurve: [
|
|
|
|
+ {MeasureNumberXML: 15, bezierEndControlPt: {y: 2.8}, bezierEndPt:{y: 1.1}},
|
|
|
|
+ {MeasureNumberXML: 16, bezierEndControlPt: {y: -1}},
|
|
|
|
+ {MeasureNumberXML: 19, index: 1, bezierEndControlPt: {y: 2}},
|
|
|
|
+ {MeasureNumberXML: 20, bezierEndControlPt: {y: -1}},
|
|
|
|
+ {MeasureNumberXML: 42, index: 1, bezierEndControlPt: {y: -1.5}, bezierStartControlPt: {y: -1.5}},
|
|
|
|
+ {MeasureNumberXML: 46, index: 3, bezierEndControlPt: {y: -1.5}, bezierStartControlPt: {y: -1.5}},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '12668',
|
|
|
|
+ part_index: '11',
|
|
|
|
+ vfcurve: [
|
|
|
|
+ {MeasureNumberXML: 8, index: 2, bezierEndControlPt: {y: -3}, bezierStartControlPt:{y: -3}, bezierEndPt:{y: -1}},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: '11976',
|
|
|
|
+ part_index: '0',
|
|
|
|
+ vfcurve: [
|
|
|
|
+ {MeasureNumberXML: 14, index: 4, bezierEndControlPt: {y: -3}},
|
|
|
|
+ {MeasureNumberXML: 14, index: 1, bezierEndPt: {y: 1.5}, bezierEndControlPt: {y: 1}},
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ const vfcurveItem = vfcurveList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ if (vfcurveItem) {
|
|
|
|
+ setGlobalData('vfcurveItem', vfcurveItem.vfcurve)
|
|
|
|
+ }
|
|
|
|
+ /** drum set声部 重音 */
|
|
|
|
+ const customArtPositionList = [
|
|
|
|
+ {id: '12644', part_index: '25'}
|
|
|
|
+ ]
|
|
|
|
+ const customArtPositionItem = customArtPositionList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ if (customArtPositionItem) {
|
|
|
|
+ setGlobalData('customArtPosition', true)
|
|
|
|
+ }
|
|
|
|
+ /** 全声部声部 - & 全音符 */
|
|
|
|
+ const customTenutoList = [
|
|
|
|
+ {id: '12645', part_index: '5'}
|
|
|
|
+ ]
|
|
|
|
+ const customTenutoItem = customTenutoList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ if (customTenutoItem) {
|
|
|
|
+ setGlobalData('customTenutoItem', true)
|
|
|
|
+ }
|
|
|
|
+ /** 全声部声部 > */
|
|
|
|
+ const customAccentList = [
|
|
|
|
+ {id: '12711', part_index: '22'},
|
|
|
|
+ {id: '12711', part_index: '25'},
|
|
|
|
+ ]
|
|
|
|
+ const customAccentItem = customAccentList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ if (customAccentItem) {
|
|
|
|
+ setGlobalData('customAccentItem', true)
|
|
|
|
+ }
|
|
|
|
+ /** 全声部声部 + */
|
|
|
|
+ const customLefthandpizzicatoList = [
|
|
|
|
+ {id: '12711', part_index: '25'},
|
|
|
|
+ {id: '7755', part_index: '10'},
|
|
|
|
+ {id: '6226', part_index: '16'},
|
|
|
|
+ ]
|
|
|
|
+ const customLefthandpizzicatoItem = customLefthandpizzicatoList.find(({id, part_index}) => {
|
|
|
|
+ return id == state.cbsExamSongId && part_index == partIndex
|
|
|
|
+ })
|
|
|
|
+ if (customLefthandpizzicatoItem) {
|
|
|
|
+ setGlobalData('customLefthandpizzicatoItem', true)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/** 设置自定义渐慢 */
|
|
|
|
+export const setCustomGradual = () => {
|
|
|
|
+ if (state.gradualTimes) {
|
|
|
|
+ const detailId = state.cbsExamSongId + "";
|
|
|
|
+ const partIndex = state.partIndex + "";
|
|
|
|
+ if (["12280"].includes(detailId) && ["24"].includes(partIndex)) {
|
|
|
|
+ state.gradualTimes["8"] = "00:26:10";
|
|
|
|
+ state.gradualTimes["66"] = "01:53:35";
|
|
|
|
+ state.gradualTimes["90"] = "02:41:40";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/** 设置自定义音符数据 */
|
|
|
|
+export const setCustomNoteRealValue = () => {
|
|
|
|
+ const detailId = state.cbsExamSongId + "";
|
|
|
|
+ const partIndex = state.partIndex + "";
|
|
|
|
+ if (["2670"].includes(detailId)) {
|
|
|
|
+ customData.customNoteRealValue = {
|
|
|
|
+ 0: 0.03125,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ if (["12673"].includes(detailId) && ['22'].includes(partIndex)) {
|
|
|
|
+ customData.customNoteRealValue = {
|
|
|
|
+ 208: 0.125,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (["12667", "12673"].includes(detailId)){
|
|
|
|
+ customData.customNoteCurrentTime = true
|
|
|
|
+ }
|
|
};
|
|
};
|