Mehmet a ecrit:
I beg your pardon if I did not express myself as well as a native English
speaking person.>

I felt unusually confident I knew what you really meant because I have one of the Universal Editions you were talking about as a reference and we had discussed it a little further. Your english is really very good.

The function is very useful and it must be uploaded at the code snippets.>

I am having trouble with it when I put it in a PianoStaff.

Please quote the message to which your replying, in order to bring some
context to the discussion>

I am trying, but it does not happen automatically because I am not subscibed to user-lilypond only lilypond-devel.

then engine compares note alterations with the
key signature, which contains only non-existant alterations.>

When I place the functions inside a PianoStaff, it prints a key signature unfortunately.

Skipping the explanation, I'll just attach the example I made if you don't mind.

The KeySignature print-function override only occurs after the line breaks are set. Removing the engraver nullifies the function entirely.

I am wondering if there is a way to override the print-function before line-breaking? Perhaps in the layout block. Or is there a way to get the note alterations we want without creating a key signature. I already experimented with the pitch-alist to no avail. How does "tonic (ly:make-pitch -1 4 0)" work? I there something we can do there to stop printing the key signature? I think this is the most staight-forward way to manipulate the accidetal_engraver.cc to do what we want without re-writing it, but can it be done without creating a real key signature at all?

Alternatively, perhaps I don't understand where to place the function. Or perhaps there might be a way to change the context of the function? Maybe just the right context would put it outside the scope of printing the keysignature while still affecting the notes. Anyway, it is a nice function.

Check out atonicKey.ly to see what I am talking about.

By the way, the error messages also stopped once it started to print a key signature.

Stephen
  \version "2.6.0"
  
  atonicKey = 
  #(def-music-function (parser location) ()
     #{ #(ly:export (make-music 'EventChord
                     'origin $location
                     'elements (list (make-music 'KeyChangeEvent
                                      'tonic (ly:make-pitch -1 4 0)
                                      'pitch-alist '((5 . 1)
                                                     (6 . 1)
                                                     (0 . 1)
                                                     (1 . 1)
                                                     (2 . 1)
                                                     (3 . 1)
                                                     (4 . 1))))))
        \set Score . extraNatural = ##f #})
  
  \layout { 
    %\context { \Staff \remove Key_engraver }
    raggedright = ##t 
  }
  
  \context PianoStaff <<
  \override PianoStaff.KeySignature #'print-function = ##f
  \context Staff = upper \transpose c c' { 
    \time 6/8
    \tempo 4.=80
    \override Score.Hairpin #'height = #'0.5
    \override Score.Beam #'auto-knee-gap = #'4.5
    \set Score.allowBeamBreak = ##t
    \override Score.MetronomeMark #'extra-offset = #'(5.0 . 2.0)
    #(set-accidental-style 'modern-voice)

    % Add bar numbers in a cirlce every 5th bar
    \override Score.BarNumber  #'break-visibility = #end-of-line-invisible
    \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
    \override Score.BarNumber #'font-size = #1
    \override Score.BarNumber #'print-function
    = #(make-stencil-circler 0.1 0.25 Text_interface::print)

    \clef G
    \atonicKey 
    r8^\markup { " " \translate #(cons -5.5 2.25) \bold \huge " Rasch" }
    e'-.\p f'-. g4^>( \< des'8^.) \! | 
    ges es8. ^\< as16( \! d8-.) r b ~ ^\sf | \noBreak b 
    \once \override Script #'extra-offset = #'(0.5 . -0.5) c^^[
    \once \override Script #'extra-offset = #'(0.5 . 0.0) a,^^] r r
    \once \override Script #'extra-offset = #'(0.5 . 0.0) 
    \once \override DynamicText #'extra-offset = #'(-0.9375 . -1.75) 
    as^. ^\p \break 
    << {
      \override Script #'extra-offset = #'(0.5 . 0.0) 
      \override DynamicText #'self-alignment-X = #1 
      \override DynamicText #'extra-offset = #'(-0.875 . -2.375) 
      ces'-. r r ges[ c']-.-> ^\sf } \\ {
      \override Script #'extra-offset = #'(-0.5 . 0.0)
      es( d)-. f( ~ f[ e]) } >>
    f'\rest |
  }
  \context Staff = lower \transpose c c { 
    \clef F 
    \atonicKey
    r4 r8 bes8.^^\mf[ ces'^^ | 
    des^^ g^^] r8 << { << { c^\p( a, | d4 gis,16) }
      \once \override Hairpin #'extra-offset = #'(0.0 . -1.375)
      { s4 \< | s4*8/45 
      \once \override Hairpin #'extra-offset = #'(0.0 . -1.8125)
      s4*22/45 \> s4*3/12 s4*1/12 \! s16 } >> } 
    \\ { 
      \override Script #'extra-offset = #'(-0.5 . 0.0)
      f,8-.\pp fis,-. | es,-.[ e,8.-.] } >> 
    r16 \change Staff = upper \stemDown bes^^ \fp bes^^ bes^^ \< 
    \stemUp 
    \change Staff = lower bes^^ bes^^ bes^^  
    \clef G
    bes bes bes \! a\> a a \! a a \< a \! 
    \stemDown 
    \change Staff = upper g' \fp \< g' g' \! | 
  }
  >>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to