Skip to content
Browse files

[#18] I should be able to specify if a bar is a partial.

  • Loading branch information...
1 parent aa7c475 commit db31972dd73dfbab0a6c78adde643020a3f43551 @gsmendoza committed Mar 17, 2012
View
332 examples/eraserheads-huling-el-bimbo/tab.ly
@@ -16,6 +16,7 @@
% Chord Sets
cChordSetG = { r1-"G" }
+cChordSetGEight = { r8-"G" }
cChordSetC = { r1-"C" }
cChordSetASeven = { r1-"A7" }
cChordSetEm = { r1-"Em" }
@@ -24,145 +25,180 @@ cChordSetD = { r1-"D" }
%-----------------------------------------------------------------------
% Bars
-vOneBarVerseLineOneBarOne = { r2. r8 <g\3>8 }
-vTwoBarVerseLineOneBarOne = { r1 }
-cBarVerseLineOneBarOne = { \cChordSetG }
-
-vOneBarVerseLineOneBarTwo = { <a\3>16\glissando <b\3>16 <b\3>4 r16 <a\3>16\glissando <b\3>4. <a\3>16( <g\3>16) }
-vTwoBarVerseLineOneBarTwo = { r1 }
-cBarVerseLineOneBarTwo = { \cChordSetG }
-
-vOneBarVerseLineOneBarThree = { <a\3>8( <g\3>4) <cs'\2>4 <g\3>4. }
-vTwoBarVerseLineOneBarThree = { \skip 8 r8 <e\4>4 <a,\5>4 <e\4>8 <b,\5>8 }
-cBarVerseLineOneBarThree = { \cChordSetASeven }
-
-vOneBarVerseLineOneBarFour = { r4 <g\3>8 <g\3>8 <g\3>8 <a\3>8 <c'\2>8 <b~\2>8 }
-vTwoBarVerseLineOneBarFour = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
-cBarVerseLineOneBarFour = { \cChordSetC }
-
-vOneBarVerseLineOneBarFive = { <b\2>8 <g\3>8 <b\2>8 <b\2>16 <g\3>16 \skip 16 <b\2>16 <g\3>16 \skip 16 <b\2>16 <g\3>16 \skip 8 }
-vTwoBarVerseLineOneBarFive = { <g,\6>4 <d\4>4 <d\4>16 \skip 16 \skip 16 <d\4>16 \skip 16 \skip 16 <d\4>8 }
-cBarVerseLineOneBarFive = { \cChordSetG }
-
-vOneBarVerseLineTwoBarOne = { r8 <g\3>8 <b\2>8 <b\2>16 <b\2>8 <b\2>16( <d'\2>8) <e'\1>4 }
-vTwoBarVerseLineTwoBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarVerseLineTwoBarOne = { \cChordSetG }
-
-vOneBarVerseLineTwoBarTwo = { <a\3>16( <g\3>16)( <a\3>4) <cs'\2>4 <a\3>4 <b\2>8 }
-vTwoBarVerseLineTwoBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
-cBarVerseLineTwoBarTwo = { \cChordSetASeven }
-
-vOneBarVerseLineTwoBarThree = { <c'\2>4. <d'\2>4 <c'\2>4 <b~\2>8 }
-vTwoBarVerseLineTwoBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
-cBarVerseLineTwoBarThree = { \cChordSetC }
-
-vOneBarVerseLineTwoBarFour = { <b\2>8 <g\3>4 <g\3>4 <b\2>8 <b\2>8 <c'\2>8 }
-vTwoBarVerseLineTwoBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarVerseLineTwoBarFour = { \cChordSetG }
-
-vOneBarVerseLineThreeBarOne = { <d'\2>4. <d'\2>4 <d'\2>4 <cs'~\2>8 }
-vTwoBarVerseLineThreeBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarVerseLineThreeBarOne = { \cChordSetG }
-
-vOneBarVerseLineThreeBarTwo = { <cs'\2>8 <a\3>4 <a\3>4 <a\3>4 <b\2>8 }
-vTwoBarVerseLineThreeBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
-cBarVerseLineThreeBarTwo = { \cChordSetASeven }
-
-vOneBarVerseLineThreeBarThree = { <c'\2>4 <c'\2>8 <d'\2>4 <e'\1>4 <b~\2>8 }
-vTwoBarVerseLineThreeBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
-cBarVerseLineThreeBarThree = { \cChordSetC }
-
-vOneBarVerseLineThreeBarFour = { <b\2>8 <d'\2>4 <d'\2>4 <b\2>16 <a\3>8 <g\3>16( <a\3>8) }
-vTwoBarVerseLineThreeBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarVerseLineThreeBarFour = { \cChordSetG }
-
-vOneBarVerseLineFourBarOne = { <b\2>4. <b\2>4 <b\2>16 <b\2>16 r16 <a\3>16 <b\2>8 }
-vTwoBarVerseLineFourBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarVerseLineFourBarOne = { \cChordSetG }
-
-vOneBarVerseLineFourBarTwo = { <a\3>16( <g\3>16) <e\4>4 <cs'\2>4 <g\3>16 <g\3>16 r16 <g\3>16 <g\3>8 }
-vTwoBarVerseLineFourBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
-cBarVerseLineFourBarTwo = { \cChordSetASeven }
-
-vOneBarVerseLineFourBarThree = { <g\3>4. <g\3>4 <a\3>8 <c'\2>8 <b~\2>8 }
-vTwoBarVerseLineFourBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
-cBarVerseLineFourBarThree = { \cChordSetC }
-
-vOneBarVerseLineFourBarFour = { <b\2>8 <g\3>4 <g\3>4 <g\3>4. }
-vTwoBarVerseLineFourBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <g,\6>8 <fs,\6>8 }
-cBarVerseLineFourBarFour = { \cChordSetG }
-
-vOneBarRefrainLineOneBarOne = { r4 <g\3>8 <g\3>8 <g\3>8 <g\3>8 <e'\1>8 <d'~\2>8 }
-vTwoBarRefrainLineOneBarOne = { <e,\6>4 <e\4>4 <e,\6>4 <e\4>4 }
-cBarRefrainLineOneBarOne = { \cChordSetEm }
-
-vOneBarRefrainLineOneBarTwo = { <d'\2>8 <b\2>4 <a\3>4 <a\3>4 <b\2>8 }
-vTwoBarRefrainLineOneBarTwo = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarRefrainLineOneBarTwo = { \cChordSetG }
-
-vOneBarRefrainLineOneBarThree = { <c'\2>4 <c'\2>8 <d'\2>4 <g\3>8 <a\3>8 <b~\2>8 }
-vTwoBarRefrainLineOneBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
-cBarRefrainLineOneBarThree = { \cChordSetC }
-
-vOneBarRefrainLineOneBarFour = { <b\2>8 <a\3>4 <a\3>4 <a\3>4. }
-vTwoBarRefrainLineOneBarFour = { <a,\5>4 <d\4>4 <a,\5>4 <g,\6>8 <fs,\6>8 }
-cBarRefrainLineOneBarFour = { \cChordSetD }
-
-vOneBarRefrainLineTwoBarOne = { r4 <g\3>8 <g\3>8 <g\3>8 <g\3>8 <e'\1>8 <d'~\2>8 }
-vTwoBarRefrainLineTwoBarOne = { <e,\6>4 <e\4>4 <e,\6>4 <e\4>4 }
-cBarRefrainLineTwoBarOne = { \cChordSetEm }
-
-vOneBarRefrainLineTwoBarTwo = { <d'\2>8 <b\2>4 <a\3>4 <a\3>4 <b\2>8 }
-vTwoBarRefrainLineTwoBarTwo = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarRefrainLineTwoBarTwo = { \cChordSetG }
-
-vOneBarRefrainLineTwoBarThree = { <c'\2>4 <c'\2>8 <d'\2>4 <e'\1>4 <e'~\1>8 }
-vTwoBarRefrainLineTwoBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
-cBarRefrainLineTwoBarThree = { \cChordSetC }
-
-vOneBarRefrainLineTwoBarFour = { <e'\1>8 <d'\2>4 <d'\2>4 <d'\2>4 <d'\2>8 }
-vTwoBarRefrainLineTwoBarFour = { <a,\5>4 <d\4>4 <a,\5>4 <d\4>4 }
-cBarRefrainLineTwoBarFour = { \cChordSetD }
-
-vOneBarRefrainLineTwoBarFive = { <a\3 d'\2 >8 <a\3 d'\2 >8 <a\3 d'\2 >8 <a\3 d'\2 >8 <a\3 d'\2 >8 <b\2>8 <b\2>8 <c'\2>8 }
-vTwoBarRefrainLineTwoBarFive = { <d\4>8 <d\4>8 <d\4>8 <d\4>8 <d\4>8 \skip 8 \skip 8 \skip 8 }
-cBarRefrainLineTwoBarFive = { \cChordSetD }
-
-vOneBarChorusLineOneBarOne = { <d'\2>4. <g'\1>4 <d'\2>4 <cs'~\2>8 }
-vTwoBarChorusLineOneBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarChorusLineOneBarOne = { \cChordSetG }
-
-vOneBarChorusLineOneBarTwo = { <cs'\2>4 <g'\1>8 <g'\1>4 <cs'\2>4 <c'~\2>8 }
-vTwoBarChorusLineOneBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
-cBarChorusLineOneBarTwo = { \cChordSetASeven }
-
-vOneBarChorusLineOneBarThree = { <c'\2>4. <d'\2>4 <e'\1>4 <b~\2>8 }
-vTwoBarChorusLineOneBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
-cBarChorusLineOneBarThree = { \cChordSetC }
-
-vOneBarChorusLineOneBarFour = { <b\2>8 <d'\2>4 <d'\2>4 <b\2>8 <b\2>8 <c'\2>8 }
-vTwoBarChorusLineOneBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarChorusLineOneBarFour = { \cChordSetG }
-
-vOneBarChorusLineTwoBarOne = { <d'\2>4. <g'\1>4 <d'\2>4 <cs'~\2>8 }
-vTwoBarChorusLineTwoBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarChorusLineTwoBarOne = { \cChordSetG }
-
-vOneBarChorusLineTwoBarTwo = { <cs'\2>4 <g'\1>8 <g'\1>4 <cs'\2>4 <c'~\2>8 }
-vTwoBarChorusLineTwoBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
-cBarChorusLineTwoBarTwo = { \cChordSetASeven }
-
-vOneBarChorusLineTwoBarThree = { <c'\2>4. <d'\2>4 <c'\2>4 <b~\2>8 }
-vTwoBarChorusLineTwoBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
-cBarChorusLineTwoBarThree = { \cChordSetC }
-
-vOneBarChorusLineTwoBarFour = { <b\2>8 <g\3>4 <g\3>4 <g\3>4 <g\3>8 }
-vTwoBarChorusLineTwoBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
-cBarChorusLineTwoBarFour = { \cChordSetG }
-
-vOneBarChorusLineTwoBarFive = { <g\3 d'\2 g'\1 >1 }
-vTwoBarChorusLineTwoBarFive = { <g,\6 b,\5 d\4 >1 }
-cBarChorusLineTwoBarFive = { \cChordSetG }
+vOneBarVerseLineOneBarOne = { \partial 8 <g\3>8 }
+vTwoBarVerseLineOneBarOne = { \partial 8 r8 }
+cBarVerseLineOneBarOne = { \partial 8 \cChordSetGEight }
+sBarVerseLineOneBarOne = { \partial 8 r8^"Verse" }
+
+vOneBarVerseLineOneBarTwo = { <a\3>16\glissando <b\3>16 <b\3>4 r16 <a\3>16\glissando <b\3>4. <a\3>16( <g\3>16) }
+vTwoBarVerseLineOneBarTwo = { r1 }
+cBarVerseLineOneBarTwo = { \cChordSetG }
+sBarVerseLineOneBarTwo = { r1 }
+
+vOneBarVerseLineOneBarThree = { <a\3>8( <g\3>4) <cs'\2>4 <g\3>4. }
+vTwoBarVerseLineOneBarThree = { \skip 8 r8 <e\4>4 <a,\5>4 <e\4>8 <b,\5>8 }
+cBarVerseLineOneBarThree = { \cChordSetASeven }
+sBarVerseLineOneBarThree = { r1 }
+
+vOneBarVerseLineOneBarFour = { r4 <g\3>8 <g\3>8 <g\3>8 <a\3>8 <c'\2>8 <b~\2>8 }
+vTwoBarVerseLineOneBarFour = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
+cBarVerseLineOneBarFour = { \cChordSetC }
+sBarVerseLineOneBarFour = { r1 }
+
+vOneBarVerseLineOneBarFive = { <b\2>8 <g\3>8 <b\2>8 <b\2>16 <g\3>16 \skip 16 <b\2>16 <g\3>16 \skip 16 <b\2>16 <g\3>16 \skip 8 }
+vTwoBarVerseLineOneBarFive = { <g,\6>4 <d\4>4 <d\4>16 \skip 16 \skip 16 <d\4>16 \skip 16 \skip 16 <d\4>8 }
+cBarVerseLineOneBarFive = { \cChordSetG }
+sBarVerseLineOneBarFive = { r1 }
+
+vOneBarVerseLineTwoBarOne = { r8 <g\3>8 <b\2>8 <b\2>16 <b\2>8 <b\2>16( <d'\2>8) <e'\1>4 }
+vTwoBarVerseLineTwoBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarVerseLineTwoBarOne = { \cChordSetG }
+sBarVerseLineTwoBarOne = { r1 }
+
+vOneBarVerseLineTwoBarTwo = { <a\3>16( <g\3>16)( <a\3>4) <cs'\2>4 <a\3>4 <b\2>8 }
+vTwoBarVerseLineTwoBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
+cBarVerseLineTwoBarTwo = { \cChordSetASeven }
+sBarVerseLineTwoBarTwo = { r1 }
+
+vOneBarVerseLineTwoBarThree = { <c'\2>4. <d'\2>4 <c'\2>4 <b~\2>8 }
+vTwoBarVerseLineTwoBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
+cBarVerseLineTwoBarThree = { \cChordSetC }
+sBarVerseLineTwoBarThree = { r1 }
+
+vOneBarVerseLineTwoBarFour = { <b\2>8 <g\3>4 <g\3>4 <b\2>8 <b\2>8 <c'\2>8 }
+vTwoBarVerseLineTwoBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarVerseLineTwoBarFour = { \cChordSetG }
+sBarVerseLineTwoBarFour = { r1 }
+
+vOneBarVerseLineThreeBarOne = { <d'\2>4. <d'\2>4 <d'\2>4 <cs'~\2>8 }
+vTwoBarVerseLineThreeBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarVerseLineThreeBarOne = { \cChordSetG }
+sBarVerseLineThreeBarOne = { r1 }
+
+vOneBarVerseLineThreeBarTwo = { <cs'\2>8 <a\3>4 <a\3>4 <a\3>4 <b\2>8 }
+vTwoBarVerseLineThreeBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
+cBarVerseLineThreeBarTwo = { \cChordSetASeven }
+sBarVerseLineThreeBarTwo = { r1 }
+
+vOneBarVerseLineThreeBarThree = { <c'\2>4 <c'\2>8 <d'\2>4 <e'\1>4 <b~\2>8 }
+vTwoBarVerseLineThreeBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
+cBarVerseLineThreeBarThree = { \cChordSetC }
+sBarVerseLineThreeBarThree = { r1 }
+
+vOneBarVerseLineThreeBarFour = { <b\2>8 <d'\2>4 <d'\2>4 <b\2>16 <a\3>8 <g\3>16( <a\3>8) }
+vTwoBarVerseLineThreeBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarVerseLineThreeBarFour = { \cChordSetG }
+sBarVerseLineThreeBarFour = { r1 }
+
+vOneBarVerseLineFourBarOne = { <b\2>4. <b\2>4 <b\2>16 <b\2>16 r16 <a\3>16 <b\2>8 }
+vTwoBarVerseLineFourBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarVerseLineFourBarOne = { \cChordSetG }
+sBarVerseLineFourBarOne = { r1 }
+
+vOneBarVerseLineFourBarTwo = { <a\3>16( <g\3>16) <e\4>4 <cs'\2>4 <g\3>16 <g\3>16 r16 <g\3>16 <g\3>8 }
+vTwoBarVerseLineFourBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
+cBarVerseLineFourBarTwo = { \cChordSetASeven }
+sBarVerseLineFourBarTwo = { r1 }
+
+vOneBarVerseLineFourBarThree = { <g\3>4. <g\3>4 <a\3>8 <c'\2>8 <b~\2>8 }
+vTwoBarVerseLineFourBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
+cBarVerseLineFourBarThree = { \cChordSetC }
+sBarVerseLineFourBarThree = { r1 }
+
+vOneBarVerseLineFourBarFour = { <b\2>8 <g\3>4 <g\3>4 <g\3>4. }
+vTwoBarVerseLineFourBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <g,\6>8 <fs,\6>8 }
+cBarVerseLineFourBarFour = { \cChordSetG }
+sBarVerseLineFourBarFour = { r1 }
+
+vOneBarRefrainLineOneBarOne = { r4 <g\3>8 <g\3>8 <g\3>8 <g\3>8 <e'\1>8 <d'~\2>8 }
+vTwoBarRefrainLineOneBarOne = { <e,\6>4 <e\4>4 <e,\6>4 <e\4>4 }
+cBarRefrainLineOneBarOne = { \cChordSetEm }
+sBarRefrainLineOneBarOne = { r1^"Refrain" }
+
+vOneBarRefrainLineOneBarTwo = { <d'\2>8 <b\2>4 <a\3>4 <a\3>4 <b\2>8 }
+vTwoBarRefrainLineOneBarTwo = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarRefrainLineOneBarTwo = { \cChordSetG }
+sBarRefrainLineOneBarTwo = { r1 }
+
+vOneBarRefrainLineOneBarThree = { <c'\2>4 <c'\2>8 <d'\2>4 <g\3>8( <a\3>8) <b~\2>8 }
+vTwoBarRefrainLineOneBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
+cBarRefrainLineOneBarThree = { \cChordSetC }
+sBarRefrainLineOneBarThree = { r1 }
+
+vOneBarRefrainLineOneBarFour = { <b\2>8 <a\3>4 <a\3>4 <a\3>4. }
+vTwoBarRefrainLineOneBarFour = { <a,\5>4 <d\4>4 <a,\5>4 <g,\6>8 <fs,\6>8 }
+cBarRefrainLineOneBarFour = { \cChordSetD }
+sBarRefrainLineOneBarFour = { r1 }
+
+vOneBarRefrainLineTwoBarOne = { r4 <g\3>8 <g\3>8 <g\3>8 <g\3>8 <e'\1>8 <d'~\2>8 }
+vTwoBarRefrainLineTwoBarOne = { <e,\6>4 <e\4>4 <e,\6>4 <e\4>4 }
+cBarRefrainLineTwoBarOne = { \cChordSetEm }
+sBarRefrainLineTwoBarOne = { r1 }
+
+vOneBarRefrainLineTwoBarTwo = { <d'\2>8 <b\2>4 <a\3>4 <a\3>4 <b\2>8 }
+vTwoBarRefrainLineTwoBarTwo = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarRefrainLineTwoBarTwo = { \cChordSetG }
+sBarRefrainLineTwoBarTwo = { r1 }
+
+vOneBarRefrainLineTwoBarThree = { <c'\2>4 <c'\2>8 <d'\2>4 <e'\1>4 <e'~\1>8 }
+vTwoBarRefrainLineTwoBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
+cBarRefrainLineTwoBarThree = { \cChordSetC }
+sBarRefrainLineTwoBarThree = { r1 }
+
+vOneBarRefrainLineTwoBarFour = { <e'\1>8 <d'\2>4 <d'\2>4 <d'\2>4 <d'\2>8 }
+vTwoBarRefrainLineTwoBarFour = { <a,\5>4 <d\4>4 <a,\5>4 <d\4>4 }
+cBarRefrainLineTwoBarFour = { \cChordSetD }
+sBarRefrainLineTwoBarFour = { r1 }
+
+vOneBarRefrainLineTwoBarFive = { <a\3 d'\2 >8 <a\3 d'\2 >8 <a\3 d'\2 >8 <a\3 d'\2 >8 <a\3 d'\2 >8 <b\2>8 <b\2>8 <c'\2>8 }
+vTwoBarRefrainLineTwoBarFive = { <d\4>8 <d\4>8 <d\4>8 <d\4>8 <d\4>8 \skip 8 \skip 8 \skip 8 }
+cBarRefrainLineTwoBarFive = { \cChordSetD }
+sBarRefrainLineTwoBarFive = { r1 }
+
+vOneBarChorusLineOneBarOne = { <d'\2>4. <g'\1>4 <d'\2>4 <cs'~\2>8 }
+vTwoBarChorusLineOneBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarChorusLineOneBarOne = { \cChordSetG }
+sBarChorusLineOneBarOne = { r1^"Chorus" }
+
+vOneBarChorusLineOneBarTwo = { <cs'\2>4 <g'\1>8 <g'\1>4 <cs'\2>4 <c'~\2>8 }
+vTwoBarChorusLineOneBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
+cBarChorusLineOneBarTwo = { \cChordSetASeven }
+sBarChorusLineOneBarTwo = { r1 }
+
+vOneBarChorusLineOneBarThree = { <c'\2>4. <d'\2>4 <e'\1>4 <b~\2>8 }
+vTwoBarChorusLineOneBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
+cBarChorusLineOneBarThree = { \cChordSetC }
+sBarChorusLineOneBarThree = { r1 }
+
+vOneBarChorusLineOneBarFour = { <b\2>8 <d'\2>4 <d'\2>4 <b\2>8 <b\2>8 <c'\2>8 }
+vTwoBarChorusLineOneBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarChorusLineOneBarFour = { \cChordSetG }
+sBarChorusLineOneBarFour = { r1 }
+
+vOneBarChorusLineTwoBarOne = { <d'\2>4. <g'\1>4 <d'\2>4 <cs'~\2>8 }
+vTwoBarChorusLineTwoBarOne = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarChorusLineTwoBarOne = { \cChordSetG }
+sBarChorusLineTwoBarOne = { r1 }
+
+vOneBarChorusLineTwoBarTwo = { <cs'\2>4 <g'\1>8 <g'\1>4 <cs'\2>4 <c'~\2>8 }
+vTwoBarChorusLineTwoBarTwo = { <a,\5>4 <e\4>4 <a,\5>4 <e\4>4 }
+cBarChorusLineTwoBarTwo = { \cChordSetASeven }
+sBarChorusLineTwoBarTwo = { r1 }
+
+vOneBarChorusLineTwoBarThree = { <c'\2>4. <d'\2>4 <c'\2>4 <b~\2>8 }
+vTwoBarChorusLineTwoBarThree = { <c\5>4 <e\4>4 <c\5>4 <e\4>4 }
+cBarChorusLineTwoBarThree = { \cChordSetC }
+sBarChorusLineTwoBarThree = { r1 }
+
+vOneBarChorusLineTwoBarFour = { <b\2>8 <g\3>4 <g\3>4 <g\3>4 <g\3>8 }
+vTwoBarChorusLineTwoBarFour = { <g,\6>4 <d\4>4 <g,\6>4 <d\4>4 }
+cBarChorusLineTwoBarFour = { \cChordSetG }
+sBarChorusLineTwoBarFour = { r1 }
+
+vOneBarChorusLineTwoBarFive = { <g\3 d'\2 g'\1 >1 }
+vTwoBarChorusLineTwoBarFive = { <g,\6 b,\5 d\4 >1 }
+cBarChorusLineTwoBarFive = { \cChordSetG }
+sBarChorusLineTwoBarFive = { r1 }
%-----------------------------------------------------------------------
@@ -171,34 +207,42 @@ cBarChorusLineTwoBarFive = { \cChordSetG }
vOneLineVerseLineOne = { \vOneBarVerseLineOneBarOne \vOneBarVerseLineOneBarTwo \vOneBarVerseLineOneBarThree \vOneBarVerseLineOneBarFour \vOneBarVerseLineOneBarFive \break }
vTwoLineVerseLineOne = { \vTwoBarVerseLineOneBarOne \vTwoBarVerseLineOneBarTwo \vTwoBarVerseLineOneBarThree \vTwoBarVerseLineOneBarFour \vTwoBarVerseLineOneBarFive \break }
cLineVerseLineOne = { \cBarVerseLineOneBarOne \cBarVerseLineOneBarTwo \cBarVerseLineOneBarThree \cBarVerseLineOneBarFour \cBarVerseLineOneBarFive }
+sLineVerseLineOne = { \sBarVerseLineOneBarOne \sBarVerseLineOneBarTwo \sBarVerseLineOneBarThree \sBarVerseLineOneBarFour \sBarVerseLineOneBarFive }
vOneLineVerseLineTwo = { \vOneBarVerseLineTwoBarOne \vOneBarVerseLineTwoBarTwo \vOneBarVerseLineTwoBarThree \vOneBarVerseLineTwoBarFour \break }
vTwoLineVerseLineTwo = { \vTwoBarVerseLineTwoBarOne \vTwoBarVerseLineTwoBarTwo \vTwoBarVerseLineTwoBarThree \vTwoBarVerseLineTwoBarFour \break }
cLineVerseLineTwo = { \cBarVerseLineTwoBarOne \cBarVerseLineTwoBarTwo \cBarVerseLineTwoBarThree \cBarVerseLineTwoBarFour }
+sLineVerseLineTwo = { \sBarVerseLineTwoBarOne \sBarVerseLineTwoBarTwo \sBarVerseLineTwoBarThree \sBarVerseLineTwoBarFour }
vOneLineVerseLineThree = { \vOneBarVerseLineThreeBarOne \vOneBarVerseLineThreeBarTwo \vOneBarVerseLineThreeBarThree \vOneBarVerseLineThreeBarFour \break }
vTwoLineVerseLineThree = { \vTwoBarVerseLineThreeBarOne \vTwoBarVerseLineThreeBarTwo \vTwoBarVerseLineThreeBarThree \vTwoBarVerseLineThreeBarFour \break }
cLineVerseLineThree = { \cBarVerseLineThreeBarOne \cBarVerseLineThreeBarTwo \cBarVerseLineThreeBarThree \cBarVerseLineThreeBarFour }
+sLineVerseLineThree = { \sBarVerseLineThreeBarOne \sBarVerseLineThreeBarTwo \sBarVerseLineThreeBarThree \sBarVerseLineThreeBarFour }
vOneLineVerseLineFour = { \vOneBarVerseLineFourBarOne \vOneBarVerseLineFourBarTwo \vOneBarVerseLineFourBarThree \vOneBarVerseLineFourBarFour \break }
vTwoLineVerseLineFour = { \vTwoBarVerseLineFourBarOne \vTwoBarVerseLineFourBarTwo \vTwoBarVerseLineFourBarThree \vTwoBarVerseLineFourBarFour \break }
cLineVerseLineFour = { \cBarVerseLineFourBarOne \cBarVerseLineFourBarTwo \cBarVerseLineFourBarThree \cBarVerseLineFourBarFour }
+sLineVerseLineFour = { \sBarVerseLineFourBarOne \sBarVerseLineFourBarTwo \sBarVerseLineFourBarThree \sBarVerseLineFourBarFour }
vOneLineRefrainLineOne = { \vOneBarRefrainLineOneBarOne \vOneBarRefrainLineOneBarTwo \vOneBarRefrainLineOneBarThree \vOneBarRefrainLineOneBarFour \break }
vTwoLineRefrainLineOne = { \vTwoBarRefrainLineOneBarOne \vTwoBarRefrainLineOneBarTwo \vTwoBarRefrainLineOneBarThree \vTwoBarRefrainLineOneBarFour \break }
cLineRefrainLineOne = { \cBarRefrainLineOneBarOne \cBarRefrainLineOneBarTwo \cBarRefrainLineOneBarThree \cBarRefrainLineOneBarFour }
+sLineRefrainLineOne = { \sBarRefrainLineOneBarOne \sBarRefrainLineOneBarTwo \sBarRefrainLineOneBarThree \sBarRefrainLineOneBarFour }
vOneLineRefrainLineTwo = { \vOneBarRefrainLineTwoBarOne \vOneBarRefrainLineTwoBarTwo \vOneBarRefrainLineTwoBarThree \vOneBarRefrainLineTwoBarFour \vOneBarRefrainLineTwoBarFive \break }
vTwoLineRefrainLineTwo = { \vTwoBarRefrainLineTwoBarOne \vTwoBarRefrainLineTwoBarTwo \vTwoBarRefrainLineTwoBarThree \vTwoBarRefrainLineTwoBarFour \vTwoBarRefrainLineTwoBarFive \break }
cLineRefrainLineTwo = { \cBarRefrainLineTwoBarOne \cBarRefrainLineTwoBarTwo \cBarRefrainLineTwoBarThree \cBarRefrainLineTwoBarFour \cBarRefrainLineTwoBarFive }
+sLineRefrainLineTwo = { \sBarRefrainLineTwoBarOne \sBarRefrainLineTwoBarTwo \sBarRefrainLineTwoBarThree \sBarRefrainLineTwoBarFour \sBarRefrainLineTwoBarFive }
vOneLineChorusLineOne = { \vOneBarChorusLineOneBarOne \vOneBarChorusLineOneBarTwo \vOneBarChorusLineOneBarThree \vOneBarChorusLineOneBarFour \break }
vTwoLineChorusLineOne = { \vTwoBarChorusLineOneBarOne \vTwoBarChorusLineOneBarTwo \vTwoBarChorusLineOneBarThree \vTwoBarChorusLineOneBarFour \break }
cLineChorusLineOne = { \cBarChorusLineOneBarOne \cBarChorusLineOneBarTwo \cBarChorusLineOneBarThree \cBarChorusLineOneBarFour }
+sLineChorusLineOne = { \sBarChorusLineOneBarOne \sBarChorusLineOneBarTwo \sBarChorusLineOneBarThree \sBarChorusLineOneBarFour }
vOneLineChorusLineTwo = { \vOneBarChorusLineTwoBarOne \vOneBarChorusLineTwoBarTwo \vOneBarChorusLineTwoBarThree \vOneBarChorusLineTwoBarFour \vOneBarChorusLineTwoBarFive \break }
vTwoLineChorusLineTwo = { \vTwoBarChorusLineTwoBarOne \vTwoBarChorusLineTwoBarTwo \vTwoBarChorusLineTwoBarThree \vTwoBarChorusLineTwoBarFour \vTwoBarChorusLineTwoBarFive \break }
cLineChorusLineTwo = { \cBarChorusLineTwoBarOne \cBarChorusLineTwoBarTwo \cBarChorusLineTwoBarThree \cBarChorusLineTwoBarFour \cBarChorusLineTwoBarFive }
+sLineChorusLineTwo = { \sBarChorusLineTwoBarOne \sBarChorusLineTwoBarTwo \sBarChorusLineTwoBarThree \sBarChorusLineTwoBarFour \sBarChorusLineTwoBarFive }
%-----------------------------------------------------------------------
@@ -207,14 +251,17 @@ cLineChorusLineTwo = { \cBarChorusLineTwoBarOne \cBarChorusLineTwoBarTwo \cBarCh
vOneStanzaVerse = { \vOneLineVerseLineOne \vOneLineVerseLineTwo \vOneLineVerseLineThree \vOneLineVerseLineFour }
vTwoStanzaVerse = { \vTwoLineVerseLineOne \vTwoLineVerseLineTwo \vTwoLineVerseLineThree \vTwoLineVerseLineFour }
cStanzaVerse = { \cLineVerseLineOne \cLineVerseLineTwo \cLineVerseLineThree \cLineVerseLineFour }
+sStanzaVerse = { \sLineVerseLineOne \sLineVerseLineTwo \sLineVerseLineThree \sLineVerseLineFour }
vOneStanzaRefrain = { \vOneLineRefrainLineOne \vOneLineRefrainLineTwo }
vTwoStanzaRefrain = { \vTwoLineRefrainLineOne \vTwoLineRefrainLineTwo }
cStanzaRefrain = { \cLineRefrainLineOne \cLineRefrainLineTwo }
+sStanzaRefrain = { \sLineRefrainLineOne \sLineRefrainLineTwo }
vOneStanzaChorus = { \vOneLineChorusLineOne \vOneLineChorusLineTwo }
vTwoStanzaChorus = { \vTwoLineChorusLineOne \vTwoLineChorusLineTwo }
cStanzaChorus = { \cLineChorusLineOne \cLineChorusLineTwo }
+sStanzaChorus = { \sLineChorusLineOne \sLineChorusLineTwo }
%-----------------------------------------------------------------------
@@ -223,6 +270,7 @@ cStanzaChorus = { \cLineChorusLineOne \cLineChorusLineTwo }
vOneScoreTabOneScoreOne = { \vOneStanzaVerse \vOneStanzaRefrain \vOneStanzaChorus }
vTwoScoreTabOneScoreOne = { \vTwoStanzaVerse \vTwoStanzaRefrain \vTwoStanzaChorus }
cScoreTabOneScoreOne = { \cStanzaVerse \cStanzaRefrain \cStanzaChorus }
+sScoreTabOneScoreOne = { \sStanzaVerse \sStanzaRefrain \sStanzaChorus }
%-----------------------------------------------------------------------
@@ -242,11 +290,7 @@ vTwo = {
%-----------------------------------------------------------------------
% Stanza Headings
-stanzaHeadings = {
- r1^"Verse" r r r r r r r r r r r r r r r r
- r1^"Refrain" r r r r r r r r
- r1^"Chorus" r r r r r r r r
-}
+stanzaHeadings = { \sScoreTabOneScoreOne }
%-----------------------------------------------------------------------
% Chord Headings
View
BIN examples/eraserheads-huling-el-bimbo/tab.midi
Binary file not shown.
View
BIN examples/eraserheads-huling-el-bimbo/tab.pdf
Binary file not shown.
View
8 examples/eraserheads-huling-el-bimbo/tab.rb
@@ -8,6 +8,7 @@
tempo "4 = 90"
chords :G, 'r1-"G"'
+ chords :G8, 'r8-"G"'
chords :C, 'r1-"C"'
chords :A7, 'r1-"A7"'
chords :Em, 'r1-"Em"'
@@ -17,9 +18,10 @@
stanza "Verse" do
line do
bar do
- notes "r2. r8 <g/3>8"
- notes "r1"
- chords :G
+ partial 8
+ notes "<g/3>8"
+ notes "r8"
+ chords :G8
end
bar do
View
167 examples/tab-with-partial.ly
@@ -0,0 +1,167 @@
+\version "2.12.3"
+\include "english.ly"
+
+\paper {
+ indent = #0
+}
+
+\header {
+ title = "Huling El Bimbo"
+ composer = "Eraserheads"
+ arranger = "Arranged by George Mendoza"
+ instrument = "Guitar (capo on first fret)"
+}
+
+%-----------------------------------------------------------------------
+% Chord Sets
+
+cChordSetG = { r1-"G" }
+cChordSetGEight = { r8-"G" }
+cChordSetC = { r1-"C" }
+cChordSetASeven = { r1-"A7" }
+cChordSetEm = { r1-"Em" }
+cChordSetD = { r1-"D" }
+
+%-----------------------------------------------------------------------
+% Bars
+
+vOneBarVerseLineOneBarOne = { \partial 8 <g\3>8 }
+vTwoBarVerseLineOneBarOne = { \partial 8 r8 }
+cBarVerseLineOneBarOne = { \partial 8 \cChordSetGEight }
+sBarVerseLineOneBarOne = { \partial 8 r8^"Verse" }
+
+vOneBarVerseLineOneBarTwo = { <a\3>16\glissando <b\3>16 <b\3>4 r16 <a\3>16\glissando <b\3>4. <a\3>16( <g\3>16) }
+vTwoBarVerseLineOneBarTwo = { r1 }
+cBarVerseLineOneBarTwo = { \cChordSetG }
+sBarVerseLineOneBarTwo = { r1 }
+
+
+%-----------------------------------------------------------------------
+% Lines
+
+vOneLineVerseLineOne = { \vOneBarVerseLineOneBarOne \vOneBarVerseLineOneBarTwo \break }
+vTwoLineVerseLineOne = { \vTwoBarVerseLineOneBarOne \vTwoBarVerseLineOneBarTwo \break }
+cLineVerseLineOne = { \cBarVerseLineOneBarOne \cBarVerseLineOneBarTwo }
+sLineVerseLineOne = { \sBarVerseLineOneBarOne \sBarVerseLineOneBarTwo }
+
+
+%-----------------------------------------------------------------------
+% Stanzas
+
+vOneStanzaVerse = { \vOneLineVerseLineOne }
+vTwoStanzaVerse = { \vTwoLineVerseLineOne }
+cStanzaVerse = { \cLineVerseLineOne }
+sStanzaVerse = { \sLineVerseLineOne }
+
+
+%-----------------------------------------------------------------------
+% Scores
+
+vOneScoreTabOneScoreOne = { \vOneStanzaVerse }
+vTwoScoreTabOneScoreOne = { \vTwoStanzaVerse }
+cScoreTabOneScoreOne = { \cStanzaVerse }
+sScoreTabOneScoreOne = { \sStanzaVerse }
+
+
+%-----------------------------------------------------------------------
+% Voices
+
+vOne = {
+ \transposition cs''
+ \vOneScoreTabOneScoreOne
+}
+
+vTwo = {
+ \transposition cs'
+ \vTwoScoreTabOneScoreOne
+}
+
+
+%-----------------------------------------------------------------------
+% Stanza Headings
+
+stanzaHeadings = { \sScoreTabOneScoreOne }
+
+%-----------------------------------------------------------------------
+% Chord Headings
+
+chordHeadings = { \cScoreTabOneScoreOne }
+
+%-----------------------------------------------------------------------
+
+\score {
+ \new StaffGroup <<
+ \new Staff <<
+ \tempo 4 = 90
+
+ \clef "treble_8"
+
+ \new Voice \with { \remove Rest_engraver } {
+ \stanzaHeadings
+ }
+
+ \new Voice {
+ \voiceOne
+ \vOne
+ }
+ \new Voice {
+ \voiceTwo
+ \vTwo
+ }
+ >>
+
+ \new TabStaff <<
+ \new TabVoice {
+ \slurUp
+ \vOne
+ }
+ \new TabVoice {
+ \slurUp
+ \vTwo
+ }
+ \new TabVoice {
+ \chordHeadings
+ }
+ >>
+ >>
+
+ \layout {
+ \context { \Staff
+ \override TimeSignature #'style = #'numbered
+ \override StringNumber #'transparent = ##t
+ }
+ \context { \TabStaff
+ \override TimeSignature #'style = #'numbered
+ }
+ \context { \Voice
+ \remove Slur_engraver
+ }
+ \context { \TabVoice
+ \remove Dots_engraver
+ \remove Stem_engraver
+ \remove Rest_engraver
+ }
+ }
+}
+
+% showLastLength = R1*4
+\score {
+ \new Staff \with {midiInstrument = #"acoustic guitar (nylon)"} <<
+ \tempo 4 = 90
+
+ \clef "treble_8"
+
+ \new Voice {
+ \unfoldRepeats {
+ \vOne
+ }
+ }
+ \new Voice {
+ \unfoldRepeats {
+ \vTwo
+ }
+ }
+ >>
+
+ \midi {}
+}
View
35 examples/tab-with-partial.rb
@@ -0,0 +1,35 @@
+Gitara.define do
+ title "Huling El Bimbo"
+ composer "Eraserheads"
+ arranger "Arranged by George Mendoza"
+ instrument "Guitar (capo on first fret)"
+ midi_instrument "acoustic guitar (nylon)"
+ transposition "cs"
+ tempo "4 = 90"
+
+ chords :G, 'r1-"G"'
+ chords :G8, 'r8-"G"'
+ chords :C, 'r1-"C"'
+ chords :A7, 'r1-"A7"'
+ chords :Em, 'r1-"Em"'
+ chords :D, 'r1-"D"'
+
+ score do
+ stanza "Verse" do
+ line do
+ bar do
+ partial 8
+ notes "<g/3>8"
+ notes "r8"
+ chords :G8
+ end
+
+ bar do
+ notes "<a/3>16/glissando <b/3>16 <b/3>4 r16 <a/3>16/glissando <b/3>4. <a/3>16( <g/3>16)"
+ notes "r1"
+ chords :G
+ end
+ end
+ end
+ end
+end
View
58 examples/tab.ly
@@ -26,35 +26,35 @@ cChordSetFD = { r4-"F" r r-"D" r }
%-----------------------------------------------------------------------
% Bars
-vOneBarBeganIt = { \skip 4 <a\3 c'\2 >8 <g\3>8 \skip 4 <g\3 c'\2 >8 <g\3>8 }
-vTwoBarBeganIt = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
-cBarBeganIt = { \cChordSetFC }
-sBarBeganIt = { r1 }
-
-vOneBarItsNot = { r8 <g'\1>4 <a\3>16 <g'\1>8 <g\3>16 <e'\1>4 <g\3>16( <a\3>16) }
-vTwoBarItsNot = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
-cBarItsNot = { \cChordSetFC }
-sBarItsNot = { r1 }
-
-vOneBarItThough = { r8 <d'\2>16( <c'\2>16) r8 <a\3>16 <c'\2>16 r8 <d'\2>16( <c'\2>16) r8 <a\3>8 }
-vTwoBarItThough = { <f\4>4 <f\4>4 <d\4>4 <d\4>4 }
-cBarItThough = { \cChordSetFD }
-sBarItThough = { r1 }
-
-vOneBarWhatYouThought = { r8 <g'\1>4 <a\3>16 <g'\1>8 <g\3>16 <e'\1>4 <g\3>8 }
-vTwoBarWhatYouThought = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
-cBarWhatYouThought = { \cChordSetFC }
-sBarWhatYouThought = { r1 }
-
-vOneBarWhenYouFirst = { <e'\1>8 <d'\2>16( <c'\2>8) <a\3>8. <c'\2>4 <a\3>8 <c'\2>8 }
-vTwoBarWhenYouFirst = { <a,\5>4 <a,\5>8 <e\4>4 <a,\5>4 \skip 8 }
-cBarWhenYouFirst = { \cChordSetAm }
-sBarWhenYouFirst = { r1 }
-
-vOneBarYouGot = { <g'\1>8 <a\3>8 <g'\1>8 <a\3>16 <g'\1>8 <g\3>16 <e'\1>4 <g\3>16( <a\3>16) }
-vTwoBarYouGot = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
-cBarYouGot = { \cChordSetFC }
-sBarYouGot = { r1 }
+vOneBarBeganIt = { \skip 4 <a\3 c'\2 >8 <g\3>8 \skip 4 <g\3 c'\2 >8 <g\3>8 }
+vTwoBarBeganIt = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
+cBarBeganIt = { \cChordSetFC }
+sBarBeganIt = { r1 }
+
+vOneBarItsNot = { r8 <g'\1>4 <a\3>16 <g'\1>8 <g\3>16 <e'\1>4 <g\3>16( <a\3>16) }
+vTwoBarItsNot = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
+cBarItsNot = { \cChordSetFC }
+sBarItsNot = { r1 }
+
+vOneBarItThough = { r8 <d'\2>16( <c'\2>16) r8 <a\3>16 <c'\2>16 r8 <d'\2>16( <c'\2>16) r8 <a\3>8 }
+vTwoBarItThough = { <f\4>4 <f\4>4 <d\4>4 <d\4>4 }
+cBarItThough = { \cChordSetFD }
+sBarItThough = { r1 }
+
+vOneBarWhatYouThought = { r8 <g'\1>4 <a\3>16 <g'\1>8 <g\3>16 <e'\1>4 <g\3>8 }
+vTwoBarWhatYouThought = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
+cBarWhatYouThought = { \cChordSetFC }
+sBarWhatYouThought = { r1 }
+
+vOneBarWhenYouFirst = { <e'\1>8 <d'\2>16( <c'\2>8) <a\3>8. <c'\2>4 <a\3>8 <c'\2>8 }
+vTwoBarWhenYouFirst = { <a,\5>4 <a,\5>8 <e\4>4 <a,\5>4 \skip 8 }
+cBarWhenYouFirst = { \cChordSetAm }
+sBarWhenYouFirst = { r1 }
+
+vOneBarYouGot = { <g'\1>8 <a\3>8 <g'\1>8 <a\3>16 <g'\1>8 <g\3>16 <e'\1>4 <g\3>16( <a\3>16) }
+vTwoBarYouGot = { <f\4>4 <f\4>4 <c\5>4 <e\4>4 }
+cBarYouGot = { \cChordSetFC }
+sBarYouGot = { r1 }
%-----------------------------------------------------------------------
View
4 lib/gitara/dsl.rb
@@ -44,6 +44,10 @@ def notes(value)
add Node::NoteSet.new(:value => value)
end
+ def partial(duration)
+ node.specified_duration = duration
+ end
+
def score(*names, &block)
add_names :names => names, :node_class => Node::Score, &block
end
View
12 lib/gitara/node/bar.rb
@@ -1,6 +1,12 @@
module Gitara
module Node
class Bar < Base
+ has_value :specified_duration
+
+ def duration
+ specified_duration || 1
+ end
+
def first_bar_of_stanza?
stanza && stanza.descendants(Node::Bar)[0] == self
end
@@ -9,12 +15,16 @@ def note_sets
children.select{|child| child.is_a?(Node::NoteSet)}
end
+ def specified_duration_as_lilypond
+ specified_duration ? "\\partial #{specified_duration}" : nil
+ end
+
def stanza
self.ancestor(Node::Stanza)
end
def stanza_heading
- first_bar_of_stanza? ? %Q|r1^"#{ancestor(Node::Stanza).name}"| : "r1"
+ first_bar_of_stanza? ? %Q|r#{duration}^"#{ancestor(Node::Stanza).name}"| : "r#{duration}"
end
end
end
View
6 lib/gitara/template/bar.erb
@@ -1,5 +1,5 @@
<% self.voiced_as(self.root.voices).each do |voiced_bar| %>
-<%= voiced_bar.definition_name %> = { <%= voiced_bar.matching_note_set.value %> }
+<%= voiced_bar.definition_name %> = { <%= voiced_bar.node.specified_duration_as_lilypond %> <%= voiced_bar.matching_note_set.value %> }
<% end %>
-<%= self.chorded.definition_name %> = { <%= self.chorded.value %> }
-<%= self.stanza_version.definition_name %> = { <%= self.stanza_version.value %> }
+<%= self.chorded.definition_name %> = { <%= self.specified_duration_as_lilypond %> <%= self.chorded.value %> }
+<%= self.stanza_version.definition_name %> = { <%= self.specified_duration_as_lilypond %> <%= self.stanza_version.value %> }
View
33 spec/lib/gitara/app_spec.rb
@@ -1,16 +1,35 @@
require 'spec_helper'
describe App do
- describe "export" do
- it "can convert a tab without a reused bar to lilypond" do
+ class AppTest < Valuable
+ has_value :name
+
+ def run
app = FactoryGirl.build(:app)
- app.invoke :export, ['examples/tab.rb'], "target-directory" => test_tmp_dir.path, "run-lilypond" => false
+ app.invoke :export, ["examples/#{name}.rb"], "target-directory" => test_tmp_dir.path, "run-lilypond" => false
+ (Pow("tmp") / "new-#{name}.ly").write actual if self.expected != self.actual
+ end
+
+ def expected
+ @expected ||= Pow("examples/#{name}.ly").read
+ end
- example = Pow('examples/tab.ly').read
- actual = (test_tmp_dir / 'tab.ly').read
+ def actual
+ @actual ||= (test_tmp_dir / "#{name}.ly").read
+ end
+ end
+
+ describe "export" do
+ it "can convert a tab to lilypond" do
+ app_test = AppTest.new(:name => 'tab')
+ app_test.run
+ app_test.actual.should == app_test.expected
+ end
- (Pow('tmp') / 'new-tab.ly').write actual if example != actual
- actual.should == example
+ it "can convert a tab with a partial to lilypond" do
+ app_test = AppTest.new(:name => 'tab-with-partial')
+ app_test.run
+ app_test.actual.should == app_test.expected
end
end
end
View
11 spec/lib/gitara/dsl_spec.rb
@@ -244,5 +244,16 @@
chord_set.name.should == :Am
end
end
+
+ describe "partial(duration)" do
+ it "should set the specified duration of the bar node to duration" do
+ dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:bar))
+ dsl.node.specified_duration.should be_nil
+
+ dsl.partial 8
+
+ dsl.node.specified_duration.should == 8
+ end
+ end
end
end
View
36 spec/lib/gitara/node/bar_spec.rb
@@ -32,6 +32,20 @@
end
end
+ describe "with a special_duration" do
+ subject { FactoryGirl.build(:bar, :specified_duration => 8) }
+
+ it "should be a partial with the stanza name if the bar is the first node of a stanza" do
+ stanza = FactoryGirl.build(:stanza, :name => 'Intro', :children => [subject])
+
+ subject.stanza_heading.should == 'r8^"Intro"'
+ end
+
+ it "should be a partial with no stanza name if the subject is not the first node of a stanza" do
+ subject.stanza_heading.should == 'r8'
+ end
+ end
+
describe "first_bar_of_stanza?" do
it "should be true if the bar is the first bar of a stanza" do
bar = FactoryGirl.build(:bar)
@@ -51,4 +65,26 @@
bar.should_not be_first_bar_of_stanza
end
end
+
+ describe "specified_duration_as_lilypond" do
+ it "should be \\partial specified_duration if present" do
+ bar = FactoryGirl.build(:bar, :specified_duration => 8)
+ bar.specified_duration_as_lilypond.should == '\partial 8'
+ end
+
+ it "should be nil if there is no specified_duration" do
+ bar = FactoryGirl.build(:bar, :specified_duration => nil)
+ bar.specified_duration_as_lilypond.should be_nil
+ end
+ end
+
+ describe "duration" do
+ it "should be 1 if there is no specified duration" do
+ FactoryGirl.build(:bar, :specified_duration => nil).duration.should == 1
+ end
+
+ it "should be the specified duration if present" do
+ FactoryGirl.build(:bar, :specified_duration => 8).duration.should == 8
+ end
+ end
end

0 comments on commit db31972

Please sign in to comment.
Something went wrong with that request. Please try again.