lilypond-user
[Top][All Lists]
Advanced

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

Re: how to move a clef horizontally


From: Thomas Morley
Subject: Re: how to move a clef horizontally
Date: Thu, 24 Dec 2020 23:51:01 +0100

Am Mi., 23. Dez. 2020 um 15:25 Uhr schrieb Stefan Thomas
<kontrapunktstefan@gmail.com>:
>
> Dear community,
> I would like to know, how I can avoid the collision between the treble clef 
> and the note b in the below quoted example:
> %%%%%%%%% SNIP
> \version "2.20.0"
> global = { \key e \major \time 4/4 }
> Up = { \change Staff="upper" \stemDown }
> Down = { \change Staff="lower" \stemUp }
> upper = {
> \clef "bass" \global
> dis'4   e'4
>
>       \clef "treble" gis'4\!
>       fis'8.   e'16 |
> }
> middle = {
>  a,16
>         dis16  \Up a16    b16
>      \Down   a,16
>       e16  \Up  a16   b16
>   \Down  b,16    fis16
>   \Up    a16   b16  \Down   b,16
>        dis16    \Up a16
>       b16
> }
> lower = {
> fis,,4   e,4
>       dis,4    b,,4
> }
>
> lower = {
> \global \clef "bass"
> << { \middle } \\ { \lower } >>
> }
>
> \score {
> \new PianoStaff  = "Klavier"  \with { \override 
> StaffGrouper.staff-staff-spacing.stretchability = #1 }
> <<
> \new Staff= "upper" { \upper }
>   \new Staff = "lower" { \lower} >>
> }
> %%%%%%%%%%% END SNIPPET
>
> Thank You all,
> Stefan

How about:

\version "2.20.0"

global = { \key e \major \time 4/4 }

Up = { \change Staff = "upper" \stemDown }
Down = { \change Staff = "lower" \stemUp }

upperVoice = {
  \clef "bass"
  \global
  dis'4 e'4
  \clef "treble"
  gis'4
  fis'8. e'16
}

middleVoice = {
  a,16 dis16 \Up a16 b16
  \Down a,16 e16 \Up a16 b16
  %% get rid of the warning
  \once \override Beam.positions = #'(4 . 3)
  \Down b,16 fis16 \Up a16 b16
  \Down b,16 dis16 \Up a16 b16
}

bottomVoice = {
  fis,,4 e,4
  %% Move NoteColumns to get some free space
  %% TODO not sure why we need two overrides with different values
  \once \override PianoStaff.NoteColumn.X-offset = 2.5
  \once \override PianoStaff.NoteColumn.force-hshift = 1.5
  %% Let the Clef glide into the opened free space
  \once \override PianoStaff.Clef.X-extent = #'(0 . 0)
  dis,4 b,,4
}

lowerStaff = {
  \global
  \clef "bass"
  <<  \middleVoice \\ \bottomVoice >>
}

\score {
  \new PianoStaff = "Klavier"
    \with { \override StaffGrouper.staff-staff-spacing.stretchability = #1 }
    <<
    \new Staff = "upper" \upperVoice
    \new Staff = "lower" \lowerStaff
    >>
}


Cheers,
  Harm



reply via email to

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