|
@@ -1,4 +1,5 @@
|
|
|
-import state from "/src/state";
|
|
|
+import state, { customData } from "/src/state";
|
|
|
+import { setGlobalData } from "/src/utils";
|
|
|
|
|
|
/** 设置自定义渐慢 */
|
|
|
export const setCustomGradual = () => {
|
|
@@ -12,3 +13,300 @@ export const setCustomGradual = () => {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+/** 设置自定义音符数据 */
|
|
|
+export const setCustomNoteRealValue = () => {
|
|
|
+ const detailId = state.examSongId + "";
|
|
|
+ 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,
|
|
|
+ };
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * 曲谱渲染自定义逻辑
|
|
|
+ */
|
|
|
+export const handleSetCustomRender = () => {
|
|
|
+ const detailId = state.examSongId + "";
|
|
|
+ const partIndex = state.partIndex + "";
|
|
|
+ /** 不计算默认渐强渐弱位置的条件 start */
|
|
|
+ const noNeedList = [
|
|
|
+ { id: "11977", part_index: "11" },
|
|
|
+ { id: "11608", part_index: "2" },
|
|
|
+ { id: "11608", part_index: "10" },
|
|
|
+ { id: "11826", part_index: "5" },
|
|
|
+ { id: "12305", part_index: "13" },
|
|
|
+ { id: "12307", part_index: "2" },
|
|
|
+ { id: "7929", part_index: "9" },
|
|
|
+ { id: "12669", part_index: "0" },
|
|
|
+ ];
|
|
|
+ const noNeedItem = noNeedList.find(({ id, part_index }) => {
|
|
|
+ return id == detailId && part_index == partIndex;
|
|
|
+ });
|
|
|
+ setGlobalData("noNeedContinuousDynamic", noNeedItem ? true : false);
|
|
|
+
|
|
|
+ const noNeedGraphicalList = [
|
|
|
+ { id: "12307", part_index: "2" },
|
|
|
+ { id: "7929", part_index: "9" },
|
|
|
+ ];
|
|
|
+ const noNeedGraphicalItem = noNeedGraphicalList.find(({ id, part_index }) => {
|
|
|
+ return id == detailId && part_index == partIndex;
|
|
|
+ });
|
|
|
+ setGlobalData("noNeedGraphicalContinuousDynamic", noNeedGraphicalItem ? true : false);
|
|
|
+ /** 不计算默认渐强渐弱位置的条件 end */
|
|
|
+
|
|
|
+ /** 设置换行标准 */
|
|
|
+ const wrapList = [
|
|
|
+ { id: "11609", part_index: "24", wrapNum: 4 },
|
|
|
+ { id: "7472", part_index: "22", wrapNum: 4 },
|
|
|
+ ];
|
|
|
+ const wrapItem = wrapList.find(({ id, part_index }) => {
|
|
|
+ return id == detailId && part_index == partIndex;
|
|
|
+ });
|
|
|
+ setGlobalData("wrapNum", wrapItem ? wrapItem.wrapNum : undefined);
|
|
|
+
|
|
|
+ /** 设置特定声部,换行规则(打击乐(小鼓+键盘) , 打击乐(小鼓)) */
|
|
|
+ if ([121, 23].includes(state.subjectId as number)) {
|
|
|
+ setGlobalData("wrapNum", 2);
|
|
|
+ state.zoom = 0.9;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 延音线方向问题 start */
|
|
|
+ const stavetieList = [{ id: "12644", part_index: "25", direction: 1 }];
|
|
|
+ const tieItem = stavetieList.find(({ id, part_index }) => {
|
|
|
+ return id == detailId && part_index == partIndex;
|
|
|
+ });
|
|
|
+ setGlobalData("tieDirection", tieItem ? tieItem.direction : undefined);
|
|
|
+ /** 延音线方向问题 end */
|
|
|
+
|
|
|
+ /** 打击乐多声部,双声部休止符重叠 start */
|
|
|
+ const productMeasure = (total: number, base: number) => {
|
|
|
+ const list = [];
|
|
|
+ for (let i = 0; i < total; i++) {
|
|
|
+ list.push(i + base);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ };
|
|
|
+ const drumSetList = [
|
|
|
+ { id: "12420", part_index: "21", measures: [...productMeasure(17, 9), 60] },
|
|
|
+ { id: "6244", part_index: "15", measures: [6, 38, 46] },
|
|
|
+ ];
|
|
|
+ const drumSetItem = drumSetList.find(({ id, part_index }) => {
|
|
|
+ return id == detailId && part_index == partIndex;
|
|
|
+ });
|
|
|
+ if (drumSetItem) {
|
|
|
+ setGlobalData("drumSetMeasures", drumSetItem.measures);
|
|
|
+ }
|
|
|
+ const graceList = [{ id: "3509", part_index: "16", direction: 1 }];
|
|
|
+ const graceItem = graceList.find(({ id, part_index }) => {
|
|
|
+ return id == detailId && 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 == detailId && 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 == detailId && 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 == detailId && 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 == detailId && part_index == partIndex;
|
|
|
+ });
|
|
|
+ if (customArtPositionItem) {
|
|
|
+ setGlobalData("customArtPosition", true);
|
|
|
+ }
|
|
|
+ /** 全声部声部 - & 全音符 */
|
|
|
+ const customTenutoList = [{ id: "12645", part_index: "5" }];
|
|
|
+ const customTenutoItem = customTenutoList.find(({ id, part_index }) => {
|
|
|
+ return id == detailId && 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 == detailId && 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 == detailId && part_index == partIndex;
|
|
|
+ });
|
|
|
+ if (customLefthandpizzicatoItem) {
|
|
|
+ setGlobalData("customLefthandpizzicatoItem", true);
|
|
|
+ }
|
|
|
+};
|