Skip to content

Commit f6e96e3

Browse files
committed
fixes #122, support barre chord, in both shape diagram, and guitar view
1 parent a001893 commit f6e96e3

File tree

24 files changed

+1582
-38
lines changed

24 files changed

+1582
-38
lines changed

apps/notation_tabs/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use notation_tab::prelude::*;
22

3+
pub mod test;
34
pub mod scarborough_fair;
45

56
pub fn main() {
7+
write_tab(&test::new_tab(), "../notation_viewer/assets/tabs/test.ron");
68
write_tab(&scarborough_fair::new_tab(), "../notation_viewer/assets/tabs/scarborough_fair.ron");
79
}

apps/notation_tabs/src/test.rs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env rust-script
2+
//! ```cargo
3+
//! [dependencies]
4+
//! notation_tab = "0.3.0"
5+
//! ```
6+
7+
use notation_tab::prelude::*;
8+
9+
pub fn main() {
10+
print_tab(&new_tab());
11+
}
12+
13+
pub fn new_tab() -> Tab {
14+
tab! {
15+
"c430733f-46c3-4db2-9685-a72c05027e62"
16+
Meta: TabMeta::new(Key::G, Scale::Major, Signature::_4_4, Tempo::Bpm(60))
17+
Tracks: [
18+
{chord Chord [
19+
$duration = _1
20+
"1" Chord ( 1: 3 5 )
21+
"6-" Chord ( 6: 3- 5 )
22+
]}
23+
{guitar Guitar [
24+
Fretboard
25+
$duration = _1
26+
"Em" Shape ( 0 2 2 0 0 0 )
27+
"G" Shape ( 3 2 0 0 0 0 )
28+
$duration = T_1_8
29+
"picks" Pick [ 6 3 2 1 2 3 ]
30+
Pick [ 6 3 2 1 2 3 ] |
31+
]}
32+
]
33+
Sections: [
34+
{"A" Verse [
35+
{
36+
chord [ "6-" 1 ]
37+
guitar [ "Em" 1 ; "picks" | ]
38+
} {
39+
chord [ "6-" 1 ]
40+
guitar [ "Em" 1 ; "picks" | ]
41+
} {
42+
chord [ "1" 1 ]
43+
guitar [ "G" 1 ; "picks" | ]
44+
} {
45+
chord [ "1" 1 ]
46+
guitar [ "G" 1 ; "picks" | ]
47+
}
48+
]}
49+
]
50+
Form: "A" "A"
51+
}
52+
}
-72.4 KB
Loading

apps/notation_viewer/assets/tabs/scarborough_fair.ron

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
Mark("Asus4"),// [2]
237237
Fretted6(Shape(
238238
(
239+
barre: None,
239240
frets: (
240241
Some(0),
241242
Some(3),
@@ -258,6 +259,7 @@
258259
Mark("Asus4/D"),// [4]
259260
Fretted6(Shape(
260261
(
262+
barre: None,
261263
frets: (
262264
Some(0),
263265
Some(3),
@@ -280,6 +282,7 @@
280282
Mark("G/C"),// [6]
281283
Fretted6(Shape(
282284
(
285+
barre: None,
283286
frets: (
284287
None,
285288
Some(0),
@@ -302,6 +305,7 @@
302305
Mark("Asus2"),// [8]
303306
Fretted6(Shape(
304307
(
308+
barre: None,
305309
frets: (
306310
Some(0),
307311
Some(0),
@@ -324,6 +328,7 @@
324328
Mark("G\'"),// [10]
325329
Fretted6(Shape(
326330
(
331+
barre: None,
327332
frets: (
328333
None,
329334
Some(0),
@@ -346,6 +351,7 @@
346351
Mark("G"),// [12]
347352
Fretted6(Shape(
348353
(
354+
barre: None,
349355
frets: (
350356
Some(3),
351357
Some(0),
@@ -368,6 +374,7 @@
368374
Mark("C"),// [14]
369375
Fretted6(Shape(
370376
(
377+
barre: None,
371378
frets: (
372379
Some(0),
373380
Some(1),
@@ -390,6 +397,7 @@
390397
Mark("Am"),// [16]
391398
Fretted6(Shape(
392399
(
400+
barre: None,
393401
frets: (
394402
Some(0),
395403
Some(1),
@@ -417,6 +425,7 @@
417425
Mark("C"),// [20]
418426
Fretted6(Shape(
419427
(
428+
barre: None,
420429
frets: (
421430
Some(0),
422431
Some(1),
@@ -443,6 +452,7 @@
443452
Mark("D"),// [23]
444453
Fretted6(Shape(
445454
(
455+
barre: None,
446456
frets: (
447457
Some(2),
448458
Some(3),
@@ -471,6 +481,7 @@
471481
Mark("C"),// [28]
472482
Fretted6(Shape(
473483
(
484+
barre: None,
474485
frets: (
475486
Some(0),
476487
Some(1),
@@ -493,6 +504,7 @@
493504
Mark("G/B"),// [30]
494505
Fretted6(Shape(
495506
(
507+
barre: None,
496508
frets: (
497509
Some(0),
498510
Some(3),
@@ -515,6 +527,7 @@
515527
Mark("Am"),// [32]
516528
Fretted6(Shape(
517529
(
530+
barre: None,
518531
frets: (
519532
Some(0),
520533
Some(1),

0 commit comments

Comments
 (0)