gitara 0.8.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +8 -1
- data/README.markdown +15 -21
- data/examples/{aimee-man-wise-up/aimee-man-wise-up.ly → aimee-man-wise-up.ly} +94 -80
- data/examples/aimee-man-wise-up.midi +0 -0
- data/examples/aimee-man-wise-up.pdf +0 -0
- data/examples/{aimee-man-wise-up/aimee-man-wise-up.rb → aimee-man-wise-up.rb} +7 -7
- data/examples/{eraserheads-huling-el-bimbo/tab.ly → eraserheads-huling-el-bimbo.ly} +27 -57
- data/examples/eraserheads-huling-el-bimbo.midi +0 -0
- data/examples/eraserheads-huling-el-bimbo.pdf +0 -0
- data/examples/{eraserheads-huling-el-bimbo/tab.rb → eraserheads-huling-el-bimbo.rb} +7 -7
- data/examples/{foo-fighters-walking-after-you/foo-fighters-walking-after-you.ly → foo-fighters-walking-after-you.ly} +19 -90
- data/examples/{foo-fighters-walking-after-you/foo-fighters-walking-after-you.midi → foo-fighters-walking-after-you.midi} +0 -0
- data/examples/foo-fighters-walking-after-you.pdf +0 -0
- data/examples/{foo-fighters-walking-after-you/foo-fighters-walking-after-you.rb → foo-fighters-walking-after-you.rb} +1 -1
- data/examples/tab-with-alternate-tuning.ly +11 -7
- data/examples/tab-with-alternate-tuning.midi +0 -0
- data/examples/tab-with-alternate-tuning.pdf +0 -0
- data/examples/tab-with-alternate-tuning.rb +1 -1
- data/examples/tab-with-chords.ly +134 -0
- data/examples/tab-with-chords.midi +0 -0
- data/examples/tab-with-chords.pdf +0 -0
- data/examples/tab-with-chords.rb +16 -0
- data/examples/tab-with-key-signature.ly +21 -7
- data/examples/tab-with-key-signature.midi +0 -0
- data/examples/tab-with-key-signature.pdf +0 -0
- data/examples/tab-with-key-signature.rb +2 -2
- data/examples/tab-with-line-with-no-break.ly +7 -12
- data/examples/tab-with-line-with-no-break.midi +0 -0
- data/examples/tab-with-line-with-no-break.pdf +0 -0
- data/examples/tab-with-partial.ly +25 -15
- data/examples/tab-with-partial.midi +0 -0
- data/examples/tab-with-partial.pdf +0 -0
- data/examples/tab-with-partial.rb +7 -7
- data/examples/tab-with-repeats.ly +25 -9
- data/examples/tab-with-repeats.midi +0 -0
- data/examples/tab-with-repeats.pdf +0 -0
- data/examples/tab-with-reused-bar-in-stanza.ly +154 -0
- data/examples/tab-with-reused-bar-in-stanza.midi +0 -0
- data/examples/tab-with-reused-bar-in-stanza.pdf +0 -0
- data/examples/tab-with-reused-bar-in-stanza.rb +14 -0
- data/examples/tab-with-time-signature.ly +27 -8
- data/examples/tab-with-time-signature.midi +0 -0
- data/examples/tab-with-time-signature.pdf +0 -0
- data/lib/gitara/node/bar.rb +0 -25
- data/lib/gitara/node/stanza.rb +22 -2
- data/lib/gitara/template/bar.erb +0 -1
- data/lib/gitara/template/chord_set.erb +1 -1
- data/lib/gitara/template/line.erb +0 -1
- data/lib/gitara/template/score.erb +2 -0
- data/lib/gitara/template/stanza.erb +1 -1
- data/lib/gitara/template/tab.erb +10 -5
- data/lib/gitara/version.rb +1 -1
- data/spec/lib/gitara/app_spec.rb +14 -39
- data/spec/lib/gitara/node/bar/stanza_version_spec.rb +1 -1
- data/spec/lib/gitara/node/bar_spec.rb +2 -58
- data/spec/lib/gitara/node/stanza_spec.rb +21 -1
- data/spec/spec_helper.rb +5 -1
- data/spec/support/app_tester.rb +12 -1
- metadata +34 -16
- data/examples/aimee-man-wise-up/aimee-man-wise-up.midi +0 -0
- data/examples/aimee-man-wise-up/aimee-man-wise-up.pdf +0 -0
- data/examples/eraserheads-huling-el-bimbo/tab.midi +0 -0
- data/examples/eraserheads-huling-el-bimbo/tab.pdf +0 -0
- data/examples/foo-fighters-walking-after-you/foo-fighters-walking-after-you.pdf +0 -0
- data/examples/tab.ly +0 -193
- data/examples/tab.rb +0 -67
Binary file
|
Binary file
|
@@ -7,12 +7,12 @@ Gitara.define do
|
|
7
7
|
transposition "cs"
|
8
8
|
tempo "4 = 90"
|
9
9
|
|
10
|
-
chords :G, '
|
11
|
-
chords :G8, '
|
12
|
-
chords :C, '
|
13
|
-
chords :A7, '
|
14
|
-
chords :Em, '
|
15
|
-
chords :D, '
|
10
|
+
chords :G, 'g1'
|
11
|
+
chords :G8, 'g8'
|
12
|
+
chords :C, 'c1'
|
13
|
+
chords :A7, 'a1:7'
|
14
|
+
chords :Em, 'e1:m'
|
15
|
+
chords :D, 'd1'
|
16
16
|
|
17
17
|
score do
|
18
18
|
stanza "Verse" do
|
@@ -32,4 +32,4 @@ Gitara.define do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
|
-
end
|
35
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
\version "2.
|
1
|
+
\version "2.14.2"
|
2
2
|
\include "english.ly"
|
3
3
|
|
4
4
|
\paper {
|
@@ -14,40 +14,50 @@
|
|
14
14
|
|
15
15
|
%-----------------------------------------------------------------------
|
16
16
|
% Chord Sets
|
17
|
+
|
18
|
+
|
17
19
|
%-----------------------------------------------------------------------
|
18
20
|
% Bars
|
19
21
|
|
20
22
|
vOneBarTabOneLineOneRepeatOneBarOne = { c4 d e f }
|
21
23
|
cBarTabOneLineOneRepeatOneBarOne = { }
|
22
|
-
sBarTabOneLineOneRepeatOneBarOne = { r1 }
|
23
24
|
|
24
25
|
vOneBarTabOneLineOneAlternativeOneBarOne = { d2 e }
|
25
26
|
cBarTabOneLineOneAlternativeOneBarOne = { }
|
26
|
-
sBarTabOneLineOneAlternativeOneBarOne = { r1 }
|
27
27
|
|
28
28
|
vOneBarTabOneLineOneAlternativeOneBarTwo = { f2 g }
|
29
29
|
cBarTabOneLineOneAlternativeOneBarTwo = { }
|
30
|
-
|
30
|
+
|
31
|
+
|
31
32
|
%-----------------------------------------------------------------------
|
32
33
|
% Lines
|
33
34
|
|
34
35
|
vOneLineTabOneLineOne = { \repeat volta 4 { \vOneBarTabOneLineOneRepeatOneBarOne } \alternative { { \vOneBarTabOneLineOneAlternativeOneBarOne } { \vOneBarTabOneLineOneAlternativeOneBarTwo } } \break }
|
35
36
|
cLineTabOneLineOne = { \repeat volta 4 { \cBarTabOneLineOneRepeatOneBarOne } \alternative { { \cBarTabOneLineOneAlternativeOneBarOne } { \cBarTabOneLineOneAlternativeOneBarTwo } } }
|
36
|
-
|
37
|
+
|
38
|
+
|
37
39
|
%-----------------------------------------------------------------------
|
38
40
|
% Stanzas
|
41
|
+
|
42
|
+
|
39
43
|
%-----------------------------------------------------------------------
|
40
44
|
% Scores
|
45
|
+
|
46
|
+
|
41
47
|
%-----------------------------------------------------------------------
|
42
48
|
% Voices
|
43
49
|
|
44
50
|
vOne = {
|
51
|
+
|
45
52
|
\vOneLineTabOneLineOne
|
46
53
|
}
|
54
|
+
|
55
|
+
|
47
56
|
%-----------------------------------------------------------------------
|
48
57
|
% Stanza Headings
|
49
58
|
|
50
|
-
stanzaHeadings = {
|
59
|
+
stanzaHeadings = {
|
60
|
+
}
|
51
61
|
|
52
62
|
%-----------------------------------------------------------------------
|
53
63
|
% Chord Headings
|
@@ -59,26 +69,31 @@ chordHeadings = { \cLineTabOneLineOne }
|
|
59
69
|
\score {
|
60
70
|
\new StaffGroup <<
|
61
71
|
\new Staff <<
|
72
|
+
|
73
|
+
|
62
74
|
\clef "treble_8"
|
63
75
|
|
76
|
+
\new ChordNames {
|
77
|
+
\chordHeadings
|
78
|
+
}
|
79
|
+
|
64
80
|
\new Voice \with { \remove Rest_engraver } {
|
65
81
|
\stanzaHeadings
|
66
82
|
}
|
67
83
|
|
68
84
|
\new Voice {
|
85
|
+
|
69
86
|
\voiceOne
|
70
87
|
\vOne
|
71
88
|
}
|
72
89
|
>>
|
73
90
|
|
74
91
|
\new TabStaff <<
|
92
|
+
|
75
93
|
\new TabVoice {
|
76
94
|
\slurUp
|
77
95
|
\vOne
|
78
96
|
}
|
79
|
-
\new TabVoice {
|
80
|
-
\chordHeadings
|
81
|
-
}
|
82
97
|
>>
|
83
98
|
>>
|
84
99
|
|
@@ -104,6 +119,7 @@ chordHeadings = { \cLineTabOneLineOne }
|
|
104
119
|
% showLastLength = R1*4
|
105
120
|
\score {
|
106
121
|
\new Staff \with {midiInstrument = #"acoustic guitar (nylon)"} <<
|
122
|
+
|
107
123
|
\clef "treble_8"
|
108
124
|
|
109
125
|
\new Voice {
|
Binary file
|
Binary file
|
@@ -0,0 +1,154 @@
|
|
1
|
+
\version "2.14.2"
|
2
|
+
\include "english.ly"
|
3
|
+
|
4
|
+
\paper {
|
5
|
+
indent = #0
|
6
|
+
}
|
7
|
+
|
8
|
+
\header {
|
9
|
+
title = ""
|
10
|
+
composer = ""
|
11
|
+
arranger = ""
|
12
|
+
instrument = ""
|
13
|
+
}
|
14
|
+
|
15
|
+
%-----------------------------------------------------------------------
|
16
|
+
% Chord Sets
|
17
|
+
|
18
|
+
|
19
|
+
%-----------------------------------------------------------------------
|
20
|
+
% Bars
|
21
|
+
|
22
|
+
vOneBarIntro = { <g'\1>8 <a\3>8 <g'\1>8 <a\3>16 <g'\1>8 <g\3>16 <e'\1>4 <g\3>8 }
|
23
|
+
vTwoBarIntro = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
|
24
|
+
cBarIntro = { }
|
25
|
+
|
26
|
+
|
27
|
+
%-----------------------------------------------------------------------
|
28
|
+
% Lines
|
29
|
+
|
30
|
+
vOneLineIntroLineOne = { \vOneBarIntro \vOneBarIntro \vOneBarIntro \vOneBarIntro \break }
|
31
|
+
vTwoLineIntroLineOne = { \vTwoBarIntro \vTwoBarIntro \vTwoBarIntro \vTwoBarIntro \break }
|
32
|
+
cLineIntroLineOne = { \cBarIntro \cBarIntro \cBarIntro \cBarIntro }
|
33
|
+
|
34
|
+
|
35
|
+
%-----------------------------------------------------------------------
|
36
|
+
% Stanzas
|
37
|
+
|
38
|
+
vOneStanzaIntro = { \vOneLineIntroLineOne }
|
39
|
+
vTwoStanzaIntro = { \vTwoLineIntroLineOne }
|
40
|
+
cStanzaIntro = { \cLineIntroLineOne }
|
41
|
+
sStanzaIntro = { r1^"Intro" r1 r1 r1 }
|
42
|
+
|
43
|
+
|
44
|
+
%-----------------------------------------------------------------------
|
45
|
+
% Scores
|
46
|
+
|
47
|
+
|
48
|
+
%-----------------------------------------------------------------------
|
49
|
+
% Voices
|
50
|
+
|
51
|
+
vOne = {
|
52
|
+
|
53
|
+
\vOneStanzaIntro
|
54
|
+
}
|
55
|
+
|
56
|
+
vTwo = {
|
57
|
+
|
58
|
+
\vTwoStanzaIntro
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
%-----------------------------------------------------------------------
|
63
|
+
% Stanza Headings
|
64
|
+
|
65
|
+
stanzaHeadings = {
|
66
|
+
\sStanzaIntro
|
67
|
+
}
|
68
|
+
|
69
|
+
%-----------------------------------------------------------------------
|
70
|
+
% Chord Headings
|
71
|
+
|
72
|
+
chordHeadings = { \cStanzaIntro }
|
73
|
+
|
74
|
+
%-----------------------------------------------------------------------
|
75
|
+
|
76
|
+
\score {
|
77
|
+
\new StaffGroup <<
|
78
|
+
\new Staff <<
|
79
|
+
|
80
|
+
|
81
|
+
\clef "treble_8"
|
82
|
+
|
83
|
+
\new ChordNames {
|
84
|
+
\chordHeadings
|
85
|
+
}
|
86
|
+
|
87
|
+
\new Voice \with { \remove Rest_engraver } {
|
88
|
+
\stanzaHeadings
|
89
|
+
}
|
90
|
+
|
91
|
+
\new Voice {
|
92
|
+
|
93
|
+
\voiceOne
|
94
|
+
\vOne
|
95
|
+
}
|
96
|
+
\new Voice {
|
97
|
+
|
98
|
+
\voiceTwo
|
99
|
+
\vTwo
|
100
|
+
}
|
101
|
+
>>
|
102
|
+
|
103
|
+
\new TabStaff <<
|
104
|
+
|
105
|
+
\new TabVoice {
|
106
|
+
\slurUp
|
107
|
+
\vOne
|
108
|
+
}
|
109
|
+
\new TabVoice {
|
110
|
+
\slurUp
|
111
|
+
\vTwo
|
112
|
+
}
|
113
|
+
>>
|
114
|
+
>>
|
115
|
+
|
116
|
+
\layout {
|
117
|
+
\context { \Staff
|
118
|
+
\override TimeSignature #'style = #'numbered
|
119
|
+
\override StringNumber #'transparent = ##t
|
120
|
+
}
|
121
|
+
\context { \TabStaff
|
122
|
+
\override TimeSignature #'style = #'numbered
|
123
|
+
}
|
124
|
+
\context { \Voice
|
125
|
+
\remove Slur_engraver
|
126
|
+
}
|
127
|
+
\context { \TabVoice
|
128
|
+
\remove Dots_engraver
|
129
|
+
\remove Stem_engraver
|
130
|
+
\remove Rest_engraver
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
% showLastLength = R1*4
|
136
|
+
\score {
|
137
|
+
\new Staff \with {midiInstrument = #"acoustic guitar (nylon)"} <<
|
138
|
+
|
139
|
+
\clef "treble_8"
|
140
|
+
|
141
|
+
\new Voice {
|
142
|
+
\unfoldRepeats {
|
143
|
+
\vOne
|
144
|
+
}
|
145
|
+
}
|
146
|
+
\new Voice {
|
147
|
+
\unfoldRepeats {
|
148
|
+
\vTwo
|
149
|
+
}
|
150
|
+
}
|
151
|
+
>>
|
152
|
+
|
153
|
+
\midi {}
|
154
|
+
}
|
Binary file
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Gitara.define do
|
2
|
+
bar :Intro do
|
3
|
+
notes "<g'/1>8 <a/3>8 <g'/1>8 <a/3>16 <g'/1>8 <g/3>16 <e'/1>4 <g/3>8"
|
4
|
+
notes "<f/4>4 <f/4>4 <c/5>4 <e/4>4"
|
5
|
+
end
|
6
|
+
|
7
|
+
line :IntroLineOne do
|
8
|
+
bar :Intro, :Intro, :Intro, :Intro
|
9
|
+
end
|
10
|
+
|
11
|
+
stanza "Intro" do
|
12
|
+
line :IntroLineOne
|
13
|
+
end
|
14
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
\version "2.
|
1
|
+
\version "2.14.2"
|
2
2
|
\include "english.ly"
|
3
3
|
|
4
4
|
\paper {
|
@@ -14,36 +14,49 @@
|
|
14
14
|
|
15
15
|
%-----------------------------------------------------------------------
|
16
16
|
% Chord Sets
|
17
|
+
|
18
|
+
|
17
19
|
%-----------------------------------------------------------------------
|
18
20
|
% Bars
|
19
21
|
|
20
22
|
vOneBarCChordBarOne = { c4 e4 }
|
21
23
|
cBarCChordBarOne = { }
|
22
|
-
sBarCChordBarOne = { r4^"C chord" r4 }
|
23
24
|
|
24
25
|
vOneBarCChordBarTwo = { g2 }
|
25
26
|
cBarCChordBarTwo = { }
|
26
|
-
|
27
|
+
|
28
|
+
|
27
29
|
%-----------------------------------------------------------------------
|
28
30
|
% Lines
|
31
|
+
|
32
|
+
|
29
33
|
%-----------------------------------------------------------------------
|
30
34
|
% Stanzas
|
31
35
|
|
32
36
|
vOneStanzaCChord = { \vOneBarCChordBarOne \vOneBarCChordBarTwo }
|
33
37
|
cStanzaCChord = { \cBarCChordBarOne \cBarCChordBarTwo }
|
34
|
-
sStanzaCChord = {
|
38
|
+
sStanzaCChord = { r4^"C chord" r4 r4 r4 }
|
39
|
+
|
40
|
+
|
35
41
|
%-----------------------------------------------------------------------
|
36
42
|
% Scores
|
43
|
+
|
44
|
+
|
37
45
|
%-----------------------------------------------------------------------
|
38
46
|
% Voices
|
39
47
|
|
40
48
|
vOne = {
|
49
|
+
|
41
50
|
\vOneStanzaCChord
|
42
51
|
}
|
52
|
+
|
53
|
+
|
43
54
|
%-----------------------------------------------------------------------
|
44
55
|
% Stanza Headings
|
45
56
|
|
46
|
-
stanzaHeadings = {
|
57
|
+
stanzaHeadings = {
|
58
|
+
\sStanzaCChord
|
59
|
+
}
|
47
60
|
|
48
61
|
%-----------------------------------------------------------------------
|
49
62
|
% Chord Headings
|
@@ -56,26 +69,31 @@ chordHeadings = { \cStanzaCChord }
|
|
56
69
|
\new StaffGroup <<
|
57
70
|
\new Staff <<
|
58
71
|
\time 2/4
|
72
|
+
|
73
|
+
|
59
74
|
\clef "treble_8"
|
60
75
|
|
76
|
+
\new ChordNames {
|
77
|
+
\chordHeadings
|
78
|
+
}
|
79
|
+
|
61
80
|
\new Voice \with { \remove Rest_engraver } {
|
62
81
|
\stanzaHeadings
|
63
82
|
}
|
64
83
|
|
65
84
|
\new Voice {
|
85
|
+
|
66
86
|
\voiceOne
|
67
87
|
\vOne
|
68
88
|
}
|
69
89
|
>>
|
70
90
|
|
71
91
|
\new TabStaff <<
|
92
|
+
|
72
93
|
\new TabVoice {
|
73
94
|
\slurUp
|
74
95
|
\vOne
|
75
96
|
}
|
76
|
-
\new TabVoice {
|
77
|
-
\chordHeadings
|
78
|
-
}
|
79
97
|
>>
|
80
98
|
>>
|
81
99
|
|
@@ -101,6 +119,7 @@ chordHeadings = { \cStanzaCChord }
|
|
101
119
|
% showLastLength = R1*4
|
102
120
|
\score {
|
103
121
|
\new Staff \with {midiInstrument = #"acoustic guitar (nylon)"} <<
|
122
|
+
|
104
123
|
\clef "treble_8"
|
105
124
|
|
106
125
|
\new Voice {
|
Binary file
|
Binary file
|
data/lib/gitara/node/bar.rb
CHANGED
@@ -5,10 +5,6 @@ module Gitara
|
|
5
5
|
# @attribute $1
|
6
6
|
has_value :specified_duration
|
7
7
|
|
8
|
-
def first_bar_of_stanza?
|
9
|
-
stanza && stanza.descendants(Node::Bar)[0] == self
|
10
|
-
end
|
11
|
-
|
12
8
|
def note_sets
|
13
9
|
definition_children.select{|child| child.is_a?(Node::NoteSet)}
|
14
10
|
end
|
@@ -17,28 +13,7 @@ module Gitara
|
|
17
13
|
specified_duration ? "\\partial #{specified_duration}" : nil
|
18
14
|
end
|
19
15
|
|
20
|
-
def stanza
|
21
|
-
self.ancestor(Node::Stanza)
|
22
|
-
end
|
23
|
-
|
24
16
|
def stanza_heading
|
25
|
-
first_bar_of_stanza? ? stanza_heading_for_first_bar : stanza_heading_for_succeeding_bars
|
26
|
-
end
|
27
|
-
|
28
|
-
def stanza_heading_for_first_bar
|
29
|
-
if specified_duration
|
30
|
-
%Q|r#{specified_duration}^"#{ancestor(Node::Stanza).name}"|
|
31
|
-
else
|
32
|
-
ts = ancestor(Node::Tab).time_signature
|
33
|
-
if ts.generates_whole_note_bars?
|
34
|
-
%Q|#{ts.rest_bar_value}^"#{ancestor(Node::Stanza).name}"|
|
35
|
-
else
|
36
|
-
%Q|r#{ts.beat_unit}^"#{ancestor(Node::Stanza).name}" | + ("r#{ts.beat_unit} " * (ts.beats_per_bar - 1)).strip
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def stanza_heading_for_succeeding_bars
|
42
17
|
specified_duration ? "r#{specified_duration}" : ancestor(Node::Tab).time_signature.rest_bar_value
|
43
18
|
end
|
44
19
|
end
|