jpfun 0.9.0 → 1.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/README.md +11 -16
- package/dist/diagnostic.d.ts +29 -2
- package/dist/diagnostic.js +5 -4
- package/dist/functions/arpeggio/index.js +2 -3
- package/dist/functions/bar/index.d.ts +3 -0
- package/dist/functions/bar/index.js +21 -3
- package/dist/functions/beam/layout.js +3 -2
- package/dist/functions/box/index.js +1 -0
- package/dist/functions/dash/index.js +5 -2
- package/dist/functions/default.js +2 -1
- package/dist/functions/div/index.d.ts +1 -1
- package/dist/functions/div/index.js +4 -2
- package/dist/functions/dyn/index.js +1 -0
- package/dist/functions/gliss/index.js +85 -9
- package/dist/functions/grace/index.d.ts +1 -8
- package/dist/functions/grace/index.js +23 -53
- package/dist/functions/head/index.js +23 -30
- package/dist/functions/key/index.js +5 -7
- package/dist/functions/meter/index.d.ts +1 -0
- package/dist/functions/meter/index.js +3 -0
- package/dist/functions/meter/shape.d.ts +1 -1
- package/dist/functions/note/accidentals.d.ts +3 -3
- package/dist/functions/note/accidentals.js +29 -16
- package/dist/functions/note/index.d.ts +5 -2
- package/dist/functions/note/index.js +168 -25
- package/dist/functions/note/source-transform.d.ts +23 -2
- package/dist/functions/note/source-transform.js +95 -74
- package/dist/functions/ottava/index.js +1 -0
- package/dist/functions/page/index.d.ts +1 -36
- package/dist/functions/page/index.js +8 -7
- package/dist/functions/rest/index.js +8 -6
- package/dist/functions/set/index.js +2 -2
- package/dist/functions/slide/index.js +1 -0
- package/dist/functions/stack/index.js +6 -4
- package/dist/functions/temporal.d.ts +12 -3
- package/dist/functions/temporal.js +15 -2
- package/dist/functions/text/index.js +2 -2
- package/dist/functions/tie/index.js +28 -4
- package/dist/functions/tremolo/index.js +1 -0
- package/dist/functions/tuplet/index.js +1 -0
- package/dist/functions/up/index.js +12 -12
- package/dist/functions/voice/connections.d.ts +1 -1
- package/dist/functions/voice/connections.js +2 -2
- package/dist/functions/voice/lyrics.d.ts +11 -5
- package/dist/functions/voice/lyrics.js +151 -47
- package/dist/functions/voice/voice.d.ts +6 -2
- package/dist/functions/voice/voice.js +51 -19
- package/dist/functions/voice/voices.d.ts +2 -1
- package/dist/functions/voice/voices.js +4 -3
- package/dist/functions/volta/index.js +1 -0
- package/dist/index.d.ts +69 -3
- package/dist/index.js +69 -3
- package/dist/jpfun.min.js +47 -60
- package/dist/layout/engine.d.ts +4 -3
- package/dist/layout/engine.js +173 -27
- package/dist/layout/model.d.ts +13 -4
- package/dist/layout/model.js +15 -7
- package/dist/layout/page.js +2 -2
- package/dist/layout/path.js +1 -1
- package/dist/layout/types.d.ts +12 -3
- package/dist/lowering/accidentalMemory.d.ts +33 -0
- package/dist/lowering/accidentalMemory.js +84 -0
- package/dist/lowering/loweringContext.js +4 -0
- package/dist/parser/grammarType.d.ts +8 -3
- package/dist/parser/parse-utils/brace-utils.js +7 -17
- package/dist/parser/parse-utils/call-utils.d.ts +3 -1
- package/dist/parser/parse-utils/call-utils.js +17 -32
- package/dist/parser/parse-utils/note-utils.d.ts +4 -0
- package/dist/parser/parse-utils/note-utils.js +8 -12
- package/dist/parser/parse-utils/string-utils.d.ts +1 -1
- package/dist/parser/parse-utils/string-utils.js +1 -1
- package/dist/parser/parserContext.d.ts +32 -26
- package/dist/parser/parserContext.js +104 -194
- package/dist/parser/preprocess.d.ts +7 -0
- package/dist/parser/preprocess.js +31 -42
- package/dist/parser/syntax.d.ts +9 -0
- package/dist/parser/syntax.js +109 -0
- package/dist/pipeline.d.ts +1 -1
- package/dist/pipeline.js +3 -2
- package/dist/playback/compile.js +5 -7
- package/dist/playback/event.d.ts +1 -2
- package/dist/playback/event.js +2 -3
- package/dist/render/canvas.js +50 -35
- package/dist/render/index.d.ts +2 -1
- package/dist/render/index.js +2 -1
- package/dist/render/paint.d.ts +7 -0
- package/dist/render/paint.js +70 -20
- package/dist/render/recording.d.ts +8 -1
- package/dist/render/recording.js +12 -0
- package/dist/render/svg.d.ts +5 -1
- package/dist/render/svg.js +37 -17
- package/dist/render/text.d.ts +2 -2
- package/dist/render/text.js +7 -6
- package/dist/render/translate.d.ts +3 -1
- package/dist/render/translate.js +6 -0
- package/dist/render/types.d.ts +9 -0
- package/grammar.md +7 -5
- package/package.json +8 -18
- package/dist/converter/midi/convert.d.ts +0 -42
- package/dist/converter/midi/convert.js +0 -682
- package/dist/converter/midi/index.d.ts +0 -5
- package/dist/converter/midi/index.js +0 -11
- package/dist/converter/midi/json.d.ts +0 -38
- package/dist/converter/midi/json.js +0 -1
- package/dist/converter/midi/triplet.d.ts +0 -30
- package/dist/converter/midi/triplet.js +0 -75
- package/dist/converter/musicxml/dom.d.ts +0 -25
- package/dist/converter/musicxml/dom.js +0 -65
- package/dist/converter/musicxml/features.d.ts +0 -114
- package/dist/converter/musicxml/features.js +0 -501
- package/dist/converter/musicxml/index.d.ts +0 -14
- package/dist/converter/musicxml/index.js +0 -1285
- package/dist/converter/musicxml/model.d.ts +0 -176
- package/dist/converter/musicxml/model.js +0 -1
- package/dist/converter/musicxml/resolve.d.ts +0 -10
- package/dist/converter/musicxml/resolve.js +0 -152
- package/dist/converter/source.d.ts +0 -19
- package/dist/converter/source.js +0 -53
- package/dist/core.d.ts +0 -24
- package/dist/core.js +0 -24
- package/dist/functions/voice/index.d.ts +0 -2
- package/dist/functions/voice/index.js +0 -2
- package/dist/jpfun.core.min.js +0 -132
- package/dist/jpfun.from-midi.min.js +0 -9
- package/dist/jpfun.from-musicxml.min.js +0 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ASTFunctionNode, ASTTextNode } from "../ASTtypes.js";
|
|
2
2
|
import { ErrorDiagnostic, WarningDiagnostic } from "../../diagnostic.js";
|
|
3
|
-
import { findClosingQuote,
|
|
3
|
+
import { findClosingQuote, quoteSourceString } from "../../parser/parse-utils/string-utils.js";
|
|
4
4
|
import { ParserContext } from "../../parser/parserContext.js";
|
|
5
5
|
import { paintRichLine, prepareRichLine } from "../../render/text.js";
|
|
6
6
|
import { BRACKET_HOOK_COMMANDS, BRACKET_HOOK_DROP, BRACKET_HOOK_REACH, CURVED_BRACE_BOUNDS, CURVED_BRACE_COMMANDS, parseConnections, resolveConnections, serializeConnections, } from "./connections.js";
|
|
@@ -91,7 +91,7 @@ N(女低): 1 2 3
|
|
|
91
91
|
name: "minGap",
|
|
92
92
|
namedOnly: true,
|
|
93
93
|
type: "length",
|
|
94
|
-
default: { value: 0.
|
|
94
|
+
default: { value: 0.2, unit: "em" },
|
|
95
95
|
description: "上方记号借用间距后保留的最小间距",
|
|
96
96
|
},
|
|
97
97
|
],
|
|
@@ -272,7 +272,7 @@ N(女低): 1 2 3
|
|
|
272
272
|
}
|
|
273
273
|
toString(source) {
|
|
274
274
|
const parameters = this.voices.map(voice => `\t${voice.toString(source)}`);
|
|
275
|
-
parameters.push(`\tconnect=${
|
|
275
|
+
parameters.push(`\tconnect=${quoteSourceString(serializeConnections(this.connectionSpecs))}`, `\tgap=${this.gap}px`, `\tminGap=${this.minGap}px`);
|
|
276
276
|
return `@voices(\n${parameters.join(",\n")}\n)`;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
@@ -287,6 +287,7 @@ class VoicesBraceAttachment {
|
|
|
287
287
|
names;
|
|
288
288
|
ast;
|
|
289
289
|
connections;
|
|
290
|
+
kind = "voices";
|
|
290
291
|
layer = "background";
|
|
291
292
|
leftWidth = 0;
|
|
292
293
|
measuredLabels = [];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./pipeline.js";
|
|
2
|
+
export * from "./functions/ASTtypes.js";
|
|
3
|
+
export * from "./functions/temporal.js";
|
|
4
|
+
export * from "./functions/default.js";
|
|
5
|
+
export * from "./functions/adjust/index.js";
|
|
6
|
+
export * from "./functions/arpeggio/index.js";
|
|
7
|
+
export { BarNode } from "./functions/bar/index.js";
|
|
8
|
+
export * from "./functions/beam/index.js";
|
|
9
|
+
export * from "./functions/box/index.js";
|
|
10
|
+
export * from "./functions/br/index.js";
|
|
11
|
+
export * from "./functions/dash/index.js";
|
|
12
|
+
export { DivNode } from "./functions/div/index.js";
|
|
13
|
+
export * from "./functions/dot/index.js";
|
|
14
|
+
export * from "./functions/dyn/index.js";
|
|
15
|
+
export * from "./functions/gliss/index.js";
|
|
16
|
+
export * from "./functions/grace/index.js";
|
|
17
|
+
export * from "./functions/head/index.js";
|
|
18
|
+
export * from "./functions/key/index.js";
|
|
19
|
+
export { MeterNode } from "./functions/meter/index.js";
|
|
20
|
+
export * from "./functions/note/index.js";
|
|
21
|
+
export * from "./functions/note/noteName.js";
|
|
22
|
+
export * from "./functions/note/source-transform.js";
|
|
23
|
+
export * from "./functions/ottava/index.js";
|
|
24
|
+
export * from "./functions/page/index.js";
|
|
25
|
+
export * from "./functions/pagebreak/index.js";
|
|
26
|
+
export * from "./functions/program/index.js";
|
|
27
|
+
export * from "./functions/rest/index.js";
|
|
28
|
+
export * from "./functions/set/index.js";
|
|
29
|
+
export * from "./functions/slide/index.js";
|
|
30
|
+
export * from "./functions/stack/index.js";
|
|
31
|
+
export * from "./functions/symbol/index.js";
|
|
32
|
+
export * from "./functions/tempo/index.js";
|
|
33
|
+
export * from "./functions/text/index.js";
|
|
34
|
+
export * from "./functions/tie/index.js";
|
|
35
|
+
export * from "./functions/tremolo/index.js";
|
|
36
|
+
export * from "./functions/tuplet/index.js";
|
|
37
|
+
export * from "./functions/up/index.js";
|
|
38
|
+
export * from "./functions/voice/voice.js";
|
|
39
|
+
export * from "./functions/voice/voices.js";
|
|
40
|
+
export { parseConnections, resolveConnections, serializeConnections, type ConnectionSpec, type VoiceConnection, } from "./functions/voice/connections.js";
|
|
41
|
+
export * from "./functions/voice/lyrics.js";
|
|
42
|
+
export * from "./functions/volta/index.js";
|
|
43
|
+
export * from "./diagnostic.js";
|
|
44
|
+
export * from "./fraction.js";
|
|
45
|
+
export * from "./parser/types.js";
|
|
46
|
+
export * from "./parser/grammarType.js";
|
|
47
|
+
export { ParserContext, DEFAULT_FONT_SIZE, skipSpaces, skipSpacesBack } from "./parser/parserContext.js";
|
|
48
|
+
export * from "./parser/preprocess.js";
|
|
49
|
+
export * from "./parser/parse-utils/brace-utils.js";
|
|
50
|
+
export * from "./parser/parse-utils/call-utils.js";
|
|
51
|
+
export * from "./parser/parse-utils/label-utils.js";
|
|
52
|
+
export * from "./parser/parse-utils/length-utils.js";
|
|
53
|
+
export * from "./parser/parse-utils/note-utils.js";
|
|
54
|
+
export * from "./parser/parse-utils/string-utils.js";
|
|
55
|
+
export * from "./lowering/types.js";
|
|
56
|
+
export * from "./lowering/loweringContext.js";
|
|
57
|
+
export * from "./lowering/track.js";
|
|
58
|
+
export * from "./lowering/accidentalMemory.js";
|
|
59
|
+
export * from "./playback/types.js";
|
|
60
|
+
export * from "./playback/time.js";
|
|
61
|
+
export * from "./playback/compile.js";
|
|
62
|
+
export * from "./layout/types.js";
|
|
63
|
+
export * from "./layout/model.js";
|
|
64
|
+
export * from "./layout/default.js";
|
|
65
|
+
export { DEFAULT_PAGE_CONFIG, normalizePageConfig, paginateLayoutLines, type DocumentLayoutPage, } from "./layout/page.js";
|
|
66
|
+
export * from "./layout/engine.js";
|
|
67
|
+
export * from "./layout/path.js";
|
|
68
|
+
export * from "./layout/range.js";
|
|
69
|
+
export * from "./render/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./pipeline.js";
|
|
2
|
+
export * from "./functions/ASTtypes.js";
|
|
3
|
+
export * from "./functions/temporal.js";
|
|
4
|
+
export * from "./functions/default.js";
|
|
5
|
+
export * from "./functions/adjust/index.js";
|
|
6
|
+
export * from "./functions/arpeggio/index.js";
|
|
7
|
+
export { BarNode } from "./functions/bar/index.js";
|
|
8
|
+
export * from "./functions/beam/index.js";
|
|
9
|
+
export * from "./functions/box/index.js";
|
|
10
|
+
export * from "./functions/br/index.js";
|
|
11
|
+
export * from "./functions/dash/index.js";
|
|
12
|
+
export { DivNode } from "./functions/div/index.js";
|
|
13
|
+
export * from "./functions/dot/index.js";
|
|
14
|
+
export * from "./functions/dyn/index.js";
|
|
15
|
+
export * from "./functions/gliss/index.js";
|
|
16
|
+
export * from "./functions/grace/index.js";
|
|
17
|
+
export * from "./functions/head/index.js";
|
|
18
|
+
export * from "./functions/key/index.js";
|
|
19
|
+
export { MeterNode } from "./functions/meter/index.js";
|
|
20
|
+
export * from "./functions/note/index.js";
|
|
21
|
+
export * from "./functions/note/noteName.js";
|
|
22
|
+
export * from "./functions/note/source-transform.js";
|
|
23
|
+
export * from "./functions/ottava/index.js";
|
|
24
|
+
export * from "./functions/page/index.js";
|
|
25
|
+
export * from "./functions/pagebreak/index.js";
|
|
26
|
+
export * from "./functions/program/index.js";
|
|
27
|
+
export * from "./functions/rest/index.js";
|
|
28
|
+
export * from "./functions/set/index.js";
|
|
29
|
+
export * from "./functions/slide/index.js";
|
|
30
|
+
export * from "./functions/stack/index.js";
|
|
31
|
+
export * from "./functions/symbol/index.js";
|
|
32
|
+
export * from "./functions/tempo/index.js";
|
|
33
|
+
export * from "./functions/text/index.js";
|
|
34
|
+
export * from "./functions/tie/index.js";
|
|
35
|
+
export * from "./functions/tremolo/index.js";
|
|
36
|
+
export * from "./functions/tuplet/index.js";
|
|
37
|
+
export * from "./functions/up/index.js";
|
|
38
|
+
export * from "./functions/voice/voice.js";
|
|
39
|
+
export * from "./functions/voice/voices.js";
|
|
40
|
+
export { parseConnections, resolveConnections, serializeConnections, } from "./functions/voice/connections.js";
|
|
41
|
+
export * from "./functions/voice/lyrics.js";
|
|
42
|
+
export * from "./functions/volta/index.js";
|
|
43
|
+
export * from "./diagnostic.js";
|
|
44
|
+
export * from "./fraction.js";
|
|
45
|
+
export * from "./parser/types.js";
|
|
46
|
+
export * from "./parser/grammarType.js";
|
|
47
|
+
export { ParserContext, DEFAULT_FONT_SIZE, skipSpaces, skipSpacesBack } from "./parser/parserContext.js";
|
|
48
|
+
export * from "./parser/preprocess.js";
|
|
49
|
+
export * from "./parser/parse-utils/brace-utils.js";
|
|
50
|
+
export * from "./parser/parse-utils/call-utils.js";
|
|
51
|
+
export * from "./parser/parse-utils/label-utils.js";
|
|
52
|
+
export * from "./parser/parse-utils/length-utils.js";
|
|
53
|
+
export * from "./parser/parse-utils/note-utils.js";
|
|
54
|
+
export * from "./parser/parse-utils/string-utils.js";
|
|
55
|
+
export * from "./lowering/types.js";
|
|
56
|
+
export * from "./lowering/loweringContext.js";
|
|
57
|
+
export * from "./lowering/track.js";
|
|
58
|
+
export * from "./lowering/accidentalMemory.js";
|
|
59
|
+
export * from "./playback/types.js";
|
|
60
|
+
export * from "./playback/time.js";
|
|
61
|
+
export * from "./playback/compile.js";
|
|
62
|
+
export * from "./layout/types.js";
|
|
63
|
+
export * from "./layout/model.js";
|
|
64
|
+
export * from "./layout/default.js";
|
|
65
|
+
export { DEFAULT_PAGE_CONFIG, normalizePageConfig, paginateLayoutLines, } from "./layout/page.js";
|
|
66
|
+
export * from "./layout/engine.js";
|
|
67
|
+
export * from "./layout/path.js";
|
|
68
|
+
export * from "./layout/range.js";
|
|
69
|
+
export * from "./render/index.js";
|