text-guitar-chart 0.1.1 → 0.2.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/FORMAT.md +10 -4
- package/docs/app.js +5 -0
- package/docs/bundle.js +278 -208
- package/docs/bundle.js.map +2 -2
- package/docs/index.html +1 -0
- package/lib/editableSVGuitar.js +184 -127
- package/lib/fingeringToString.js +25 -2
- package/lib/stringToFingering.js +23 -2
- package/package.json +1 -1
- package/test/editableSVGuitar.test.js +15 -6
- package/test/fingeringToString.test.js +221 -0
- package/test/stringToFingering.test.js +176 -0
- package/types/editableSVGuitar.d.ts +22 -1
- package/types/stringToFingering.d.ts +3 -1
package/FORMAT.md
CHANGED
|
@@ -14,11 +14,13 @@ Strings are numbered 1-6 from right to left in the diagram. In standard guitar t
|
|
|
14
14
|
- String 1 (rightmost) is the highest pitch (E4)
|
|
15
15
|
|
|
16
16
|
### Color values
|
|
17
|
-
The format supports
|
|
17
|
+
The format supports four colors for fingering markers:
|
|
18
18
|
- `#000000` (black) for regular fingering positions
|
|
19
19
|
- `#e74c3c` (red/root marker color) for special positions (typically root notes)
|
|
20
|
+
- `#9B9B9B` (grey) for grey marker positions
|
|
21
|
+
- `#4A90E2` (blue) for blue marker positions
|
|
20
22
|
|
|
21
|
-
Any color value
|
|
23
|
+
Any color value not matching one of the four known colors is treated as a root marker (red) and rendered with the root marker symbol.
|
|
22
24
|
|
|
23
25
|
## ascii format
|
|
24
26
|
|
|
@@ -47,7 +49,9 @@ The first line can optionally have an indication of the starting fret on the lef
|
|
|
47
49
|
These different characters are used:
|
|
48
50
|
- "|" indicates that there is no fingering in this position
|
|
49
51
|
- "o" indicates that this position is fingered with a regular dot (color #000000)
|
|
50
|
-
- "*" indicates that this position is fingered with a root marker (
|
|
52
|
+
- "*" indicates that this position is fingered with a root marker (color #e74c3c or any unrecognized color)
|
|
53
|
+
- "O" (uppercase) indicates that this position is fingered with a grey marker (color #9B9B9B)
|
|
54
|
+
- "+" indicates that this position is fingered with a blue marker (color #4A90E2)
|
|
51
55
|
- any other character is displayed as text on the fretboard at that position (commonly used for finger numbers or note names)
|
|
52
56
|
|
|
53
57
|
Examples:
|
|
@@ -139,7 +143,9 @@ The second line can optionally have an indication of the starting fret on the le
|
|
|
139
143
|
The even rows contain characters representing the fingering:
|
|
140
144
|
- "│" indicates that there is no fingering in this position
|
|
141
145
|
- "○" indicates that this position is fingered with a regular dot (color #000000)
|
|
142
|
-
- "●" indicates that this position is fingered with a root marker (
|
|
146
|
+
- "●" indicates that this position is fingered with a root marker (color #e74c3c or any unrecognized color)
|
|
147
|
+
- "□" indicates that this position is fingered with a grey marker (color #9B9B9B)
|
|
148
|
+
- "■" indicates that this position is fingered with a blue marker (color #4A90E2)
|
|
143
149
|
- any other character is displayed as text on the fretboard at that position (commonly used for finger numbers or note names)
|
|
144
150
|
|
|
145
151
|
Example:
|
package/docs/app.js
CHANGED
|
@@ -156,6 +156,11 @@ function layout (columnNumber){
|
|
|
156
156
|
textarea.value = layout;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
// Batch conversion
|
|
160
|
+
document.getElementById('layout-1-btn')?.addEventListener('click', () => {
|
|
161
|
+
layout(1);
|
|
162
|
+
});
|
|
163
|
+
|
|
159
164
|
// Batch conversion
|
|
160
165
|
document.getElementById('layout-2-btn')?.addEventListener('click', () => {
|
|
161
166
|
layout(2);
|