print bass staff not always

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

print bass staff not always

Gianmaria Lari
The following code prints three "lines" of music. The first and second lines are two staff system (treble and bass) and the third line just one staff (treble). 

\version "2.19.82"
rh = { \clef treble \repeat unfold 3 {a1 b1 c'1 d'1 \break}}
lh = { \clef bass s1*4 a1 1 11}
\score 
  \new PianoStaff <<
    \new Staff \rh
    \new Staff \lh
  >>
  \layout {}
}

I would like to avoid printing the first bass line because it's empty (s1*4). How can I do it?
Sorry for my "imprecise" english.
g.


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Andrew Bernard
Hi Gianmaria,

I know you can do this with GrandStaff and the score context settings shown here.

Not sure how to do it with PianoStaff.

Andrew

%====
\version "2.19.82"
rh = { \clef treble \repeat unfold 3 {a1 b1 c'1 d'1 \break}}
lh = { \clef bass s1*4 a1 1 1 1}
\score
{
  \new GrandStaff <<
    \new Staff \rh
    \new Staff \lh
  >>
  \layout {

    \context {
      \Score
      \RemoveEmptyStaves
      \override VerticalAxisGroup.remove-first = ##t
    }
  }
}

%===


On Mon, 21 Jan 2019 at 21:13, Gianmaria Lari <[hidden email]> wrote:
The following code prints three "lines" of music. The first and second lines are two staff system (treble and bass) and the third line just one staff (treble). 

\version "2.19.82"
rh = { \clef treble \repeat unfold 3 {a1 b1 c'1 d'1 \break}}
lh = { \clef bass s1*4 a1 1 11}
\score 
  \new PianoStaff <<
    \new Staff \rh
    \new Staff \lh
  >>
  \layout {}
}

I would like to avoid printing the first bass line because it's empty (s1*4). How can I do it?
Sorry for my "imprecise" english.
g.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Valentin Villenave-3
On 1/21/19, Andrew Bernard <[hidden email]> wrote:
> Not sure how to do it with PianoStaff.

That’s because of the Keep_alive_together engraver. Your layout block
should look like:

\layout {
    \context {
      \PianoStaff
      \RemoveEmptyStaves
      \remove "Keep_alive_together_engraver"
      \override VerticalAxisGroup.remove-first = ##t
    }
}

That being said, I have never seen a piano part where only one of the
hands is printed when the other doesn’t play. (Vibraphone and marimba
parts, maybe.) That’s why we added this feature in the first place.

Cheers,
V.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Andrew Bernard
Hi Valentin,

Great!

Re staff visibility in piano, that was going to be my comment also. But I always say, give people what they want. At least lilypond lets you do it if you like.

Andrew



On Mon, 21 Jan 2019 at 23:00, Valentin Villenave <[hidden email]> wrote:

That being said, I have never seen a piano part where only one of the
hands is printed when the other doesn’t play. (Vibraphone and marimba
parts, maybe.) That’s why we added this feature in the first place.


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Gianmaria Lari
In reply to this post by Valentin Villenave-3


On Mon, 21 Jan 2019 at 13:02, Valentin Villenave <[hidden email]> wrote:
On 1/21/19, Andrew Bernard <[hidden email]> wrote:
> Not sure how to do it with PianoStaff.

That’s because of the Keep_alive_together engraver. Your layout block
should look like:

\layout {
    \context {
      \PianoStaff
      \RemoveEmptyStaves
      \remove "Keep_alive_together_engraver"
      \override VerticalAxisGroup.remove-first = ##t
    }
}

That being said, I have never seen a piano part where only one of the
hands is printed when the other doesn’t play. (Vibraphone and marimba
parts, maybe.) That’s why we added this feature in the first place.

Cheers,
V.

Yes, sure.

My piece is for Accordion (Harlequin from V.Zolotaryof). I attached a screenshot of it.

Thank's a lot for your help!!
g.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

temp.png (357K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Gianmaria Lari


On Mon, 21 Jan 2019 at 14:57, Gianmaria Lari <[hidden email]> wrote:


On Mon, 21 Jan 2019 at 13:02, Valentin Villenave <[hidden email]> wrote:
On 1/21/19, Andrew Bernard <[hidden email]> wrote:
> Not sure how to do it with PianoStaff.

That’s because of the Keep_alive_together engraver. Your layout block
should look like:

\layout {
    \context {
      \PianoStaff
      \RemoveEmptyStaves
      \remove "Keep_alive_together_engraver"
      \override VerticalAxisGroup.remove-first = ##t
    }
}

That being said, I have never seen a piano part where only one of the
hands is printed when the other doesn’t play. (Vibraphone and marimba
parts, maybe.) That’s why we added this feature in the first place.
[...]

Valentin, your solution works well if the staff is made of rests (r) or skips (s). Is it possible to print the staff if it contains rests but avoid to print it if it contains skip?

Thank you, g.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

David Kastrup
Gianmaria Lari <[hidden email]> writes:

> On Mon, 21 Jan 2019 at 14:57, Gianmaria Lari <[hidden email]>
> wrote:
>
>>
>>
>> On Mon, 21 Jan 2019 at 13:02, Valentin Villenave <[hidden email]>
>> wrote:
>>
>>> On 1/21/19, Andrew Bernard <[hidden email]> wrote:
>>> > Not sure how to do it with PianoStaff.
>>>
>>> That’s because of the Keep_alive_together engraver. Your layout block
>>> should look like:
>>>
>>> \layout {
>>>     \context {
>>>       \PianoStaff
>>>       \RemoveEmptyStaves
>>>       \remove "Keep_alive_together_engraver"
>>>       \override VerticalAxisGroup.remove-first = ##t
>>>     }
>>> }
>>>
>>> That being said, I have never seen a piano part where only one of the
>>> hands is printed when the other doesn’t play. (Vibraphone and marimba
>>> parts, maybe.) That’s why we added this feature in the first place.
>>>
>> [...]
>
> Valentin, your solution works well if the staff is made of rests (r) or
> skips (s). Is it possible to print the staff if it contains rests but avoid
> to print it if it contains skip?

[NR:]

A.20 Context modification identifiers
=====================================

The following commands are defined for use as context modifications
within a ‘\layout’ or ‘\with’ block.

‘RemoveAllEmptyStaves’
     Remove staves which are considered to be empty according to the
     list of interfaces set by ‘keepAliveInterfaces’, including those in
     the first system.
        • Sets grob property ‘remove-empty’ in ‘*note
          (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.
        • Sets grob property ‘remove-first’ in ‘*note
          (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.

‘RemoveEmptyStaves’
     Remove staves which are considered to be empty according to the
     list of interfaces set by ‘keepAliveInterfaces’.
        • Sets grob property ‘remove-empty’ in ‘*note
          (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.

[IR:]

2.2.5 Axis_group_engraver
-------------------------

Group all objects created in this context in a ‘VerticalAxisGroup’
spanner.

   Properties (read)

     ‘currentCommandColumn’ (graphical (layout) object)
          Grob that is X-parent to all current breakable (clef, key
          signature, etc.)  items.

     ‘hasAxisGroup’ (boolean)
          True if the current context is contained in an axis group.

     ‘keepAliveInterfaces’ (list)
          A list of symbols, signifying grob interfaces that are worth
          keeping a staff with ‘remove-empty’ set around for.

   Properties (write)

     ‘hasAxisGroup’ (boolean)
          True if the current context is contained in an axis group.

   This engraver creates the following layout object(s):

   *note VerticalAxisGroup::.

   ‘Axis_group_engraver’ is part of the following context(s): *note
ChordNames::, *note DrumStaff::, *note Dynamics::, *note FiguredBass::,
*note FretBoards::, *note GregorianTranscriptionStaff::, *note
KievanStaff::, *note Lyrics::, *note MensuralStaff::, *note NoteNames::,
*note OneStaff::, *note PetrucciStaff::, *note RhythmicStaff::, *note
Staff::, *note TabStaff:: and *note VaticanaStaff::.

[ly/engraver-init.ly in definition of Score]

  keepAliveInterfaces = #'(
    bass-figure-interface
    chord-name-interface
    cluster-beacon-interface
    fret-diagram-interface
    lyric-syllable-interface
    note-head-interface
    tab-note-head-interface
    lyric-interface
    percent-repeat-item-interface
    percent-repeat-interface

    ;; need this, as stanza numbers are items, and appear only once.
    stanza-number-interface
  )

So probably you likely want to add the rest-interface to that list of
interfaces, probably in Staff context.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Gianmaria Lari


On Mon, 21 Jan 2019 at 22:33, David Kastrup <[hidden email]> wrote:
Gianmaria Lari <[hidden email]> writes:

> On Mon, 21 Jan 2019 at 14:57, Gianmaria Lari <[hidden email]>
> wrote:
>
>>
>>
>> On Mon, 21 Jan 2019 at 13:02, Valentin Villenave <[hidden email]>
>> wrote:
>>
>>> On 1/21/19, Andrew Bernard <[hidden email]> wrote:
>>> > Not sure how to do it with PianoStaff.
>>>
>>> That’s because of the Keep_alive_together engraver. Your layout block
>>> should look like:
>>>
>>> \layout {
>>>     \context {
>>>       \PianoStaff
>>>       \RemoveEmptyStaves
>>>       \remove "Keep_alive_together_engraver"
>>>       \override VerticalAxisGroup.remove-first = ##t
>>>     }
>>> }
>>>
>>> That being said, I have never seen a piano part where only one of the
>>> hands is printed when the other doesn’t play. (Vibraphone and marimba
>>> parts, maybe.) That’s why we added this feature in the first place.
>>>
>> [...]
>
> Valentin, your solution works well if the staff is made of rests (r) or
> skips (s). Is it possible to print the staff if it contains rests but avoid
> to print it if it contains skip?

[NR:]

A.20 Context modification identifiers
=====================================

The following commands are defined for use as context modifications
within a ‘\layout’ or ‘\with’ block.

‘RemoveAllEmptyStaves’
     Remove staves which are considered to be empty according to the
     list of interfaces set by ‘keepAliveInterfaces’, including those in
     the first system.
        • Sets grob property ‘remove-empty’ in ‘*note
          (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.
        • Sets grob property ‘remove-first’ in ‘*note
          (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.

‘RemoveEmptyStaves’
     Remove staves which are considered to be empty according to the
     list of interfaces set by ‘keepAliveInterfaces’.
        • Sets grob property ‘remove-empty’ in ‘*note
          (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.

[IR:]

2.2.5 Axis_group_engraver
-------------------------

Group all objects created in this context in a ‘VerticalAxisGroup’
spanner.

   Properties (read)

     ‘currentCommandColumn’ (graphical (layout) object)
          Grob that is X-parent to all current breakable (clef, key
          signature, etc.)  items.

     ‘hasAxisGroup’ (boolean)
          True if the current context is contained in an axis group.

     ‘keepAliveInterfaces’ (list)
          A list of symbols, signifying grob interfaces that are worth
          keeping a staff with ‘remove-empty’ set around for.

   Properties (write)

     ‘hasAxisGroup’ (boolean)
          True if the current context is contained in an axis group.

   This engraver creates the following layout object(s):

   *note VerticalAxisGroup::.

   ‘Axis_group_engraver’ is part of the following context(s): *note
ChordNames::, *note DrumStaff::, *note Dynamics::, *note FiguredBass::,
*note FretBoards::, *note GregorianTranscriptionStaff::, *note
KievanStaff::, *note Lyrics::, *note MensuralStaff::, *note NoteNames::,
*note OneStaff::, *note PetrucciStaff::, *note RhythmicStaff::, *note
Staff::, *note TabStaff:: and *note VaticanaStaff::.

[ly/engraver-init.ly in definition of Score]

  keepAliveInterfaces = #'(
    bass-figure-interface
    chord-name-interface
    cluster-beacon-interface
    fret-diagram-interface
    lyric-syllable-interface
    note-head-interface
    tab-note-head-interface
    lyric-interface
    percent-repeat-item-interface
    percent-repeat-interface

    ;; need this, as stanza numbers are items, and appear only once.
    stanza-number-interface
  )

So probably you likely want to add the rest-interface to that list of
interfaces, probably in Staff context.

--
David Kastrup

I post here another solution that's not clean as David solution. It's a simple escamotage.

To make lilypond print anyway a staff only containing rests I put in the staff a zero length note and hide it like this:
 
\hideNotes g4*0  R1*4 \unHideNotes \break  

I saw only two drawbacks (?): 
1 You have to put this hide note in each line that is made of rests
2 There is some small rest alignment issue in the bar where you put the hide note

In my case these two drawbacks were not a problem.

Here a complete (and simple) example that compiles.

\version "2.19.82"
stone = { 
  \clef treble 
  a1 b c' d' \break
  a1 b c' d' \break
  a1 b c' d' \break
}
sttwo = { 
  \clef bass 
  \hideNotes g4*0 R1*4 \unHideNotes 
  f1 g a b \break
  f1 g a b \break
}
sttre = { 
  \clef bass 
  s1*4 
  a1 b c' d'
  s1*4 
}
\score {
  \new PianoStaff { <<
    \new Staff \with {instrumentName = #"S1" shortInstrumentName = #"S1"} \stone 
    \new Staff \with {instrumentName = #"S2" shortInstrumentName = #"S2"} \sttwo 
    \new Staff \with {instrumentName = #"S3" shortInstrumentName = #"S3"} \sttre
  >> }
  \layout {
    \context {
      \PianoStaff
      \RemoveEmptyStaves
      \remove "Keep_alive_together_engraver"
      \override VerticalAxisGroup.remove-first = ##t
    }
  }  
}
Thank you for everybody help.
g.


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Andrew Bernard
Hi Gianmaria,

I am indebted to you for introducing me to the word escamotage. I have never heard it before!

Andrew



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Gianmaria Lari

I found an issue with \RemoveEmptyStaves. It also remove \Dynamics.

So, if I write something like this

\version "2.19.82"
\score {
  \new PianoStaff { <<
    \new Staff {a4 b c' d'}
    \new Dynamics {s4\pp}
  >> }
  \layout {
    \context {
      \PianoStaff
      \RemoveEmptyStaves
      \remove "Keep_alive_together_engraver"
      \override VerticalAxisGroup.remove-first = ##t
    }
  }  
}

the music dynamic is not engraved. How can I fix this? Normally I put the dynamics in the same staff as music but in this case the score is pretty complex and I would prefer use a specific "staff". Is there any solution to this?

Thank you, g.
P.S. To Andrew: well as you saw my english it's pretty imprecise. So if you will be patient from me you will teach a lot of new words....


 

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Andrew Bernard
Hi Giammaria,

No, it's a valid English word!

Andrew


On Tue, 22 Jan 2019 at 19:58, Gianmaria Lari <[hidden email]> wrote:

P.S. To Andrew: well as you saw my english it's pretty imprecise. So if you will be patient from me you will teach a lot of new words....


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

David Kastrup
In reply to this post by Gianmaria Lari
Gianmaria Lari <[hidden email]> writes:

> On Mon, 21 Jan 2019 at 22:33, David Kastrup <[hidden email]> wrote:
>
>> Gianmaria Lari <[hidden email]> writes:
>>
>> > On Mon, 21 Jan 2019 at 14:57, Gianmaria Lari <[hidden email]>
>> > wrote:
>> >
>> >>
>> >>
>> >> On Mon, 21 Jan 2019 at 13:02, Valentin Villenave <
>> [hidden email]>
>> >> wrote:
>> >>
>> >>> On 1/21/19, Andrew Bernard <[hidden email]> wrote:
>> >>> > Not sure how to do it with PianoStaff.
>> >>>
>> >>> That’s because of the Keep_alive_together engraver. Your layout block
>> >>> should look like:
>> >>>
>> >>> \layout {
>> >>>     \context {
>> >>>       \PianoStaff
>> >>>       \RemoveEmptyStaves
>> >>>       \remove "Keep_alive_together_engraver"
>> >>>       \override VerticalAxisGroup.remove-first = ##t
>> >>>     }
>> >>> }
>> >>>
>> >>> That being said, I have never seen a piano part where only one of the
>> >>> hands is printed when the other doesn’t play. (Vibraphone and marimba
>> >>> parts, maybe.) That’s why we added this feature in the first place.
>> >>>
>> >> [...]
>> >
>> > Valentin, your solution works well if the staff is made of rests (r) or
>> > skips (s). Is it possible to print the staff if it contains rests but
>> avoid
>> > to print it if it contains skip?
>>
>> [NR:]
>>
>> A.20 Context modification identifiers
>> =====================================
>>
>> The following commands are defined for use as context modifications
>> within a ‘\layout’ or ‘\with’ block.
>>
>> ‘RemoveAllEmptyStaves’
>>      Remove staves which are considered to be empty according to the
>>      list of interfaces set by ‘keepAliveInterfaces’, including those in
>>      the first system.
>>         • Sets grob property ‘remove-empty’ in ‘*note
>>           (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.
>>         • Sets grob property ‘remove-first’ in ‘*note
>>           (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.
>>
>> ‘RemoveEmptyStaves’
>>      Remove staves which are considered to be empty according to the
>>      list of interfaces set by ‘keepAliveInterfaces’.
>>         • Sets grob property ‘remove-empty’ in ‘*note
>>           (lilypond-internals)VerticalAxisGroup::’ to ‘#t’.
>>
>> [IR:]
>>
>> 2.2.5 Axis_group_engraver
>> -------------------------
>>
>> Group all objects created in this context in a ‘VerticalAxisGroup’
>> spanner.
>>
>>    Properties (read)
>>
>>      ‘currentCommandColumn’ (graphical (layout) object)
>>           Grob that is X-parent to all current breakable (clef, key
>>           signature, etc.)  items.
>>
>>      ‘hasAxisGroup’ (boolean)
>>           True if the current context is contained in an axis group.
>>
>>      ‘keepAliveInterfaces’ (list)
>>           A list of symbols, signifying grob interfaces that are worth
>>           keeping a staff with ‘remove-empty’ set around for.
>>
>>    Properties (write)
>>
>>      ‘hasAxisGroup’ (boolean)
>>           True if the current context is contained in an axis group.
>>
>>    This engraver creates the following layout object(s):
>>
>>    *note VerticalAxisGroup::.
>>
>>    ‘Axis_group_engraver’ is part of the following context(s): *note
>> ChordNames::, *note DrumStaff::, *note Dynamics::, *note FiguredBass::,
>> *note FretBoards::, *note GregorianTranscriptionStaff::, *note
>> KievanStaff::, *note Lyrics::, *note MensuralStaff::, *note NoteNames::,
>> *note OneStaff::, *note PetrucciStaff::, *note RhythmicStaff::, *note
>> Staff::, *note TabStaff:: and *note VaticanaStaff::.
>>
>> [ly/engraver-init.ly in definition of Score]
>>
>>   keepAliveInterfaces = #'(
>>     bass-figure-interface
>>     chord-name-interface
>>     cluster-beacon-interface
>>     fret-diagram-interface
>>     lyric-syllable-interface
>>     note-head-interface
>>     tab-note-head-interface
>>     lyric-interface
>>     percent-repeat-item-interface
>>     percent-repeat-interface
>>
>>     ;; need this, as stanza numbers are items, and appear only once.
>>     stanza-number-interface
>>   )
>>
>> So probably you likely want to add the rest-interface to that list of
>> interfaces, probably in Staff context.
>>
>> --
>> David Kastrup
>>
>
> I post here another solution that's not clean as David solution. It's a
> simple escamotage.
>
> To make lilypond print anyway a staff only containing rests I put in the
> staff a zero length note and hide it like this:
>
>
> \hideNotes g4*0  R1*4 \unHideNotes \break

That does not look simpler than

\new Staff \with {
  keepAliveInterfaces = #'(
     rest-interface
     bass-figure-interface
     chord-name-interface
     cluster-beacon-interface
     fret-diagram-interface
     lyric-syllable-interface
     note-head-interface
     tab-note-head-interface
     lyric-interface
     percent-repeat-item-interface
     percent-repeat-interface

     ;; need this, as stanza numbers are items, and appear only once.
     stanza-number-interface
   )
} ...

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Simon Albrecht-2
In reply to this post by Gianmaria Lari
On 22.01.19 09:56, Gianmaria Lari wrote:
>
> I found an issue with \RemoveEmptyStaves. It also remove \Dynamics.


Just write a layout block like this:
\layout {
   \context {
     \PianoStaff
     \remove Keep_alive_together_engraver
   }
   \context {
     \Staff
     \RemoveAllEmptyStaves
   }
}

This is the use case for which I introduced the latter command, and if
you apply it specifically to Staff contexts, Dynamics will not be affected.

Best, Simon


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Gianmaria Lari
In reply to this post by David Kastrup


On Wed, 23 Jan 2019 at 14:53, David Kastrup <[hidden email]> wrote:
Gianmaria Lari <[hidden email]> writes:
[...] 
> To make lilypond print anyway a staff only containing rests [....]
 
That does not look simpler than

\new Staff \with {
  keepAliveInterfaces = #'(
     rest-interface
     bass-figure-interface
     chord-name-interface
     cluster-beacon-interface
     fret-diagram-interface
     lyric-syllable-interface
     note-head-interface
     tab-note-head-interface
     lyric-interface
     percent-repeat-item-interface
     percent-repeat-interface

     ;; need this, as stanza numbers are items, and appear only once.
     stanza-number-interface
   )
} ...

Thanks a lot David!!!
Here it is a complete example that compiles (just in case others need it).

\version "2.19.82"
rh = { \clef treble 
       a1 b1 c'1 d'1 \break
       a1 b1 c'1 d'1 \break
       a1 b1 c'1 d'1 \break}

lh = { \clef bass 
       r1 r r r 
       a1 a a a
       s1 s s s}

\score 
  \new PianoStaff <<
    \new Staff \rh
    \new Staff \with {
      keepAliveInterfaces = 
      #'( rest-interface bass-figure-interface chord-name-interface cluster-beacon-interface
          fret-diagram-interface lyric-syllable-interface note-head-interface tab-note-head-interface lyric-interface
          percent-repeat-item-interface percent-repeat-interface stanza-number-interface
          )
    } \lh
  >>
  \layout {
    \context {
      \PianoStaff
      \RemoveEmptyStaves
      \remove "Keep_alive_together_engraver"
      \override VerticalAxisGroup.remove-first = ##t
    }
  }
}

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Gianmaria Lari
In reply to this post by Simon Albrecht-2


On Wed, 23 Jan 2019 at 16:31, Simon Albrecht <[hidden email]> wrote:
On 22.01.19 09:56, Gianmaria Lari wrote:
>
> I found an issue with \RemoveEmptyStaves. It also remove \Dynamics.

Just write a layout block like this:
\layout {
   \context {
     \PianoStaff
     \remove Keep_alive_together_engraver
   }
   \context {
     \Staff
     \RemoveAllEmptyStaves
   }
}

This is the use case for which I introduced the latter command, and if
you apply it specifically to Staff contexts, Dynamics will not be affected.

Super Simon, thanks a lot!

Here it is a complete example that compiles.
 
\version "2.19.82"
rh = { \clef treble 
       a1 b1 c'1 d'1 \break
       a1 b1 c'1 d'1 \break
       a1 b1 c'1 d'1 \break}

lh = { \clef bass 
       r1 r r r 
       a1 a a a 
       s1 s s s}

dynamics = {
  s1\p s1 s1 s1
  s1\f s1 s1 s1
  s1\sf s1 s1 s1
}

\score 
  \new PianoStaff <<
    \new Staff \rh
    \new Dynamics \dynamics
    \new Staff \with {
      keepAliveInterfaces = 
      #'( rest-interface bass-figure-interface chord-name-interface cluster-beacon-interface
          fret-diagram-interface lyric-syllable-interface note-head-interface tab-note-head-interface lyric-interface
          percent-repeat-item-interface percent-repeat-interface stanza-number-interface
          )
    } \lh
  >>
  \layout {
    \context {
      \PianoStaff
      \remove Keep_alive_together_engraver
    }
    \context {
      \Staff
      \RemoveAllEmptyStaves
    }
  }
}

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

David Kastrup
In reply to this post by Gianmaria Lari
Gianmaria Lari <[hidden email]> writes:

> On Wed, 23 Jan 2019 at 14:53, David Kastrup <[hidden email]> wrote:
>
>> Gianmaria Lari <[hidden email]> writes:
>> [...]
>
>> To make lilypond print anyway a staff only containing rests [....]
>>
>
>
>> That does not look simpler than
>>
>> \new Staff \with {
>>   keepAliveInterfaces = #'(
>>      rest-interface
>>      bass-figure-interface
>>      chord-name-interface
>>      cluster-beacon-interface
>>      fret-diagram-interface
>>      lyric-syllable-interface
>>      note-head-interface
>>      tab-note-head-interface
>>      lyric-interface
>>      percent-repeat-item-interface
>>      percent-repeat-interface
>>
>>      ;; need this, as stanza numbers are items, and appear only once.
>>      stanza-number-interface
>>    )
>> } ...
>>
>
> Thanks a lot David!!!
> Here it is a complete example that compiles (just in case others need it).
>
> \version "2.19.82"
> rh = { \clef treble
>        a1 b1 c'1 d'1 \break
>        a1 b1 c'1 d'1 \break
>        a1 b1 c'1 d'1 \break}
>
> lh = { \clef bass
>        r1 r r r
>        a1 a a a
>        s1 s s s}
>
> \score
> {
>   \new PianoStaff <<
>     \new Staff \rh
>     \new Staff \with {
>       keepAliveInterfaces =
>       #'( rest-interface bass-figure-interface chord-name-interface
> cluster-beacon-interface
>           fret-diagram-interface lyric-syllable-interface
> note-head-interface tab-note-head-interface lyric-interface
>           percent-repeat-item-interface percent-repeat-interface
> stanza-number-interface
>           )
>     } \lh
>   >>
>   \layout {
>     \context {
>       \PianoStaff
>       \RemoveEmptyStaves
>       \remove "Keep_alive_together_engraver"
>       \override VerticalAxisGroup.remove-first = ##t
>     }
>   }
> }

AFAIR, \PianoStaff \remove "Keep_alive_together_engraver" is the same as
\GrandStaff .  And \RemoveEmptyStaves \override
VerticalAxisGroup.remove-first = ##t is the same as
\RemoveAllEmptyStaves .

So it's more like you want

\score
{
  \new GrandStaff <<
    \new Staff \rh
    \new Staff \with {
      keepAliveInterfaces =
      #'( rest-interface bass-figure-interface chord-name-interface
cluster-beacon-interface
          fret-diagram-interface lyric-syllable-interface
note-head-interface tab-note-head-interface lyric-interface
          percent-repeat-item-interface percent-repeat-interface
stanza-number-interface
          )
    } \lh
  >>
  \layout {
    \context {
      \GrandStaff
      \RemoveAllEmptyStaves
    }
  }
}


--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: print bass staff not always

Gianmaria Lari
From David K.
AFAIR, \PianoStaff \remove "Keep_alive_together_engraver" is the same as
\GrandStaff .  And \RemoveEmptyStaves \override
VerticalAxisGroup.remove-first = ##t is the same as
\RemoveAllEmptyStaves .

So it's more like you want

\score
{
  \new GrandStaff <<
    \new Staff \rh
    \new Staff \with {
      keepAliveInterfaces =
      #'( rest-interface bass-figure-interface chord-name-interface
cluster-beacon-interface
          fret-diagram-interface lyric-syllable-interface
note-head-interface tab-note-head-interface lyric-interface
          percent-repeat-item-interface percent-repeat-interface
stanza-number-interface
          )
    } \lh
  >>
  \layout {
    \context {
      \GrandStaff
      \RemoveAllEmptyStaves
    }
  }
}

Tried it and you're right, the output is the same. Thank you David!
g. 

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user