]> git.donarmstrong.com Git - lilypond.git/commitdiff
Adding a regtest for flexible contemporary accidentals
authorValentin Villenave <valentin@villenave.net>
Tue, 19 Aug 2008 08:35:07 +0000 (10:35 +0200)
committerJoe Neeman <joeneeman@gmail.com>
Tue, 19 Aug 2008 19:46:19 +0000 (12:46 -0700)
This commits also updates the docs about Automatic accidentals.

Documentation/user/pitches.itely
input/regression/accidental-contemporary.ly [new file with mode: 0644]

index 615191a0f852602e8b53fc0520047e00f16b2791..7f39d91f1012d289542fd8443a01b20be60d6a55 100644 (file)
@@ -1680,6 +1680,179 @@ musicB = {
 }
 @end lilypond
 
+
+@item neo-modern
+
+@funindex neo-modern
+@cindex neo-modern accidental style
+@cindex accidental style, neo-modern
+
+This rule reproduces a common practice in contemporary music:
+accidentals are printed like with @code{modern}, but they are printed
+again if the same note appears later in the same measure -- except
+if the note is immediately repeated.
+
+@lilypond[quote]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'neo-modern)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'neo-modern)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item neo-modern-cautionary
+
+@funindex neo-modern-cautionary
+@cindex neo-modern-cautionary accidental style
+@cindex accidental style, neo-modern-cautionary
+
+This rule is similar to @code{neo-modern}, but the extra
+accidentals are printed as cautionary accidentals.
+
+@lilypond[quote]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'neo-modern-cautionary)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'neo-modern-cautionary)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+
+@item dodecaphonic
+
+@funindex dodecaphonic
+@cindex dodecaphonic accidental style
+@cindex dodecaphonic style, neo-modern
+
+This rule reflects a practice introduced by composers at
+the beginning of the 20th century, in an attempt to
+abolish the hierarchy between natural and non-natural notes.
+With this style, @emph{every} note gets an accidental sign,
+including natural signs.
+
+@lilypond[quote]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'dodecaphonic)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'dodecaphonic)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+
 @item no-reset
 
 @funindex no-reset
@@ -1744,7 +1917,8 @@ musicB = {
 This is the opposite of @code{no-reset}: Accidentals are not
 remembered at all -- and hence all accidentals are typeset
 relative to the key signature, regardless of what came before in
-the music:
+the music.  Unlike @code{dodecaphonic}, this rule never prints
+any naturals.
 
 @lilypond[quote]
 musicA = {
diff --git a/input/regression/accidental-contemporary.ly b/input/regression/accidental-contemporary.ly
new file mode 100644 (file)
index 0000000..145c96a
--- /dev/null
@@ -0,0 +1,33 @@
+\version "2.11.57"
+\header {
+
+texidoc = "Several automatic accidental rules
+aim to reproduce contemporary music notation
+practices:
+@itemize
+@item
+'dodecaphonic style prints accidentals on every
+note (including naturals)
+@item
+'neo-modern style prints accidentals on every note
+(not including naturals), except when a note is
+immediately repeated
+@item
+'neo-modern-cautionary style acts like neo-modern,
+adding cautionary parentheses around accidentals.
+@end itemize
+"
+
+}
+
+\layout { ragged-right = ##t }
+
+\relative c'' {
+  #(set-accidental-style 'dodecaphonic)
+  gis4 a g gisis
+  #(set-accidental-style 'neo-modern)
+  gis8 a gis gis g' gis gis,, a'
+  #(set-accidental-style 'neo-modern-cautionary)
+  eis fis eis eis g2
+}
+