From: David Kastrup Date: Thu, 23 Aug 2012 13:39:04 +0000 (+0200) Subject: Issue 2745: more fun with accidental rules. X-Git-Tag: release/2.17.6-1~46^2~3^2~21 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4261503b7bbe41042d65062542ca96bacae89005;p=lilypond.git Issue 2745: more fun with accidental rules. There was still code mixing up the somewhat orthogonal concept of single-octave accidentals with non-keysignature accidentals. --- diff --git a/scm/music-functions.scm b/scm/music-functions.scm index cd0ff32e1c..e231299bf0 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -1361,11 +1361,13 @@ If no matching entry is found, @var{#f} is returned." (let* ((entry (car keysig)) (entryoct (key-entry-octave entry)) (entrynn (key-entry-notename entry)) - (oct (ly:pitch-octave pitch)) (nn (ly:pitch-notename pitch))) (if (and (equal? nn entrynn) - (or (and accept-global (not entryoct)) - (and accept-local (equal? oct entryoct)))) + (or (not entryoct) + (= entryoct (ly:pitch-octave pitch))) + (if (key-entry-bar-number entry) + accept-local + accept-global)) entry (find-pitch-entry (cdr keysig) pitch accept-global accept-local))))) @@ -1394,13 +1396,9 @@ on the same staff line." (entry (find-pitch-entry keysig pitch #t #t))) (if (not entry) (cons #f #f) - (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)) + (let* ((entrymp (key-entry-measure-position entry)) (entrybn (key-entry-bar-number entry))) - (cons #f (not (or (equal? acc key-acc) - (and (equal? entrybn barnum) (equal? entrymp measurepos))))))))) + (cons #f (not (and (equal? entrybn barnum) (equal? entrymp measurepos)))))))) (define-public (set-accidentals-properties extra-natural auto-accs auto-cauts