lilypond-user
[Top][All Lists]
Advanced

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

Re: overriding the order of accidentals in a chord


From: Thomas Morley
Subject: Re: overriding the order of accidentals in a chord
Date: Wed, 19 Oct 2011 23:22:36 +0200

Hi Kieren

2011/10/19 Kieren MacMillan <address@hidden>
Hello all!

Is there an easy way to override the order of accidentals appearing next to a chord, e.g. have the natural come first in the following snippet?
(...)

I'm not aware of any easy method to do so. But are you sure you want to? In the following I did it manually, and I don't like the output:

\version "2.14.2"

#(define (offset-accidental note-grob x-value)
 (let ((accidental (ly:grob-object note-grob 'accidental-grob)))
   (if (not (null? accidental))
     (ly:grob-set-property! accidental 'extra-offset (cons x-value 0)))))
    
accTw =
#(define-music-function (parser location x-offset music) (number? ly:music?)
         (set! (ly:music-property music 'tweaks)
    (acons 'before-line-breaking (lambda (grob) (offset-accidental grob x-offset))
         (ly:music-property music 'tweaks)))
   music)
  
%------- Test

\relative dis {
        \clef bass <\accTw #1.2 dis! \accTw #-1 a'! b>
}

Cheers,
  Harm

reply via email to

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