@gondola-lyrics/kit 0.3.0 → 0.5.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 +4 -3
- package/dist/formats.d.ts +110 -5
- package/dist/formats.js +1188 -266
- package/dist/formats.js.map +1 -1
- package/dist/generator.d.ts +7 -3
- package/dist/index.d.ts +320 -5
- package/dist/index.js +3 -1
- package/dist/language.js +117 -0
- package/dist/language.js.map +1 -0
- package/dist/parser.d.ts +314 -3
- package/dist/parser.js +3 -1
- package/dist/transforms.d.ts +257 -1
- package/dist/transforms.js +3307 -0
- package/dist/transforms.js.map +1 -0
- package/package.json +1 -1
package/dist/transforms.js
CHANGED
|
@@ -0,0 +1,3307 @@
|
|
|
1
|
+
import { i as mapShared, t as findScriptRunEnd } from "./language.js";
|
|
2
|
+
import { AgentType, CreditRole, LineType, Timing, WordType, deriveLanguageUsages, getContentText, isWordLevelLine, makeAgent, makeLineAnnotation, makeLineAnnotationRoman, makeLineAnnotationTranslation, makeLineBackground, makeLineContentText, makeLineContentWords, makeLineInstrumental, makeMeta, makeMetaCredit, makeText, makeTimeRange, makeWordEmphasis, makeWordSpace, validateTimeRange } from "@gondola-lyrics/model/runtime";
|
|
3
|
+
//#region src/utils/rules.ts
|
|
4
|
+
var RULE_WHITESPACE = /[\u0009-\u000D\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/g;
|
|
5
|
+
var RULE_EDGE_WHITESPACE = /^[\u0009-\u000D\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+|[\u0009-\u000D\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+$/g;
|
|
6
|
+
/**
|
|
7
|
+
* Uses the shared whitespace set and ASCII case folding to keep matching consistent across language kits.
|
|
8
|
+
*/
|
|
9
|
+
var toRuleMatchKey = (text) => {
|
|
10
|
+
return text.replace(RULE_WHITESPACE, "").replace(/[A-Z]+/g, (run) => run.toLowerCase());
|
|
11
|
+
};
|
|
12
|
+
var RULE_WHITESPACE_CHARACTER = new RegExp(RULE_WHITESPACE.source);
|
|
13
|
+
/**
|
|
14
|
+
* Finds the offsets in toRuleMatchKey(text) where the source allows a cut.
|
|
15
|
+
* A cut sits before the first kept character of a script run and after configured whitespace, so neutral punctuation never splits aliases such as A&R or Co-Producer.
|
|
16
|
+
*
|
|
17
|
+
* @param text A source label with its original spelling.
|
|
18
|
+
*
|
|
19
|
+
* @returns Ascending offsets from 0 to the key length, or undefined when the source has no inner cut.
|
|
20
|
+
*/
|
|
21
|
+
var findRuleMatchCuts = (text) => {
|
|
22
|
+
if (!RULE_WHITESPACE_CHARACTER.test(text) && findScriptRunEnd(text) === text.length) return;
|
|
23
|
+
const cuts = [0];
|
|
24
|
+
let length = 0;
|
|
25
|
+
let pendingCut = false;
|
|
26
|
+
let runStart = 0;
|
|
27
|
+
while (runStart < text.length) {
|
|
28
|
+
const runEnd = findScriptRunEnd(text, runStart);
|
|
29
|
+
if (runStart > 0) pendingCut = true;
|
|
30
|
+
for (const character of text.slice(runStart, runEnd)) {
|
|
31
|
+
if (RULE_WHITESPACE_CHARACTER.test(character)) {
|
|
32
|
+
pendingCut = true;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (pendingCut) {
|
|
36
|
+
if (length > 0) cuts.push(length);
|
|
37
|
+
pendingCut = false;
|
|
38
|
+
}
|
|
39
|
+
length += character.length;
|
|
40
|
+
}
|
|
41
|
+
runStart = runEnd;
|
|
42
|
+
}
|
|
43
|
+
if (cuts.length === 1) return;
|
|
44
|
+
cuts.push(length);
|
|
45
|
+
return cuts;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Preserves internal whitespace so source labels and credited names retain their spelling.
|
|
49
|
+
*/
|
|
50
|
+
var trimRuleWhitespace = (text) => text.replace(RULE_EDGE_WHITESPACE, "");
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/transforms/agent/extract.ts
|
|
53
|
+
var hashName = (name) => {
|
|
54
|
+
let hash = 0;
|
|
55
|
+
for (let index = 0; index < name.length; index += 1) hash = (hash << 5) - hash + name.charCodeAt(index) | 0;
|
|
56
|
+
return (hash >>> 0).toString(16).padStart(8, "0").toUpperCase();
|
|
57
|
+
};
|
|
58
|
+
var haveSameAgents = (first, second) => {
|
|
59
|
+
return first.length === second.length && first.every((id, index) => id === second[index]);
|
|
60
|
+
};
|
|
61
|
+
var prepareBindings = (bindings, agents) => {
|
|
62
|
+
if (!bindings) return;
|
|
63
|
+
const knownIds = new Set(agents.map((agent) => agent.id));
|
|
64
|
+
return new Map(Object.entries(bindings).map(([prefix, target]) => {
|
|
65
|
+
const ids = [...new Set(typeof target === "string" ? [target] : target)];
|
|
66
|
+
const missingId = ids.find((id) => !knownIds.has(id));
|
|
67
|
+
if (missingId !== void 0) throw new TypeError(`binding for ${JSON.stringify(prefix)} references unknown agent id ${JSON.stringify(missingId)}`);
|
|
68
|
+
return [prefix.trim(), ids];
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Retains the legacy clock exclusion, including its accepted hour and minute bounds.
|
|
73
|
+
*/
|
|
74
|
+
var isClockTimeColon = (before, after) => {
|
|
75
|
+
const hour = /(\d+)$/.exec(before)?.[1];
|
|
76
|
+
const minute = /^(\d+)/.exec(after)?.[1];
|
|
77
|
+
if (!hour || !minute) return false;
|
|
78
|
+
return hour.length <= 2 && Number(hour) <= 24 && minute.length <= 2 && Number(minute) <= 60;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Cuts only source text, so retained word ranges and annotations do not need fabricated character timings.
|
|
82
|
+
*/
|
|
83
|
+
var removePrefix = (content, length) => {
|
|
84
|
+
if (!content) return;
|
|
85
|
+
if (content.text !== void 0) {
|
|
86
|
+
const text = content.text.slice(length).trim();
|
|
87
|
+
return text ? makeLineContentText(text) : void 0;
|
|
88
|
+
}
|
|
89
|
+
const words = [];
|
|
90
|
+
let remaining = length;
|
|
91
|
+
for (const word of content.words) {
|
|
92
|
+
if (remaining >= word.text.length) {
|
|
93
|
+
remaining -= word.text.length;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (remaining > 0) {
|
|
97
|
+
const text = word.text.slice(remaining).trim();
|
|
98
|
+
remaining = 0;
|
|
99
|
+
if (text) words.push({
|
|
100
|
+
...word,
|
|
101
|
+
text
|
|
102
|
+
});
|
|
103
|
+
} else words.push(word);
|
|
104
|
+
}
|
|
105
|
+
return words.some((word) => !!word.text.trim()) ? makeLineContentWords(words) : void 0;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Extracts colon-prefixed performers and carries them across nonempty normal lines, replacing their existing agent lists.
|
|
109
|
+
* Missing bindings enables legacy name inference; supplied bindings accept exact prefixes and reset propagation on unmatched prefixes.
|
|
110
|
+
* Removing prefixes preserves retained line and word times, but drops prefix-only lines with their attached content.
|
|
111
|
+
*
|
|
112
|
+
* @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
|
|
113
|
+
*
|
|
114
|
+
* @throws {TypeError} If bindings reference an agent id absent from lyric.agents.
|
|
115
|
+
*/
|
|
116
|
+
var extractAgents = (lyric, options = {}) => {
|
|
117
|
+
const bindings = prepareBindings(options.bindings, lyric.agents);
|
|
118
|
+
if (bindings?.size === 0 || !lyric.lines.length) return lyric;
|
|
119
|
+
const removePrefixes = options.removePrefixes ?? true;
|
|
120
|
+
const usedIds = new Set(lyric.agents.map((agent) => agent.id));
|
|
121
|
+
const names = /* @__PURE__ */ new Map();
|
|
122
|
+
for (const agent of lyric.agents) {
|
|
123
|
+
if (!agent.id) continue;
|
|
124
|
+
for (const item of agent.names) {
|
|
125
|
+
const name = item.text.trim();
|
|
126
|
+
if (!name) continue;
|
|
127
|
+
if (!names.has(name)) names.set(name, agent.id);
|
|
128
|
+
else if (names.get(name) !== agent.id) names.set(name, null);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
let agents = lyric.agents;
|
|
132
|
+
const resolveName = (name) => {
|
|
133
|
+
const existing = names.get(name);
|
|
134
|
+
if (existing) return [existing];
|
|
135
|
+
const base = hashName(name);
|
|
136
|
+
let id = base;
|
|
137
|
+
for (let suffix = 1; usedIds.has(id); suffix += 1) id = `${base}-${suffix}`;
|
|
138
|
+
const agent = makeAgent({
|
|
139
|
+
id,
|
|
140
|
+
type: AgentType.PERSON,
|
|
141
|
+
names: [makeText({ text: name })]
|
|
142
|
+
});
|
|
143
|
+
if (agents === lyric.agents) agents = [...agents];
|
|
144
|
+
agents.push(agent);
|
|
145
|
+
usedIds.add(id);
|
|
146
|
+
names.set(name, id);
|
|
147
|
+
return [id];
|
|
148
|
+
};
|
|
149
|
+
const originalLines = lyric.lines;
|
|
150
|
+
let lines;
|
|
151
|
+
let current;
|
|
152
|
+
let contentChanged = false;
|
|
153
|
+
for (const [index, line] of originalLines.entries()) {
|
|
154
|
+
const text = line.type === LineType.NORMAL ? getContentText(line.content) : "";
|
|
155
|
+
if (line.type !== LineType.NORMAL || !text.trim()) {
|
|
156
|
+
current = void 0;
|
|
157
|
+
lines?.push(line);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const colon = text.search(/[::]/u);
|
|
161
|
+
let matched = false;
|
|
162
|
+
if (colon !== -1) {
|
|
163
|
+
const name = text.slice(0, colon).trim();
|
|
164
|
+
if (bindings) {
|
|
165
|
+
const target = bindings.get(name);
|
|
166
|
+
if (!target) {
|
|
167
|
+
current = void 0;
|
|
168
|
+
lines?.push(line);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
current = target;
|
|
172
|
+
matched = true;
|
|
173
|
+
} else if (!isClockTimeColon(text.slice(0, colon), text.slice(colon + 1))) {
|
|
174
|
+
if (!name) {
|
|
175
|
+
current = void 0;
|
|
176
|
+
lines?.push(line);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
current = resolveName(name);
|
|
180
|
+
matched = true;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
let content = line.content;
|
|
184
|
+
if (matched && removePrefixes) {
|
|
185
|
+
content = removePrefix(content, colon + 1);
|
|
186
|
+
contentChanged = true;
|
|
187
|
+
if (!content) {
|
|
188
|
+
lines ??= originalLines.slice(0, index);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const nextAgents = current && !haveSameAgents(line.agents, current) ? [...current] : line.agents;
|
|
193
|
+
if (content !== line.content || nextAgents !== line.agents) {
|
|
194
|
+
lines ??= originalLines.slice(0, index);
|
|
195
|
+
lines.push({
|
|
196
|
+
...line,
|
|
197
|
+
content,
|
|
198
|
+
agents: nextAgents
|
|
199
|
+
});
|
|
200
|
+
} else lines?.push(line);
|
|
201
|
+
}
|
|
202
|
+
if (!lines && agents === lyric.agents) return lyric;
|
|
203
|
+
const remainingLines = lines ?? originalLines;
|
|
204
|
+
let timing = lyric.timing;
|
|
205
|
+
if (contentChanged && timing === Timing.WORD) {
|
|
206
|
+
if (!remainingLines.some((line) => {
|
|
207
|
+
return isWordLevelLine(line) || line.backgrounds.some(isWordLevelLine);
|
|
208
|
+
})) timing = Timing.LINE;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
...lyric,
|
|
212
|
+
agents,
|
|
213
|
+
lines: remainingLines,
|
|
214
|
+
timing,
|
|
215
|
+
languages: contentChanged ? deriveLanguageUsages(remainingLines) : lyric.languages
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/transforms/background/utils.ts
|
|
220
|
+
var OPEN_BRACKETS = /* @__PURE__ */ new Set(["(", "("]);
|
|
221
|
+
var CLOSE_BRACKETS = /* @__PURE__ */ new Set([")", ")"]);
|
|
222
|
+
var isOpenBracket = (char) => {
|
|
223
|
+
return OPEN_BRACKETS.has(char);
|
|
224
|
+
};
|
|
225
|
+
var isCloseBracket = (char) => {
|
|
226
|
+
return CLOSE_BRACKETS.has(char);
|
|
227
|
+
};
|
|
228
|
+
var isNormalWord = (word) => {
|
|
229
|
+
return word.type === WordType.NORMAL;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Content carries plain text or words, never both, so exactly one of the two is read.
|
|
233
|
+
*/
|
|
234
|
+
var readLineText = (line) => {
|
|
235
|
+
return line.content?.text ?? (line.content?.words ?? []).map((word) => word.text).join("");
|
|
236
|
+
};
|
|
237
|
+
var readTimeRange = (line) => {
|
|
238
|
+
return line.time ? makeTimeRange({
|
|
239
|
+
start: line.time.start,
|
|
240
|
+
end: line.time.end
|
|
241
|
+
}) : void 0;
|
|
242
|
+
};
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/transforms/background/brackets.ts
|
|
245
|
+
/**
|
|
246
|
+
* Removes one leading bracket from the first sung word and one trailing bracket from the last, so an inner pair stays as written.
|
|
247
|
+
*
|
|
248
|
+
* Space words at the same edge go with the bracket, and a word left with no text goes too, since a sung word must carry something.
|
|
249
|
+
*/
|
|
250
|
+
var stripWordEdges = (words) => {
|
|
251
|
+
const firstIndex = words.findIndex(isNormalWord);
|
|
252
|
+
const first = words[firstIndex];
|
|
253
|
+
const last = words[words.findLastIndex(isNormalWord)];
|
|
254
|
+
const stripStart = first ? isOpenBracket(first.text.charAt(0)) : false;
|
|
255
|
+
const stripEnd = last ? isCloseBracket(last.text.charAt(last.text.length - 1)) : false;
|
|
256
|
+
if (!stripStart && !stripEnd) return words;
|
|
257
|
+
const result = [...words];
|
|
258
|
+
if (stripStart && first) {
|
|
259
|
+
const text = first.text.slice(1);
|
|
260
|
+
if (text) result[firstIndex] = {
|
|
261
|
+
...first,
|
|
262
|
+
text
|
|
263
|
+
};
|
|
264
|
+
else result.splice(firstIndex, 1);
|
|
265
|
+
while (result[0]?.type === WordType.SPACE) result.shift();
|
|
266
|
+
}
|
|
267
|
+
const endIndex = result.findLastIndex(isNormalWord);
|
|
268
|
+
const end = result[endIndex];
|
|
269
|
+
if (stripEnd && end) {
|
|
270
|
+
const text = end.text.slice(0, -1);
|
|
271
|
+
if (text) result[endIndex] = {
|
|
272
|
+
...end,
|
|
273
|
+
text
|
|
274
|
+
};
|
|
275
|
+
else result.splice(endIndex, 1);
|
|
276
|
+
while (result.at(-1)?.type === WordType.SPACE) result.pop();
|
|
277
|
+
}
|
|
278
|
+
return result;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Plain text is read literally, so a source that padded it with spaces keeps them; only word content
|
|
282
|
+
* treats space words as the structural separators they are.
|
|
283
|
+
*/
|
|
284
|
+
var stripContentBrackets = (content) => {
|
|
285
|
+
if (!content) return content;
|
|
286
|
+
if (!content.words.length) {
|
|
287
|
+
const text = content.text;
|
|
288
|
+
if (!text) return content;
|
|
289
|
+
const start = isOpenBracket(text.charAt(0)) ? 1 : 0;
|
|
290
|
+
const end = isCloseBracket(text.charAt(text.length - 1)) ? -1 : 0;
|
|
291
|
+
if (!start && !end) return content;
|
|
292
|
+
const stripped = text.slice(start, end === 0 ? void 0 : end);
|
|
293
|
+
return stripped ? makeLineContentText(stripped) : void 0;
|
|
294
|
+
}
|
|
295
|
+
const words = stripWordEdges(content.words);
|
|
296
|
+
if (words === content.words) return content;
|
|
297
|
+
return words.length ? makeLineContentWords(words) : void 0;
|
|
298
|
+
};
|
|
299
|
+
var stripLineBackgrounds = (line) => {
|
|
300
|
+
if (!line.backgrounds.length) return line;
|
|
301
|
+
let changed = false;
|
|
302
|
+
const kept = [];
|
|
303
|
+
for (const background of line.backgrounds) {
|
|
304
|
+
const content = stripContentBrackets(background.content);
|
|
305
|
+
if (content === background.content) {
|
|
306
|
+
kept.push(background);
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
changed = true;
|
|
310
|
+
if (content) kept.push({
|
|
311
|
+
...background,
|
|
312
|
+
content
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
return changed ? {
|
|
316
|
+
...line,
|
|
317
|
+
backgrounds: kept
|
|
318
|
+
} : line;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Removes the brackets some sources wrap around background vocals.
|
|
322
|
+
*
|
|
323
|
+
* One layer is removed from each edge of every background line, leaving a nested pair as `(x)`.
|
|
324
|
+
* A line left with no content is dropped, since a background line must carry something.
|
|
325
|
+
*
|
|
326
|
+
* @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
|
|
327
|
+
*/
|
|
328
|
+
var stripBackgroundBrackets = (lyric) => {
|
|
329
|
+
const lines = mapShared(lyric.lines, stripLineBackgrounds);
|
|
330
|
+
return lines === lyric.lines ? lyric : {
|
|
331
|
+
...lyric,
|
|
332
|
+
lines
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/transforms/background/extract.ts
|
|
337
|
+
/**
|
|
338
|
+
* An unclosed bracket never became a run, so its text returns to the line it came from.
|
|
339
|
+
* An empty pair yields no run, since a background line must carry text.
|
|
340
|
+
*/
|
|
341
|
+
var splitText = (text) => {
|
|
342
|
+
const chars = [...text];
|
|
343
|
+
let main = "";
|
|
344
|
+
let current = "";
|
|
345
|
+
let opened = "";
|
|
346
|
+
let openedAt = 0;
|
|
347
|
+
let depth = 0;
|
|
348
|
+
const runs = [];
|
|
349
|
+
for (const [index, char] of chars.entries()) if (isOpenBracket(char)) {
|
|
350
|
+
if (depth) current += char;
|
|
351
|
+
else {
|
|
352
|
+
opened = char;
|
|
353
|
+
openedAt = index;
|
|
354
|
+
}
|
|
355
|
+
depth += 1;
|
|
356
|
+
} else if (isCloseBracket(char)) {
|
|
357
|
+
if (depth === 0) {
|
|
358
|
+
main += char;
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
depth -= 1;
|
|
362
|
+
if (depth) current += char;
|
|
363
|
+
else {
|
|
364
|
+
runs.push({
|
|
365
|
+
text: current,
|
|
366
|
+
start: openedAt + 1,
|
|
367
|
+
end: index
|
|
368
|
+
});
|
|
369
|
+
current = "";
|
|
370
|
+
}
|
|
371
|
+
} else if (depth) current += char;
|
|
372
|
+
else main += char;
|
|
373
|
+
if (depth) main += opened + current;
|
|
374
|
+
return {
|
|
375
|
+
main: main.trim().replaceAll(/\s{2,}/gu, " "),
|
|
376
|
+
runs: runs.filter((run) => {
|
|
377
|
+
return !!run.text.trim();
|
|
378
|
+
}),
|
|
379
|
+
length: chars.length
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* A word straddling a bracket is cut into pieces sharing its time, since the source gave no finer boundary.
|
|
384
|
+
* An unclosed bracket never became a run, so its text returns to the line it came from.
|
|
385
|
+
* An empty pair yields no run, since a background line must carry text.
|
|
386
|
+
*/
|
|
387
|
+
var splitWords = (words) => {
|
|
388
|
+
const main = [];
|
|
389
|
+
const runs = [];
|
|
390
|
+
let current = [];
|
|
391
|
+
let opened;
|
|
392
|
+
let depth = 0;
|
|
393
|
+
for (const word of words) {
|
|
394
|
+
if (!isNormalWord(word)) {
|
|
395
|
+
(depth ? current : main).push(word);
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
let buffer = "";
|
|
399
|
+
for (const char of word.text) if (isOpenBracket(char)) {
|
|
400
|
+
if (depth) buffer += char;
|
|
401
|
+
else {
|
|
402
|
+
if (buffer) {
|
|
403
|
+
main.push({
|
|
404
|
+
...word,
|
|
405
|
+
text: buffer
|
|
406
|
+
});
|
|
407
|
+
buffer = "";
|
|
408
|
+
}
|
|
409
|
+
opened = {
|
|
410
|
+
...word,
|
|
411
|
+
text: char
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
depth += 1;
|
|
415
|
+
} else if (isCloseBracket(char)) {
|
|
416
|
+
if (depth === 0) {
|
|
417
|
+
buffer += char;
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
depth -= 1;
|
|
421
|
+
if (depth) buffer += char;
|
|
422
|
+
else {
|
|
423
|
+
if (buffer) {
|
|
424
|
+
current.push({
|
|
425
|
+
...word,
|
|
426
|
+
text: buffer
|
|
427
|
+
});
|
|
428
|
+
buffer = "";
|
|
429
|
+
}
|
|
430
|
+
if (current.length) {
|
|
431
|
+
runs.push(current);
|
|
432
|
+
current = [];
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
} else buffer += char;
|
|
436
|
+
if (buffer) (depth ? current : main).push({
|
|
437
|
+
...word,
|
|
438
|
+
text: buffer
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
if (depth) {
|
|
442
|
+
if (opened) main.push(opened);
|
|
443
|
+
main.push(...current);
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
main,
|
|
447
|
+
runs: runs.filter((run) => {
|
|
448
|
+
return run.some((word) => {
|
|
449
|
+
return !!word.text.trim();
|
|
450
|
+
});
|
|
451
|
+
})
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
var mapSpan = (range, length, run) => {
|
|
455
|
+
if (range.end === void 0 || !length) return makeTimeRange({
|
|
456
|
+
start: range.start,
|
|
457
|
+
end: range.end
|
|
458
|
+
});
|
|
459
|
+
const span = range.end - range.start;
|
|
460
|
+
const start = range.start + Math.round(span * run.start / length);
|
|
461
|
+
const end = range.start + Math.round(span * run.end / length);
|
|
462
|
+
return makeTimeRange({
|
|
463
|
+
start,
|
|
464
|
+
end: Math.max(start, end)
|
|
465
|
+
});
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* Falls back to the line's own range when no word carries a time, so a run still gets a range.
|
|
469
|
+
*/
|
|
470
|
+
var readWordRange = (words, fallback) => {
|
|
471
|
+
const timed = words.filter((word) => {
|
|
472
|
+
return isNormalWord(word) && !!word.time;
|
|
473
|
+
});
|
|
474
|
+
const first = timed[0]?.time;
|
|
475
|
+
const last = timed.at(-1)?.time;
|
|
476
|
+
if (!first || !last) return fallback;
|
|
477
|
+
return makeTimeRange({
|
|
478
|
+
start: first.start,
|
|
479
|
+
end: last.end
|
|
480
|
+
});
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* A background may start before its line but not finish after it, so the line grows to the furthest stated end.
|
|
484
|
+
*/
|
|
485
|
+
var attach = (line, backgrounds) => {
|
|
486
|
+
const merged = [...line.backgrounds, ...backgrounds];
|
|
487
|
+
merged.sort((left, right) => {
|
|
488
|
+
const leftStart = left.time?.start ?? 0;
|
|
489
|
+
const rightStart = right.time?.start ?? 0;
|
|
490
|
+
return leftStart === rightStart ? (left.time?.end ?? 0) - (right.time?.end ?? 0) : leftStart - rightStart;
|
|
491
|
+
});
|
|
492
|
+
let end = line.time?.end;
|
|
493
|
+
for (const background of merged) {
|
|
494
|
+
const backgroundEnd = background.time?.end;
|
|
495
|
+
if (backgroundEnd !== void 0 && (end === void 0 || backgroundEnd > end)) end = backgroundEnd;
|
|
496
|
+
}
|
|
497
|
+
if (!line.time || end === line.time.end) return {
|
|
498
|
+
...line,
|
|
499
|
+
backgrounds: merged
|
|
500
|
+
};
|
|
501
|
+
return {
|
|
502
|
+
...line,
|
|
503
|
+
time: makeTimeRange({
|
|
504
|
+
start: line.time.start,
|
|
505
|
+
end
|
|
506
|
+
}),
|
|
507
|
+
backgrounds: merged
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
/**
|
|
511
|
+
* A closed line cannot hold an open background, so it stops where the line does.
|
|
512
|
+
* On the last line the timeline itself ends unknown, so an open background leaves the line open too.
|
|
513
|
+
*/
|
|
514
|
+
var boundOpenBackgrounds = (lines) => {
|
|
515
|
+
const last = lines.length - 1;
|
|
516
|
+
return lines.map((line, index) => {
|
|
517
|
+
if (!line.backgrounds.filter((background) => {
|
|
518
|
+
return !!background.time && background.time.end === void 0;
|
|
519
|
+
}).length) return line;
|
|
520
|
+
if (index === last) return line.time ? {
|
|
521
|
+
...line,
|
|
522
|
+
time: makeTimeRange({ start: line.time.start })
|
|
523
|
+
} : line;
|
|
524
|
+
if (!line.time || line.time.end === void 0) return line;
|
|
525
|
+
const end = line.time.end;
|
|
526
|
+
return {
|
|
527
|
+
...line,
|
|
528
|
+
backgrounds: line.backgrounds.map((background) => {
|
|
529
|
+
const time = background.time;
|
|
530
|
+
if (!time || time.end !== void 0) return background;
|
|
531
|
+
return {
|
|
532
|
+
...background,
|
|
533
|
+
time: makeTimeRange({
|
|
534
|
+
start: time.start,
|
|
535
|
+
end: Math.max(time.start, end)
|
|
536
|
+
})
|
|
537
|
+
};
|
|
538
|
+
})
|
|
539
|
+
};
|
|
540
|
+
});
|
|
541
|
+
};
|
|
542
|
+
/**
|
|
543
|
+
* Words are kept only where the caller says the lyric is word-timed, since the other timings forbid them.
|
|
544
|
+
*/
|
|
545
|
+
var makeBackground = (line, words, text, time, wordLevel) => {
|
|
546
|
+
return makeLineBackground({
|
|
547
|
+
time,
|
|
548
|
+
agents: [...line.agents],
|
|
549
|
+
languages: [...line.languages],
|
|
550
|
+
content: wordLevel && words.length ? makeLineContentWords(words) : makeLineContentText(text)
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
var readBackgrounds = (line, wordLevel) => {
|
|
554
|
+
const content = line.content;
|
|
555
|
+
if (!content) return [];
|
|
556
|
+
const range = line.time;
|
|
557
|
+
if (wordLevel && content.words.length) return splitWords(content.words).runs.map((words) => {
|
|
558
|
+
const time = range ? readWordRange(words, range) : void 0;
|
|
559
|
+
return makeBackground(line, words, words.map((word) => word.text).join(""), time, wordLevel);
|
|
560
|
+
});
|
|
561
|
+
const text = content.text ?? content.words.map((word) => word.text).join("");
|
|
562
|
+
if (!text) return [];
|
|
563
|
+
const { runs, length } = splitText(text);
|
|
564
|
+
return runs.map((run) => {
|
|
565
|
+
return makeBackground(line, [], run.text, range ? mapSpan(range, length, run) : void 0, false);
|
|
566
|
+
});
|
|
567
|
+
};
|
|
568
|
+
/**
|
|
569
|
+
* An entry without brackets stays on the line, since only the bracketed part describes a background.
|
|
570
|
+
* The line's annotation is rebuilt rather than edited, so the input lyric stays untouched.
|
|
571
|
+
*/
|
|
572
|
+
var splitAnnotation = (annotation, backgrounds) => {
|
|
573
|
+
if (!annotation || !backgrounds.length) return annotation;
|
|
574
|
+
const move = (items, rebuild, push) => {
|
|
575
|
+
return items.map((item) => {
|
|
576
|
+
const { main, runs } = splitText(item.text);
|
|
577
|
+
if (!runs.length) return item;
|
|
578
|
+
for (const [index, run] of runs.entries()) {
|
|
579
|
+
const background = backgrounds[index];
|
|
580
|
+
if (background) push(background, run.text, item.language);
|
|
581
|
+
}
|
|
582
|
+
return rebuild(item, main);
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
const romans = move(annotation.romans, (item, text) => makeLineAnnotationRoman({
|
|
586
|
+
...item,
|
|
587
|
+
text
|
|
588
|
+
}), (background, text, language) => {
|
|
589
|
+
background.annotation ??= makeLineAnnotation();
|
|
590
|
+
background.annotation.romans.push(makeLineAnnotationRoman({
|
|
591
|
+
text,
|
|
592
|
+
language
|
|
593
|
+
}));
|
|
594
|
+
});
|
|
595
|
+
const translations = move(annotation.translations, (item, text) => makeLineAnnotationTranslation({
|
|
596
|
+
...item,
|
|
597
|
+
text
|
|
598
|
+
}), (background, text, language) => {
|
|
599
|
+
background.annotation ??= makeLineAnnotation();
|
|
600
|
+
background.annotation.translations.push(makeLineAnnotationTranslation({
|
|
601
|
+
text,
|
|
602
|
+
language
|
|
603
|
+
}));
|
|
604
|
+
});
|
|
605
|
+
return makeLineAnnotation({
|
|
606
|
+
...annotation,
|
|
607
|
+
romans,
|
|
608
|
+
translations
|
|
609
|
+
});
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* Words survive only where the lyric is word-timed, since the other timings forbid them.
|
|
613
|
+
*/
|
|
614
|
+
var toBackground = (line, time, wordLevel) => {
|
|
615
|
+
const content = line.content;
|
|
616
|
+
if (!content) return;
|
|
617
|
+
const text = content.text ?? content.words.map((word) => word.text).join("");
|
|
618
|
+
if (!text) return;
|
|
619
|
+
return makeLineBackground({
|
|
620
|
+
time,
|
|
621
|
+
agents: [...line.agents],
|
|
622
|
+
languages: [...line.languages],
|
|
623
|
+
content: wordLevel && content.words.length ? content : makeLineContentText(text),
|
|
624
|
+
annotation: line.annotation
|
|
625
|
+
});
|
|
626
|
+
};
|
|
627
|
+
var isBracketOnlyLine = (line) => {
|
|
628
|
+
if (!line || line.type !== LineType.NORMAL) return false;
|
|
629
|
+
const { main, runs } = splitText(readLineText(line));
|
|
630
|
+
return !!runs.length && !main;
|
|
631
|
+
};
|
|
632
|
+
/**
|
|
633
|
+
* A line that held nothing but brackets has no text of its own to sing, so it cannot be the one a background accompanies.
|
|
634
|
+
*/
|
|
635
|
+
var findParentIndex = (lines) => {
|
|
636
|
+
for (let index = lines.length - 1; index >= 0; index--) {
|
|
637
|
+
const line = lines[index];
|
|
638
|
+
if (line?.type === LineType.NORMAL && !isBracketOnlyLine(line)) return index;
|
|
639
|
+
}
|
|
640
|
+
return -1;
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* Both source lines go, since neither holds anything left to sing, and the joined range spans both.
|
|
644
|
+
*/
|
|
645
|
+
var joinCrossLine = (lines, wordLevel) => {
|
|
646
|
+
const result = [];
|
|
647
|
+
let changed = false;
|
|
648
|
+
let skip = false;
|
|
649
|
+
for (const [index, line] of lines.entries()) {
|
|
650
|
+
if (skip) {
|
|
651
|
+
skip = false;
|
|
652
|
+
continue;
|
|
653
|
+
}
|
|
654
|
+
const next = lines[index + 1];
|
|
655
|
+
const parentIndex = findParentIndex(result);
|
|
656
|
+
if (line.type === LineType.NORMAL && next?.type === LineType.NORMAL && parentIndex !== -1) {
|
|
657
|
+
const opened = splitText(readLineText(line));
|
|
658
|
+
const closed = splitText(readLineText(next));
|
|
659
|
+
const opens = !opened.runs.length && isOpenBracket(opened.main.charAt(0));
|
|
660
|
+
const closes = !closed.runs.length && isCloseBracket(closed.main.charAt(closed.main.length - 1));
|
|
661
|
+
if (opens && closes) {
|
|
662
|
+
const start = line.time?.start;
|
|
663
|
+
const end = next.time?.end ?? next.time?.start;
|
|
664
|
+
const background = toBackground({
|
|
665
|
+
...line,
|
|
666
|
+
content: makeLineContentText(opened.main.slice(1) + closed.main.slice(0, -1))
|
|
667
|
+
}, start === void 0 ? void 0 : makeTimeRange({
|
|
668
|
+
start,
|
|
669
|
+
end
|
|
670
|
+
}), wordLevel);
|
|
671
|
+
if (background) {
|
|
672
|
+
result[parentIndex] = attach(result[parentIndex], [background]);
|
|
673
|
+
changed = true;
|
|
674
|
+
skip = true;
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
result.push(line);
|
|
680
|
+
}
|
|
681
|
+
return {
|
|
682
|
+
lines: result,
|
|
683
|
+
changed
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
var stripRuns = (content) => {
|
|
687
|
+
if (content.words.length) {
|
|
688
|
+
const { main } = splitWords(content.words);
|
|
689
|
+
return main.length ? makeLineContentWords(main) : void 0;
|
|
690
|
+
}
|
|
691
|
+
const { main } = splitText(content.text ?? "");
|
|
692
|
+
return main ? makeLineContentText(main) : void 0;
|
|
693
|
+
};
|
|
694
|
+
/**
|
|
695
|
+
* Pulls bracketed background vocals out of the sung lines and attaches them to the line they accompany.
|
|
696
|
+
*
|
|
697
|
+
* A line holding nothing but brackets becomes a background of the line before it and is removed.
|
|
698
|
+
* A bracket opened on one line and closed on a later one joins the line before the opening, and both source lines go.
|
|
699
|
+
* Text outside brackets stays on its line, and a line left with none keeps its place.
|
|
700
|
+
*
|
|
701
|
+
* @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
|
|
702
|
+
*/
|
|
703
|
+
var extractBackgroundLines = (lyric, options = {}) => {
|
|
704
|
+
const fullLine = options.fullLine ?? true;
|
|
705
|
+
const inLine = options.inLine ?? true;
|
|
706
|
+
const crossLine = options.crossLine ?? true;
|
|
707
|
+
if (!lyric.lines.length) return lyric;
|
|
708
|
+
const wordLevel = lyric.timing === Timing.WORD;
|
|
709
|
+
const joined = crossLine ? joinCrossLine(lyric.lines, wordLevel) : {
|
|
710
|
+
lines: lyric.lines,
|
|
711
|
+
changed: false
|
|
712
|
+
};
|
|
713
|
+
const result = [];
|
|
714
|
+
let changed = joined.changed;
|
|
715
|
+
for (const line of joined.lines) {
|
|
716
|
+
if (line.type !== LineType.NORMAL || !line.content) {
|
|
717
|
+
result.push(line);
|
|
718
|
+
continue;
|
|
719
|
+
}
|
|
720
|
+
const parentIndex = findParentIndex(result);
|
|
721
|
+
if (fullLine && parentIndex !== -1) {
|
|
722
|
+
const { main, runs } = splitText(readLineText(line));
|
|
723
|
+
if (runs.length && !main) {
|
|
724
|
+
const backgrounds = runs.map((run) => {
|
|
725
|
+
return makeBackground(line, [], run.text, readTimeRange(line), false);
|
|
726
|
+
});
|
|
727
|
+
result[parentIndex] = attach(result[parentIndex], backgrounds);
|
|
728
|
+
changed = true;
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
const backgrounds = inLine ? readBackgrounds(line, wordLevel) : [];
|
|
733
|
+
if (!backgrounds.length) {
|
|
734
|
+
result.push(line);
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
const nextContent = stripRuns(line.content);
|
|
738
|
+
if (!nextContent) {
|
|
739
|
+
result.push(line);
|
|
740
|
+
continue;
|
|
741
|
+
}
|
|
742
|
+
const extracted = {
|
|
743
|
+
...line,
|
|
744
|
+
content: nextContent,
|
|
745
|
+
annotation: splitAnnotation(line.annotation, backgrounds)
|
|
746
|
+
};
|
|
747
|
+
result.push(attach(extracted, backgrounds));
|
|
748
|
+
changed = true;
|
|
749
|
+
}
|
|
750
|
+
if (!changed) return lyric;
|
|
751
|
+
const lines = boundOpenBackgrounds(result);
|
|
752
|
+
return {
|
|
753
|
+
...lyric,
|
|
754
|
+
lines,
|
|
755
|
+
languages: deriveLanguageUsages(lines)
|
|
756
|
+
};
|
|
757
|
+
};
|
|
758
|
+
var en_default$1 = {
|
|
759
|
+
$schema: "../schema.json",
|
|
760
|
+
version: 1,
|
|
761
|
+
language: "en",
|
|
762
|
+
normalization: {
|
|
763
|
+
"whitespace": "remove",
|
|
764
|
+
"case": "asciiLower"
|
|
765
|
+
},
|
|
766
|
+
groups: [
|
|
767
|
+
{
|
|
768
|
+
"id": "lyricist",
|
|
769
|
+
"kind": "role",
|
|
770
|
+
"roles": ["LYRICIST"],
|
|
771
|
+
"words": [
|
|
772
|
+
"Lyrics",
|
|
773
|
+
"Lyricsby",
|
|
774
|
+
"Lyricist",
|
|
775
|
+
"Words",
|
|
776
|
+
"Wordsby",
|
|
777
|
+
"Lyric",
|
|
778
|
+
"Lyr",
|
|
779
|
+
"Lyricists",
|
|
780
|
+
"Lyricwriting"
|
|
781
|
+
]
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"id": "composer",
|
|
785
|
+
"kind": "role",
|
|
786
|
+
"roles": ["COMPOSER"],
|
|
787
|
+
"words": [
|
|
788
|
+
"Music",
|
|
789
|
+
"Musicby",
|
|
790
|
+
"Composer",
|
|
791
|
+
"Composedby",
|
|
792
|
+
"Compose",
|
|
793
|
+
"Composition",
|
|
794
|
+
"Melody",
|
|
795
|
+
"Melodyby",
|
|
796
|
+
"Comp",
|
|
797
|
+
"Composers",
|
|
798
|
+
"Score",
|
|
799
|
+
"Scoredby",
|
|
800
|
+
"Composed"
|
|
801
|
+
]
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
"id": "arranger",
|
|
805
|
+
"kind": "role",
|
|
806
|
+
"roles": ["ARRANGER"],
|
|
807
|
+
"words": [
|
|
808
|
+
"Arrangement",
|
|
809
|
+
"Arranger",
|
|
810
|
+
"Arrangedby",
|
|
811
|
+
"Arranged",
|
|
812
|
+
"Arrange",
|
|
813
|
+
"Arr",
|
|
814
|
+
"Orchestration",
|
|
815
|
+
"StringArrangement",
|
|
816
|
+
"VocalArrangement",
|
|
817
|
+
"ChoirArrangement",
|
|
818
|
+
"Orchestrator",
|
|
819
|
+
"Orchestratedby",
|
|
820
|
+
"Orch",
|
|
821
|
+
"AdditionalArrangement",
|
|
822
|
+
"BGVsArranger",
|
|
823
|
+
"BVArranger",
|
|
824
|
+
"BackgroundVocalArrangement",
|
|
825
|
+
"BackgroundVocalsArrangement",
|
|
826
|
+
"BackingVocalsArranger",
|
|
827
|
+
"BackingVocalArrangement",
|
|
828
|
+
"BackingVocalsArrangement",
|
|
829
|
+
"BrassArrangement",
|
|
830
|
+
"HornArrangement",
|
|
831
|
+
"OrchestralArrangement",
|
|
832
|
+
"RhythmArrangement",
|
|
833
|
+
"StringArrangedby",
|
|
834
|
+
"StringArranger",
|
|
835
|
+
"VocalArrangedby",
|
|
836
|
+
"VocalArranger"
|
|
837
|
+
]
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"id": "producer",
|
|
841
|
+
"kind": "role",
|
|
842
|
+
"roles": ["PRODUCER"],
|
|
843
|
+
"words": [
|
|
844
|
+
"Producer",
|
|
845
|
+
"Producedby",
|
|
846
|
+
"Produced",
|
|
847
|
+
"Production",
|
|
848
|
+
"Prod",
|
|
849
|
+
"Prodby",
|
|
850
|
+
"Producers",
|
|
851
|
+
"Produce",
|
|
852
|
+
"CoProducer",
|
|
853
|
+
"Co-Producer",
|
|
854
|
+
"ExecutiveProducer",
|
|
855
|
+
"AdditionalProducer",
|
|
856
|
+
"AdditionalProduction",
|
|
857
|
+
"VocalProducer",
|
|
858
|
+
"MusicProducer",
|
|
859
|
+
"AssociateProducer",
|
|
860
|
+
"Co-Produced",
|
|
861
|
+
"Co-Producedby",
|
|
862
|
+
"Co-Production",
|
|
863
|
+
"Co-Productionby",
|
|
864
|
+
"CoProd",
|
|
865
|
+
"Coproduction",
|
|
866
|
+
"CreativeProducer",
|
|
867
|
+
"ExProd",
|
|
868
|
+
"ExecProducer",
|
|
869
|
+
"ExecutiveProducers",
|
|
870
|
+
"Productionby",
|
|
871
|
+
"VocalProduction",
|
|
872
|
+
"MusicSupervisor",
|
|
873
|
+
"Supervisor",
|
|
874
|
+
"Presentedby",
|
|
875
|
+
"Presenter"
|
|
876
|
+
]
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"id": "performer",
|
|
880
|
+
"kind": "role",
|
|
881
|
+
"roles": ["PERFORMER"],
|
|
882
|
+
"words": [
|
|
883
|
+
"Vocals",
|
|
884
|
+
"Vocal",
|
|
885
|
+
"Vocalist",
|
|
886
|
+
"Singer",
|
|
887
|
+
"Voice",
|
|
888
|
+
"Performer",
|
|
889
|
+
"Featuring",
|
|
890
|
+
"Feat",
|
|
891
|
+
"Ft",
|
|
892
|
+
"Artist",
|
|
893
|
+
"Vocalsby",
|
|
894
|
+
"Sungby",
|
|
895
|
+
"Performedby",
|
|
896
|
+
"Performed",
|
|
897
|
+
"LeadVocal",
|
|
898
|
+
"LeadVocals",
|
|
899
|
+
"BackgroundVocals",
|
|
900
|
+
"BackingVocals",
|
|
901
|
+
"Harmony",
|
|
902
|
+
"Choir",
|
|
903
|
+
"Band",
|
|
904
|
+
"Rap",
|
|
905
|
+
"Rapper",
|
|
906
|
+
"Soloist",
|
|
907
|
+
"Musician",
|
|
908
|
+
"Player",
|
|
909
|
+
"GuestVocals",
|
|
910
|
+
"FeaturedArtist",
|
|
911
|
+
"Narrator",
|
|
912
|
+
"Guitarist",
|
|
913
|
+
"Bassist",
|
|
914
|
+
"Pianist",
|
|
915
|
+
"Drummer",
|
|
916
|
+
"Keyboardist",
|
|
917
|
+
"Violinist",
|
|
918
|
+
"Cellist",
|
|
919
|
+
"Accompaniment",
|
|
920
|
+
"Accompanist",
|
|
921
|
+
"Accordionist",
|
|
922
|
+
"Ad-lib",
|
|
923
|
+
"Ad-libs",
|
|
924
|
+
"AdditionalVocals",
|
|
925
|
+
"Adlib",
|
|
926
|
+
"Adlibs",
|
|
927
|
+
"Allvocals",
|
|
928
|
+
"Allvocalsby",
|
|
929
|
+
"BGV",
|
|
930
|
+
"BGVs",
|
|
931
|
+
"BGs",
|
|
932
|
+
"BV",
|
|
933
|
+
"BackgroundVocal",
|
|
934
|
+
"BackingVocal",
|
|
935
|
+
"Banjoist",
|
|
936
|
+
"Beatbox",
|
|
937
|
+
"Beatboxer",
|
|
938
|
+
"Bvox",
|
|
939
|
+
"CV",
|
|
940
|
+
"ChildrenVoice",
|
|
941
|
+
"Clarinetist",
|
|
942
|
+
"Contrabassist",
|
|
943
|
+
"CoverSong",
|
|
944
|
+
"Dialogue",
|
|
945
|
+
"Ensemble",
|
|
946
|
+
"FemaleVoice",
|
|
947
|
+
"Flutist",
|
|
948
|
+
"GuestArtist",
|
|
949
|
+
"GuestSinger",
|
|
950
|
+
"Harmonies",
|
|
951
|
+
"Harpist",
|
|
952
|
+
"Hornist",
|
|
953
|
+
"HumanBeatbox",
|
|
954
|
+
"HumanVoice",
|
|
955
|
+
"LeadSinger",
|
|
956
|
+
"LeadVocalist",
|
|
957
|
+
"LiveBand",
|
|
958
|
+
"MainVocal",
|
|
959
|
+
"MainVocals",
|
|
960
|
+
"MaleVoice",
|
|
961
|
+
"Mandolinist",
|
|
962
|
+
"Narration",
|
|
963
|
+
"Orchestra",
|
|
964
|
+
"Organist",
|
|
965
|
+
"OriginalSinger",
|
|
966
|
+
"Percussionist",
|
|
967
|
+
"Recitation",
|
|
968
|
+
"Saxophonist",
|
|
969
|
+
"SessionMusician",
|
|
970
|
+
"SessionPlayer",
|
|
971
|
+
"Singers",
|
|
972
|
+
"Singing",
|
|
973
|
+
"Sitarist",
|
|
974
|
+
"Trombonist",
|
|
975
|
+
"Trumpeter",
|
|
976
|
+
"Tubist",
|
|
977
|
+
"Ukuleleist",
|
|
978
|
+
"Violist",
|
|
979
|
+
"VocalPerformance",
|
|
980
|
+
"Vocalists",
|
|
981
|
+
"VoiceActor",
|
|
982
|
+
"VoiceActress",
|
|
983
|
+
"Vox",
|
|
984
|
+
"Chorus",
|
|
985
|
+
"Solo"
|
|
986
|
+
]
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
"id": "instruments",
|
|
990
|
+
"kind": "instrument",
|
|
991
|
+
"roles": ["PERFORMER"],
|
|
992
|
+
"words": [
|
|
993
|
+
"Guitar",
|
|
994
|
+
"Piano",
|
|
995
|
+
"Bass",
|
|
996
|
+
"Drums",
|
|
997
|
+
"Keyboard",
|
|
998
|
+
"Strings",
|
|
999
|
+
"Synth",
|
|
1000
|
+
"Violin",
|
|
1001
|
+
"Cello",
|
|
1002
|
+
"Saxophone",
|
|
1003
|
+
"Trumpet",
|
|
1004
|
+
"Flute",
|
|
1005
|
+
"Clarinet",
|
|
1006
|
+
"Trombone",
|
|
1007
|
+
"Horn",
|
|
1008
|
+
"Organ",
|
|
1009
|
+
"Percussion",
|
|
1010
|
+
"Ukulele",
|
|
1011
|
+
"Banjo",
|
|
1012
|
+
"Mandolin",
|
|
1013
|
+
"Harp",
|
|
1014
|
+
"Viola",
|
|
1015
|
+
"AcousticGuitar",
|
|
1016
|
+
"ElectricGuitar",
|
|
1017
|
+
"BassGuitar",
|
|
1018
|
+
"ElectricBass",
|
|
1019
|
+
"Keyboards",
|
|
1020
|
+
"Keys",
|
|
1021
|
+
"Synthesizer",
|
|
1022
|
+
"Perc",
|
|
1023
|
+
"12-StringGuitar",
|
|
1024
|
+
"A.Gtr",
|
|
1025
|
+
"A.Sax",
|
|
1026
|
+
"Accordion",
|
|
1027
|
+
"AcousticBass",
|
|
1028
|
+
"AcousticElectricGuitar",
|
|
1029
|
+
"Allinstrumental",
|
|
1030
|
+
"Allinstrumentalby",
|
|
1031
|
+
"Allinstruments",
|
|
1032
|
+
"AltoSax",
|
|
1033
|
+
"AltoSaxophone",
|
|
1034
|
+
"AppalachianDulcimer",
|
|
1035
|
+
"Autoharp",
|
|
1036
|
+
"B.Cl",
|
|
1037
|
+
"B.Sax",
|
|
1038
|
+
"B3",
|
|
1039
|
+
"BANDONEÓN",
|
|
1040
|
+
"BODHRÁN",
|
|
1041
|
+
"Bagpipe",
|
|
1042
|
+
"Bagpipes",
|
|
1043
|
+
"Balalaika",
|
|
1044
|
+
"Bandoneon",
|
|
1045
|
+
"Bandoneón",
|
|
1046
|
+
"Banhu",
|
|
1047
|
+
"Bansuri",
|
|
1048
|
+
"BaritoneSax",
|
|
1049
|
+
"BaritoneSaxophone",
|
|
1050
|
+
"BassClarinet",
|
|
1051
|
+
"BassSynth",
|
|
1052
|
+
"Bassoon",
|
|
1053
|
+
"Bawu",
|
|
1054
|
+
"Bodhran",
|
|
1055
|
+
"Bodhrán",
|
|
1056
|
+
"Bongo",
|
|
1057
|
+
"Bouzouki",
|
|
1058
|
+
"Brass",
|
|
1059
|
+
"Bsn",
|
|
1060
|
+
"Bss",
|
|
1061
|
+
"CAJÓN",
|
|
1062
|
+
"Cajon",
|
|
1063
|
+
"Cajón",
|
|
1064
|
+
"Castanets",
|
|
1065
|
+
"Cb",
|
|
1066
|
+
"Celesta",
|
|
1067
|
+
"Charango",
|
|
1068
|
+
"Chimes",
|
|
1069
|
+
"Cl",
|
|
1070
|
+
"ClassicalGuitar",
|
|
1071
|
+
"Clav",
|
|
1072
|
+
"Claves",
|
|
1073
|
+
"Clavinet",
|
|
1074
|
+
"Cnt",
|
|
1075
|
+
"Concertina",
|
|
1076
|
+
"Conga",
|
|
1077
|
+
"Contrabass",
|
|
1078
|
+
"Cornet",
|
|
1079
|
+
"Cowbell",
|
|
1080
|
+
"Cymbal",
|
|
1081
|
+
"Cymbals",
|
|
1082
|
+
"DJ",
|
|
1083
|
+
"Daegeum",
|
|
1084
|
+
"Darbuka",
|
|
1085
|
+
"Daruan",
|
|
1086
|
+
"Didgeridoo",
|
|
1087
|
+
"Dizi",
|
|
1088
|
+
"Djembe",
|
|
1089
|
+
"Dobro",
|
|
1090
|
+
"DoubleBass",
|
|
1091
|
+
"Doumbek",
|
|
1092
|
+
"Dr",
|
|
1093
|
+
"Drum",
|
|
1094
|
+
"DrumMachine",
|
|
1095
|
+
"DrumPad",
|
|
1096
|
+
"DrumSet",
|
|
1097
|
+
"Duduk",
|
|
1098
|
+
"Dulcimer",
|
|
1099
|
+
"E.Bss",
|
|
1100
|
+
"E.Gtr",
|
|
1101
|
+
"E.Hn",
|
|
1102
|
+
"EP",
|
|
1103
|
+
"ElectricPiano",
|
|
1104
|
+
"ElectronicKeyboard",
|
|
1105
|
+
"EnglishHorn",
|
|
1106
|
+
"Erhu",
|
|
1107
|
+
"Euph",
|
|
1108
|
+
"Euphonium",
|
|
1109
|
+
"FingerDrumming",
|
|
1110
|
+
"Fingerpicking",
|
|
1111
|
+
"FingerstyleGuitar",
|
|
1112
|
+
"Fl",
|
|
1113
|
+
"Flageolet",
|
|
1114
|
+
"Flt",
|
|
1115
|
+
"Flugelhorn",
|
|
1116
|
+
"FrameDrum",
|
|
1117
|
+
"FrenchHorn",
|
|
1118
|
+
"Gaohu",
|
|
1119
|
+
"Gayageum",
|
|
1120
|
+
"Glockenspiel",
|
|
1121
|
+
"Gong",
|
|
1122
|
+
"Gtr",
|
|
1123
|
+
"Guiro",
|
|
1124
|
+
"Guitars",
|
|
1125
|
+
"Guqin",
|
|
1126
|
+
"Guzheng",
|
|
1127
|
+
"GÜIRO",
|
|
1128
|
+
"Güiro",
|
|
1129
|
+
"Haegeum",
|
|
1130
|
+
"HammeredDulcimer",
|
|
1131
|
+
"Hammond",
|
|
1132
|
+
"HammondOrgan",
|
|
1133
|
+
"HandDrum",
|
|
1134
|
+
"Handpan",
|
|
1135
|
+
"HangDrum",
|
|
1136
|
+
"Harmonica",
|
|
1137
|
+
"Harmonium",
|
|
1138
|
+
"Harpsichord",
|
|
1139
|
+
"Hn",
|
|
1140
|
+
"HornSection",
|
|
1141
|
+
"Horns",
|
|
1142
|
+
"Hpschd",
|
|
1143
|
+
"Hrp",
|
|
1144
|
+
"Hulusi",
|
|
1145
|
+
"Hurdy-Gurdy",
|
|
1146
|
+
"HurdyGurdy",
|
|
1147
|
+
"Janggu",
|
|
1148
|
+
"Jinghu",
|
|
1149
|
+
"Kalimba",
|
|
1150
|
+
"Keytar",
|
|
1151
|
+
"Konghou",
|
|
1152
|
+
"Kora",
|
|
1153
|
+
"Koto",
|
|
1154
|
+
"Kybd",
|
|
1155
|
+
"LapSteel",
|
|
1156
|
+
"LapSteelGuitar",
|
|
1157
|
+
"LeadGuitar",
|
|
1158
|
+
"Liuqin",
|
|
1159
|
+
"Lute",
|
|
1160
|
+
"MPC",
|
|
1161
|
+
"Marimba",
|
|
1162
|
+
"Matouqin",
|
|
1163
|
+
"Mbira",
|
|
1164
|
+
"Mellotron",
|
|
1165
|
+
"Melodica",
|
|
1166
|
+
"MorinKhuur",
|
|
1167
|
+
"MusicalInstruments",
|
|
1168
|
+
"Nyckelharpa",
|
|
1169
|
+
"NylonGuitar",
|
|
1170
|
+
"Ob",
|
|
1171
|
+
"Oboe",
|
|
1172
|
+
"Ocarina",
|
|
1173
|
+
"Org",
|
|
1174
|
+
"Oud",
|
|
1175
|
+
"PanFlute",
|
|
1176
|
+
"Panpipes",
|
|
1177
|
+
"PedalSteel",
|
|
1178
|
+
"PedalSteelGuitar",
|
|
1179
|
+
"PennyWhistle",
|
|
1180
|
+
"Picc",
|
|
1181
|
+
"Piccolo",
|
|
1182
|
+
"Pipa",
|
|
1183
|
+
"Pno",
|
|
1184
|
+
"Rebab",
|
|
1185
|
+
"Recorder",
|
|
1186
|
+
"Resonator",
|
|
1187
|
+
"ResonatorGuitar",
|
|
1188
|
+
"Rhodes",
|
|
1189
|
+
"RhythmGuitar",
|
|
1190
|
+
"Ruan",
|
|
1191
|
+
"S.Sax",
|
|
1192
|
+
"Sampler",
|
|
1193
|
+
"Sanxian",
|
|
1194
|
+
"Sax",
|
|
1195
|
+
"Scratching",
|
|
1196
|
+
"Sequencer",
|
|
1197
|
+
"Shaker",
|
|
1198
|
+
"Shakuhachi",
|
|
1199
|
+
"Shamisen",
|
|
1200
|
+
"Sheng",
|
|
1201
|
+
"Sitar",
|
|
1202
|
+
"SlideGuitar",
|
|
1203
|
+
"Snare",
|
|
1204
|
+
"SnareDrum",
|
|
1205
|
+
"SopranoSax",
|
|
1206
|
+
"SteelDrum",
|
|
1207
|
+
"SteelGuitar",
|
|
1208
|
+
"SteelPan",
|
|
1209
|
+
"Str",
|
|
1210
|
+
"String",
|
|
1211
|
+
"StringQuartet",
|
|
1212
|
+
"StringSection",
|
|
1213
|
+
"SubBass",
|
|
1214
|
+
"Suona",
|
|
1215
|
+
"SynthBass",
|
|
1216
|
+
"Synthesizers",
|
|
1217
|
+
"Synths",
|
|
1218
|
+
"T.Sax",
|
|
1219
|
+
"Tabla",
|
|
1220
|
+
"Taiko",
|
|
1221
|
+
"TalkingDrum",
|
|
1222
|
+
"Tamb",
|
|
1223
|
+
"Tambourine",
|
|
1224
|
+
"Tba",
|
|
1225
|
+
"Tbn",
|
|
1226
|
+
"TenorSax",
|
|
1227
|
+
"TenorSaxophone",
|
|
1228
|
+
"Theremin",
|
|
1229
|
+
"Timbales",
|
|
1230
|
+
"Timp",
|
|
1231
|
+
"Timpani",
|
|
1232
|
+
"TinWhistle",
|
|
1233
|
+
"Tpt",
|
|
1234
|
+
"Triangle",
|
|
1235
|
+
"Tuba",
|
|
1236
|
+
"TubularBells",
|
|
1237
|
+
"Turntable",
|
|
1238
|
+
"Turntables",
|
|
1239
|
+
"Uke",
|
|
1240
|
+
"UprightBass",
|
|
1241
|
+
"Vc",
|
|
1242
|
+
"Vib",
|
|
1243
|
+
"Vibes",
|
|
1244
|
+
"Vibraphone",
|
|
1245
|
+
"Vla",
|
|
1246
|
+
"Vln",
|
|
1247
|
+
"Vocoder",
|
|
1248
|
+
"Whistle",
|
|
1249
|
+
"Winds",
|
|
1250
|
+
"Woodblock",
|
|
1251
|
+
"Woodwinds",
|
|
1252
|
+
"Wurlitzer",
|
|
1253
|
+
"Xiao",
|
|
1254
|
+
"Xiaoruan",
|
|
1255
|
+
"Xun",
|
|
1256
|
+
"Xylo",
|
|
1257
|
+
"Xylophone",
|
|
1258
|
+
"Yangqin",
|
|
1259
|
+
"Yueqin",
|
|
1260
|
+
"Zhonghu",
|
|
1261
|
+
"Zither"
|
|
1262
|
+
]
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
"id": "mixer",
|
|
1266
|
+
"kind": "role",
|
|
1267
|
+
"roles": ["MIXER"],
|
|
1268
|
+
"words": [
|
|
1269
|
+
"Mix",
|
|
1270
|
+
"Mixedby",
|
|
1271
|
+
"Mixing",
|
|
1272
|
+
"Mixer",
|
|
1273
|
+
"MixingEngineer",
|
|
1274
|
+
"MixEngineer",
|
|
1275
|
+
"Remix",
|
|
1276
|
+
"Remixedby",
|
|
1277
|
+
"Remixer",
|
|
1278
|
+
"Mixdown",
|
|
1279
|
+
"Mixdownby",
|
|
1280
|
+
"Mixed",
|
|
1281
|
+
"Remixby"
|
|
1282
|
+
]
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
"id": "mastering",
|
|
1286
|
+
"kind": "role",
|
|
1287
|
+
"roles": ["MASTERING"],
|
|
1288
|
+
"words": [
|
|
1289
|
+
"Mastering",
|
|
1290
|
+
"Masteredby",
|
|
1291
|
+
"Master",
|
|
1292
|
+
"MasteringEngineer",
|
|
1293
|
+
"MasterEngineer",
|
|
1294
|
+
"Mst",
|
|
1295
|
+
"Mastered",
|
|
1296
|
+
"MasteringEngineerby",
|
|
1297
|
+
"Masteringby"
|
|
1298
|
+
]
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"id": "lyrics-and-composition",
|
|
1302
|
+
"kind": "role",
|
|
1303
|
+
"roles": ["LYRICIST", "COMPOSER"],
|
|
1304
|
+
"words": [
|
|
1305
|
+
"Lyrics&Music",
|
|
1306
|
+
"Music&Lyrics",
|
|
1307
|
+
"Words&Music",
|
|
1308
|
+
"Lyrics&Musicby",
|
|
1309
|
+
"Music&Lyricsby",
|
|
1310
|
+
"Words&Musicby",
|
|
1311
|
+
"Composed&Writtenby",
|
|
1312
|
+
"ComposedandWrittenby",
|
|
1313
|
+
"Composer&Lyricist",
|
|
1314
|
+
"Composer/Lyricist",
|
|
1315
|
+
"Lyricist&Composer",
|
|
1316
|
+
"Lyricist/Composer",
|
|
1317
|
+
"Lyrics&Melody",
|
|
1318
|
+
"Lyrics/Music",
|
|
1319
|
+
"LyricsandMusic",
|
|
1320
|
+
"LyricsandMusicby",
|
|
1321
|
+
"Melody&Lyrics",
|
|
1322
|
+
"Melody&Words",
|
|
1323
|
+
"Music&Words",
|
|
1324
|
+
"Music/Lyrics",
|
|
1325
|
+
"MusicandLyrics",
|
|
1326
|
+
"MusicandLyricsby",
|
|
1327
|
+
"Words&Melody",
|
|
1328
|
+
"Words/Music",
|
|
1329
|
+
"WordsandMusic",
|
|
1330
|
+
"WordsandMusicby",
|
|
1331
|
+
"Written&Composedby",
|
|
1332
|
+
"WrittenandComposedby"
|
|
1333
|
+
]
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
"id": "composition-and-arrangement",
|
|
1337
|
+
"kind": "role",
|
|
1338
|
+
"roles": ["COMPOSER", "ARRANGER"],
|
|
1339
|
+
"words": [
|
|
1340
|
+
"Composer&Arranger",
|
|
1341
|
+
"Composer/Arranger",
|
|
1342
|
+
"Composed&Arrangedby",
|
|
1343
|
+
"Music&Arrangement",
|
|
1344
|
+
"Composed&Arranged",
|
|
1345
|
+
"ComposedandArrangedby",
|
|
1346
|
+
"ComposerandArranger",
|
|
1347
|
+
"Composition&Arrangement",
|
|
1348
|
+
"MusicandArrangement"
|
|
1349
|
+
]
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"id": "mixing-and-mastering",
|
|
1353
|
+
"kind": "role",
|
|
1354
|
+
"roles": ["MIXER", "MASTERING"],
|
|
1355
|
+
"words": [
|
|
1356
|
+
"Mix&Master",
|
|
1357
|
+
"Mix/Master",
|
|
1358
|
+
"Mixed&Masteredby",
|
|
1359
|
+
"Mixing&Mastering",
|
|
1360
|
+
"Mixing/Mastering",
|
|
1361
|
+
"Mix&Mastering",
|
|
1362
|
+
"MixandMaster",
|
|
1363
|
+
"MixandMastering",
|
|
1364
|
+
"MixedandMasteredby",
|
|
1365
|
+
"Mixing&Master",
|
|
1366
|
+
"MixingandMaster",
|
|
1367
|
+
"MixingandMastering"
|
|
1368
|
+
]
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
"id": "lyrics-and-arrangement",
|
|
1372
|
+
"kind": "role",
|
|
1373
|
+
"roles": ["LYRICIST", "ARRANGER"],
|
|
1374
|
+
"words": [
|
|
1375
|
+
"Lyrics&Arrangement",
|
|
1376
|
+
"LyricsArrangement",
|
|
1377
|
+
"LyricsandArrangement",
|
|
1378
|
+
"Words&Arrangement",
|
|
1379
|
+
"WordsArrangement"
|
|
1380
|
+
]
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
"id": "lyrics-composition-and-arrangement",
|
|
1384
|
+
"kind": "role",
|
|
1385
|
+
"roles": [
|
|
1386
|
+
"LYRICIST",
|
|
1387
|
+
"COMPOSER",
|
|
1388
|
+
"ARRANGER"
|
|
1389
|
+
],
|
|
1390
|
+
"words": [
|
|
1391
|
+
"ComposedWritten&Arrangedby",
|
|
1392
|
+
"ComposedWrittenandArrangedby",
|
|
1393
|
+
"LyricsMusic&Arrangement",
|
|
1394
|
+
"LyricsMusicArrangement",
|
|
1395
|
+
"LyricsMusicandArrangement",
|
|
1396
|
+
"MusicLyrics&Arrangement",
|
|
1397
|
+
"WordsMusic&Arrangement",
|
|
1398
|
+
"WrittenComposed&Arrangedby",
|
|
1399
|
+
"WrittenComposedandArrangedby"
|
|
1400
|
+
]
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
"id": "singer-songwriter",
|
|
1404
|
+
"kind": "role",
|
|
1405
|
+
"roles": [
|
|
1406
|
+
"LYRICIST",
|
|
1407
|
+
"COMPOSER",
|
|
1408
|
+
"PERFORMER"
|
|
1409
|
+
],
|
|
1410
|
+
"words": [
|
|
1411
|
+
"Singer-Songwriter",
|
|
1412
|
+
"SingerSongwriter",
|
|
1413
|
+
"SingerSongwriterby"
|
|
1414
|
+
]
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
"id": "other",
|
|
1418
|
+
"kind": "role",
|
|
1419
|
+
"roles": ["OTHER"],
|
|
1420
|
+
"words": [
|
|
1421
|
+
"Engineer",
|
|
1422
|
+
"RecordingEngineer",
|
|
1423
|
+
"SoundEngineer",
|
|
1424
|
+
"MixAssistant",
|
|
1425
|
+
"MixingAssistant",
|
|
1426
|
+
"MasteringAssistant",
|
|
1427
|
+
"A&R",
|
|
1428
|
+
"ArtDirection",
|
|
1429
|
+
"ArtDirector",
|
|
1430
|
+
"Design",
|
|
1431
|
+
"Designer",
|
|
1432
|
+
"Photographer",
|
|
1433
|
+
"Photography",
|
|
1434
|
+
"Photo",
|
|
1435
|
+
"Director",
|
|
1436
|
+
"Video",
|
|
1437
|
+
"Manager",
|
|
1438
|
+
"Management",
|
|
1439
|
+
"Coordinator",
|
|
1440
|
+
"Consultant",
|
|
1441
|
+
"Translator",
|
|
1442
|
+
"Translation",
|
|
1443
|
+
"Transcription",
|
|
1444
|
+
"Editor",
|
|
1445
|
+
"Edit",
|
|
1446
|
+
"Programmer",
|
|
1447
|
+
"Programming",
|
|
1448
|
+
"Conductor",
|
|
1449
|
+
"Choreographer",
|
|
1450
|
+
"A.Eng",
|
|
1451
|
+
"Acknowledgments",
|
|
1452
|
+
"AdditionalEngineering",
|
|
1453
|
+
"Adjustment",
|
|
1454
|
+
"AlbumArt",
|
|
1455
|
+
"Animatedby",
|
|
1456
|
+
"Animation",
|
|
1457
|
+
"Animator",
|
|
1458
|
+
"Animatorby",
|
|
1459
|
+
"ArtConsultant",
|
|
1460
|
+
"ArtistManagement",
|
|
1461
|
+
"Artistassistant",
|
|
1462
|
+
"ArtistsandRepertoire",
|
|
1463
|
+
"Artwork",
|
|
1464
|
+
"AssetManagement",
|
|
1465
|
+
"Assistance",
|
|
1466
|
+
"Assistant",
|
|
1467
|
+
"AssistantEngineer",
|
|
1468
|
+
"AssistantMixEngineer",
|
|
1469
|
+
"AsstEng",
|
|
1470
|
+
"AudioEditing",
|
|
1471
|
+
"AudioEditor",
|
|
1472
|
+
"AudioEngineer",
|
|
1473
|
+
"Auto-Tune",
|
|
1474
|
+
"BTS",
|
|
1475
|
+
"Beatby",
|
|
1476
|
+
"Beatmaker",
|
|
1477
|
+
"Beats",
|
|
1478
|
+
"Behind-the-Scenes",
|
|
1479
|
+
"Behind-theScenes",
|
|
1480
|
+
"Behindthe-Scenes",
|
|
1481
|
+
"BehindtheScenes",
|
|
1482
|
+
"CG",
|
|
1483
|
+
"COO",
|
|
1484
|
+
"ChiefOperatingOfficer",
|
|
1485
|
+
"Choreography",
|
|
1486
|
+
"Clothing",
|
|
1487
|
+
"ComputerEngineer",
|
|
1488
|
+
"Cond",
|
|
1489
|
+
"Conductedby",
|
|
1490
|
+
"Contractor",
|
|
1491
|
+
"Copyist",
|
|
1492
|
+
"Copywriter",
|
|
1493
|
+
"Copywriting",
|
|
1494
|
+
"Costume",
|
|
1495
|
+
"CoverArt",
|
|
1496
|
+
"CoverDesign",
|
|
1497
|
+
"CreativeDirection",
|
|
1498
|
+
"CreativeDirector",
|
|
1499
|
+
"Designedby",
|
|
1500
|
+
"Digitaledit",
|
|
1501
|
+
"Digitalediting",
|
|
1502
|
+
"Directedby",
|
|
1503
|
+
"Distributedby",
|
|
1504
|
+
"DolbyAtmos",
|
|
1505
|
+
"Drawing",
|
|
1506
|
+
"DrumProgramming",
|
|
1507
|
+
"DrumTech",
|
|
1508
|
+
"Editedby",
|
|
1509
|
+
"Eng",
|
|
1510
|
+
"Engineeredby",
|
|
1511
|
+
"FOHEngineer",
|
|
1512
|
+
"Fashion",
|
|
1513
|
+
"Film",
|
|
1514
|
+
"Filmedby",
|
|
1515
|
+
"FineArts",
|
|
1516
|
+
"Flatdesign",
|
|
1517
|
+
"Foley",
|
|
1518
|
+
"FoleyArtist",
|
|
1519
|
+
"FrontofHouse",
|
|
1520
|
+
"FrontofHouseEngineer",
|
|
1521
|
+
"GraphicDesign",
|
|
1522
|
+
"Graphics",
|
|
1523
|
+
"Graphicvisual",
|
|
1524
|
+
"GuitarTech",
|
|
1525
|
+
"Hair",
|
|
1526
|
+
"Hair-Stylist",
|
|
1527
|
+
"HairStylist",
|
|
1528
|
+
"Illustratedby",
|
|
1529
|
+
"Illustration",
|
|
1530
|
+
"Illustrator",
|
|
1531
|
+
"Inscription",
|
|
1532
|
+
"InstrumentTech",
|
|
1533
|
+
"Librarian",
|
|
1534
|
+
"LightTech",
|
|
1535
|
+
"LightingDesigner",
|
|
1536
|
+
"LiveSoundEngineer",
|
|
1537
|
+
"Loops",
|
|
1538
|
+
"LyricVideo",
|
|
1539
|
+
"MD",
|
|
1540
|
+
"MIDI",
|
|
1541
|
+
"MIDIProgramming",
|
|
1542
|
+
"MV",
|
|
1543
|
+
"MVDirector",
|
|
1544
|
+
"MainCreators",
|
|
1545
|
+
"Make-up",
|
|
1546
|
+
"Makeup",
|
|
1547
|
+
"MakeupArtist",
|
|
1548
|
+
"Making",
|
|
1549
|
+
"Making-of",
|
|
1550
|
+
"Makingof",
|
|
1551
|
+
"Marketing",
|
|
1552
|
+
"Marketing&promotion",
|
|
1553
|
+
"MonitorEngineer",
|
|
1554
|
+
"MusicConcept",
|
|
1555
|
+
"MusicDirector",
|
|
1556
|
+
"MusicVideo",
|
|
1557
|
+
"MusicVideoDirector",
|
|
1558
|
+
"Musicproductionassistant",
|
|
1559
|
+
"OP",
|
|
1560
|
+
"PGM",
|
|
1561
|
+
"PRpromotion",
|
|
1562
|
+
"PV",
|
|
1563
|
+
"Photoby",
|
|
1564
|
+
"PitchCorrection",
|
|
1565
|
+
"PitchEditing",
|
|
1566
|
+
"Planner",
|
|
1567
|
+
"Planning",
|
|
1568
|
+
"Post-production",
|
|
1569
|
+
"PostMastering",
|
|
1570
|
+
"PostProd",
|
|
1571
|
+
"Pre-production",
|
|
1572
|
+
"Printvisual",
|
|
1573
|
+
"Productionassistant",
|
|
1574
|
+
"Prog",
|
|
1575
|
+
"Program",
|
|
1576
|
+
"Programmedby",
|
|
1577
|
+
"ProjectCoordinator",
|
|
1578
|
+
"ProjectPlanning",
|
|
1579
|
+
"Promo-Material",
|
|
1580
|
+
"PromoMaterial",
|
|
1581
|
+
"Promotion",
|
|
1582
|
+
"Proofreading",
|
|
1583
|
+
"Publicity",
|
|
1584
|
+
"Publishedby",
|
|
1585
|
+
"Publisher",
|
|
1586
|
+
"Rec",
|
|
1587
|
+
"Recordedby",
|
|
1588
|
+
"Recording",
|
|
1589
|
+
"RecordingAssistant",
|
|
1590
|
+
"Recordist",
|
|
1591
|
+
"SFX",
|
|
1592
|
+
"SFXDesigner",
|
|
1593
|
+
"SP",
|
|
1594
|
+
"Samples",
|
|
1595
|
+
"Sampling",
|
|
1596
|
+
"Scoring",
|
|
1597
|
+
"Short-Form",
|
|
1598
|
+
"Short-Video",
|
|
1599
|
+
"ShortForm",
|
|
1600
|
+
"ShortVideo",
|
|
1601
|
+
"Songby",
|
|
1602
|
+
"Songwriter",
|
|
1603
|
+
"Songwriting",
|
|
1604
|
+
"SoundDes",
|
|
1605
|
+
"SoundDesign",
|
|
1606
|
+
"SoundDesigner",
|
|
1607
|
+
"SoundEffects",
|
|
1608
|
+
"SoundEffectsDesigner",
|
|
1609
|
+
"SoundMixer",
|
|
1610
|
+
"SpecialThanks",
|
|
1611
|
+
"SpecialThanksto",
|
|
1612
|
+
"StageManager",
|
|
1613
|
+
"Styling",
|
|
1614
|
+
"Stylist",
|
|
1615
|
+
"Sub-publisher",
|
|
1616
|
+
"Subpublisher",
|
|
1617
|
+
"Subtitles",
|
|
1618
|
+
"Supervisedby",
|
|
1619
|
+
"Tech",
|
|
1620
|
+
"Thanks",
|
|
1621
|
+
"Thanksto",
|
|
1622
|
+
"Timing",
|
|
1623
|
+
"Topliner",
|
|
1624
|
+
"TrackingEng",
|
|
1625
|
+
"TrackingEngineer",
|
|
1626
|
+
"Training",
|
|
1627
|
+
"Trans",
|
|
1628
|
+
"Transcriber",
|
|
1629
|
+
"Translatedby",
|
|
1630
|
+
"Tunedby",
|
|
1631
|
+
"Tuning",
|
|
1632
|
+
"Videoby",
|
|
1633
|
+
"Visual",
|
|
1634
|
+
"VisualDesign",
|
|
1635
|
+
"VocalCoach",
|
|
1636
|
+
"VocalDirectedby",
|
|
1637
|
+
"VocalDirection",
|
|
1638
|
+
"VocalDirector",
|
|
1639
|
+
"VocalEdit",
|
|
1640
|
+
"VocalEditing",
|
|
1641
|
+
"VocalEditor",
|
|
1642
|
+
"VocalTuning",
|
|
1643
|
+
"Wardrobe",
|
|
1644
|
+
"Writer",
|
|
1645
|
+
"Written",
|
|
1646
|
+
"Writtenby",
|
|
1647
|
+
"Art",
|
|
1648
|
+
"Image",
|
|
1649
|
+
"Material",
|
|
1650
|
+
"Marketing-Material",
|
|
1651
|
+
"MarketingMaterial",
|
|
1652
|
+
"Copyrightmanagement",
|
|
1653
|
+
"Copyrightoperation",
|
|
1654
|
+
"StudioManager",
|
|
1655
|
+
"Beat",
|
|
1656
|
+
"Cut",
|
|
1657
|
+
"Guest",
|
|
1658
|
+
"Stage"
|
|
1659
|
+
]
|
|
1660
|
+
}
|
|
1661
|
+
]
|
|
1662
|
+
};
|
|
1663
|
+
var zh_hans_default$1 = {
|
|
1664
|
+
$schema: "../schema.json",
|
|
1665
|
+
version: 1,
|
|
1666
|
+
language: "zh-hans",
|
|
1667
|
+
normalization: {
|
|
1668
|
+
"whitespace": "remove",
|
|
1669
|
+
"case": "asciiLower"
|
|
1670
|
+
},
|
|
1671
|
+
groups: [
|
|
1672
|
+
{
|
|
1673
|
+
"id": "lyricist",
|
|
1674
|
+
"kind": "role",
|
|
1675
|
+
"roles": ["LYRICIST"],
|
|
1676
|
+
"words": [
|
|
1677
|
+
"作词",
|
|
1678
|
+
"填词",
|
|
1679
|
+
"词",
|
|
1680
|
+
"歌词",
|
|
1681
|
+
"作词人",
|
|
1682
|
+
"词作者",
|
|
1683
|
+
"作词者",
|
|
1684
|
+
"填词人",
|
|
1685
|
+
"词作",
|
|
1686
|
+
"中文词",
|
|
1687
|
+
"英文词",
|
|
1688
|
+
"粤语词",
|
|
1689
|
+
"韩文词",
|
|
1690
|
+
"日文词",
|
|
1691
|
+
"RAP词"
|
|
1692
|
+
]
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
"id": "composer",
|
|
1696
|
+
"kind": "role",
|
|
1697
|
+
"roles": ["COMPOSER"],
|
|
1698
|
+
"words": [
|
|
1699
|
+
"作曲",
|
|
1700
|
+
"曲",
|
|
1701
|
+
"谱曲",
|
|
1702
|
+
"作曲人",
|
|
1703
|
+
"曲作者",
|
|
1704
|
+
"作曲者"
|
|
1705
|
+
]
|
|
1706
|
+
},
|
|
1707
|
+
{
|
|
1708
|
+
"id": "arranger",
|
|
1709
|
+
"kind": "role",
|
|
1710
|
+
"roles": ["ARRANGER"],
|
|
1711
|
+
"words": [
|
|
1712
|
+
"编曲",
|
|
1713
|
+
"配器",
|
|
1714
|
+
"和声编写",
|
|
1715
|
+
"弦乐编写",
|
|
1716
|
+
"管乐编写",
|
|
1717
|
+
"节奏编写",
|
|
1718
|
+
"合唱编写",
|
|
1719
|
+
"和声编排",
|
|
1720
|
+
"弦乐编排",
|
|
1721
|
+
"管弦乐编排",
|
|
1722
|
+
"编曲人",
|
|
1723
|
+
"编曲者",
|
|
1724
|
+
"编曲师",
|
|
1725
|
+
"和声编配",
|
|
1726
|
+
"弦乐编配",
|
|
1727
|
+
"和音编写"
|
|
1728
|
+
]
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
"id": "producer",
|
|
1732
|
+
"kind": "role",
|
|
1733
|
+
"roles": ["PRODUCER"],
|
|
1734
|
+
"words": [
|
|
1735
|
+
"制作人",
|
|
1736
|
+
"制作",
|
|
1737
|
+
"监制",
|
|
1738
|
+
"出品人",
|
|
1739
|
+
"出品",
|
|
1740
|
+
"音乐制作人",
|
|
1741
|
+
"执行制作人",
|
|
1742
|
+
"制作总监",
|
|
1743
|
+
"总制作人",
|
|
1744
|
+
"人声制作",
|
|
1745
|
+
"人声制作人",
|
|
1746
|
+
"配唱制作人",
|
|
1747
|
+
"共同制作",
|
|
1748
|
+
"共同制作人",
|
|
1749
|
+
"协力制作人",
|
|
1750
|
+
"制作协力",
|
|
1751
|
+
"单曲制作",
|
|
1752
|
+
"创意制作人",
|
|
1753
|
+
"出品方",
|
|
1754
|
+
"联合出品",
|
|
1755
|
+
"联合出品方",
|
|
1756
|
+
"执制",
|
|
1757
|
+
"执行监制",
|
|
1758
|
+
"总监制",
|
|
1759
|
+
"音乐监制"
|
|
1760
|
+
]
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
"id": "performer",
|
|
1764
|
+
"kind": "role",
|
|
1765
|
+
"roles": ["PERFORMER"],
|
|
1766
|
+
"words": [
|
|
1767
|
+
"演唱",
|
|
1768
|
+
"主唱",
|
|
1769
|
+
"歌手",
|
|
1770
|
+
"唱",
|
|
1771
|
+
"和声",
|
|
1772
|
+
"和音",
|
|
1773
|
+
"伴唱",
|
|
1774
|
+
"合唱",
|
|
1775
|
+
"原唱",
|
|
1776
|
+
"翻唱",
|
|
1777
|
+
"配唱",
|
|
1778
|
+
"女声",
|
|
1779
|
+
"男声",
|
|
1780
|
+
"童声",
|
|
1781
|
+
"人声",
|
|
1782
|
+
"合声",
|
|
1783
|
+
"合音",
|
|
1784
|
+
"领唱",
|
|
1785
|
+
"独奏",
|
|
1786
|
+
"演奏",
|
|
1787
|
+
"演奏者",
|
|
1788
|
+
"说唱",
|
|
1789
|
+
"配音",
|
|
1790
|
+
"旁白",
|
|
1791
|
+
"念白",
|
|
1792
|
+
"对白",
|
|
1793
|
+
"口技",
|
|
1794
|
+
"人声打击",
|
|
1795
|
+
"乐队",
|
|
1796
|
+
"乐团",
|
|
1797
|
+
"交响乐团",
|
|
1798
|
+
"管弦乐团",
|
|
1799
|
+
"弦乐团",
|
|
1800
|
+
"现场乐队",
|
|
1801
|
+
"乐手",
|
|
1802
|
+
"乐师",
|
|
1803
|
+
"伴奏",
|
|
1804
|
+
"演唱者",
|
|
1805
|
+
"演唱人",
|
|
1806
|
+
"和声者",
|
|
1807
|
+
"伴唱者",
|
|
1808
|
+
"领唱者",
|
|
1809
|
+
"吉他手",
|
|
1810
|
+
"贝斯手",
|
|
1811
|
+
"鼓手",
|
|
1812
|
+
"键盘手",
|
|
1813
|
+
"钢琴家",
|
|
1814
|
+
"小提琴手",
|
|
1815
|
+
"大提琴手",
|
|
1816
|
+
"中提琴手",
|
|
1817
|
+
"长笛手",
|
|
1818
|
+
"萨克斯手",
|
|
1819
|
+
"小号手",
|
|
1820
|
+
"长号手",
|
|
1821
|
+
"圆号手",
|
|
1822
|
+
"打击乐手",
|
|
1823
|
+
"单簧管手",
|
|
1824
|
+
"口琴手",
|
|
1825
|
+
"合唱团",
|
|
1826
|
+
"手风琴手",
|
|
1827
|
+
"竖琴手",
|
|
1828
|
+
"艺人"
|
|
1829
|
+
]
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
"id": "instruments",
|
|
1833
|
+
"kind": "instrument",
|
|
1834
|
+
"roles": ["PERFORMER"],
|
|
1835
|
+
"words": [
|
|
1836
|
+
"吉他",
|
|
1837
|
+
"钢琴",
|
|
1838
|
+
"贝斯",
|
|
1839
|
+
"贝司",
|
|
1840
|
+
"鼓",
|
|
1841
|
+
"键盘",
|
|
1842
|
+
"弦乐",
|
|
1843
|
+
"小提琴",
|
|
1844
|
+
"大提琴",
|
|
1845
|
+
"中提琴",
|
|
1846
|
+
"长笛",
|
|
1847
|
+
"萨克斯",
|
|
1848
|
+
"小号",
|
|
1849
|
+
"长号",
|
|
1850
|
+
"圆号",
|
|
1851
|
+
"单簧管",
|
|
1852
|
+
"双簧管",
|
|
1853
|
+
"手风琴",
|
|
1854
|
+
"口琴",
|
|
1855
|
+
"二胡",
|
|
1856
|
+
"古筝",
|
|
1857
|
+
"琵琶",
|
|
1858
|
+
"架子鼓",
|
|
1859
|
+
"电子琴",
|
|
1860
|
+
"合成器",
|
|
1861
|
+
"打击乐",
|
|
1862
|
+
"打击乐器",
|
|
1863
|
+
"管乐",
|
|
1864
|
+
"木管",
|
|
1865
|
+
"铜管",
|
|
1866
|
+
"三味线",
|
|
1867
|
+
"三弦",
|
|
1868
|
+
"三角铁",
|
|
1869
|
+
"中国笛",
|
|
1870
|
+
"中提",
|
|
1871
|
+
"中胡",
|
|
1872
|
+
"中阮",
|
|
1873
|
+
"乌德琴",
|
|
1874
|
+
"乐器",
|
|
1875
|
+
"乐器独奏",
|
|
1876
|
+
"京胡",
|
|
1877
|
+
"伽倻琴",
|
|
1878
|
+
"低音单簧管",
|
|
1879
|
+
"低音吉他",
|
|
1880
|
+
"低音提琴",
|
|
1881
|
+
"克拉维奈",
|
|
1882
|
+
"全部乐器",
|
|
1883
|
+
"六角手风琴",
|
|
1884
|
+
"军鼓",
|
|
1885
|
+
"刮壶",
|
|
1886
|
+
"十二弦吉他",
|
|
1887
|
+
"卡洪",
|
|
1888
|
+
"口风琴",
|
|
1889
|
+
"古琴",
|
|
1890
|
+
"合成贝斯",
|
|
1891
|
+
"哈蒙德风琴",
|
|
1892
|
+
"响板",
|
|
1893
|
+
"哨笛",
|
|
1894
|
+
"唢呐",
|
|
1895
|
+
"埙",
|
|
1896
|
+
"塔布拉",
|
|
1897
|
+
"声码器",
|
|
1898
|
+
"大号",
|
|
1899
|
+
"大提",
|
|
1900
|
+
"大笒",
|
|
1901
|
+
"大管",
|
|
1902
|
+
"大键琴",
|
|
1903
|
+
"大阮",
|
|
1904
|
+
"太鼓",
|
|
1905
|
+
"奚琴",
|
|
1906
|
+
"定音鼓",
|
|
1907
|
+
"富鲁格",
|
|
1908
|
+
"富鲁格号",
|
|
1909
|
+
"小提",
|
|
1910
|
+
"小阮",
|
|
1911
|
+
"小鼓",
|
|
1912
|
+
"尤克里里",
|
|
1913
|
+
"尺八",
|
|
1914
|
+
"巴乌",
|
|
1915
|
+
"巴拉莱卡",
|
|
1916
|
+
"巴松",
|
|
1917
|
+
"布祖基",
|
|
1918
|
+
"序列器",
|
|
1919
|
+
"康加鼓",
|
|
1920
|
+
"弦",
|
|
1921
|
+
"德西马",
|
|
1922
|
+
"恰朗戈",
|
|
1923
|
+
"所有乐器",
|
|
1924
|
+
"所有乐器演奏",
|
|
1925
|
+
"手摇琴",
|
|
1926
|
+
"手碟",
|
|
1927
|
+
"手鼓",
|
|
1928
|
+
"打击垫",
|
|
1929
|
+
"扬琴",
|
|
1930
|
+
"拇指琴",
|
|
1931
|
+
"拉巴卜",
|
|
1932
|
+
"指弹吉他",
|
|
1933
|
+
"排笛",
|
|
1934
|
+
"排箫",
|
|
1935
|
+
"提琴",
|
|
1936
|
+
"曼陀林",
|
|
1937
|
+
"月琴",
|
|
1938
|
+
"木吉他",
|
|
1939
|
+
"木棒",
|
|
1940
|
+
"木琴",
|
|
1941
|
+
"木箱鼓",
|
|
1942
|
+
"木鱼",
|
|
1943
|
+
"杜杜克",
|
|
1944
|
+
"板胡",
|
|
1945
|
+
"柳琴",
|
|
1946
|
+
"框鼓",
|
|
1947
|
+
"梅洛特隆",
|
|
1948
|
+
"次中音号",
|
|
1949
|
+
"沙锤",
|
|
1950
|
+
"波德兰鼓",
|
|
1951
|
+
"洞萧",
|
|
1952
|
+
"滑棒吉他",
|
|
1953
|
+
"牛铃",
|
|
1954
|
+
"特雷门琴",
|
|
1955
|
+
"玉琴",
|
|
1956
|
+
"班卓琴",
|
|
1957
|
+
"班多钮",
|
|
1958
|
+
"班苏里笛",
|
|
1959
|
+
"瑶琴",
|
|
1960
|
+
"电吉他",
|
|
1961
|
+
"电子打击垫",
|
|
1962
|
+
"电子鼓",
|
|
1963
|
+
"电贝司",
|
|
1964
|
+
"电贝斯",
|
|
1965
|
+
"电钢琴",
|
|
1966
|
+
"短号",
|
|
1967
|
+
"短笛",
|
|
1968
|
+
"竖琴",
|
|
1969
|
+
"竖笛",
|
|
1970
|
+
"竹笛",
|
|
1971
|
+
"笙",
|
|
1972
|
+
"笛子",
|
|
1973
|
+
"笛萧",
|
|
1974
|
+
"筝",
|
|
1975
|
+
"箜篌",
|
|
1976
|
+
"管钟",
|
|
1977
|
+
"箫",
|
|
1978
|
+
"箱琴",
|
|
1979
|
+
"簧风琴",
|
|
1980
|
+
"编钟",
|
|
1981
|
+
"肩背键盘",
|
|
1982
|
+
"自动竖琴",
|
|
1983
|
+
"英国管",
|
|
1984
|
+
"葫芦丝",
|
|
1985
|
+
"蒂姆巴尔鼓",
|
|
1986
|
+
"西塔琴",
|
|
1987
|
+
"说话鼓",
|
|
1988
|
+
"谐振吉他",
|
|
1989
|
+
"踏板钢弦吉他",
|
|
1990
|
+
"转盘",
|
|
1991
|
+
"达布卡",
|
|
1992
|
+
"迪吉里杜管",
|
|
1993
|
+
"邦戈鼓",
|
|
1994
|
+
"采样器",
|
|
1995
|
+
"金贝鼓",
|
|
1996
|
+
"钟琴",
|
|
1997
|
+
"钢片琴",
|
|
1998
|
+
"钢鼓",
|
|
1999
|
+
"钹",
|
|
2000
|
+
"铃鼓",
|
|
2001
|
+
"锡笛",
|
|
2002
|
+
"锣",
|
|
2003
|
+
"键提琴",
|
|
2004
|
+
"镲",
|
|
2005
|
+
"长鼓",
|
|
2006
|
+
"阮",
|
|
2007
|
+
"陶笛",
|
|
2008
|
+
"非洲鼓",
|
|
2009
|
+
"颤音琴",
|
|
2010
|
+
"风琴",
|
|
2011
|
+
"风笛",
|
|
2012
|
+
"马头琴",
|
|
2013
|
+
"马林巴",
|
|
2014
|
+
"高胡",
|
|
2015
|
+
"鲁特琴",
|
|
2016
|
+
"齐特琴"
|
|
2017
|
+
]
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
"id": "mixer",
|
|
2021
|
+
"kind": "role",
|
|
2022
|
+
"roles": ["MIXER"],
|
|
2023
|
+
"words": [
|
|
2024
|
+
"混音",
|
|
2025
|
+
"混音师",
|
|
2026
|
+
"混",
|
|
2027
|
+
"混音工程师",
|
|
2028
|
+
"缩混",
|
|
2029
|
+
"贴混",
|
|
2030
|
+
"混音工程",
|
|
2031
|
+
"重混音师"
|
|
2032
|
+
]
|
|
2033
|
+
},
|
|
2034
|
+
{
|
|
2035
|
+
"id": "mastering",
|
|
2036
|
+
"kind": "role",
|
|
2037
|
+
"roles": ["MASTERING"],
|
|
2038
|
+
"words": [
|
|
2039
|
+
"母带",
|
|
2040
|
+
"母带工程师",
|
|
2041
|
+
"母带处理",
|
|
2042
|
+
"母带制作",
|
|
2043
|
+
"母带后期",
|
|
2044
|
+
"母带工程",
|
|
2045
|
+
"母带师",
|
|
2046
|
+
"母带制作人",
|
|
2047
|
+
"母带处理制作人"
|
|
2048
|
+
]
|
|
2049
|
+
},
|
|
2050
|
+
{
|
|
2051
|
+
"id": "lyrics-and-composition",
|
|
2052
|
+
"kind": "role",
|
|
2053
|
+
"roles": ["LYRICIST", "COMPOSER"],
|
|
2054
|
+
"words": [
|
|
2055
|
+
"词曲",
|
|
2056
|
+
"作词/作曲",
|
|
2057
|
+
"作词作曲",
|
|
2058
|
+
"词/曲",
|
|
2059
|
+
"词&曲",
|
|
2060
|
+
"词曲作者",
|
|
2061
|
+
"词曲创作",
|
|
2062
|
+
"作曲/作词",
|
|
2063
|
+
"作曲、作词",
|
|
2064
|
+
"作词+作曲",
|
|
2065
|
+
"作词,作曲",
|
|
2066
|
+
"作词·作曲",
|
|
2067
|
+
"作词、作曲",
|
|
2068
|
+
"作词,作曲",
|
|
2069
|
+
"词/曲作",
|
|
2070
|
+
"词、曲",
|
|
2071
|
+
"词,曲"
|
|
2072
|
+
]
|
|
2073
|
+
},
|
|
2074
|
+
{
|
|
2075
|
+
"id": "composition-and-arrangement",
|
|
2076
|
+
"kind": "role",
|
|
2077
|
+
"roles": ["COMPOSER", "ARRANGER"],
|
|
2078
|
+
"words": [
|
|
2079
|
+
"作编曲",
|
|
2080
|
+
"作曲/编曲",
|
|
2081
|
+
"作曲编曲",
|
|
2082
|
+
"曲/编",
|
|
2083
|
+
"曲编",
|
|
2084
|
+
"作曲、编曲",
|
|
2085
|
+
"作曲,编曲"
|
|
2086
|
+
]
|
|
2087
|
+
},
|
|
2088
|
+
{
|
|
2089
|
+
"id": "mixing-and-mastering",
|
|
2090
|
+
"kind": "role",
|
|
2091
|
+
"roles": ["MIXER", "MASTERING"],
|
|
2092
|
+
"words": [
|
|
2093
|
+
"混音/母带",
|
|
2094
|
+
"混音母带",
|
|
2095
|
+
"混音&母带",
|
|
2096
|
+
"混音与母带",
|
|
2097
|
+
"混音及母带",
|
|
2098
|
+
"母带/混音",
|
|
2099
|
+
"混音、母带",
|
|
2100
|
+
"混音,母带"
|
|
2101
|
+
]
|
|
2102
|
+
},
|
|
2103
|
+
{
|
|
2104
|
+
"id": "lyrics-and-arrangement",
|
|
2105
|
+
"kind": "role",
|
|
2106
|
+
"roles": ["LYRICIST", "ARRANGER"],
|
|
2107
|
+
"words": [
|
|
2108
|
+
"作词/编曲",
|
|
2109
|
+
"作词、编曲",
|
|
2110
|
+
"作词编曲",
|
|
2111
|
+
"词/编",
|
|
2112
|
+
"词编"
|
|
2113
|
+
]
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
"id": "lyrics-composition-and-arrangement",
|
|
2117
|
+
"kind": "role",
|
|
2118
|
+
"roles": [
|
|
2119
|
+
"LYRICIST",
|
|
2120
|
+
"COMPOSER",
|
|
2121
|
+
"ARRANGER"
|
|
2122
|
+
],
|
|
2123
|
+
"words": [
|
|
2124
|
+
"作词/作曲/编曲",
|
|
2125
|
+
"作词、作曲、编曲",
|
|
2126
|
+
"作词作曲编曲",
|
|
2127
|
+
"词曲编",
|
|
2128
|
+
"词曲编曲"
|
|
2129
|
+
]
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
"id": "singer-songwriter",
|
|
2133
|
+
"kind": "role",
|
|
2134
|
+
"roles": [
|
|
2135
|
+
"LYRICIST",
|
|
2136
|
+
"COMPOSER",
|
|
2137
|
+
"PERFORMER"
|
|
2138
|
+
],
|
|
2139
|
+
"words": [
|
|
2140
|
+
"唱作",
|
|
2141
|
+
"唱作人",
|
|
2142
|
+
"唱作歌手"
|
|
2143
|
+
]
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
"id": "other",
|
|
2147
|
+
"kind": "role",
|
|
2148
|
+
"roles": ["OTHER"],
|
|
2149
|
+
"words": [
|
|
2150
|
+
"录音师",
|
|
2151
|
+
"录音工程师",
|
|
2152
|
+
"录音",
|
|
2153
|
+
"录制",
|
|
2154
|
+
"工程师",
|
|
2155
|
+
"混音助理",
|
|
2156
|
+
"母带助理",
|
|
2157
|
+
"制作助理",
|
|
2158
|
+
"策划",
|
|
2159
|
+
"宣发",
|
|
2160
|
+
"摄影师",
|
|
2161
|
+
"摄像",
|
|
2162
|
+
"设计师",
|
|
2163
|
+
"美术",
|
|
2164
|
+
"美工",
|
|
2165
|
+
"视觉设计",
|
|
2166
|
+
"封面设计",
|
|
2167
|
+
"插画",
|
|
2168
|
+
"插画师",
|
|
2169
|
+
"曲绘",
|
|
2170
|
+
"校对",
|
|
2171
|
+
"打轴",
|
|
2172
|
+
"时轴",
|
|
2173
|
+
"时间轴",
|
|
2174
|
+
"修音",
|
|
2175
|
+
"修音师",
|
|
2176
|
+
"调音",
|
|
2177
|
+
"调音师",
|
|
2178
|
+
"拟音",
|
|
2179
|
+
"音效",
|
|
2180
|
+
"音响",
|
|
2181
|
+
"指挥",
|
|
2182
|
+
"经纪",
|
|
2183
|
+
"顾问",
|
|
2184
|
+
"艺术指导",
|
|
2185
|
+
"艺术总监",
|
|
2186
|
+
"音乐总监",
|
|
2187
|
+
"创意总监",
|
|
2188
|
+
"舞台监督",
|
|
2189
|
+
"灯光师",
|
|
2190
|
+
"特别感谢",
|
|
2191
|
+
"特别鸣谢",
|
|
2192
|
+
"感谢",
|
|
2193
|
+
"鸣谢",
|
|
2194
|
+
"致谢",
|
|
2195
|
+
"短视频",
|
|
2196
|
+
"MIDI编程",
|
|
2197
|
+
"OP",
|
|
2198
|
+
"PGM",
|
|
2199
|
+
"Program",
|
|
2200
|
+
"SP",
|
|
2201
|
+
"主创",
|
|
2202
|
+
"乐器技师",
|
|
2203
|
+
"乐谱",
|
|
2204
|
+
"乐谱管理员",
|
|
2205
|
+
"人声指导",
|
|
2206
|
+
"人声编辑",
|
|
2207
|
+
"企划宣传",
|
|
2208
|
+
"企宣",
|
|
2209
|
+
"分轨",
|
|
2210
|
+
"分镜",
|
|
2211
|
+
"制作统筹",
|
|
2212
|
+
"前台工程师",
|
|
2213
|
+
"剪辑",
|
|
2214
|
+
"剪辑师",
|
|
2215
|
+
"动画师",
|
|
2216
|
+
"助工",
|
|
2217
|
+
"助理",
|
|
2218
|
+
"助理工程师",
|
|
2219
|
+
"化妆",
|
|
2220
|
+
"协力",
|
|
2221
|
+
"吉他技师",
|
|
2222
|
+
"后期制作",
|
|
2223
|
+
"图绘",
|
|
2224
|
+
"声工",
|
|
2225
|
+
"声设",
|
|
2226
|
+
"声音设计师",
|
|
2227
|
+
"妆发",
|
|
2228
|
+
"妆造",
|
|
2229
|
+
"客串",
|
|
2230
|
+
"宣推",
|
|
2231
|
+
"平面",
|
|
2232
|
+
"平面视觉",
|
|
2233
|
+
"平面设计",
|
|
2234
|
+
"录音助理",
|
|
2235
|
+
"录音室经理",
|
|
2236
|
+
"扒谱",
|
|
2237
|
+
"扒谱员",
|
|
2238
|
+
"承办人",
|
|
2239
|
+
"技术支持",
|
|
2240
|
+
"抄谱",
|
|
2241
|
+
"抄谱员",
|
|
2242
|
+
"拟音师",
|
|
2243
|
+
"数字剪辑",
|
|
2244
|
+
"数字编辑",
|
|
2245
|
+
"文案策划",
|
|
2246
|
+
"映像",
|
|
2247
|
+
"服装",
|
|
2248
|
+
"杜比全景声",
|
|
2249
|
+
"歌词翻译",
|
|
2250
|
+
"灯光",
|
|
2251
|
+
"特约嘉宾",
|
|
2252
|
+
"特邀",
|
|
2253
|
+
"电脑",
|
|
2254
|
+
"电脑工程师",
|
|
2255
|
+
"监听",
|
|
2256
|
+
"监听工程师",
|
|
2257
|
+
"策监",
|
|
2258
|
+
"筹划",
|
|
2259
|
+
"编程",
|
|
2260
|
+
"编程播放",
|
|
2261
|
+
"编调",
|
|
2262
|
+
"编辑",
|
|
2263
|
+
"美术指导",
|
|
2264
|
+
"舞台总监",
|
|
2265
|
+
"艺人与产品",
|
|
2266
|
+
"艺人助理",
|
|
2267
|
+
"艺人统筹",
|
|
2268
|
+
"艺术顾问",
|
|
2269
|
+
"节拍",
|
|
2270
|
+
"节拍制作",
|
|
2271
|
+
"节拍制作人",
|
|
2272
|
+
"营销",
|
|
2273
|
+
"视觉总监",
|
|
2274
|
+
"调教",
|
|
2275
|
+
"调校",
|
|
2276
|
+
"谱务",
|
|
2277
|
+
"资产管理",
|
|
2278
|
+
"跟踪工程师",
|
|
2279
|
+
"辅助监督",
|
|
2280
|
+
"造型",
|
|
2281
|
+
"造型师",
|
|
2282
|
+
"采样",
|
|
2283
|
+
"音乐制作助理",
|
|
2284
|
+
"音乐统筹",
|
|
2285
|
+
"音乐视频导演",
|
|
2286
|
+
"音响工程师",
|
|
2287
|
+
"音序",
|
|
2288
|
+
"音控师",
|
|
2289
|
+
"音效设计",
|
|
2290
|
+
"音频编辑",
|
|
2291
|
+
"项目策划",
|
|
2292
|
+
"项目统筹",
|
|
2293
|
+
"预制作",
|
|
2294
|
+
"题字",
|
|
2295
|
+
"首席运营官",
|
|
2296
|
+
"鼓技师",
|
|
2297
|
+
"封面",
|
|
2298
|
+
"海报",
|
|
2299
|
+
"原版权",
|
|
2300
|
+
"原始版权",
|
|
2301
|
+
"次级版权",
|
|
2302
|
+
"版权运营",
|
|
2303
|
+
"业务",
|
|
2304
|
+
"企划",
|
|
2305
|
+
"宣传",
|
|
2306
|
+
"推广",
|
|
2307
|
+
"发行",
|
|
2308
|
+
"统筹",
|
|
2309
|
+
"设计",
|
|
2310
|
+
"摄影",
|
|
2311
|
+
"导演",
|
|
2312
|
+
"翻译",
|
|
2313
|
+
"后期",
|
|
2314
|
+
"工程",
|
|
2315
|
+
"声音",
|
|
2316
|
+
"支持",
|
|
2317
|
+
"艺术",
|
|
2318
|
+
"指导",
|
|
2319
|
+
"监督",
|
|
2320
|
+
"视觉",
|
|
2321
|
+
"舞台",
|
|
2322
|
+
"物料",
|
|
2323
|
+
"台词",
|
|
2324
|
+
"字幕",
|
|
2325
|
+
"文案",
|
|
2326
|
+
"脚本",
|
|
2327
|
+
"花絮",
|
|
2328
|
+
"视频",
|
|
2329
|
+
"作",
|
|
2330
|
+
"封",
|
|
2331
|
+
"监",
|
|
2332
|
+
"编",
|
|
2333
|
+
"译",
|
|
2334
|
+
"谱"
|
|
2335
|
+
]
|
|
2336
|
+
}
|
|
2337
|
+
]
|
|
2338
|
+
};
|
|
2339
|
+
//#endregion
|
|
2340
|
+
//#region src/transforms/credit/rules.ts
|
|
2341
|
+
var MATCH_CACHE_LIMIT = 256;
|
|
2342
|
+
var MAX_CACHED_LABEL_LENGTH = 256;
|
|
2343
|
+
var CREDIT_ROLES = /* @__PURE__ */ new Map([
|
|
2344
|
+
["OTHER", CreditRole.OTHER],
|
|
2345
|
+
["LYRICIST", CreditRole.LYRICIST],
|
|
2346
|
+
["COMPOSER", CreditRole.COMPOSER],
|
|
2347
|
+
["ARRANGER", CreditRole.ARRANGER],
|
|
2348
|
+
["PRODUCER", CreditRole.PRODUCER],
|
|
2349
|
+
["PERFORMER", CreditRole.PERFORMER],
|
|
2350
|
+
["MIXER", CreditRole.MIXER],
|
|
2351
|
+
["MASTERING", CreditRole.MASTERING]
|
|
2352
|
+
]);
|
|
2353
|
+
var creditRules = /* @__PURE__ */ new Map();
|
|
2354
|
+
var matchCache = /* @__PURE__ */ new Map();
|
|
2355
|
+
for (const ruleSet of [zh_hans_default$1, en_default$1]) for (const group of ruleSet.groups) {
|
|
2356
|
+
const roles = group.roles.map((name) => {
|
|
2357
|
+
const role = CREDIT_ROLES.get(name);
|
|
2358
|
+
if (role === void 0) throw new TypeError("Unsupported credit role: " + name);
|
|
2359
|
+
return role;
|
|
2360
|
+
});
|
|
2361
|
+
for (const word of group.words) {
|
|
2362
|
+
const key = toRuleMatchKey(word);
|
|
2363
|
+
if (!creditRules.has(key)) creditRules.set(key, roles);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
var haveSameRoles = (first, second) => {
|
|
2367
|
+
if (first === second) return true;
|
|
2368
|
+
if (first.length !== second.length) return false;
|
|
2369
|
+
if (first.length === 1) return first[0] === second[0];
|
|
2370
|
+
return first.every((role) => second.includes(role));
|
|
2371
|
+
};
|
|
2372
|
+
var findCoveringRoles = (label, key) => {
|
|
2373
|
+
const cuts = findRuleMatchCuts(label);
|
|
2374
|
+
if (!cuts) return;
|
|
2375
|
+
const last = cuts.length - 1;
|
|
2376
|
+
let bestCount = last + 1;
|
|
2377
|
+
let bestRoles;
|
|
2378
|
+
const search = (from, count, roles) => {
|
|
2379
|
+
if (from === last) {
|
|
2380
|
+
if (count < bestCount) {
|
|
2381
|
+
bestCount = count;
|
|
2382
|
+
bestRoles = roles;
|
|
2383
|
+
return true;
|
|
2384
|
+
}
|
|
2385
|
+
return count > bestCount || haveSameRoles(roles, bestRoles);
|
|
2386
|
+
}
|
|
2387
|
+
if (count + 1 > bestCount) return true;
|
|
2388
|
+
for (let to = last; to > from; to -= 1) {
|
|
2389
|
+
const matched = creditRules.get(key.slice(cuts[from], cuts[to]));
|
|
2390
|
+
if (!matched || roles && !haveSameRoles(roles, matched)) continue;
|
|
2391
|
+
if (!search(to, count + 1, roles ?? matched)) return false;
|
|
2392
|
+
}
|
|
2393
|
+
return true;
|
|
2394
|
+
};
|
|
2395
|
+
return search(0, 0, void 0) ? bestRoles : void 0;
|
|
2396
|
+
};
|
|
2397
|
+
/**
|
|
2398
|
+
* Prefers the complete alias, then accepts adjacent parts that each resolve to the same roles.
|
|
2399
|
+
* Parts are cut only where the source has whitespace or a script boundary, and the covering with the fewest parts wins.
|
|
2400
|
+
* Unknown parts, role conflicts, and equally short coverings that disagree stay unmatched so the source remains available to later processing.
|
|
2401
|
+
*/
|
|
2402
|
+
var matchCreditLabel = (label) => {
|
|
2403
|
+
const cached = matchCache.get(label);
|
|
2404
|
+
if (cached !== void 0) return cached ?? void 0;
|
|
2405
|
+
const key = toRuleMatchKey(label);
|
|
2406
|
+
const roles = creditRules.get(key) ?? findCoveringRoles(label, key);
|
|
2407
|
+
if (label.length <= MAX_CACHED_LABEL_LENGTH) {
|
|
2408
|
+
if (matchCache.size === MATCH_CACHE_LIMIT) {
|
|
2409
|
+
const oldest = matchCache.keys().next().value;
|
|
2410
|
+
if (oldest !== void 0) matchCache.delete(oldest);
|
|
2411
|
+
}
|
|
2412
|
+
matchCache.set(label, roles ?? null);
|
|
2413
|
+
}
|
|
2414
|
+
return roles;
|
|
2415
|
+
};
|
|
2416
|
+
//#endregion
|
|
2417
|
+
//#region src/transforms/credit/extract.ts
|
|
2418
|
+
var DEFAULT_CREDIT_NAME_SEPARATORS = [
|
|
2419
|
+
"+",
|
|
2420
|
+
":",
|
|
2421
|
+
"/"
|
|
2422
|
+
];
|
|
2423
|
+
var createCreditIndex = (credits) => {
|
|
2424
|
+
const creditIndex = /* @__PURE__ */ new Map();
|
|
2425
|
+
for (let index = 0; index < credits.length; index += 1) {
|
|
2426
|
+
const credit = credits[index];
|
|
2427
|
+
let entries = creditIndex.get(credit.raw);
|
|
2428
|
+
if (!entries) {
|
|
2429
|
+
entries = /* @__PURE__ */ new Map();
|
|
2430
|
+
creditIndex.set(credit.raw, entries);
|
|
2431
|
+
}
|
|
2432
|
+
let entry = entries.get(credit.role);
|
|
2433
|
+
if (!entry) {
|
|
2434
|
+
entry = {
|
|
2435
|
+
index,
|
|
2436
|
+
names: /* @__PURE__ */ new Set()
|
|
2437
|
+
};
|
|
2438
|
+
entries.set(credit.role, entry);
|
|
2439
|
+
}
|
|
2440
|
+
for (const name of credit.names) entry.names.add(name.text);
|
|
2441
|
+
}
|
|
2442
|
+
return creditIndex;
|
|
2443
|
+
};
|
|
2444
|
+
var prepareCreditSeparators = (selected) => {
|
|
2445
|
+
if (!selected || selected === DEFAULT_CREDIT_NAME_SEPARATORS) return DEFAULT_CREDIT_NAME_SEPARATORS;
|
|
2446
|
+
if (selected.length === DEFAULT_CREDIT_NAME_SEPARATORS.length && selected.every((separator, index) => separator === DEFAULT_CREDIT_NAME_SEPARATORS[index])) return DEFAULT_CREDIT_NAME_SEPARATORS;
|
|
2447
|
+
return [...new Set(selected)].filter(Boolean).sort((first, second) => second.length - first.length);
|
|
2448
|
+
};
|
|
2449
|
+
var readCreditNames = (text, separators) => {
|
|
2450
|
+
if (!separators.some((separator) => text.includes(separator))) {
|
|
2451
|
+
const name = trimRuleWhitespace(text);
|
|
2452
|
+
return name ? [name] : [];
|
|
2453
|
+
}
|
|
2454
|
+
let names = [text];
|
|
2455
|
+
for (const separator of separators) if (names.some((name) => name.includes(separator))) names = names.flatMap((name) => name.split(separator));
|
|
2456
|
+
const unique = /* @__PURE__ */ new Set();
|
|
2457
|
+
for (const name of names) {
|
|
2458
|
+
const trimmed = trimRuleWhitespace(name);
|
|
2459
|
+
if (trimmed) unique.add(trimmed);
|
|
2460
|
+
}
|
|
2461
|
+
return [...unique];
|
|
2462
|
+
};
|
|
2463
|
+
var canRemoveSourceLine = (line) => {
|
|
2464
|
+
if (line.backgrounds.length || line.annotation) return false;
|
|
2465
|
+
return !line.content?.words.some(({ annotation }) => {
|
|
2466
|
+
if (!annotation) return false;
|
|
2467
|
+
return !!(annotation.translations.length || annotation.romans.length);
|
|
2468
|
+
});
|
|
2469
|
+
};
|
|
2470
|
+
var hasCreditColon = (word) => {
|
|
2471
|
+
return word.text.includes(":") || word.text.includes(":");
|
|
2472
|
+
};
|
|
2473
|
+
/**
|
|
2474
|
+
* Preserves source labels and name spelling while matching normalized credit labels in normal lead lines.
|
|
2475
|
+
* Merges names by role and original label without inferring their language.
|
|
2476
|
+
*
|
|
2477
|
+
* @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
|
|
2478
|
+
*/
|
|
2479
|
+
var extractCredits = (lyric, options = {}) => {
|
|
2480
|
+
const separators = prepareCreditSeparators(options.nameSeparators);
|
|
2481
|
+
const originalCredits = lyric.meta?.credits ?? [];
|
|
2482
|
+
let credits = originalCredits;
|
|
2483
|
+
let creditIndex;
|
|
2484
|
+
const originalLines = lyric.lines;
|
|
2485
|
+
let remainingLines;
|
|
2486
|
+
for (let index = 0; index < originalLines.length; index += 1) {
|
|
2487
|
+
const line = originalLines[index];
|
|
2488
|
+
if (line.type !== LineType.NORMAL) {
|
|
2489
|
+
remainingLines?.push(line);
|
|
2490
|
+
continue;
|
|
2491
|
+
}
|
|
2492
|
+
const content = line.content;
|
|
2493
|
+
if (!(content?.text !== void 0 || (content?.words.some(hasCreditColon) ?? false))) {
|
|
2494
|
+
remainingLines?.push(line);
|
|
2495
|
+
continue;
|
|
2496
|
+
}
|
|
2497
|
+
const text = getContentText(content);
|
|
2498
|
+
const colon = text.search(/[::]/);
|
|
2499
|
+
if (colon === -1) {
|
|
2500
|
+
remainingLines?.push(line);
|
|
2501
|
+
continue;
|
|
2502
|
+
}
|
|
2503
|
+
const raw = trimRuleWhitespace(text.slice(0, colon));
|
|
2504
|
+
const roles = matchCreditLabel(raw);
|
|
2505
|
+
const names = roles ? readCreditNames(text.slice(colon + 1), separators) : [];
|
|
2506
|
+
if (!roles || !names.length) {
|
|
2507
|
+
remainingLines?.push(line);
|
|
2508
|
+
continue;
|
|
2509
|
+
}
|
|
2510
|
+
creditIndex ??= createCreditIndex(originalCredits);
|
|
2511
|
+
let entries = creditIndex.get(raw);
|
|
2512
|
+
if (!entries) {
|
|
2513
|
+
entries = /* @__PURE__ */ new Map();
|
|
2514
|
+
creditIndex.set(raw, entries);
|
|
2515
|
+
}
|
|
2516
|
+
for (const role of roles) {
|
|
2517
|
+
let entry = entries.get(role);
|
|
2518
|
+
const additions = names.filter((name) => !entry?.names.has(name));
|
|
2519
|
+
if (!additions.length) continue;
|
|
2520
|
+
if (credits === originalCredits) credits = [...originalCredits];
|
|
2521
|
+
const nameNodes = additions.map((name) => makeText({ text: name }));
|
|
2522
|
+
if (!entry) {
|
|
2523
|
+
entry = {
|
|
2524
|
+
index: credits.length,
|
|
2525
|
+
names: /* @__PURE__ */ new Set()
|
|
2526
|
+
};
|
|
2527
|
+
entries.set(role, entry);
|
|
2528
|
+
credits.push(makeMetaCredit({
|
|
2529
|
+
role,
|
|
2530
|
+
raw,
|
|
2531
|
+
names: nameNodes
|
|
2532
|
+
}));
|
|
2533
|
+
} else {
|
|
2534
|
+
const credit = credits[entry.index];
|
|
2535
|
+
credits[entry.index] = {
|
|
2536
|
+
...credit,
|
|
2537
|
+
names: [...credit.names, ...nameNodes]
|
|
2538
|
+
};
|
|
2539
|
+
}
|
|
2540
|
+
for (const name of additions) entry.names.add(name);
|
|
2541
|
+
}
|
|
2542
|
+
if (options.removeSourceLines && canRemoveSourceLine(line)) remainingLines ??= originalLines.slice(0, index);
|
|
2543
|
+
else remainingLines?.push(line);
|
|
2544
|
+
}
|
|
2545
|
+
if (credits === originalCredits && !remainingLines) return lyric;
|
|
2546
|
+
const removed = !!remainingLines;
|
|
2547
|
+
const lines = remainingLines ?? originalLines;
|
|
2548
|
+
let timing = lyric.timing;
|
|
2549
|
+
if (removed && timing === Timing.WORD) {
|
|
2550
|
+
if (!lines.some((line) => {
|
|
2551
|
+
return isWordLevelLine(line) || line.backgrounds.some(isWordLevelLine);
|
|
2552
|
+
})) timing = Timing.LINE;
|
|
2553
|
+
}
|
|
2554
|
+
const meta = credits === originalCredits ? lyric.meta : lyric.meta ? {
|
|
2555
|
+
...lyric.meta,
|
|
2556
|
+
credits
|
|
2557
|
+
} : makeMeta({ credits });
|
|
2558
|
+
return {
|
|
2559
|
+
...lyric,
|
|
2560
|
+
meta,
|
|
2561
|
+
lines,
|
|
2562
|
+
timing,
|
|
2563
|
+
languages: removed ? deriveLanguageUsages(lines) : lyric.languages
|
|
2564
|
+
};
|
|
2565
|
+
};
|
|
2566
|
+
//#endregion
|
|
2567
|
+
//#region src/transforms/emphasis/index.ts
|
|
2568
|
+
var deriveContentEmphasis = (content, durationThreshold) => {
|
|
2569
|
+
if (!content) return content;
|
|
2570
|
+
const words = mapShared(content.words, (word) => {
|
|
2571
|
+
if (word.type !== WordType.NORMAL || word.emphasis?.derived === false) return word;
|
|
2572
|
+
const time = word.time;
|
|
2573
|
+
if (!!time && time.end !== void 0 && !validateTimeRange(time).length && time.end - time.start > durationThreshold) {
|
|
2574
|
+
if (word.emphasis?.value) return word;
|
|
2575
|
+
return {
|
|
2576
|
+
...word,
|
|
2577
|
+
emphasis: makeWordEmphasis({
|
|
2578
|
+
value: true,
|
|
2579
|
+
derived: true
|
|
2580
|
+
})
|
|
2581
|
+
};
|
|
2582
|
+
}
|
|
2583
|
+
if (!word.emphasis) return word;
|
|
2584
|
+
return {
|
|
2585
|
+
...word,
|
|
2586
|
+
emphasis: void 0
|
|
2587
|
+
};
|
|
2588
|
+
});
|
|
2589
|
+
return words === content.words ? content : {
|
|
2590
|
+
...content,
|
|
2591
|
+
words
|
|
2592
|
+
};
|
|
2593
|
+
};
|
|
2594
|
+
/**
|
|
2595
|
+
* Derives emphasis for normal words in lead and background vocals using complete, valid word ranges.
|
|
2596
|
+
* The stored word duration must strictly exceed durationThreshold; metadata offset and duration have no effect.
|
|
2597
|
+
*
|
|
2598
|
+
* Source emphasis, including an explicit false, is preserved; derived emphasis is cleared when a word no longer qualifies.
|
|
2599
|
+
*
|
|
2600
|
+
* @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
|
|
2601
|
+
*
|
|
2602
|
+
* @throws {RangeError} If durationThreshold is not a non-negative safe integer in milliseconds.
|
|
2603
|
+
*/
|
|
2604
|
+
var deriveWordEmphasis = (lyric, options = {}) => {
|
|
2605
|
+
const durationThreshold = options.durationThreshold ?? 3e3;
|
|
2606
|
+
if (!Number.isSafeInteger(durationThreshold) || durationThreshold < 0) throw new RangeError("durationThreshold must be a non-negative safe integer in milliseconds");
|
|
2607
|
+
const lines = mapShared(lyric.lines, (line) => {
|
|
2608
|
+
if (line.type !== LineType.NORMAL) return line;
|
|
2609
|
+
const content = deriveContentEmphasis(line.content, durationThreshold);
|
|
2610
|
+
const backgrounds = mapShared(line.backgrounds, (background) => {
|
|
2611
|
+
const content = deriveContentEmphasis(background.content, durationThreshold);
|
|
2612
|
+
return content === background.content ? background : {
|
|
2613
|
+
...background,
|
|
2614
|
+
content
|
|
2615
|
+
};
|
|
2616
|
+
});
|
|
2617
|
+
return content === line.content && backgrounds === line.backgrounds ? line : {
|
|
2618
|
+
...line,
|
|
2619
|
+
content,
|
|
2620
|
+
backgrounds
|
|
2621
|
+
};
|
|
2622
|
+
});
|
|
2623
|
+
return lines === lyric.lines ? lyric : {
|
|
2624
|
+
...lyric,
|
|
2625
|
+
lines
|
|
2626
|
+
};
|
|
2627
|
+
};
|
|
2628
|
+
//#endregion
|
|
2629
|
+
//#region src/transforms/filter/rules.ts
|
|
2630
|
+
var nonLyricGroups = [{
|
|
2631
|
+
$schema: "../schema.json",
|
|
2632
|
+
version: 1,
|
|
2633
|
+
language: "zh-hans",
|
|
2634
|
+
normalization: {
|
|
2635
|
+
"whitespace": "remove",
|
|
2636
|
+
"case": "asciiLower"
|
|
2637
|
+
},
|
|
2638
|
+
groups: [
|
|
2639
|
+
{
|
|
2640
|
+
"id": "copyright-notice",
|
|
2641
|
+
"category": "copyright",
|
|
2642
|
+
"match": "contains",
|
|
2643
|
+
"words": [
|
|
2644
|
+
"版权所有",
|
|
2645
|
+
"保留所有权利",
|
|
2646
|
+
"侵权必究",
|
|
2647
|
+
"翻版必究",
|
|
2648
|
+
"违者必究",
|
|
2649
|
+
"未经授权",
|
|
2650
|
+
"未经许可",
|
|
2651
|
+
"版权归",
|
|
2652
|
+
"版权属于",
|
|
2653
|
+
"不得转载",
|
|
2654
|
+
"严禁转载",
|
|
2655
|
+
"盗版必究",
|
|
2656
|
+
"禁止转载"
|
|
2657
|
+
]
|
|
2658
|
+
},
|
|
2659
|
+
{
|
|
2660
|
+
"id": "copyright-label",
|
|
2661
|
+
"category": "copyright",
|
|
2662
|
+
"match": "whole",
|
|
2663
|
+
"words": ["版权", "授权"]
|
|
2664
|
+
},
|
|
2665
|
+
{
|
|
2666
|
+
"id": "adaptation-label",
|
|
2667
|
+
"category": "adaptation",
|
|
2668
|
+
"match": "whole",
|
|
2669
|
+
"words": [
|
|
2670
|
+
"改编",
|
|
2671
|
+
"翻唱",
|
|
2672
|
+
"致敬"
|
|
2673
|
+
]
|
|
2674
|
+
},
|
|
2675
|
+
{
|
|
2676
|
+
"id": "disclaimer-notice",
|
|
2677
|
+
"category": "disclaimer",
|
|
2678
|
+
"match": "contains",
|
|
2679
|
+
"words": [
|
|
2680
|
+
"仅供学习",
|
|
2681
|
+
"仅供个人",
|
|
2682
|
+
"仅供参考",
|
|
2683
|
+
"仅供交流",
|
|
2684
|
+
"禁止商业用途",
|
|
2685
|
+
"非商业用途"
|
|
2686
|
+
]
|
|
2687
|
+
},
|
|
2688
|
+
{
|
|
2689
|
+
"id": "organization-label",
|
|
2690
|
+
"category": "organization",
|
|
2691
|
+
"match": "contains",
|
|
2692
|
+
"words": [
|
|
2693
|
+
"唱片公司",
|
|
2694
|
+
"制作公司",
|
|
2695
|
+
"发行公司",
|
|
2696
|
+
"承办单位",
|
|
2697
|
+
"次级发行方",
|
|
2698
|
+
"厂牌"
|
|
2699
|
+
]
|
|
2700
|
+
},
|
|
2701
|
+
{
|
|
2702
|
+
"id": "studio-label",
|
|
2703
|
+
"category": "studio",
|
|
2704
|
+
"match": "contains",
|
|
2705
|
+
"words": [
|
|
2706
|
+
"录音室",
|
|
2707
|
+
"录音棚",
|
|
2708
|
+
"混音室",
|
|
2709
|
+
"混音工作室",
|
|
2710
|
+
"混音录音室",
|
|
2711
|
+
"母带录音室",
|
|
2712
|
+
"母带处理录音室"
|
|
2713
|
+
]
|
|
2714
|
+
}
|
|
2715
|
+
]
|
|
2716
|
+
}, {
|
|
2717
|
+
$schema: "../schema.json",
|
|
2718
|
+
version: 1,
|
|
2719
|
+
language: "en",
|
|
2720
|
+
normalization: {
|
|
2721
|
+
"whitespace": "remove",
|
|
2722
|
+
"case": "asciiLower"
|
|
2723
|
+
},
|
|
2724
|
+
groups: [
|
|
2725
|
+
{
|
|
2726
|
+
"id": "copyright-notice",
|
|
2727
|
+
"category": "copyright",
|
|
2728
|
+
"match": "contains",
|
|
2729
|
+
"words": [
|
|
2730
|
+
"Allrightsreserved",
|
|
2731
|
+
"Allrightsofthe",
|
|
2732
|
+
"Nopartofthis",
|
|
2733
|
+
"Unauthorizedreproduction",
|
|
2734
|
+
"Unauthorizedduplication",
|
|
2735
|
+
"Unauthorizedcopying",
|
|
2736
|
+
"Unauthorizeduse",
|
|
2737
|
+
"Underexclusivelicense",
|
|
2738
|
+
"Allrightsreservedby",
|
|
2739
|
+
"Anyunauthorizeduse",
|
|
2740
|
+
"Usedbypermission"
|
|
2741
|
+
]
|
|
2742
|
+
},
|
|
2743
|
+
{
|
|
2744
|
+
"id": "copyright-label",
|
|
2745
|
+
"category": "copyright",
|
|
2746
|
+
"match": "whole",
|
|
2747
|
+
"words": ["Copyright", "License"]
|
|
2748
|
+
},
|
|
2749
|
+
{
|
|
2750
|
+
"id": "adaptation-label",
|
|
2751
|
+
"category": "adaptation",
|
|
2752
|
+
"match": "whole",
|
|
2753
|
+
"words": [
|
|
2754
|
+
"Cover",
|
|
2755
|
+
"Remake",
|
|
2756
|
+
"Tribute",
|
|
2757
|
+
"Adaptation"
|
|
2758
|
+
]
|
|
2759
|
+
},
|
|
2760
|
+
{
|
|
2761
|
+
"id": "disclaimer-notice",
|
|
2762
|
+
"category": "disclaimer",
|
|
2763
|
+
"match": "contains",
|
|
2764
|
+
"words": [
|
|
2765
|
+
"Foreducationalpurposes",
|
|
2766
|
+
"Fornon-commercial",
|
|
2767
|
+
"Fornoncommercial",
|
|
2768
|
+
"Fornonprofitable",
|
|
2769
|
+
"Forpersonaluse",
|
|
2770
|
+
"Forpromotionalpurposes"
|
|
2771
|
+
]
|
|
2772
|
+
},
|
|
2773
|
+
{
|
|
2774
|
+
"id": "organization-label",
|
|
2775
|
+
"category": "organization",
|
|
2776
|
+
"match": "contains",
|
|
2777
|
+
"words": [
|
|
2778
|
+
"ManufacturingCompany",
|
|
2779
|
+
"RecordCompany",
|
|
2780
|
+
"RecordLabel",
|
|
2781
|
+
"Distribution"
|
|
2782
|
+
]
|
|
2783
|
+
},
|
|
2784
|
+
{
|
|
2785
|
+
"id": "studio-label",
|
|
2786
|
+
"category": "studio",
|
|
2787
|
+
"match": "contains",
|
|
2788
|
+
"words": [
|
|
2789
|
+
"RecordingStudio",
|
|
2790
|
+
"MasteringStudio",
|
|
2791
|
+
"Mixingstudio",
|
|
2792
|
+
"Mixstudio",
|
|
2793
|
+
"StudioPersonnel"
|
|
2794
|
+
]
|
|
2795
|
+
}
|
|
2796
|
+
]
|
|
2797
|
+
}].flatMap((ruleSet) => {
|
|
2798
|
+
return ruleSet.groups.map((group) => {
|
|
2799
|
+
if (group.match !== "contains" && group.match !== "whole") throw new TypeError("Unsupported filter match: " + group.match);
|
|
2800
|
+
return {
|
|
2801
|
+
category: group.category,
|
|
2802
|
+
whole: group.match === "whole",
|
|
2803
|
+
words: group.words.map(toRuleMatchKey)
|
|
2804
|
+
};
|
|
2805
|
+
});
|
|
2806
|
+
});
|
|
2807
|
+
/**
|
|
2808
|
+
* Categories the bundled filter rules identify, in rule order.
|
|
2809
|
+
*/
|
|
2810
|
+
var NON_LYRIC_CATEGORIES = [...new Set(nonLyricGroups.map((group) => group.category))];
|
|
2811
|
+
/**
|
|
2812
|
+
* Keeps rule order so earlier groups still take precedence within a selection; undefined selects every group.
|
|
2813
|
+
*/
|
|
2814
|
+
var selectNonLyricGroups = (categories) => {
|
|
2815
|
+
if (!categories) return nonLyricGroups;
|
|
2816
|
+
return nonLyricGroups.filter((group) => categories.includes(group.category));
|
|
2817
|
+
};
|
|
2818
|
+
/**
|
|
2819
|
+
* Returns the category of the first group that identifies the normalized text.
|
|
2820
|
+
* whole needs the complete text to equal a word, while contains accepts a word anywhere because the rules carry no word boundaries.
|
|
2821
|
+
*/
|
|
2822
|
+
var matchNonLyricCategory = (text, groups) => {
|
|
2823
|
+
const key = toRuleMatchKey(text);
|
|
2824
|
+
if (!key) return;
|
|
2825
|
+
for (const group of groups) if (group.whole ? group.words.includes(key) : group.words.some((word) => key.includes(word))) return group.category;
|
|
2826
|
+
};
|
|
2827
|
+
//#endregion
|
|
2828
|
+
//#region src/transforms/filter/remove.ts
|
|
2829
|
+
var toMusicInfoMatchText = (text) => {
|
|
2830
|
+
return text.normalize("NFC").trim().replace(/\s+/gu, " ").replace(/[A-Z]+/g, (run) => run.toLowerCase());
|
|
2831
|
+
};
|
|
2832
|
+
var findFirstMusicInfoLine = (lyric, musicInfo) => {
|
|
2833
|
+
const titles = (musicInfo.titles ?? []).map(toMusicInfoMatchText).filter(Boolean);
|
|
2834
|
+
const artists = (musicInfo.artists ?? []).map(toMusicInfoMatchText).filter(Boolean);
|
|
2835
|
+
if (!titles.length || !artists.length) return -1;
|
|
2836
|
+
const index = lyric.lines.findIndex((line) => {
|
|
2837
|
+
return line.type === LineType.NORMAL && !!getContentText(line.content).trim();
|
|
2838
|
+
});
|
|
2839
|
+
if (index === -1) return -1;
|
|
2840
|
+
const parts = getContentText(lyric.lines[index].content).trim().split(" - ");
|
|
2841
|
+
if (parts.length !== 2) return -1;
|
|
2842
|
+
const left = toMusicInfoMatchText(parts[0]);
|
|
2843
|
+
const right = toMusicInfoMatchText(parts[1]);
|
|
2844
|
+
if (!left || !right) return -1;
|
|
2845
|
+
const titleOnLeft = titles.some((title) => left.includes(title));
|
|
2846
|
+
const titleOnRight = titles.some((title) => right.includes(title));
|
|
2847
|
+
const artistOnLeft = artists.some((artist) => left.includes(artist));
|
|
2848
|
+
const artistOnRight = artists.some((artist) => right.includes(artist));
|
|
2849
|
+
return titleOnLeft && artistOnRight || artistOnLeft && titleOnRight ? index : -1;
|
|
2850
|
+
};
|
|
2851
|
+
/**
|
|
2852
|
+
* Removes normal lead lines matched by the shared notice rules and, when musicInfo is provided, first-line song information.
|
|
2853
|
+
* The first non-empty normal line must have one literal " - " separator and a known title and artist on opposite sides; either order and extra text such as bracketed aliases are accepted.
|
|
2854
|
+
* Drops attached annotations and backgrounds, refreshes language usages, and falls back to line timing when no word-level content remains.
|
|
2855
|
+
*
|
|
2856
|
+
* @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
|
|
2857
|
+
*/
|
|
2858
|
+
var removeNonLyricLines = (lyric, options = {}) => {
|
|
2859
|
+
const groups = selectNonLyricGroups(options.categories);
|
|
2860
|
+
const musicInfoIndex = options.musicInfo ? findFirstMusicInfoLine(lyric, options.musicInfo) : -1;
|
|
2861
|
+
if (!groups.length && musicInfoIndex === -1) return lyric;
|
|
2862
|
+
const lines = lyric.lines.filter((line, index) => {
|
|
2863
|
+
if (index === musicInfoIndex) return false;
|
|
2864
|
+
return line.type !== LineType.NORMAL || matchNonLyricCategory(getContentText(line.content), groups) === void 0;
|
|
2865
|
+
});
|
|
2866
|
+
if (lines.length === lyric.lines.length) return lyric;
|
|
2867
|
+
let timing = lyric.timing;
|
|
2868
|
+
if (timing === Timing.WORD) {
|
|
2869
|
+
if (!lines.some((line) => {
|
|
2870
|
+
return isWordLevelLine(line) || line.backgrounds.some(isWordLevelLine);
|
|
2871
|
+
})) timing = Timing.LINE;
|
|
2872
|
+
}
|
|
2873
|
+
return {
|
|
2874
|
+
...lyric,
|
|
2875
|
+
lines,
|
|
2876
|
+
timing,
|
|
2877
|
+
languages: deriveLanguageUsages(lines)
|
|
2878
|
+
};
|
|
2879
|
+
};
|
|
2880
|
+
//#endregion
|
|
2881
|
+
//#region src/transforms/instrumental/index.ts
|
|
2882
|
+
var MAX_TIME = 2 ** 31 - 1;
|
|
2883
|
+
var readMinimum = (value, fallback, name) => {
|
|
2884
|
+
const minimum = value ?? fallback;
|
|
2885
|
+
if (!Number.isSafeInteger(minimum) || minimum < 0) throw new RangeError(`${name} must be a non-negative safe integer in milliseconds`);
|
|
2886
|
+
return minimum;
|
|
2887
|
+
};
|
|
2888
|
+
var readEndTime = (value) => {
|
|
2889
|
+
if (value !== void 0 && (!Number.isInteger(value) || value < 0 || value > MAX_TIME)) throw new RangeError(`endTime must be a non-negative integer in milliseconds no greater than ${MAX_TIME}`);
|
|
2890
|
+
return value;
|
|
2891
|
+
};
|
|
2892
|
+
var compareTimeRanges = (left, right) => {
|
|
2893
|
+
const leftStart = left?.start ?? Infinity;
|
|
2894
|
+
const rightStart = right?.start ?? Infinity;
|
|
2895
|
+
if (leftStart !== rightStart) return leftStart - rightStart;
|
|
2896
|
+
const leftEnd = left?.end ?? Infinity;
|
|
2897
|
+
const rightEnd = right?.end ?? Infinity;
|
|
2898
|
+
return leftEnd === rightEnd ? 0 : leftEnd - rightEnd;
|
|
2899
|
+
};
|
|
2900
|
+
var readOccupiedTimeline = (lyric) => {
|
|
2901
|
+
const ranges = [];
|
|
2902
|
+
let firstSungStart = Infinity;
|
|
2903
|
+
const append = (time, sung) => {
|
|
2904
|
+
if (!time || validateTimeRange(time).length) return false;
|
|
2905
|
+
if (time.end === time.start) return true;
|
|
2906
|
+
ranges.push(time);
|
|
2907
|
+
if (sung) firstSungStart = Math.min(firstSungStart, time.start);
|
|
2908
|
+
return true;
|
|
2909
|
+
};
|
|
2910
|
+
for (const line of lyric.lines) {
|
|
2911
|
+
if (!append(line.time, line.type === LineType.NORMAL)) return;
|
|
2912
|
+
for (const background of line.backgrounds) if (!append(background.time, true)) return;
|
|
2913
|
+
}
|
|
2914
|
+
ranges.sort(compareTimeRanges);
|
|
2915
|
+
return {
|
|
2916
|
+
ranges,
|
|
2917
|
+
firstSungStart
|
|
2918
|
+
};
|
|
2919
|
+
};
|
|
2920
|
+
var compareLineTimes = (left, right) => {
|
|
2921
|
+
return compareTimeRanges(left.time, right.time);
|
|
2922
|
+
};
|
|
2923
|
+
var mergeLines = (lines, inserted) => {
|
|
2924
|
+
let source = lines;
|
|
2925
|
+
for (const [index, line] of lines.entries()) {
|
|
2926
|
+
const previous = lines[index - 1];
|
|
2927
|
+
if (previous && compareLineTimes(previous, line) > 0) {
|
|
2928
|
+
source = [...lines].sort(compareLineTimes);
|
|
2929
|
+
break;
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
const merged = [];
|
|
2933
|
+
let nextIndex = 0;
|
|
2934
|
+
for (const line of source) {
|
|
2935
|
+
let next = inserted[nextIndex];
|
|
2936
|
+
while (next && compareLineTimes(next, line) < 0) {
|
|
2937
|
+
merged.push(next);
|
|
2938
|
+
nextIndex += 1;
|
|
2939
|
+
next = inserted[nextIndex];
|
|
2940
|
+
}
|
|
2941
|
+
merged.push(line);
|
|
2942
|
+
}
|
|
2943
|
+
merged.push(...inserted.slice(nextIndex));
|
|
2944
|
+
return merged;
|
|
2945
|
+
};
|
|
2946
|
+
/**
|
|
2947
|
+
* Inserts derived instrumental lines into uncovered gaps on the stored timeline, starting at zero.
|
|
2948
|
+
* Existing lines and background vocals occupy their full ranges; an unknown end blocks later gaps.
|
|
2949
|
+
*
|
|
2950
|
+
* An outro requires an explicit endTime; metadata duration and offset do not affect insertion.
|
|
2951
|
+
*
|
|
2952
|
+
* @returns The input when unchanged, or a new lyric and lines array sharing existing nodes.
|
|
2953
|
+
*/
|
|
2954
|
+
var insertInstrumentalLines = (lyric, options = {}) => {
|
|
2955
|
+
const minDuration = readMinimum(options.minDuration, 1e4, "minDuration");
|
|
2956
|
+
const minIntroDuration = readMinimum(options.minIntroDuration, 5e3, "minIntroDuration");
|
|
2957
|
+
const endTime = readEndTime(options.endTime);
|
|
2958
|
+
if (lyric.timing !== Timing.LINE && lyric.timing !== Timing.WORD || !lyric.lines.length) return lyric;
|
|
2959
|
+
const occupied = readOccupiedTimeline(lyric);
|
|
2960
|
+
if (!occupied || occupied.firstSungStart === Infinity) return lyric;
|
|
2961
|
+
const inserted = [];
|
|
2962
|
+
let coveredEnd = 0;
|
|
2963
|
+
const appendGap = (end, minimum) => {
|
|
2964
|
+
const duration = end - coveredEnd;
|
|
2965
|
+
if (duration > 0 && duration >= minimum) inserted.push(makeLineInstrumental({ time: makeTimeRange({
|
|
2966
|
+
start: coveredEnd,
|
|
2967
|
+
end
|
|
2968
|
+
}) }));
|
|
2969
|
+
};
|
|
2970
|
+
for (const range of occupied.ranges) {
|
|
2971
|
+
appendGap(range.start, range.start <= occupied.firstSungStart ? minIntroDuration : minDuration);
|
|
2972
|
+
coveredEnd = Math.max(coveredEnd, range.end ?? Infinity);
|
|
2973
|
+
if (coveredEnd === Infinity) break;
|
|
2974
|
+
}
|
|
2975
|
+
if (endTime !== void 0) appendGap(endTime, minDuration);
|
|
2976
|
+
if (!inserted.length) return lyric;
|
|
2977
|
+
return {
|
|
2978
|
+
...lyric,
|
|
2979
|
+
lines: mergeLines(lyric.lines, inserted)
|
|
2980
|
+
};
|
|
2981
|
+
};
|
|
2982
|
+
//#endregion
|
|
2983
|
+
//#region src/transforms/space/constants.ts
|
|
2984
|
+
/**
|
|
2985
|
+
* Groups of characters a source may write without a space where one belongs.
|
|
2986
|
+
*/
|
|
2987
|
+
var InsertSpacesRules = {
|
|
2988
|
+
/**
|
|
2989
|
+
* A CJK character touching a Latin letter, as in `ABC中文`.
|
|
2990
|
+
*/
|
|
2991
|
+
CJK_ENGLISH: "cjkEnglish",
|
|
2992
|
+
/**
|
|
2993
|
+
* A CJK character touching a digit, as in `2026年`.
|
|
2994
|
+
*/
|
|
2995
|
+
CJK_NUMBER: "cjkNumber",
|
|
2996
|
+
/**
|
|
2997
|
+
* A comma, semicolon, exclamation mark, question mark or colon touching a character, as in `a,b`; a clock time or thousands separator such as `10:30` stays as written.
|
|
2998
|
+
*/
|
|
2999
|
+
PUNCTUATION: "punctuation",
|
|
3000
|
+
/**
|
|
3001
|
+
* A quotation mark touching a neighbouring character.
|
|
3002
|
+
*/
|
|
3003
|
+
QUOTE: "quote",
|
|
3004
|
+
/**
|
|
3005
|
+
* A bracket touching the character outside it.
|
|
3006
|
+
*/
|
|
3007
|
+
BRACKET_OUTSIDE: "bracketOutside",
|
|
3008
|
+
/**
|
|
3009
|
+
* A plus, equals or ampersand touching a character, as in `a+b`; a compound operator such as `a+=b` stays as written.
|
|
3010
|
+
*/
|
|
3011
|
+
MATH_OPERATOR: "mathOperator",
|
|
3012
|
+
/**
|
|
3013
|
+
* A hyphen touching a CJK character, as in `中-文`; a compound word such as `well-known` stays as written.
|
|
3014
|
+
*/
|
|
3015
|
+
HYPHEN: "hyphen",
|
|
3016
|
+
/**
|
|
3017
|
+
* A slash touching a character, as in `and/or`; a fraction such as `1/2` stays as written.
|
|
3018
|
+
*/
|
|
3019
|
+
SLASH: "slash",
|
|
3020
|
+
/**
|
|
3021
|
+
* Runs of two or more spaces, collapsed to one.
|
|
3022
|
+
*/
|
|
3023
|
+
COMPRESS_SPACES: "compressSpaces",
|
|
3024
|
+
/**
|
|
3025
|
+
* Spaces just inside a bracket or quotation mark, removed.
|
|
3026
|
+
*/
|
|
3027
|
+
TRIM_INSIDE_SYMBOLS: "trimInsideSymbols"
|
|
3028
|
+
};
|
|
3029
|
+
var INSERT_SPACES_RULES = Object.values(InsertSpacesRules);
|
|
3030
|
+
//#endregion
|
|
3031
|
+
//#region src/transforms/space/rules.ts
|
|
3032
|
+
var CJK_RANGE = "-ヿ㐀-䶿一-鿿豈-";
|
|
3033
|
+
var LATIN_RANGE = "A-Za-z";
|
|
3034
|
+
var DIGIT_RANGE = "0-9";
|
|
3035
|
+
var SYMBOL_RANGE = "!@#$%^&+\\-=/|<>";
|
|
3036
|
+
var WORD_RANGE = `${LATIN_RANGE}${DIGIT_RANGE}${CJK_RANGE}`;
|
|
3037
|
+
var ALL_RANGE = `${WORD_RANGE}${SYMBOL_RANGE}`;
|
|
3038
|
+
var CJK_LATIN = new RegExp(`([${CJK_RANGE}])([${LATIN_RANGE}])`, "gu");
|
|
3039
|
+
var LATIN_CJK = new RegExp(`([${LATIN_RANGE}])([${CJK_RANGE}])`, "gu");
|
|
3040
|
+
var CJK_DIGIT = new RegExp(`([${CJK_RANGE}])([${DIGIT_RANGE}])`, "gu");
|
|
3041
|
+
var DIGIT_CJK = new RegExp(`([${DIGIT_RANGE}])([${CJK_RANGE}])`, "gu");
|
|
3042
|
+
var PUNCTUATION = new RegExp(`([${ALL_RANGE}])([!;,\\?:])(?=[${ALL_RANGE}])`, "gu");
|
|
3043
|
+
var QUOTE_BEFORE = new RegExp(`([${CJK_RANGE}${LATIN_RANGE}${DIGIT_RANGE}])(["\`“‘])`, "gu");
|
|
3044
|
+
var QUOTE_AFTER = new RegExp(`(["”’])([${CJK_RANGE}${LATIN_RANGE}${DIGIT_RANGE}])`, "gu");
|
|
3045
|
+
var BRACKET_BEFORE = new RegExp(`([${WORD_RANGE}])([\\[({<])`, "gu");
|
|
3046
|
+
var BRACKET_AFTER = new RegExp(`([\\])}>])([${WORD_RANGE}])`, "gu");
|
|
3047
|
+
var MATH_OPERATOR = new RegExp(`([${ALL_RANGE}])([+=&])(?=[${ALL_RANGE}])`, "gu");
|
|
3048
|
+
var HYPHEN = new RegExp(`(?<=[${WORD_RANGE}])-(?=[${WORD_RANGE}])`, "gu");
|
|
3049
|
+
var SLASH = new RegExp(`([${WORD_RANGE}])(/)(?=[${WORD_RANGE}])`, "gu");
|
|
3050
|
+
var TRIM_INSIDE_SYMBOLS = /* @__PURE__ */ new RegExp("([<[{\"“‘(])\\s*([^<>[\\]{}()\"“‘”’]*?)\\s*([>\\]}\"”’)])", "gu");
|
|
3051
|
+
var REPEATED_SPACES = / {2,}/gu;
|
|
3052
|
+
var REPEATED_MARKS = /[!;,\\?:+\-=/&]{2,}/gu;
|
|
3053
|
+
var PLACEHOLDER = /\u0001(\d+)\u0001/gu;
|
|
3054
|
+
var isDigit = (char) => {
|
|
3055
|
+
return !!char && char >= "0" && char <= "9";
|
|
3056
|
+
};
|
|
3057
|
+
var isLatin = (char) => {
|
|
3058
|
+
return !!char && (char >= "A" && char <= "Z" || char >= "a" && char <= "z");
|
|
3059
|
+
};
|
|
3060
|
+
/**
|
|
3061
|
+
* A comma or colon between two digits belongs to one number or clock time, so it stays tight.
|
|
3062
|
+
*/
|
|
3063
|
+
var applyPunctuation = (text) => {
|
|
3064
|
+
return text.replace(PUNCTUATION, (match, before, mark, offset, source) => {
|
|
3065
|
+
if ((mark === "," || mark === ":") && isDigit(before) && isDigit(source[offset + match.length])) return match;
|
|
3066
|
+
return `${before}${mark} `;
|
|
3067
|
+
});
|
|
3068
|
+
};
|
|
3069
|
+
/**
|
|
3070
|
+
* A hyphen between two digits is a date, range or phone number, and one between two Latin letters joins a compound word.
|
|
3071
|
+
*
|
|
3072
|
+
* An edge hyphen is left alone, since it reads as a sign or a list marker rather than a dash.
|
|
3073
|
+
*/
|
|
3074
|
+
var applyHyphen = (text) => {
|
|
3075
|
+
return text.replace(HYPHEN, (match, offset, source) => {
|
|
3076
|
+
const left = source[offset - 1];
|
|
3077
|
+
const right = source[offset + 1];
|
|
3078
|
+
return isDigit(left) && isDigit(right) || isLatin(left) && isLatin(right) ? match : " - ";
|
|
3079
|
+
});
|
|
3080
|
+
};
|
|
3081
|
+
/**
|
|
3082
|
+
* A slash between two digits is a fraction or date, so it stays tight.
|
|
3083
|
+
*/
|
|
3084
|
+
var applySlash = (text) => {
|
|
3085
|
+
return text.replace(SLASH, (match, before, slash, offset, source) => {
|
|
3086
|
+
return isDigit(before) && isDigit(source[offset + match.length]) ? match : `${before} ${slash} `;
|
|
3087
|
+
});
|
|
3088
|
+
};
|
|
3089
|
+
/**
|
|
3090
|
+
* Trims the spaces just inside a bracket or quotation mark, without touching a nested pair inside it.
|
|
3091
|
+
*/
|
|
3092
|
+
var applyTrimInsideSymbols = (text) => {
|
|
3093
|
+
return text.replace(TRIM_INSIDE_SYMBOLS, (match, left, inner, right) => {
|
|
3094
|
+
return `${left}${inner.trim()}${right}`;
|
|
3095
|
+
});
|
|
3096
|
+
};
|
|
3097
|
+
var APPLIERS = {
|
|
3098
|
+
[InsertSpacesRules.CJK_ENGLISH]: (text) => {
|
|
3099
|
+
return text.replace(CJK_LATIN, "$1 $2").replace(LATIN_CJK, "$1 $2");
|
|
3100
|
+
},
|
|
3101
|
+
[InsertSpacesRules.CJK_NUMBER]: (text) => {
|
|
3102
|
+
return text.replace(CJK_DIGIT, "$1 $2").replace(DIGIT_CJK, "$1 $2");
|
|
3103
|
+
},
|
|
3104
|
+
[InsertSpacesRules.PUNCTUATION]: applyPunctuation,
|
|
3105
|
+
[InsertSpacesRules.QUOTE]: (text) => {
|
|
3106
|
+
return text.replace(QUOTE_BEFORE, "$1 $2").replace(QUOTE_AFTER, "$1 $2");
|
|
3107
|
+
},
|
|
3108
|
+
[InsertSpacesRules.BRACKET_OUTSIDE]: (text) => {
|
|
3109
|
+
return text.replace(BRACKET_BEFORE, "$1 $2").replace(BRACKET_AFTER, "$1 $2");
|
|
3110
|
+
},
|
|
3111
|
+
[InsertSpacesRules.MATH_OPERATOR]: (text) => {
|
|
3112
|
+
return text.replace(MATH_OPERATOR, "$1 $2 ");
|
|
3113
|
+
},
|
|
3114
|
+
[InsertSpacesRules.HYPHEN]: applyHyphen,
|
|
3115
|
+
[InsertSpacesRules.SLASH]: applySlash,
|
|
3116
|
+
[InsertSpacesRules.COMPRESS_SPACES]: (text) => {
|
|
3117
|
+
return text.replace(REPEATED_SPACES, " ");
|
|
3118
|
+
},
|
|
3119
|
+
[InsertSpacesRules.TRIM_INSIDE_SYMBOLS]: applyTrimInsideSymbols
|
|
3120
|
+
};
|
|
3121
|
+
var APPLY_ORDER = [
|
|
3122
|
+
InsertSpacesRules.CJK_ENGLISH,
|
|
3123
|
+
InsertSpacesRules.CJK_NUMBER,
|
|
3124
|
+
InsertSpacesRules.PUNCTUATION,
|
|
3125
|
+
InsertSpacesRules.QUOTE,
|
|
3126
|
+
InsertSpacesRules.BRACKET_OUTSIDE,
|
|
3127
|
+
InsertSpacesRules.MATH_OPERATOR,
|
|
3128
|
+
InsertSpacesRules.HYPHEN,
|
|
3129
|
+
InsertSpacesRules.SLASH,
|
|
3130
|
+
InsertSpacesRules.TRIM_INSIDE_SYMBOLS,
|
|
3131
|
+
InsertSpacesRules.COMPRESS_SPACES
|
|
3132
|
+
];
|
|
3133
|
+
/**
|
|
3134
|
+
* Falls back to every rule only when no list was given, so an explicit empty list means "apply nothing".
|
|
3135
|
+
*/
|
|
3136
|
+
var resolveRules = (rules) => {
|
|
3137
|
+
return new Set(rules ?? INSERT_SPACES_RULES);
|
|
3138
|
+
};
|
|
3139
|
+
/**
|
|
3140
|
+
* Applies the selected rules to one text, returning it trimmed.
|
|
3141
|
+
*
|
|
3142
|
+
* Repeated marks are held aside first, so a rule that widens a single mark never splits a run that belongs together.
|
|
3143
|
+
*/
|
|
3144
|
+
var insertSpaces = (text, rules) => {
|
|
3145
|
+
if (!text.trim()) return text;
|
|
3146
|
+
const held = [];
|
|
3147
|
+
let result = text.replace(REPEATED_MARKS, (match) => {
|
|
3148
|
+
held.push(match);
|
|
3149
|
+
return `\u0001${held.length - 1}\u0001`;
|
|
3150
|
+
});
|
|
3151
|
+
for (const rule of APPLY_ORDER) if (rules.has(rule)) result = APPLIERS[rule](result);
|
|
3152
|
+
return result.replace(PLACEHOLDER, (match, index) => {
|
|
3153
|
+
return held[Number(index)] ?? match;
|
|
3154
|
+
}).trim();
|
|
3155
|
+
};
|
|
3156
|
+
//#endregion
|
|
3157
|
+
//#region src/transforms/space/insert.ts
|
|
3158
|
+
/**
|
|
3159
|
+
* Maps the rewritten text back onto the original words.
|
|
3160
|
+
*
|
|
3161
|
+
* Every non-space character of the original survives in order, so walking both strings keeps each word's time,
|
|
3162
|
+
* language and annotation while the inserted spaces become their own words.
|
|
3163
|
+
* A word whose characters stay adjacent in the rewrite is kept whole, so only a word the space actually cuts is split.
|
|
3164
|
+
*/
|
|
3165
|
+
var alignWords = (words, text) => {
|
|
3166
|
+
const source = words.filter(isNormalWord);
|
|
3167
|
+
const result = [];
|
|
3168
|
+
let cursor = 0;
|
|
3169
|
+
const takeSpaces = () => {
|
|
3170
|
+
let spaces = "";
|
|
3171
|
+
while (text[cursor] === " ") {
|
|
3172
|
+
spaces += " ";
|
|
3173
|
+
cursor += 1;
|
|
3174
|
+
}
|
|
3175
|
+
return spaces;
|
|
3176
|
+
};
|
|
3177
|
+
for (const word of source) {
|
|
3178
|
+
const spaces = takeSpaces();
|
|
3179
|
+
if (spaces) result.push(makeWordSpace({ text: spaces }));
|
|
3180
|
+
if (text.startsWith(word.text, cursor)) {
|
|
3181
|
+
result.push(word);
|
|
3182
|
+
cursor += word.text.length;
|
|
3183
|
+
continue;
|
|
3184
|
+
}
|
|
3185
|
+
let remaining = word.text;
|
|
3186
|
+
while (remaining) {
|
|
3187
|
+
let taken = 0;
|
|
3188
|
+
while (taken < remaining.length && text[cursor + taken] === remaining[taken]) taken += 1;
|
|
3189
|
+
if (taken === 0) return;
|
|
3190
|
+
result.push({
|
|
3191
|
+
...word,
|
|
3192
|
+
text: remaining.slice(0, taken)
|
|
3193
|
+
});
|
|
3194
|
+
cursor += taken;
|
|
3195
|
+
remaining = remaining.slice(taken);
|
|
3196
|
+
if (!remaining) break;
|
|
3197
|
+
const split = takeSpaces();
|
|
3198
|
+
if (!split) return;
|
|
3199
|
+
result.push(makeWordSpace({ text: split }));
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
const tail = takeSpaces();
|
|
3203
|
+
if (tail) result.push(makeWordSpace({ text: tail }));
|
|
3204
|
+
if (cursor !== text.length) return;
|
|
3205
|
+
return result;
|
|
3206
|
+
};
|
|
3207
|
+
/**
|
|
3208
|
+
* Applies the rules to a word-level content, keeping it unchanged when the alignment fails.
|
|
3209
|
+
*/
|
|
3210
|
+
var applyToWords = (content, rules) => {
|
|
3211
|
+
const text = content.words.map((word) => word.text).join("");
|
|
3212
|
+
const rewritten = insertSpaces(text, rules);
|
|
3213
|
+
if (rewritten === text) return content;
|
|
3214
|
+
const words = alignWords(content.words, rewritten);
|
|
3215
|
+
if (!words) return content;
|
|
3216
|
+
return words.length ? makeLineContentWords(words) : void 0;
|
|
3217
|
+
};
|
|
3218
|
+
/**
|
|
3219
|
+
* Applies the rules to a plain-text content, dropping a line the rules would leave empty.
|
|
3220
|
+
*/
|
|
3221
|
+
var applyToText = (content, rules) => {
|
|
3222
|
+
const text = content.text ?? "";
|
|
3223
|
+
const rewritten = insertSpaces(text, rules);
|
|
3224
|
+
if (rewritten === text) return content;
|
|
3225
|
+
return rewritten ? makeLineContentText(rewritten) : void 0;
|
|
3226
|
+
};
|
|
3227
|
+
/**
|
|
3228
|
+
* Applies the rules to one content by the shape it carries.
|
|
3229
|
+
*/
|
|
3230
|
+
var applyToContent = (content, rules) => {
|
|
3231
|
+
if (!content) return content;
|
|
3232
|
+
return content.words.length ? applyToWords(content, rules) : applyToText(content, rules);
|
|
3233
|
+
};
|
|
3234
|
+
/**
|
|
3235
|
+
* Applies the rules to the line annotation, keeping the entries they leave untouched.
|
|
3236
|
+
*/
|
|
3237
|
+
var applyToAnnotation = (annotation, rules) => {
|
|
3238
|
+
if (!annotation) return annotation;
|
|
3239
|
+
let changed = false;
|
|
3240
|
+
const romans = annotation.romans.map((item) => {
|
|
3241
|
+
const text = insertSpaces(item.text, rules);
|
|
3242
|
+
if (text === item.text) return item;
|
|
3243
|
+
changed = true;
|
|
3244
|
+
return makeLineAnnotationRoman({
|
|
3245
|
+
...item,
|
|
3246
|
+
text
|
|
3247
|
+
});
|
|
3248
|
+
});
|
|
3249
|
+
const translations = annotation.translations.map((item) => {
|
|
3250
|
+
const text = insertSpaces(item.text, rules);
|
|
3251
|
+
if (text === item.text) return item;
|
|
3252
|
+
changed = true;
|
|
3253
|
+
return makeLineAnnotationTranslation({
|
|
3254
|
+
...item,
|
|
3255
|
+
text
|
|
3256
|
+
});
|
|
3257
|
+
});
|
|
3258
|
+
return changed ? {
|
|
3259
|
+
...annotation,
|
|
3260
|
+
romans,
|
|
3261
|
+
translations
|
|
3262
|
+
} : annotation;
|
|
3263
|
+
};
|
|
3264
|
+
/**
|
|
3265
|
+
* Inserts the spaces a source left out, so CJK text set against Latin letters, digits or punctuation reads evenly.
|
|
3266
|
+
*
|
|
3267
|
+
* A word-level line keeps every word's time and annotation: an inserted space becomes its own space word,
|
|
3268
|
+
* and a word the rules split yields one word per character, all sharing the original range.
|
|
3269
|
+
* A plain-text line and the annotation tracks are rewritten as whole strings.
|
|
3270
|
+
*
|
|
3271
|
+
* @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
|
|
3272
|
+
*/
|
|
3273
|
+
var insertSpacesInLines = (lyric, options = {}) => {
|
|
3274
|
+
const rules = resolveRules(options.rules);
|
|
3275
|
+
const annotations = options.annotations ?? true;
|
|
3276
|
+
const applyToBackground = (background) => {
|
|
3277
|
+
const content = applyToContent(background.content, rules);
|
|
3278
|
+
const annotation = annotations ? applyToAnnotation(background.annotation, rules) : background.annotation;
|
|
3279
|
+
if (content === background.content && annotation === background.annotation) return background;
|
|
3280
|
+
return {
|
|
3281
|
+
...background,
|
|
3282
|
+
content,
|
|
3283
|
+
annotation
|
|
3284
|
+
};
|
|
3285
|
+
};
|
|
3286
|
+
const lines = mapShared(lyric.lines, (line) => {
|
|
3287
|
+
if (line.type !== LineType.NORMAL) return line;
|
|
3288
|
+
const content = applyToContent(line.content, rules);
|
|
3289
|
+
const annotation = annotations ? applyToAnnotation(line.annotation, rules) : line.annotation;
|
|
3290
|
+
const backgrounds = mapShared(line.backgrounds, applyToBackground);
|
|
3291
|
+
if (content === line.content && annotation === line.annotation && backgrounds === line.backgrounds) return line;
|
|
3292
|
+
return {
|
|
3293
|
+
...line,
|
|
3294
|
+
content,
|
|
3295
|
+
annotation,
|
|
3296
|
+
backgrounds
|
|
3297
|
+
};
|
|
3298
|
+
});
|
|
3299
|
+
return lines === lyric.lines ? lyric : {
|
|
3300
|
+
...lyric,
|
|
3301
|
+
lines
|
|
3302
|
+
};
|
|
3303
|
+
};
|
|
3304
|
+
//#endregion
|
|
3305
|
+
export { DEFAULT_CREDIT_NAME_SEPARATORS, INSERT_SPACES_RULES, InsertSpacesRules, NON_LYRIC_CATEGORIES, deriveWordEmphasis, extractAgents, extractBackgroundLines, extractCredits, insertInstrumentalLines, insertSpacesInLines, removeNonLyricLines, stripBackgroundBrackets };
|
|
3306
|
+
|
|
3307
|
+
//# sourceMappingURL=transforms.js.map
|