@dsebastien/music-notation 0.16.0 → 0.17.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/dist/index.d.ts +1 -0
- package/dist/index.js +80 -7
- package/dist/index.js.map +10 -9
- package/dist/music-notation.css +7 -0
- package/dist/music-notation.publish.min.js +36 -29
- package/dist/music-notation.tab.min.js +14 -7
- package/dist/playback/live-volume.d.ts +14 -0
- package/dist/playback/player.d.ts +2 -0
- package/dist/publish/index.js +72 -7
- package/dist/publish/index.js.map +10 -9
- package/dist/tab/index.js +22 -6
- package/dist/tab/index.js.map +4 -4
- package/dist/voicings/index.js +5 -3
- package/dist/voicings/index.js.map +3 -3
- package/package.json +1 -1
package/dist/voicings/index.js
CHANGED
|
@@ -431,6 +431,8 @@ var SIGN = "(##|bb|#|b|♯|♭)?";
|
|
|
431
431
|
var syllableLetter = (syllable) => SYLLABLE_LETTER[plain2(syllable)];
|
|
432
432
|
var AFTER_ROOT = /^(?:$|[0-9/(+°øΔ^-]|m|M|a(?:dd|ug|lt)|sus|dim)/;
|
|
433
433
|
var QUALITY_WORD = /^(?:[0-9(+°øΔ^]|m|M|a(?:dd|ug|lt)|sus|dim)/;
|
|
434
|
+
var WORD_QUALITY = /^(?:major|minor)$/i;
|
|
435
|
+
var joinsAsQuality = (word) => QUALITY_WORD.test(word) && !WORD_QUALITY.test(word);
|
|
434
436
|
var reads = (letters) => midiOf(letters) !== null || /^[A-G]/.test(letters) && parseChord(letters) !== null;
|
|
435
437
|
function rootToken(token, naming, h, solfegeLine = false) {
|
|
436
438
|
const b = naming === "german" ? /^B(?![#♯b♭x])(.*)$/.exec(token) : null;
|
|
@@ -501,7 +503,7 @@ function read(text, naming, options, changes) {
|
|
|
501
503
|
let out = text.normalize("NFC").replace(new RegExp(`(^|[\\s,/|])${SYLLABLE}\\s+(dièse|diese|bémol|bemol)(?=$|[\\s,|])`, "g"), (_, before, syllable, sign) => `${before}${syllable}${/^d/.test(sign) ? "#" : "b"}`);
|
|
502
504
|
if (options.chord) {
|
|
503
505
|
const joined = new RegExp(`^\\s*${SYLLABLE}${SIGN}\\s+(\\S+)\\s*$`).exec(out);
|
|
504
|
-
if (joined &&
|
|
506
|
+
if (joined && joinsAsQuality(joined[3])) {
|
|
505
507
|
const word = `${joined[1]}${joined[2] ?? ""}${joined[3]}`;
|
|
506
508
|
const letters = rootToken(word, naming, h) ?? letterPiece(word, naming, h);
|
|
507
509
|
if (letters !== word) {
|
|
@@ -514,7 +516,7 @@ function read(text, naming, options, changes) {
|
|
|
514
516
|
for (let i = 0;i + 2 < words.length; i += 2) {
|
|
515
517
|
const head = words[i];
|
|
516
518
|
const next = words[i + 2];
|
|
517
|
-
if (!syllableOnly(head) || !
|
|
519
|
+
if (!syllableOnly(head) || !joinsAsQuality(next))
|
|
518
520
|
continue;
|
|
519
521
|
if (naming !== "solfege" && reads(head))
|
|
520
522
|
continue;
|
|
@@ -2170,5 +2172,5 @@ export {
|
|
|
2170
2172
|
voicingCount
|
|
2171
2173
|
};
|
|
2172
2174
|
|
|
2173
|
-
//# debugId=
|
|
2175
|
+
//# debugId=92E85F892552F21C64756E2164756E21
|
|
2174
2176
|
//# sourceMappingURL=index.js.map
|