@tspro/web-music-score 4.2.1 → 5.1.0
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 +26 -0
- package/README.md +63 -26
- package/dist/audio/index.d.mts +23 -27
- package/dist/audio/index.d.ts +23 -27
- package/dist/audio/index.js +63 -85
- package/dist/audio/index.mjs +53 -73
- package/dist/audio-cg/index.d.mts +18 -3
- package/dist/audio-cg/index.d.ts +18 -3
- package/dist/audio-cg/index.js +54 -51
- package/dist/audio-cg/index.mjs +49 -52
- package/dist/audio-synth/index.d.mts +15 -0
- package/dist/audio-synth/index.d.ts +15 -0
- package/dist/audio-synth/index.js +95 -0
- package/dist/audio-synth/index.mjs +58 -0
- package/dist/{chunk-64N22LCV.mjs → chunk-2EQHSQWO.mjs} +2 -2
- package/dist/{chunk-RQFFLRWF.mjs → chunk-QVYFIK3L.mjs} +5 -6
- package/dist/chunk-ROPTZBKD.mjs +11 -0
- package/dist/core/index.d.mts +2 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.mjs +4 -3
- package/dist/iife/audio-cg.global.js +220 -0
- package/dist/iife/index.global.js +11 -11
- package/dist/instrument-DYboobMW.d.mts +44 -0
- package/dist/instrument-DYboobMW.d.ts +44 -0
- package/dist/{music-objects-CI7IjsjE.d.ts → music-objects-CMdYZeC6.d.ts} +118 -36
- package/dist/{music-objects-3Hxlkxy6.d.mts → music-objects-DTDFSro0.d.mts} +118 -36
- 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 +52 -33
- package/dist/react-ui/index.d.ts +52 -33
- package/dist/react-ui/index.js +41 -32
- package/dist/react-ui/index.mjs +42 -33
- package/dist/score/index.d.mts +8 -8
- package/dist/score/index.d.ts +8 -8
- package/dist/score/index.js +1998 -1626
- package/dist/score/index.mjs +1584 -1211
- package/dist/theory/index.js +3 -4
- package/dist/theory/index.mjs +3 -3
- package/package.json +13 -3
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
|
|
1
|
+
/* WebMusicScore v5.1.0 | (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
|
|
2
|
-
import "../chunk-
|
|
1
|
+
/* WebMusicScore v5.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
|
+
import "../chunk-2EQHSQWO.mjs";
|
|
3
3
|
|
|
4
4
|
// src/pieces/frere-jacques.ts
|
|
5
5
|
import { DocumentBuilder } from "@tspro/web-music-score/score";
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { c as Scale, S as ScaleType } from '../scale-DQP3b9Zx.mjs';
|
|
4
4
|
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-eA2xPPiG.mjs';
|
|
5
5
|
import { H as Handedness } from '../guitar-DdexKdN6.mjs';
|
|
6
|
-
import { D as DivRect, M as MDocument, n as ScoreEventListener, p as MRenderer, q as MPlaybackButtons } from '../music-objects-
|
|
6
|
+
import { D as DivRect, M as MDocument, n as ScoreEventListener, p as MRenderer, q as MPlaybackButtons } from '../music-objects-DTDFSro0.mjs';
|
|
7
7
|
import '../tempo-dkctPkCS.mjs';
|
|
8
8
|
import '@tspro/ts-utils-lib';
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@ interface CircleOfFifthsProps {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Circle of fifths react component.
|
|
17
|
-
*
|
|
17
|
+
* ```ts
|
|
18
18
|
* // Using with React TSX/JSX
|
|
19
19
|
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
20
20
|
* import * as Theory from "@tspro/web-music-score/theory";
|
|
@@ -27,14 +27,14 @@ interface CircleOfFifthsProps {
|
|
|
27
27
|
* console.log("New scale is " + newScale.getScaleName());
|
|
28
28
|
* }
|
|
29
29
|
*
|
|
30
|
-
* return
|
|
31
|
-
*
|
|
30
|
+
* return <>
|
|
31
|
+
* <ScoreUI.CircleOfFifths
|
|
32
32
|
* style={{ position: "relative", padding: "0.5em" }}
|
|
33
33
|
* scale={curScale}
|
|
34
|
-
* onScaleChange={onChangeScale}
|
|
35
|
-
*
|
|
34
|
+
* onScaleChange={onChangeScale} />
|
|
35
|
+
* </>;
|
|
36
36
|
* }
|
|
37
|
-
*
|
|
37
|
+
* ```
|
|
38
38
|
*/
|
|
39
39
|
declare class CircleOfFifths extends React.Component<CircleOfFifthsProps, {}> {
|
|
40
40
|
constructor(props: CircleOfFifthsProps);
|
|
@@ -187,7 +187,7 @@ interface GuitarViewState {
|
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* Guitar (neck) view react component.
|
|
190
|
-
*
|
|
190
|
+
* ```ts
|
|
191
191
|
* // Using with React TSX/JSX
|
|
192
192
|
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
193
193
|
* import * as Theory from "@tspro/web-music-score/theory";
|
|
@@ -204,15 +204,15 @@ interface GuitarViewState {
|
|
|
204
204
|
* const onUpdateFretPosition: ScoreUI.UpdateFretPositionFunc = (fretPos) => { }
|
|
205
205
|
* const onClickFretPosition: ScoreUI.ClickFretPositionFunc = (fretPos) => { }
|
|
206
206
|
*
|
|
207
|
-
* return
|
|
208
|
-
*
|
|
207
|
+
* return <>
|
|
208
|
+
* <ScoreUI.GuitarView
|
|
209
209
|
* style={{ position: "relative", width: 640 }}
|
|
210
210
|
* guitarContext={guitarCtx}
|
|
211
211
|
* onUpdateFretPosition={onUpdateFretPosition}
|
|
212
|
-
* onClickFretPosition={onClickFretPosition}
|
|
213
|
-
*
|
|
212
|
+
* onClickFretPosition={onClickFretPosition} />
|
|
213
|
+
* </>;
|
|
214
214
|
* }
|
|
215
|
-
*
|
|
215
|
+
* ```
|
|
216
216
|
*/
|
|
217
217
|
declare class GuitarView extends React.Component<GuitarViewProps, GuitarViewState> {
|
|
218
218
|
state: GuitarViewState;
|
|
@@ -234,20 +234,23 @@ interface MusicScoreViewProps {
|
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
236
|
* Music score view react component.
|
|
237
|
-
*
|
|
237
|
+
* ```ts
|
|
238
238
|
* // Using with React TSX/JSX
|
|
239
|
-
* import * as Score from "@tspro/web-music-score/
|
|
240
|
-
* import * as
|
|
239
|
+
* import * as Score from "@tspro/web-music-score/score";
|
|
240
|
+
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
241
241
|
*
|
|
242
242
|
* // Render function of react component.
|
|
243
243
|
* render() {
|
|
244
|
-
*
|
|
244
|
+
* // Create document.
|
|
245
|
+
* const doc = new Score.DocumentBuilder()
|
|
246
|
+
* // Build document...
|
|
247
|
+
* .getDocument();
|
|
245
248
|
*
|
|
246
|
-
* return
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
+
* return <>
|
|
250
|
+
* <ScoreUI.MusicScoreView doc={doc} />
|
|
251
|
+
* </>;
|
|
249
252
|
* }
|
|
250
|
-
*
|
|
253
|
+
* ```
|
|
251
254
|
*/
|
|
252
255
|
declare class MusicScoreView extends React.Component<MusicScoreViewProps, {}> {
|
|
253
256
|
renderer: MRenderer;
|
|
@@ -256,6 +259,10 @@ declare class MusicScoreView extends React.Component<MusicScoreViewProps, {}> {
|
|
|
256
259
|
render(): react_jsx_runtime.JSX.Element;
|
|
257
260
|
}
|
|
258
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Playback buttons layout
|
|
264
|
+
* @deprecated - Use `PlaybackButtonsProps` properties `singlePlayStop`, `playStop` or `playPauseStop` instead.
|
|
265
|
+
*/
|
|
259
266
|
declare enum PlaybackButtonsLayout {
|
|
260
267
|
PlayStopSingle = 0,
|
|
261
268
|
PlayStop = 1,
|
|
@@ -263,7 +270,11 @@ declare enum PlaybackButtonsLayout {
|
|
|
263
270
|
}
|
|
264
271
|
interface PlaybackButtonsProps {
|
|
265
272
|
doc: MDocument;
|
|
273
|
+
/** @deprecated - Use `singlePlayStop`, `playStop` or `playPauseStop` properties instead. */
|
|
266
274
|
buttonLayout?: PlaybackButtonsLayout;
|
|
275
|
+
singlePlayStop?: boolean;
|
|
276
|
+
playStop?: boolean;
|
|
277
|
+
playPauseStop?: boolean;
|
|
267
278
|
playLabel?: string;
|
|
268
279
|
pauseLabel?: string;
|
|
269
280
|
stopLabel?: string;
|
|
@@ -273,23 +284,31 @@ interface PlaybackButtonsState {
|
|
|
273
284
|
}
|
|
274
285
|
/**
|
|
275
286
|
* Usage:
|
|
276
|
-
*
|
|
287
|
+
* ```ts
|
|
277
288
|
* // Using with React TSX/JSX
|
|
278
|
-
* import * as Score from "
|
|
279
|
-
* import * as
|
|
289
|
+
* import * as Score from "@tspro/web-music-score/score";
|
|
290
|
+
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
291
|
+
*
|
|
292
|
+
* // Create document.
|
|
293
|
+
* const doc = new Score.DocumentBuilder()
|
|
294
|
+
* // Build document...
|
|
295
|
+
* .getDocument();
|
|
296
|
+
*
|
|
297
|
+
* // Create default playback buttons (play, pause and stop buttons).
|
|
298
|
+
* <ScoreUI.PlaybackButtons doc={doc} />
|
|
280
299
|
*
|
|
281
|
-
* // Create
|
|
282
|
-
*
|
|
300
|
+
* // Create playback buttons with single play/stop button.
|
|
301
|
+
* <ScoreUI.PlaybackButtons doc={doc} singlePlayStop />
|
|
283
302
|
*
|
|
284
|
-
* // Create
|
|
285
|
-
*
|
|
303
|
+
* // Create playback buttons with play and stop buttons.
|
|
304
|
+
* <ScoreUI.PlaybackButtons doc={doc} playStop />
|
|
286
305
|
*
|
|
287
|
-
* // Create playback buttons with
|
|
288
|
-
*
|
|
306
|
+
* // Create playback buttons with play, pause and stop buttons.
|
|
307
|
+
* <ScoreUI.PlaybackButtons doc={doc} playPauseStop />
|
|
289
308
|
*
|
|
290
|
-
* //
|
|
291
|
-
*
|
|
292
|
-
*
|
|
309
|
+
* // You can also set custom play, pause and stop button labels.
|
|
310
|
+
* <ScoreUI.PlaybackButtons doc={doc} playLabel="⏵" pauseLabel="⏸" stopLabel="⏹" />
|
|
311
|
+
* ```
|
|
293
312
|
*/
|
|
294
313
|
declare class PlaybackButtons extends React.Component<PlaybackButtonsProps, PlaybackButtonsState> {
|
|
295
314
|
state: PlaybackButtonsState;
|
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-DGx3tJH4.js';
|
|
4
4
|
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-eA2xPPiG.js';
|
|
5
5
|
import { H as Handedness } from '../guitar-CaZJDA05.js';
|
|
6
|
-
import { D as DivRect, M as MDocument, n as ScoreEventListener, p as MRenderer, q as MPlaybackButtons } from '../music-objects-
|
|
6
|
+
import { D as DivRect, M as MDocument, n as ScoreEventListener, p as MRenderer, q as MPlaybackButtons } from '../music-objects-CMdYZeC6.js';
|
|
7
7
|
import '../tempo-GrstpD9G.js';
|
|
8
8
|
import '@tspro/ts-utils-lib';
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@ interface CircleOfFifthsProps {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Circle of fifths react component.
|
|
17
|
-
*
|
|
17
|
+
* ```ts
|
|
18
18
|
* // Using with React TSX/JSX
|
|
19
19
|
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
20
20
|
* import * as Theory from "@tspro/web-music-score/theory";
|
|
@@ -27,14 +27,14 @@ interface CircleOfFifthsProps {
|
|
|
27
27
|
* console.log("New scale is " + newScale.getScaleName());
|
|
28
28
|
* }
|
|
29
29
|
*
|
|
30
|
-
* return
|
|
31
|
-
*
|
|
30
|
+
* return <>
|
|
31
|
+
* <ScoreUI.CircleOfFifths
|
|
32
32
|
* style={{ position: "relative", padding: "0.5em" }}
|
|
33
33
|
* scale={curScale}
|
|
34
|
-
* onScaleChange={onChangeScale}
|
|
35
|
-
*
|
|
34
|
+
* onScaleChange={onChangeScale} />
|
|
35
|
+
* </>;
|
|
36
36
|
* }
|
|
37
|
-
*
|
|
37
|
+
* ```
|
|
38
38
|
*/
|
|
39
39
|
declare class CircleOfFifths extends React.Component<CircleOfFifthsProps, {}> {
|
|
40
40
|
constructor(props: CircleOfFifthsProps);
|
|
@@ -187,7 +187,7 @@ interface GuitarViewState {
|
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* Guitar (neck) view react component.
|
|
190
|
-
*
|
|
190
|
+
* ```ts
|
|
191
191
|
* // Using with React TSX/JSX
|
|
192
192
|
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
193
193
|
* import * as Theory from "@tspro/web-music-score/theory";
|
|
@@ -204,15 +204,15 @@ interface GuitarViewState {
|
|
|
204
204
|
* const onUpdateFretPosition: ScoreUI.UpdateFretPositionFunc = (fretPos) => { }
|
|
205
205
|
* const onClickFretPosition: ScoreUI.ClickFretPositionFunc = (fretPos) => { }
|
|
206
206
|
*
|
|
207
|
-
* return
|
|
208
|
-
*
|
|
207
|
+
* return <>
|
|
208
|
+
* <ScoreUI.GuitarView
|
|
209
209
|
* style={{ position: "relative", width: 640 }}
|
|
210
210
|
* guitarContext={guitarCtx}
|
|
211
211
|
* onUpdateFretPosition={onUpdateFretPosition}
|
|
212
|
-
* onClickFretPosition={onClickFretPosition}
|
|
213
|
-
*
|
|
212
|
+
* onClickFretPosition={onClickFretPosition} />
|
|
213
|
+
* </>;
|
|
214
214
|
* }
|
|
215
|
-
*
|
|
215
|
+
* ```
|
|
216
216
|
*/
|
|
217
217
|
declare class GuitarView extends React.Component<GuitarViewProps, GuitarViewState> {
|
|
218
218
|
state: GuitarViewState;
|
|
@@ -234,20 +234,23 @@ interface MusicScoreViewProps {
|
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
236
|
* Music score view react component.
|
|
237
|
-
*
|
|
237
|
+
* ```ts
|
|
238
238
|
* // Using with React TSX/JSX
|
|
239
|
-
* import * as Score from "@tspro/web-music-score/
|
|
240
|
-
* import * as
|
|
239
|
+
* import * as Score from "@tspro/web-music-score/score";
|
|
240
|
+
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
241
241
|
*
|
|
242
242
|
* // Render function of react component.
|
|
243
243
|
* render() {
|
|
244
|
-
*
|
|
244
|
+
* // Create document.
|
|
245
|
+
* const doc = new Score.DocumentBuilder()
|
|
246
|
+
* // Build document...
|
|
247
|
+
* .getDocument();
|
|
245
248
|
*
|
|
246
|
-
* return
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
+
* return <>
|
|
250
|
+
* <ScoreUI.MusicScoreView doc={doc} />
|
|
251
|
+
* </>;
|
|
249
252
|
* }
|
|
250
|
-
*
|
|
253
|
+
* ```
|
|
251
254
|
*/
|
|
252
255
|
declare class MusicScoreView extends React.Component<MusicScoreViewProps, {}> {
|
|
253
256
|
renderer: MRenderer;
|
|
@@ -256,6 +259,10 @@ declare class MusicScoreView extends React.Component<MusicScoreViewProps, {}> {
|
|
|
256
259
|
render(): react_jsx_runtime.JSX.Element;
|
|
257
260
|
}
|
|
258
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Playback buttons layout
|
|
264
|
+
* @deprecated - Use `PlaybackButtonsProps` properties `singlePlayStop`, `playStop` or `playPauseStop` instead.
|
|
265
|
+
*/
|
|
259
266
|
declare enum PlaybackButtonsLayout {
|
|
260
267
|
PlayStopSingle = 0,
|
|
261
268
|
PlayStop = 1,
|
|
@@ -263,7 +270,11 @@ declare enum PlaybackButtonsLayout {
|
|
|
263
270
|
}
|
|
264
271
|
interface PlaybackButtonsProps {
|
|
265
272
|
doc: MDocument;
|
|
273
|
+
/** @deprecated - Use `singlePlayStop`, `playStop` or `playPauseStop` properties instead. */
|
|
266
274
|
buttonLayout?: PlaybackButtonsLayout;
|
|
275
|
+
singlePlayStop?: boolean;
|
|
276
|
+
playStop?: boolean;
|
|
277
|
+
playPauseStop?: boolean;
|
|
267
278
|
playLabel?: string;
|
|
268
279
|
pauseLabel?: string;
|
|
269
280
|
stopLabel?: string;
|
|
@@ -273,23 +284,31 @@ interface PlaybackButtonsState {
|
|
|
273
284
|
}
|
|
274
285
|
/**
|
|
275
286
|
* Usage:
|
|
276
|
-
*
|
|
287
|
+
* ```ts
|
|
277
288
|
* // Using with React TSX/JSX
|
|
278
|
-
* import * as Score from "
|
|
279
|
-
* import * as
|
|
289
|
+
* import * as Score from "@tspro/web-music-score/score";
|
|
290
|
+
* import * as ScoreUI from "@tspro/web-music-score/react-ui";
|
|
291
|
+
*
|
|
292
|
+
* // Create document.
|
|
293
|
+
* const doc = new Score.DocumentBuilder()
|
|
294
|
+
* // Build document...
|
|
295
|
+
* .getDocument();
|
|
296
|
+
*
|
|
297
|
+
* // Create default playback buttons (play, pause and stop buttons).
|
|
298
|
+
* <ScoreUI.PlaybackButtons doc={doc} />
|
|
280
299
|
*
|
|
281
|
-
* // Create
|
|
282
|
-
*
|
|
300
|
+
* // Create playback buttons with single play/stop button.
|
|
301
|
+
* <ScoreUI.PlaybackButtons doc={doc} singlePlayStop />
|
|
283
302
|
*
|
|
284
|
-
* // Create
|
|
285
|
-
*
|
|
303
|
+
* // Create playback buttons with play and stop buttons.
|
|
304
|
+
* <ScoreUI.PlaybackButtons doc={doc} playStop />
|
|
286
305
|
*
|
|
287
|
-
* // Create playback buttons with
|
|
288
|
-
*
|
|
306
|
+
* // Create playback buttons with play, pause and stop buttons.
|
|
307
|
+
* <ScoreUI.PlaybackButtons doc={doc} playPauseStop />
|
|
289
308
|
*
|
|
290
|
-
* //
|
|
291
|
-
*
|
|
292
|
-
*
|
|
309
|
+
* // You can also set custom play, pause and stop button labels.
|
|
310
|
+
* <ScoreUI.PlaybackButtons doc={doc} playLabel="⏵" pauseLabel="⏸" stopLabel="⏹" />
|
|
311
|
+
* ```
|
|
293
312
|
*/
|
|
294
313
|
declare class PlaybackButtons extends React.Component<PlaybackButtonsProps, PlaybackButtonsState> {
|
|
295
314
|
state: PlaybackButtonsState;
|
package/dist/react-ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore
|
|
1
|
+
/* WebMusicScore v5.1.0 | (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;
|
|
@@ -621,7 +621,7 @@ var MusicScoreView = class extends React3.Component {
|
|
|
621
621
|
this.renderer.draw();
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("canvas", { style: { position: "relative" }, ref: setCanvas, children: "
|
|
624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("canvas", { style: { position: "relative" }, ref: setCanvas, children: "Your browser does not support the HTML canvas tag." });
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
627
|
|
|
@@ -649,37 +649,46 @@ var PlaybackButtons = class extends React4.Component {
|
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
render() {
|
|
652
|
-
let { buttonLayout, playLabel, pauseLabel, stopLabel } = this.props;
|
|
652
|
+
let { buttonLayout, singlePlayStop, playStop, playPauseStop, playLabel, pauseLabel, stopLabel } = this.props;
|
|
653
653
|
let { controller } = this.state;
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
if (buttonLayout
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
654
|
+
playLabel != null ? playLabel : playLabel = "Play";
|
|
655
|
+
pauseLabel != null ? pauseLabel : pauseLabel = "Pause";
|
|
656
|
+
stopLabel != null ? stopLabel : stopLabel = "Stop";
|
|
657
|
+
if (singlePlayStop) buttonLayout = 0 /* PlayStopSingle */;
|
|
658
|
+
if (playStop) buttonLayout = 1 /* PlayStop */;
|
|
659
|
+
if (playPauseStop) buttonLayout = 2 /* PlayPauseStop */;
|
|
660
|
+
buttonLayout != null ? buttonLayout : buttonLayout = 2 /* PlayPauseStop */;
|
|
661
|
+
switch (buttonLayout) {
|
|
662
|
+
case 0 /* PlayStopSingle */:
|
|
663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
664
|
+
if (btn) controller.setPlayStopButton(btn, playLabel, stopLabel);
|
|
665
|
+
} });
|
|
666
|
+
case 1 /* PlayStop */:
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "btn-group", children: [
|
|
668
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
669
|
+
if (btn) controller.setPlayButton(btn, playLabel);
|
|
670
|
+
} }),
|
|
671
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
672
|
+
if (btn) controller.setStopButton(btn, stopLabel);
|
|
673
|
+
} })
|
|
674
|
+
] });
|
|
675
|
+
case 2 /* PlayPauseStop */:
|
|
676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "btn-group", children: [
|
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
678
|
+
if (btn) controller.setPlayButton(btn, playLabel);
|
|
679
|
+
} }),
|
|
680
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
681
|
+
if (btn) controller.setPauseButton(btn, pauseLabel);
|
|
682
|
+
} }),
|
|
683
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "btn btn-primary", ref: (btn) => {
|
|
684
|
+
if (btn) controller.setStopButton(btn, stopLabel);
|
|
685
|
+
} })
|
|
686
|
+
] });
|
|
687
|
+
default:
|
|
688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
689
|
+
"Invalid button layout: ",
|
|
690
|
+
buttonLayout
|
|
691
|
+
] });
|
|
683
692
|
}
|
|
684
693
|
}
|
|
685
694
|
};
|
package/dist/react-ui/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* WebMusicScore
|
|
1
|
+
/* WebMusicScore v5.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
import {
|
|
3
3
|
__publicField
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-2EQHSQWO.mjs";
|
|
5
5
|
|
|
6
6
|
// src/react-ui/circle-of-fifths.tsx
|
|
7
7
|
import * as React from "react";
|
|
@@ -580,7 +580,7 @@ var MusicScoreView = class extends React3.Component {
|
|
|
580
580
|
this.renderer.draw();
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
|
-
return /* @__PURE__ */ jsx3("canvas", { style: { position: "relative" }, ref: setCanvas, children: "
|
|
583
|
+
return /* @__PURE__ */ jsx3("canvas", { style: { position: "relative" }, ref: setCanvas, children: "Your browser does not support the HTML canvas tag." });
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
586
|
|
|
@@ -608,37 +608,46 @@ var PlaybackButtons = class extends React4.Component {
|
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
render() {
|
|
611
|
-
let { buttonLayout, playLabel, pauseLabel, stopLabel } = this.props;
|
|
611
|
+
let { buttonLayout, singlePlayStop, playStop, playPauseStop, playLabel, pauseLabel, stopLabel } = this.props;
|
|
612
612
|
let { controller } = this.state;
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
if (buttonLayout
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
613
|
+
playLabel != null ? playLabel : playLabel = "Play";
|
|
614
|
+
pauseLabel != null ? pauseLabel : pauseLabel = "Pause";
|
|
615
|
+
stopLabel != null ? stopLabel : stopLabel = "Stop";
|
|
616
|
+
if (singlePlayStop) buttonLayout = 0 /* PlayStopSingle */;
|
|
617
|
+
if (playStop) buttonLayout = 1 /* PlayStop */;
|
|
618
|
+
if (playPauseStop) buttonLayout = 2 /* PlayPauseStop */;
|
|
619
|
+
buttonLayout != null ? buttonLayout : buttonLayout = 2 /* PlayPauseStop */;
|
|
620
|
+
switch (buttonLayout) {
|
|
621
|
+
case 0 /* PlayStopSingle */:
|
|
622
|
+
return /* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
623
|
+
if (btn) controller.setPlayStopButton(btn, playLabel, stopLabel);
|
|
624
|
+
} });
|
|
625
|
+
case 1 /* PlayStop */:
|
|
626
|
+
return /* @__PURE__ */ jsxs("div", { className: "btn-group", children: [
|
|
627
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
628
|
+
if (btn) controller.setPlayButton(btn, playLabel);
|
|
629
|
+
} }),
|
|
630
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
631
|
+
if (btn) controller.setStopButton(btn, stopLabel);
|
|
632
|
+
} })
|
|
633
|
+
] });
|
|
634
|
+
case 2 /* PlayPauseStop */:
|
|
635
|
+
return /* @__PURE__ */ jsxs("div", { className: "btn-group", children: [
|
|
636
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
637
|
+
if (btn) controller.setPlayButton(btn, playLabel);
|
|
638
|
+
} }),
|
|
639
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
640
|
+
if (btn) controller.setPauseButton(btn, pauseLabel);
|
|
641
|
+
} }),
|
|
642
|
+
/* @__PURE__ */ jsx4("button", { className: "btn btn-primary", ref: (btn) => {
|
|
643
|
+
if (btn) controller.setStopButton(btn, stopLabel);
|
|
644
|
+
} })
|
|
645
|
+
] });
|
|
646
|
+
default:
|
|
647
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
648
|
+
"Invalid button layout: ",
|
|
649
|
+
buttonLayout
|
|
650
|
+
] });
|
|
642
651
|
}
|
|
643
652
|
}
|
|
644
653
|
};
|
package/dist/score/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, b as VerseNumber, L as LyricsOptions, c as StaffTabOrGroups, F as Fermata, d as Navigation, A as AnnotationText, e as Annotation, f as Label, C as Connective, g as TieType, h as NoteAnchor, i as VerticalPosition } from '../music-objects-
|
|
2
|
-
export {
|
|
1
|
+
import { N as NoteOptions, R as RestOptions, S as StaffPreset, a as ScoreConfiguration, M as MDocument, V as VoiceId, T as TupletOptions, b as VerseNumber, L as LyricsOptions, c as StaffTabOrGroups, F as Fermata, d as Navigation, A as AnnotationText, e as Annotation, f as Label, C as Connective, g as TieType, h as NoteAnchor, i as VerticalPosition } from '../music-objects-DTDFSro0.mjs';
|
|
2
|
+
export { ad as Arpeggio, a5 as BaseConfig, a4 as Clef, D as DivRect, ah as DynamicsAnnotation, af as LyricsAlign, ag as LyricsHyphen, s as MAccidental, u as MArpeggio, H as MBarLineLeft, G as MBarLineRight, v as MBeamGroup, t as MConnective, x as MEnding, a3 as MExtensionLine, y as MFermata, z as MHeader, B as MImage, a2 as MLyrics, E as MMeasure, J as MNoteGroup, q as MPlaybackButtons, o as MPlayer, p as MRenderer, P as MRest, U as MRhythmColumn, W as MScoreRow, a0 as MSpecialText, X as MStaff, w as MStaffBeamGroup, K as MStaffNoteGroup, Q as MStaffRest, Z as MStaffSignature, I as MStaffTabBarLine, Y as MTab, O as MTabNoteGroup, $ as MTabRhythm, _ as MTabSignature, a1 as MText, r as MusicInterface, aj as PlayState, ak as PlayStateChangeListener, k as ScoreEvent, n as ScoreEventListener, j as ScoreEventType, m as ScoreObjectEvent, l as ScoreStaffPosEvent, a6 as StaffConfig, ae as StaffTabOrGroup, ac as Stem, a9 as StringNumber, a7 as TabConfig, ai as TempoAnnotation, aa as getStringNumbers, ab as getVerseNumbers, a8 as getVoiceIds } from '../music-objects-DTDFSro0.mjs';
|
|
3
3
|
import { N as Note } from '../note-eA2xPPiG.mjs';
|
|
4
4
|
import { S as ScaleType, c as Scale } from '../scale-DQP3b9Zx.mjs';
|
|
5
5
|
import { N as NoteLength, i as NoteLengthStr, K as KeySignature, b as TimeSignature, T as TimeSignatures, B as BeamGrouping, k as TupletRatio } from '../tempo-dkctPkCS.mjs';
|
|
@@ -59,7 +59,7 @@ type ExtensionBuilder = {
|
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
61
61
|
* Document builder class.
|
|
62
|
-
*
|
|
62
|
+
* ```ts
|
|
63
63
|
* // Example
|
|
64
64
|
* let doc = new Score.DocumentBuilder()
|
|
65
65
|
* .addScoreConfiguration({ type: "staff", clef: "G", isOctavewDown: true })
|
|
@@ -70,7 +70,7 @@ type ExtensionBuilder = {
|
|
|
70
70
|
* .addRest(1, "4n")
|
|
71
71
|
* // etc.
|
|
72
72
|
* .getDEocument();
|
|
73
|
-
*
|
|
73
|
+
* ```
|
|
74
74
|
*/
|
|
75
75
|
declare class DocumentBuilder {
|
|
76
76
|
private readonly doc;
|
|
@@ -208,13 +208,13 @@ declare class DocumentBuilder {
|
|
|
208
208
|
addRest(voiceId: VoiceId, restLength: NoteLength | NoteLengthStr, restOptions?: RestOptions): DocumentBuilder;
|
|
209
209
|
/**
|
|
210
210
|
* Usage:
|
|
211
|
-
*
|
|
211
|
+
* ```ts
|
|
212
212
|
* addTuplet(0, Theory.Tuplet.Triplet, notes => {
|
|
213
213
|
* notes.addNote("G3", Theory.NoteLength.Eighth);
|
|
214
214
|
* notes.addNote("B3", Theory.NoteLength.Eighth);
|
|
215
215
|
* notes.addNote("D4", Theory.NoteLength.Eighth);
|
|
216
216
|
* });
|
|
217
|
-
*
|
|
217
|
+
* ```
|
|
218
218
|
*
|
|
219
219
|
* @param voiceId - Voice id to add tuplet to.
|
|
220
220
|
* @param tupletRatio - You can also use Theory.Tuplet presets (e.g. Theory.Tuplet.Triplet).
|
|
@@ -371,13 +371,13 @@ declare class DocumentBuilder {
|
|
|
371
371
|
addConnective(connective: Connective.Slide | `${Connective.Slide}`, notAnchor?: NoteAnchor | `${NoteAnchor}`): DocumentBuilder;
|
|
372
372
|
/**
|
|
373
373
|
* Add extension line to previously added annotation or label element.
|
|
374
|
-
*
|
|
374
|
+
* ```ts
|
|
375
375
|
* // Example
|
|
376
376
|
* addExtension(ext => ext.notes("1n", 2)) // length is 2 whole notes
|
|
377
377
|
* addExtension(ext => ext.measures(3).hide()) // length is 3 measures, hidden
|
|
378
378
|
* addExtension(ext => ext.measures(1).notes("8n")) // length is 1 measure + 1 eigth note
|
|
379
379
|
* addExtension(ext => ext.infinity()) // length is as long as possible
|
|
380
|
-
*
|
|
380
|
+
* ```
|
|
381
381
|
* @param extensionBuilder - Extension builder function used to build exstension.
|
|
382
382
|
* @returns - This document builder instance.
|
|
383
383
|
*/
|