]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3894: accidental rule 'teaching' broke
authorDavid Kastrup <dak@gnu.org>
Sun, 6 Apr 2014 17:59:25 +0000 (19:59 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 13 Apr 2014 17:20:36 +0000 (19:20 +0200)
Revert part of "Issue 2745: more fun with accidental rules."

This reverts the part of commit bbca17061fbc7a25ca4050e6d031b3e9562b658e
that deals with the teaching accidental rule.

scm/music-functions.scm

index 9f919b0861dd3a2ad5a65d8d4b423da0cb334fcb..b0c98769ae967b571274e14739a036a96c97b801 100644 (file)
@@ -1610,10 +1610,10 @@ look at bar lines nor different accidentals at the same note name."
                             (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."
+  "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)
@@ -1632,9 +1632,13 @@ on the same staff line."
          (entry (find-pitch-entry keysig pitch #t #t)))
     (if (not entry)
         (cons #f #f)
-        (let* ((entrymp (key-entry-measure-position entry))
+        (let* ((global-entry (find-pitch-entry keysig pitch #f #f))
+               (key-acc (key-entry-alteration global-entry))
+               (acc (ly:pitch-alteration pitch))
+               (entrymp (key-entry-measure-position entry))
                (entrybn (key-entry-bar-number entry)))
-          (cons #f (not (and (equal? entrybn barnum) (equal? entrymp measurepos))))))))
+          (cons #f (not (or (equal? acc key-acc)
+                            (and (equal? entrybn barnum) (equal? entrymp measurepos)))))))))
 
 (define-public (set-accidentals-properties extra-natural
                                            auto-accs auto-cauts