lilypond-user
[Top][All Lists]
Advanced

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

Re: Double ossia with tabulature issue


From: Neo Anderson
Subject: Re: Double ossia with tabulature issue
Date: Fri, 8 Jul 2022 14:40:54 +0000 (UTC)

Jean, 

Thank you very much! 

After hours of reading documentation and trying things out, I actually came up with the solution of treating ossia as a separate staff, just like you did, but yours is much nicer.

BTW, the tweakabilty is a great thing, but can be daunting at times. 

Regards, 
A.


On Friday, July 8, 2022 at 05:27:28 AM GMT+2, Jean Abou Samra <jean@abou-samra.fr> wrote:




On 7/8/22 02:23, Neo Anderson wrote:
> Hi!
>
> I've been trying to add an ossia to an existing guitar part with the
> tabulature. However, I run into this issue that the ossia gets doubled
> as long as the tab part is uncommented. As soon as I don't use the tab
> staff, everything is fine.
>
> I guess it's all because of my /score block, but I can't figure it out.
>
> The ossia itself doesn't have to have its own tab, but if, as an
> extra, someone could make it happen, I would be happy, too.
>
> MWEs:
> a) Minimal reproducible example included as an attachement
> b) https://www.hacklily.org/?edit=Aelfstone/sheet-music/ossia_issue_mwe.ly
> c) The code itself
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \version "2.23.10"
>
> gtrOne = {
>   d'1~ d'1
>   \break
>   <<
>     { f'1 }
>     \new Staff
>     \with { alignAboveContext = "gtrOne" }
>     { c''1 }
>   >>
>   g'1
> }
>
>
> \score {
>   <<
>     \new Staff = "gtrOne" \with { }
>     { \gtrOne }
>     \new TabStaff
>     { \gtrOne }
>   >>
>   \layout {
>     \context { }
>   }
> }
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



Well, LilyPond is doing exactly what you've asked it. Since
there is \new Staff both in the normal staff and in the tablature,
you get two new staves. You need to do \new Staff in the staff,
and \new TabStaff in the tablature. Furthermore, you need to adjust
alignAboveContext. To do that without repeating the music, you
can use tags.


\version "2.23.10"

ossia = { c''1 }

gtrOne = {
  d'1~ d'1
  \break

  <<
    { f'1 }
    \tag staff \new Staff = ossia \with { alignAboveContext = gtrOne }
\ossia
    \tag ossia \new TabStaff \with { alignAboveContext = ossia } \ossia

  >>
  g'1
}


\score {

  <<
    \new Staff = "gtrOne" \keepWithTag staff \gtrOne
    \new TabStaff \keepWithTag ossia \gtrOne
  >>
}


See
https://lilypond.org/doc/v2.23/Documentation/notation/different-editions-from-one-source#using-tags

Note that I've also removed your useless (empty) \layout block.

Best,
Jean




reply via email to

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