lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add documentation for dodecaphonic-no-repeat (issue 61510043)


From: lilyliska
Subject: Add documentation for dodecaphonic-no-repeat (issue 61510043)
Date: Mon, 10 Feb 2014 12:44:28 +0000

Reviewers: ,

Message:
This is an addition that David Nalesnik provided upon my request. I
consider this a commonly used accidental style in contemporary music.

Description:
Add documentation for dodecaphonic-no-repeat


Add dodecaphonic-no-repeat accidentalStyle

This adds an accidental style that works like the dodecaphonic style
except that it does _not_ print an accidental if the note is
in the same voice immediately preceded with a note of the same pitch.

The contribution is by David Nalesnik.

Please review this at https://codereview.appspot.com/61510043/

Affected files (+83, -0 lines):
  M Documentation/notation/pitches.itely
  M scm/music-functions.scm


Index: Documentation/notation/pitches.itely
diff --git a/Documentation/notation/pitches.itely b/Documentation/notation/pitches.itely index 03177fc45697e193eef178e6760693bb82acc7f2..4a2bce6659c1b482cf593654576dd1a335680ec5 100644
--- a/Documentation/notation/pitches.itely
+++ b/Documentation/notation/pitches.itely
@@ -2443,6 +2443,66 @@ musicB = {
 }
 @end lilypond

address@hidden dodecaphonic-no-repeat
+
address@hidden dodecaphonic accidental style
address@hidden dodecaphonic style, neo-modern
+
address@hidden dodecaphonic-no-repeat
+
+This rule reflects a practice used by numerous contemporary
+composers. While -- like with the dodecaphonic accidental
+style @emph{every} note gets an accidental sign by default,
+accidentals are suppressed for immediately repeated pitches
+within one voice.
+
address@hidden
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, bes4 <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>8[ <fis a cis>
+      \change Staff = up
+      cis' cis
+      \change Staff = down
+      <fis, a> <fis a>]
+      \showStaffSwitch
+      \change Staff = up
+      dis'4 |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      \accidentalStyle dodecaphonic-no-repeat
+      \musicA
+    }
+    \context Staff = "down" {
+      \accidentalStyle dodecaphonic-no-repeat
+      \musicB
+    }
+  >>
+}
address@hidden lilypond
+

 @item teaching

Index: scm/music-functions.scm
diff --git a/scm/music-functions.scm b/scm/music-functions.scm
index c7f41eaad8d4962a352f72c35eda7b24e9ecc3ad..72005f9da3a6de029a93c1302d5c0abaac6826c7 100644
--- a/scm/music-functions.scm
+++ b/scm/music-functions.scm
@@ -1591,6 +1591,21 @@ look at bar lines nor different accidentals at the same note name."
           (cons #f (not (or (equal? acc key-acc)
(and (equal? entrybn barnum) (equal? entrymp measurepos)))))))))

+(define-public (dodecaphonic-no-repeat-rule context pitch barnum measurepos)
+  "An accidental rule that typesets an accidental before every note
+(just as in the dodecaphonic accidental style) @emph{except} if the note
+is immediately preceded by a note with the same pitch. This is a common
+accidental style in contemporary notation."
+   (let* ((keysig (ly:context-property context 'localKeySignature))
+          (entry (find-pitch-entry keysig pitch #t #t)))
+     (if (not entry)
+          (cons #f #t)
+         (let* ((entrymp (key-entry-measure-position entry))
+                (entrybn (key-entry-bar-number entry)))
+           (cons #f
+             (not
+ (and (equal? entrybn barnum) (equal? entrymp measurepos))))))))
+
 (define-public (teaching-accidental-rule context pitch barnum measurepos)
   "An accidental rule that typesets a cautionary accidental if it is
 included in the key signature @emph{and} does not directly follow a note
@@ -1701,6 +1716,14 @@ as a context."
                                   `(Staff ,(lambda (c p bn mp) '(#f . #t)))
                                   '()
                                   context))
+     ;; As in dodecaphonic style with the exception that immediately
+     ;; repeated notes (in the same voice) don't get an accidental
+     ((equal? style 'dodecaphonic-no-repeat)
+      (set-accidentals-properties #f
+ `(Staff ,(make-accidental-rule 'same-octave 0)
+                                          ,dodecaphonic-no-repeat-rule)
+                                          '()
+                                          context))
;; Multivoice accidentals to be read both by musicians playing one voice
      ;; and musicians playing all voices.
;; Accidentals are typeset for each voice, but they ARE canceled across voices.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]