\version "2.19.80" \language "english" \include "oll-core/package.ily" \loadPackage edition-engraver \consistToContexts #edition-engraver Voice.Staff.Score #(define (pitch-or-chord? obj) (or (ly:pitch? obj) (if (ly:music? obj) (equal? (ly:music-property obj 'name) 'EventChord)))) #(define (pitch->pitch-list pitch) (list pitch)) #(define (chord->pitch-list chord) (map (lambda (element) (ly:music-property element 'pitch)) (ly:music-property chord 'elements))) condGrobTweak = #(define-music-function (use_octave target grob_proc)((boolean? #f) pitch-or-chord? procedure?) (let ((pitches (if (ly:pitch? target) (pitch->pitch-list target) (chord->pitch-list target)))) #{ \override NoteHead.before-line-breaking = #(lambda (grob) (let* ((cause (ly:grob-property grob 'cause)) (pitch (ly:prob-property cause 'pitch)) (note (ly:pitch-notename pitch)) (alteration (ly:pitch-alteration pitch)) (octave (ly:pitch-octave pitch))) (map (lambda (this-pitch) (if (and (eqv? alteration (ly:pitch-alteration this-pitch)) (eqv? note (ly:pitch-notename this-pitch)) (or (not use_octave)(eqv? octave (ly:pitch-octave this-pitch)))) (grob_proc grob))) pitches))) #})) #(define (omit-accidental grob) (let ((accidental (ly:grob-object grob 'accidental-grob))) (if (ly:grob? accidental) (ly:grob-set-property! accidental 'stencil #f) ))) \addEdition accidentals \editionMod accidentals 1 0/4 Voice \once \condGrobTweak #omit-accidental { }