lilypond-user
[Top][All Lists]
Advanced

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

Re: problem with accidental / accidental-style


From: Mats Bengtsson
Subject: Re: problem with accidental / accidental-style
Date: Fri, 16 Oct 2009 13:43:06 +0200
User-agent: Thunderbird 2.0.0.5 (X11/20070716)

All the predefined accidental styles just do a number of property settings and the underlying algorithms in LilyPond can easily give you what you want, if you just can figure out how to do the settings. Some documentation is available in the Internal Reference, http://lilypond.org/doc/v2.13/Documentation/internals/Accidental_005fengraver#Accidental_005fengraver but I'm afraid you also have to look at the source code in the file scm/music-functions.scm to get a reasonable understanding of what's going on. I did some trial and error without fully understanding what's going on and it seems that the following setting gives what you want:
global = {
 #(set-accidental-style 'piano)
\set GrandStaff.autoAccidentals = #`(GrandStaff
       ,(make-accidental-rule 'any-octave 1)   ; Default is 'any-octave 0
       ,(make-accidental-rule 'same-octave 1))
 \key b \minor
}

Note the backwards quote sign (copy paste from the email should hopefully work).

   /Mats

Roland Goretzki wrote:
version 2.12.2

Hi at all,

according to the snippet below, and AFAIK and have seen, in complex
piano music it is common practice to show an accidental, if the note was
printed with a natural before, ALSO if this did happen in the previous
bar, AND ALSO if it was in another octave.

So in the snippet with unisono-music the fourth note in the LEFT hand
does get its accidental, because in the bar before in the RIGHT hand
there was a natural in the same octave.

I know, this behaviour is caused with:

    #(set-accidental-style 'piano)

This setting is very useful in this kind of piece, but on the other hand
it is much irritating, if the accidental appears only at the note in the
one hand, AND NOT at the same note one octave higher in the other hand.

And yes, I know, it is possible to get the wanted accidental with a "!"
behind the notename, but in this special case this would be very hard:

The piece is the last part of Chopin's second sonata in b-b-moll, and
there are 77 bars similar to the two in the snippet, so my question is:

Is there a way to get accidentals automatically in the wanted form with
something like "set-accidental-style"?

Thanks for every hint
Best Regards           Roland


%snippet ----------------------------------
\version "2.12.2"

\include "deutsch.ly"
#(set-global-staff-size 20)

\paper{ ragged-bottom=##t }

global = {
  #(set-accidental-style 'piano)
  \key b \minor
}

rechts = \context Staff \relative c{
  \context Voice = "rechts"
  \clef bass
  \override TupletBracket #'bracket-visibility = ##f
  \override TupletNumber  #'transparent = ##t
  \times 2/3 {
    f8 g b des e, g
    f8 g b des e, g
    g a c es fis, a
    g a c es fis, a
  }
}

\score {
  \new PianoStaff
  <<
\context Staff = "up" << \global
      \clef violin
      \rechts
    >>
    \context Staff = "down" <<
      \global
      \clef bass
      \transpose c c, { \rechts }
    >>
  >>
}
%snippet ----------------------------------


_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user

--
=============================================
        Mats Bengtsson
        Signal Processing
        School of Electrical Engineering
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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