@tspro/web-music-score 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +4 -3
- package/dist/audio/index.js +1 -1
- package/dist/audio/index.mjs +2 -2
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +2 -2
- package/dist/{chunk-ZWFAOHYM.mjs → chunk-4AS76G4O.mjs} +2 -2
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +3 -3
- package/dist/iife/index.global.js +11 -11
- package/dist/{interface-DXyXwLBB.d.ts → interface-1TQHxSpb.d.ts} +4 -3
- package/dist/{interface-CLb7xa7_.d.mts → interface-DkUnsAjj.d.mts} +4 -3
- package/dist/pieces/index.d.mts +1 -1
- package/dist/pieces/index.d.ts +1 -1
- package/dist/pieces/index.js +1 -1
- package/dist/pieces/index.mjs +2 -2
- package/dist/react-ui/index.d.mts +1 -1
- package/dist/react-ui/index.d.ts +1 -1
- package/dist/react-ui/index.js +1 -1
- package/dist/react-ui/index.mjs +2 -2
- package/dist/score/index.d.mts +3 -3
- package/dist/score/index.d.ts +3 -3
- package/dist/score/index.js +20 -18
- package/dist/score/index.mjs +21 -19
- package/dist/theory/index.js +1 -1
- package/dist/theory/index.mjs +2 -2
- package/package.json +1 -1
|
@@ -1345,14 +1345,15 @@ declare abstract class MusicObject {
|
|
|
1345
1345
|
|
|
1346
1346
|
declare class ObjArpeggio extends MusicObject {
|
|
1347
1347
|
readonly col: ObjRhythmColumn;
|
|
1348
|
+
readonly line: ObjStaff | ObjTab;
|
|
1348
1349
|
readonly arpeggioDir: Arpeggio;
|
|
1349
1350
|
private topArrowHeight;
|
|
1350
1351
|
private bottomArrowHeight;
|
|
1351
|
-
private static NumCycles;
|
|
1352
1352
|
private cycleHeight;
|
|
1353
|
+
private numCycles;
|
|
1353
1354
|
private color;
|
|
1354
1355
|
readonly mi: MArpeggio;
|
|
1355
|
-
constructor(col: ObjRhythmColumn, arpeggioDir: Arpeggio);
|
|
1356
|
+
constructor(col: ObjRhythmColumn, line: ObjStaff | ObjTab, arpeggioDir: Arpeggio);
|
|
1356
1357
|
getMusicInterface(): MArpeggio;
|
|
1357
1358
|
pick(x: number, y: number): MusicObject[];
|
|
1358
1359
|
layout(renderer: Renderer): void;
|
|
@@ -1765,4 +1766,4 @@ declare class MPlaybackButtons {
|
|
|
1765
1766
|
private static addOnClickListener;
|
|
1766
1767
|
}
|
|
1767
1768
|
|
|
1768
|
-
export {
|
|
1769
|
+
export { type StringNumber as $, Annotation as A, MStaffRest as B, Connective as C, DivRect as D, MRhythmColumn as E, Fermata as F, MScoreRow as G, MStaff as H, MTab as I, MSignature as J, MSpecialText as K, Label as L, MDocument as M, type NoteOptions as N, MText as O, MExtensionLine as P, MPlayer as Q, type RestOptions as R, StaffPreset as S, TieType as T, MRenderer as U, MPlaybackButtons as V, Clef as W, type StaffConfig as X, type TabConfig as Y, type VoiceId as Z, getVoiceIds as _, type ScoreConfiguration as a, getStringNumbers as a0, Stem as a1, Arpeggio as a2, type ConnectiveSpan as a3, PlayState as a4, type PlayStateChangeListener as a5, Navigation as b, NoteAnchor as c, type ScoreEventType as d, ScoreEvent as e, ScoreStaffPosEvent as f, ScoreObjectEvent as g, type ScoreEventListener as h, MusicInterface as i, MAccidental as j, MConnective as k, MArpeggio as l, MBeamGroup as m, MStaffBeamGroup as n, MEnding as o, MFermata as p, MHeader as q, MImage as r, MMeasure as s, MBarLineRight as t, MBarLineLeft as u, MStaffTabBarLine as v, MNoteGroup as w, MStaffNoteGroup as x, MTabNoteGroup as y, MRest as z };
|
|
@@ -1345,14 +1345,15 @@ declare abstract class MusicObject {
|
|
|
1345
1345
|
|
|
1346
1346
|
declare class ObjArpeggio extends MusicObject {
|
|
1347
1347
|
readonly col: ObjRhythmColumn;
|
|
1348
|
+
readonly line: ObjStaff | ObjTab;
|
|
1348
1349
|
readonly arpeggioDir: Arpeggio;
|
|
1349
1350
|
private topArrowHeight;
|
|
1350
1351
|
private bottomArrowHeight;
|
|
1351
|
-
private static NumCycles;
|
|
1352
1352
|
private cycleHeight;
|
|
1353
|
+
private numCycles;
|
|
1353
1354
|
private color;
|
|
1354
1355
|
readonly mi: MArpeggio;
|
|
1355
|
-
constructor(col: ObjRhythmColumn, arpeggioDir: Arpeggio);
|
|
1356
|
+
constructor(col: ObjRhythmColumn, line: ObjStaff | ObjTab, arpeggioDir: Arpeggio);
|
|
1356
1357
|
getMusicInterface(): MArpeggio;
|
|
1357
1358
|
pick(x: number, y: number): MusicObject[];
|
|
1358
1359
|
layout(renderer: Renderer): void;
|
|
@@ -1765,4 +1766,4 @@ declare class MPlaybackButtons {
|
|
|
1765
1766
|
private static addOnClickListener;
|
|
1766
1767
|
}
|
|
1767
1768
|
|
|
1768
|
-
export {
|
|
1769
|
+
export { type StringNumber as $, Annotation as A, MStaffRest as B, Connective as C, DivRect as D, MRhythmColumn as E, Fermata as F, MScoreRow as G, MStaff as H, MTab as I, MSignature as J, MSpecialText as K, Label as L, MDocument as M, type NoteOptions as N, MText as O, MExtensionLine as P, MPlayer as Q, type RestOptions as R, StaffPreset as S, TieType as T, MRenderer as U, MPlaybackButtons as V, Clef as W, type StaffConfig as X, type TabConfig as Y, type VoiceId as Z, getVoiceIds as _, type ScoreConfiguration as a, getStringNumbers as a0, Stem as a1, Arpeggio as a2, type ConnectiveSpan as a3, PlayState as a4, type PlayStateChangeListener as a5, Navigation as b, NoteAnchor as c, type ScoreEventType as d, ScoreEvent as e, ScoreStaffPosEvent as f, ScoreObjectEvent as g, type ScoreEventListener as h, MusicInterface as i, MAccidental as j, MConnective as k, MArpeggio as l, MBeamGroup as m, MStaffBeamGroup as n, MEnding as o, MFermata as p, MHeader as q, MImage as r, MMeasure as s, MBarLineRight as t, MBarLineLeft as u, MStaffTabBarLine as v, MNoteGroup as w, MStaffNoteGroup as x, MTabNoteGroup as y, MRest as z };
|
package/dist/pieces/index.d.mts
CHANGED
package/dist/pieces/index.d.ts
CHANGED
package/dist/pieces/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v3.0.
|
|
1
|
+
/* WebMusicScore v3.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/pieces/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* WebMusicScore v3.0.
|
|
2
|
-
import "../chunk-
|
|
1
|
+
/* WebMusicScore v3.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
|
+
import "../chunk-4AS76G4O.mjs";
|
|
3
3
|
|
|
4
4
|
// src/pieces/frere-jacques.ts
|
|
5
5
|
import { NoteLength, ScaleType } from "@tspro/web-music-score/theory";
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { c as Scale, S as ScaleType } from '../scale-C-YS5iVG.mjs';
|
|
4
4
|
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-B5ZtlHc8.mjs';
|
|
5
5
|
import { H as Handedness } from '../guitar-zASF7B1g.mjs';
|
|
6
|
-
import { D as DivRect, M as MDocument, h as ScoreEventListener,
|
|
6
|
+
import { D as DivRect, M as MDocument, h as ScoreEventListener, U as MRenderer, V as MPlaybackButtons } from '../interface-DkUnsAjj.mjs';
|
|
7
7
|
import '../tempo-TjQKn46X.mjs';
|
|
8
8
|
import '@tspro/ts-utils-lib';
|
|
9
9
|
|
package/dist/react-ui/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { c as Scale, S as ScaleType } from '../scale-B_2MZaT9.js';
|
|
4
4
|
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-B5ZtlHc8.js';
|
|
5
5
|
import { H as Handedness } from '../guitar-BIFwFT31.js';
|
|
6
|
-
import { D as DivRect, M as MDocument, h as ScoreEventListener,
|
|
6
|
+
import { D as DivRect, M as MDocument, h as ScoreEventListener, U as MRenderer, V as MPlaybackButtons } from '../interface-1TQHxSpb.js';
|
|
7
7
|
import '../tempo-DoJd-UYT.js';
|
|
8
8
|
import '@tspro/ts-utils-lib';
|
|
9
9
|
|
package/dist/react-ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v3.0.
|
|
1
|
+
/* WebMusicScore v3.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist/react-ui/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* WebMusicScore v3.0.
|
|
1
|
+
/* WebMusicScore v3.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
import {
|
|
3
3
|
__publicField
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-4AS76G4O.mjs";
|
|
5
5
|
|
|
6
6
|
// src/react-ui/circle-of-fifths.tsx
|
|
7
7
|
import * as React from "react";
|
package/dist/score/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StaffPreset, a as ScoreConfiguration,
|
|
2
|
-
export {
|
|
1
|
+
import { S as StaffPreset, a as ScoreConfiguration, M as MDocument, N as NoteOptions, R as RestOptions, F as Fermata, b as Navigation, C as Connective, T as TieType, c as NoteAnchor, L as Label, A as Annotation } from '../interface-DkUnsAjj.mjs';
|
|
2
|
+
export { a2 as Arpeggio, W as Clef, a3 as ConnectiveSpan, D as DivRect, j as MAccidental, l as MArpeggio, u as MBarLineLeft, t as MBarLineRight, m as MBeamGroup, k as MConnective, o as MEnding, P as MExtensionLine, p as MFermata, q as MHeader, r as MImage, s as MMeasure, w as MNoteGroup, V as MPlaybackButtons, Q as MPlayer, U as MRenderer, z as MRest, E as MRhythmColumn, G as MScoreRow, J as MSignature, K as MSpecialText, H as MStaff, n as MStaffBeamGroup, x as MStaffNoteGroup, B as MStaffRest, v as MStaffTabBarLine, I as MTab, y as MTabNoteGroup, O as MText, i as MusicInterface, a4 as PlayState, a5 as PlayStateChangeListener, e as ScoreEvent, h as ScoreEventListener, d as ScoreEventType, g as ScoreObjectEvent, f as ScoreStaffPosEvent, X as StaffConfig, a1 as Stem, $ as StringNumber, Y as TabConfig, Z as VoiceId, a0 as getStringNumbers, _ as getVoiceIds } from '../interface-DkUnsAjj.mjs';
|
|
3
3
|
import { N as Note } from '../note-B5ZtlHc8.mjs';
|
|
4
4
|
import { S as ScaleType, c as Scale } from '../scale-C-YS5iVG.mjs';
|
|
5
5
|
import { K as KeySignature, a as TimeSignature, T as TimeSignatureString, N as NoteLength } from '../tempo-TjQKn46X.mjs';
|
|
@@ -10,7 +10,7 @@ declare class DocumentBuilder {
|
|
|
10
10
|
constructor();
|
|
11
11
|
setScoreConfiguration(staffPreset: StaffPreset): DocumentBuilder;
|
|
12
12
|
setScoreConfiguration(config: ScoreConfiguration): DocumentBuilder;
|
|
13
|
-
getMeasure
|
|
13
|
+
private getMeasure;
|
|
14
14
|
getDocument(): MDocument;
|
|
15
15
|
setHeader(title?: string, composer?: string, arranger?: string): DocumentBuilder;
|
|
16
16
|
setMeasuresPerRow(measuresPerRow: number): DocumentBuilder;
|
package/dist/score/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StaffPreset, a as ScoreConfiguration,
|
|
2
|
-
export {
|
|
1
|
+
import { S as StaffPreset, a as ScoreConfiguration, M as MDocument, N as NoteOptions, R as RestOptions, F as Fermata, b as Navigation, C as Connective, T as TieType, c as NoteAnchor, L as Label, A as Annotation } from '../interface-1TQHxSpb.js';
|
|
2
|
+
export { a2 as Arpeggio, W as Clef, a3 as ConnectiveSpan, D as DivRect, j as MAccidental, l as MArpeggio, u as MBarLineLeft, t as MBarLineRight, m as MBeamGroup, k as MConnective, o as MEnding, P as MExtensionLine, p as MFermata, q as MHeader, r as MImage, s as MMeasure, w as MNoteGroup, V as MPlaybackButtons, Q as MPlayer, U as MRenderer, z as MRest, E as MRhythmColumn, G as MScoreRow, J as MSignature, K as MSpecialText, H as MStaff, n as MStaffBeamGroup, x as MStaffNoteGroup, B as MStaffRest, v as MStaffTabBarLine, I as MTab, y as MTabNoteGroup, O as MText, i as MusicInterface, a4 as PlayState, a5 as PlayStateChangeListener, e as ScoreEvent, h as ScoreEventListener, d as ScoreEventType, g as ScoreObjectEvent, f as ScoreStaffPosEvent, X as StaffConfig, a1 as Stem, $ as StringNumber, Y as TabConfig, Z as VoiceId, a0 as getStringNumbers, _ as getVoiceIds } from '../interface-1TQHxSpb.js';
|
|
3
3
|
import { N as Note } from '../note-B5ZtlHc8.js';
|
|
4
4
|
import { S as ScaleType, c as Scale } from '../scale-B_2MZaT9.js';
|
|
5
5
|
import { K as KeySignature, a as TimeSignature, T as TimeSignatureString, N as NoteLength } from '../tempo-DoJd-UYT.js';
|
|
@@ -10,7 +10,7 @@ declare class DocumentBuilder {
|
|
|
10
10
|
constructor();
|
|
11
11
|
setScoreConfiguration(staffPreset: StaffPreset): DocumentBuilder;
|
|
12
12
|
setScoreConfiguration(config: ScoreConfiguration): DocumentBuilder;
|
|
13
|
-
getMeasure
|
|
13
|
+
private getMeasure;
|
|
14
14
|
getDocument(): MDocument;
|
|
15
15
|
setHeader(title?: string, composer?: string, arranger?: string): DocumentBuilder;
|
|
16
16
|
setMeasuresPerRow(measuresPerRow: number): DocumentBuilder;
|
package/dist/score/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v3.0.
|
|
1
|
+
/* WebMusicScore v3.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1790,14 +1790,16 @@ var Audio = __toESM(require("@tspro/web-music-score/audio"));
|
|
|
1790
1790
|
var import_theory7 = require("@tspro/web-music-score/theory");
|
|
1791
1791
|
|
|
1792
1792
|
// src/score/engine/obj-arpeggio.ts
|
|
1793
|
-
var
|
|
1794
|
-
constructor(col, arpeggioDir) {
|
|
1793
|
+
var ObjArpeggio = class extends MusicObject {
|
|
1794
|
+
constructor(col, line, arpeggioDir) {
|
|
1795
1795
|
super(col);
|
|
1796
1796
|
this.col = col;
|
|
1797
|
+
this.line = line;
|
|
1797
1798
|
this.arpeggioDir = arpeggioDir;
|
|
1798
1799
|
__publicField(this, "topArrowHeight", 0);
|
|
1799
1800
|
__publicField(this, "bottomArrowHeight", 0);
|
|
1800
1801
|
__publicField(this, "cycleHeight", 0);
|
|
1802
|
+
__publicField(this, "numCycles", 0);
|
|
1801
1803
|
__publicField(this, "color", "black");
|
|
1802
1804
|
__publicField(this, "mi");
|
|
1803
1805
|
this.mi = new MArpeggio(this);
|
|
@@ -1812,10 +1814,13 @@ var _ObjArpeggio = class _ObjArpeggio extends MusicObject {
|
|
|
1812
1814
|
let { unitSize } = renderer;
|
|
1813
1815
|
this.topArrowHeight = this.arpeggioDir === 0 /* Up */ ? unitSize : 0;
|
|
1814
1816
|
this.bottomArrowHeight = this.arpeggioDir === 1 /* Down */ ? unitSize : 0;
|
|
1817
|
+
let top = this.line instanceof ObjStaff ? this.line.getTopLineY() : this.line.getTopStringY();
|
|
1818
|
+
let bottom = this.line instanceof ObjStaff ? this.line.getBottomLineY() : this.line.getBottomStringY();
|
|
1815
1819
|
this.cycleHeight = unitSize * 2;
|
|
1820
|
+
this.numCycles = Math.ceil((bottom - top) / this.cycleHeight) + 2;
|
|
1816
1821
|
let width = unitSize * 2;
|
|
1817
|
-
let height =
|
|
1818
|
-
this.rect = new DivRect(-width / 2, width / 2, -height / 2, height / 2);
|
|
1822
|
+
let height = this.numCycles * this.cycleHeight;
|
|
1823
|
+
this.rect = new DivRect(-width / 2, width / 2, -height / 2 - this.topArrowHeight, height / 2 + this.bottomArrowHeight);
|
|
1819
1824
|
}
|
|
1820
1825
|
offset(dx, dy) {
|
|
1821
1826
|
this.rect.offsetInPlace(dx, dy);
|
|
@@ -1825,14 +1830,13 @@ var _ObjArpeggio = class _ObjArpeggio extends MusicObject {
|
|
|
1825
1830
|
if (!ctx) {
|
|
1826
1831
|
return;
|
|
1827
1832
|
}
|
|
1828
|
-
let { lineWidth
|
|
1833
|
+
let { lineWidth } = renderer;
|
|
1829
1834
|
let { rect, topArrowHeight, bottomArrowHeight } = this;
|
|
1830
1835
|
renderer.drawDebugRect(this.rect);
|
|
1831
1836
|
ctx.strokeStyle = ctx.fillStyle = this.color;
|
|
1832
1837
|
ctx.lineWidth = lineWidth * 2;
|
|
1833
1838
|
ctx.beginPath();
|
|
1834
|
-
for (let i = 0; i <
|
|
1835
|
-
let y = rect.top + topArrowHeight + i * this.cycleHeight;
|
|
1839
|
+
for (let i = 0, y = rect.top + topArrowHeight; i < this.numCycles; i++, y += this.cycleHeight) {
|
|
1836
1840
|
ctx.moveTo(rect.centerX, y);
|
|
1837
1841
|
ctx.quadraticCurveTo(rect.left, y + this.cycleHeight / 4, rect.centerX, y + this.cycleHeight / 2);
|
|
1838
1842
|
ctx.quadraticCurveTo(rect.right, y + this.cycleHeight * 3 / 4, rect.centerX, y + this.cycleHeight);
|
|
@@ -1841,21 +1845,19 @@ var _ObjArpeggio = class _ObjArpeggio extends MusicObject {
|
|
|
1841
1845
|
if (topArrowHeight > 0) {
|
|
1842
1846
|
ctx.beginPath();
|
|
1843
1847
|
ctx.moveTo(rect.centerX, rect.top);
|
|
1844
|
-
ctx.lineTo(rect.right, rect.top +
|
|
1845
|
-
ctx.lineTo(rect.left, rect.top +
|
|
1848
|
+
ctx.lineTo(rect.right, rect.top + topArrowHeight);
|
|
1849
|
+
ctx.lineTo(rect.left, rect.top + topArrowHeight);
|
|
1846
1850
|
ctx.fill();
|
|
1847
1851
|
}
|
|
1848
1852
|
if (bottomArrowHeight > 0) {
|
|
1849
1853
|
ctx.beginPath();
|
|
1850
1854
|
ctx.moveTo(rect.centerX, rect.bottom);
|
|
1851
|
-
ctx.lineTo(rect.left, rect.bottom -
|
|
1852
|
-
ctx.lineTo(rect.right, rect.bottom -
|
|
1855
|
+
ctx.lineTo(rect.left, rect.bottom - bottomArrowHeight);
|
|
1856
|
+
ctx.lineTo(rect.right, rect.bottom - bottomArrowHeight);
|
|
1853
1857
|
ctx.fill();
|
|
1854
1858
|
}
|
|
1855
1859
|
}
|
|
1856
1860
|
};
|
|
1857
|
-
__publicField(_ObjArpeggio, "NumCycles", 5);
|
|
1858
|
-
var ObjArpeggio = _ObjArpeggio;
|
|
1859
1861
|
|
|
1860
1862
|
// src/score/engine/obj-rest.ts
|
|
1861
1863
|
var import_theory4 = require("@tspro/web-music-score/theory");
|
|
@@ -3510,12 +3512,12 @@ var ObjRhythmColumn = class extends MusicObject {
|
|
|
3510
3512
|
});
|
|
3511
3513
|
if (this.arpeggioDir !== void 0) {
|
|
3512
3514
|
let arpeggioWidth = 0;
|
|
3513
|
-
this.arpeggios = row.
|
|
3514
|
-
let arpeggio = new ObjArpeggio(this, this.getArpeggioDir());
|
|
3515
|
+
this.arpeggios = row.getNotationLines().map((line) => {
|
|
3516
|
+
let arpeggio = new ObjArpeggio(this, line, this.getArpeggioDir());
|
|
3515
3517
|
arpeggio.layout(renderer);
|
|
3516
|
-
arpeggio.offset(-leftw - arpeggio.getRect().right,
|
|
3518
|
+
arpeggio.offset(-leftw - arpeggio.getRect().right, line.getRect().centerY - arpeggio.getRect().centerY);
|
|
3517
3519
|
arpeggioWidth = Math.max(arpeggioWidth, arpeggio.getRect().width);
|
|
3518
|
-
|
|
3520
|
+
line.addObject(arpeggio);
|
|
3519
3521
|
return arpeggio;
|
|
3520
3522
|
});
|
|
3521
3523
|
leftw += arpeggioWidth;
|
package/dist/score/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* WebMusicScore v3.0.
|
|
1
|
+
/* WebMusicScore v3.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
import {
|
|
3
3
|
__publicField
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-4AS76G4O.mjs";
|
|
5
5
|
|
|
6
6
|
// src/score/pub/div-rect.ts
|
|
7
7
|
import { Utils } from "@tspro/ts-utils-lib";
|
|
@@ -1707,14 +1707,16 @@ import * as Audio from "@tspro/web-music-score/audio";
|
|
|
1707
1707
|
import { Note as Note6, NoteLength as NoteLength4 } from "@tspro/web-music-score/theory";
|
|
1708
1708
|
|
|
1709
1709
|
// src/score/engine/obj-arpeggio.ts
|
|
1710
|
-
var
|
|
1711
|
-
constructor(col, arpeggioDir) {
|
|
1710
|
+
var ObjArpeggio = class extends MusicObject {
|
|
1711
|
+
constructor(col, line, arpeggioDir) {
|
|
1712
1712
|
super(col);
|
|
1713
1713
|
this.col = col;
|
|
1714
|
+
this.line = line;
|
|
1714
1715
|
this.arpeggioDir = arpeggioDir;
|
|
1715
1716
|
__publicField(this, "topArrowHeight", 0);
|
|
1716
1717
|
__publicField(this, "bottomArrowHeight", 0);
|
|
1717
1718
|
__publicField(this, "cycleHeight", 0);
|
|
1719
|
+
__publicField(this, "numCycles", 0);
|
|
1718
1720
|
__publicField(this, "color", "black");
|
|
1719
1721
|
__publicField(this, "mi");
|
|
1720
1722
|
this.mi = new MArpeggio(this);
|
|
@@ -1729,10 +1731,13 @@ var _ObjArpeggio = class _ObjArpeggio extends MusicObject {
|
|
|
1729
1731
|
let { unitSize } = renderer;
|
|
1730
1732
|
this.topArrowHeight = this.arpeggioDir === 0 /* Up */ ? unitSize : 0;
|
|
1731
1733
|
this.bottomArrowHeight = this.arpeggioDir === 1 /* Down */ ? unitSize : 0;
|
|
1734
|
+
let top = this.line instanceof ObjStaff ? this.line.getTopLineY() : this.line.getTopStringY();
|
|
1735
|
+
let bottom = this.line instanceof ObjStaff ? this.line.getBottomLineY() : this.line.getBottomStringY();
|
|
1732
1736
|
this.cycleHeight = unitSize * 2;
|
|
1737
|
+
this.numCycles = Math.ceil((bottom - top) / this.cycleHeight) + 2;
|
|
1733
1738
|
let width = unitSize * 2;
|
|
1734
|
-
let height =
|
|
1735
|
-
this.rect = new DivRect(-width / 2, width / 2, -height / 2, height / 2);
|
|
1739
|
+
let height = this.numCycles * this.cycleHeight;
|
|
1740
|
+
this.rect = new DivRect(-width / 2, width / 2, -height / 2 - this.topArrowHeight, height / 2 + this.bottomArrowHeight);
|
|
1736
1741
|
}
|
|
1737
1742
|
offset(dx, dy) {
|
|
1738
1743
|
this.rect.offsetInPlace(dx, dy);
|
|
@@ -1742,14 +1747,13 @@ var _ObjArpeggio = class _ObjArpeggio extends MusicObject {
|
|
|
1742
1747
|
if (!ctx) {
|
|
1743
1748
|
return;
|
|
1744
1749
|
}
|
|
1745
|
-
let { lineWidth
|
|
1750
|
+
let { lineWidth } = renderer;
|
|
1746
1751
|
let { rect, topArrowHeight, bottomArrowHeight } = this;
|
|
1747
1752
|
renderer.drawDebugRect(this.rect);
|
|
1748
1753
|
ctx.strokeStyle = ctx.fillStyle = this.color;
|
|
1749
1754
|
ctx.lineWidth = lineWidth * 2;
|
|
1750
1755
|
ctx.beginPath();
|
|
1751
|
-
for (let i = 0; i <
|
|
1752
|
-
let y = rect.top + topArrowHeight + i * this.cycleHeight;
|
|
1756
|
+
for (let i = 0, y = rect.top + topArrowHeight; i < this.numCycles; i++, y += this.cycleHeight) {
|
|
1753
1757
|
ctx.moveTo(rect.centerX, y);
|
|
1754
1758
|
ctx.quadraticCurveTo(rect.left, y + this.cycleHeight / 4, rect.centerX, y + this.cycleHeight / 2);
|
|
1755
1759
|
ctx.quadraticCurveTo(rect.right, y + this.cycleHeight * 3 / 4, rect.centerX, y + this.cycleHeight);
|
|
@@ -1758,21 +1762,19 @@ var _ObjArpeggio = class _ObjArpeggio extends MusicObject {
|
|
|
1758
1762
|
if (topArrowHeight > 0) {
|
|
1759
1763
|
ctx.beginPath();
|
|
1760
1764
|
ctx.moveTo(rect.centerX, rect.top);
|
|
1761
|
-
ctx.lineTo(rect.right, rect.top +
|
|
1762
|
-
ctx.lineTo(rect.left, rect.top +
|
|
1765
|
+
ctx.lineTo(rect.right, rect.top + topArrowHeight);
|
|
1766
|
+
ctx.lineTo(rect.left, rect.top + topArrowHeight);
|
|
1763
1767
|
ctx.fill();
|
|
1764
1768
|
}
|
|
1765
1769
|
if (bottomArrowHeight > 0) {
|
|
1766
1770
|
ctx.beginPath();
|
|
1767
1771
|
ctx.moveTo(rect.centerX, rect.bottom);
|
|
1768
|
-
ctx.lineTo(rect.left, rect.bottom -
|
|
1769
|
-
ctx.lineTo(rect.right, rect.bottom -
|
|
1772
|
+
ctx.lineTo(rect.left, rect.bottom - bottomArrowHeight);
|
|
1773
|
+
ctx.lineTo(rect.right, rect.bottom - bottomArrowHeight);
|
|
1770
1774
|
ctx.fill();
|
|
1771
1775
|
}
|
|
1772
1776
|
}
|
|
1773
1777
|
};
|
|
1774
|
-
__publicField(_ObjArpeggio, "NumCycles", 5);
|
|
1775
|
-
var ObjArpeggio = _ObjArpeggio;
|
|
1776
1778
|
|
|
1777
1779
|
// src/score/engine/obj-rest.ts
|
|
1778
1780
|
import { Note as Note4, NoteLength, RhythmProps } from "@tspro/web-music-score/theory";
|
|
@@ -3427,12 +3429,12 @@ var ObjRhythmColumn = class extends MusicObject {
|
|
|
3427
3429
|
});
|
|
3428
3430
|
if (this.arpeggioDir !== void 0) {
|
|
3429
3431
|
let arpeggioWidth = 0;
|
|
3430
|
-
this.arpeggios = row.
|
|
3431
|
-
let arpeggio = new ObjArpeggio(this, this.getArpeggioDir());
|
|
3432
|
+
this.arpeggios = row.getNotationLines().map((line) => {
|
|
3433
|
+
let arpeggio = new ObjArpeggio(this, line, this.getArpeggioDir());
|
|
3432
3434
|
arpeggio.layout(renderer);
|
|
3433
|
-
arpeggio.offset(-leftw - arpeggio.getRect().right,
|
|
3435
|
+
arpeggio.offset(-leftw - arpeggio.getRect().right, line.getRect().centerY - arpeggio.getRect().centerY);
|
|
3434
3436
|
arpeggioWidth = Math.max(arpeggioWidth, arpeggio.getRect().width);
|
|
3435
|
-
|
|
3437
|
+
line.addObject(arpeggio);
|
|
3436
3438
|
return arpeggio;
|
|
3437
3439
|
});
|
|
3438
3440
|
leftw += arpeggioWidth;
|
package/dist/theory/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore v3.0.
|
|
1
|
+
/* WebMusicScore v3.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/theory/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* WebMusicScore v3.0.
|
|
1
|
+
/* WebMusicScore v3.0.1 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
import {
|
|
3
3
|
__publicField
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-4AS76G4O.mjs";
|
|
5
5
|
|
|
6
6
|
// src/theory/chord.ts
|
|
7
7
|
import { Utils as Utils6 } from "@tspro/ts-utils-lib";
|