@dsebastien/music-notation 0.12.0 → 0.13.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 +2 -1
- package/dist/chord/fingering-words.d.ts +31 -0
- package/dist/cli.js +1 -1
- package/dist/fretboard/tuning.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +517 -29
- package/dist/index.js.map +13 -11
- package/dist/keyboard/piano-chord.d.ts +12 -0
- package/dist/keyboard/scale-fingering.d.ts +9 -0
- package/dist/music-notation.css +33 -0
- package/dist/music-notation.publish.min.js +63 -29
- package/dist/music-notation.tab.min.js +34 -1
- package/dist/publish/index.js +480 -29
- package/dist/publish/index.js.map +13 -11
- package/dist/tab/index.js +16 -1
- package/dist/tab/index.js.map +3 -3
- package/dist/theory/harmonize.d.ts +57 -0
- package/package.json +1 -1
package/dist/tab/index.js
CHANGED
|
@@ -191,6 +191,21 @@ function parseTuning(text) {
|
|
|
191
191
|
}
|
|
192
192
|
return midis;
|
|
193
193
|
}
|
|
194
|
+
function tuningNames(text) {
|
|
195
|
+
const trimmed = text.trim();
|
|
196
|
+
const named = NAMED.get(trimmed.toLowerCase().replace(/\s*\(.*\)$/, ""));
|
|
197
|
+
if (named)
|
|
198
|
+
return tuningNames(named);
|
|
199
|
+
if (!parseTuning(trimmed))
|
|
200
|
+
return null;
|
|
201
|
+
const spaced = trimmed.split(/[\s,]+/).filter(Boolean);
|
|
202
|
+
const names = spaced.length > 1 ? spaced : trimmed.match(/[A-G][#♯b♭]?|[a-g][#♯♭]?/g) ?? [];
|
|
203
|
+
return names.map((n) => {
|
|
204
|
+
const letter = n.charAt(0).toUpperCase();
|
|
205
|
+
const accidental = n.slice(1).replace(/-?\d+$/, "").replace("♯", "#").replace("♭", "b");
|
|
206
|
+
return letter + accidental;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
194
209
|
|
|
195
210
|
// src/convert/text-tab.ts
|
|
196
211
|
var STRING_PREFIX = /^\s*([A-Ga-g][#b]?|[1-8](?=\s*[|:]))?\s*[|:]?/;
|
|
@@ -2090,5 +2105,5 @@ export {
|
|
|
2090
2105
|
textTabToAlphaTex
|
|
2091
2106
|
};
|
|
2092
2107
|
|
|
2093
|
-
//# debugId=
|
|
2108
|
+
//# debugId=E85AD092947E6FCA64756E2164756E21
|
|
2094
2109
|
//# sourceMappingURL=index.js.map
|