Re: TabStaff.keepAliveInterfaces

2019-11-02 Thread Thomas Morley
Am Sa., 2. Nov. 2019 um 12:59 Uhr schrieb Thomas Morley
:
>
> Am Sa., 2. Nov. 2019 um 09:41 Uhr schrieb Malte Meyn :
> >
> > Hi list,
> >
> > what am I (or what is LilyPond) doing wrong here?
> >
> > %%%
> >
> > \version "2.19.83"
> >
> > bla = { \repeat unfold 100 e'4 }
> > git = {
> >\set TabStaff.keepAliveInterfaces = #'()
> >R1*10
> >\repeat unfold 60 c'4
> > }
> >
> > <<
> >\new Staff \bla
> >\new Staff \with { \RemoveAllEmptyStaves } \git
> >\new TabStaff \with { \RemoveAllEmptyStaves } \git
> >  >>
> >
> > %%%
> >
> > A stub for the first TabStaff is printed (clef and short staff lines). If I
> > • don’t \set TabStaff.keepAliveInterfaces or
> > • \set Staff.keepAliveInterfaces = #'() too
> > the TabStaff is hidden as expected. Seems like the \set TabStaff… partly
> > revives the TabStaff from being hidden. But why does the \set Staff…
> > have an effect at all?
> >
> > Cheers,
> > Malte
> >
>
> Hi Malte,
>
> you initiate TabStaff last, thus there is no TabStaff at the time \set
> TabStaff is read (in Staff). So LilyPond creates a TabStaff herself.
>
> (1)
> You could use that autogenerated TabStaff. Though, because then the
> TabStaff is already there a \with comes too late, so you need to go
> for score-layout.
> Makes for:
>
> bla = { \repeat unfold 100 e'4 f'1}
> git = {
>\set TabStaff.keepAliveInterfaces = #'()
>R1*10
>\repeat unfold 60 c'4
>\break
>\unset TabStaff.keepAliveInterfaces
>d'1
> }
>
> \score {
>   <<
>  \new Staff \bla
>  \new Staff \with { \RemoveAllEmptyStaves } \git
>  \context TabStaff \git
>   >>
>   \layout {
> \context {
>   \TabStaff
>   \RemoveAllEmptyStaves
> }
>   }
> }
>
> Though, fiddling with autogenerated contexts is not really nice...
>
> (2)
> You could initiate the TabStaff before Staff and align it properly.
> Makes for:
>
> bla = { \repeat unfold 100 e'4 f'1}
> git = {
>\set TabStaff.keepAliveInterfaces = #'()
>R1*10
>\repeat unfold 60 c'4
>\break
>\unset TabStaff.keepAliveInterfaces
>d'1
> }
>
> <<
>\new Staff \bla
>\new TabStaff = "tab" \with { \RemoveAllEmptyStaves } \git
>\new Staff \with { alignAboveContext = "tab" \RemoveAllEmptyStaves } \git
> >>
>
> Though, speaking only for me, I don't like this ordering and it feels
> very much like a workaround. Well, it _is_ a workaround ;)
>
> I'd go for:
> (3)
> _Limit_ the \set TabStaff to this context.
> Makes for:
>
> %% A simple \set TabStaff applied right at the start of some music will
> %% probably causesome spurious TabStaff, because the meant TabStaff is
> %% probably not (fully) initiated at that timestep.
> %% Thus better make sure the \set is limited to TabStaff
> %% Lateron it would not be a problem.
> removeTabStaff =
>   \applyContext
> #(lambda (ctx)
>(if (eq? (ly:context-name ctx) 'TabStaff)
>(ly:context-set-property! ctx 'keepAliveInterfaces '(
>
> %% Unset keepAliveInterfaces in TabStaff (now the settings from Score apply)
> unsetRemoveTabStaff = \unset TabStaff.keepAliveInterfaces

Better use below to avoid spurtous TabStaff, if TabStaff is not
initiated at all or commented or deleted.

%% Unset keepAliveInterfaces in TabStaff (now the settings from Score apply)
unsetRemoveTabStaff =
  \applyContext
#(lambda (ctx)
   (if (eq? (ly:context-name ctx) 'TabStaff)
   (ly:context-unset-property ctx 'keepAliveInterfaces)))

Cheers,
  Harm
>
> bla = { \repeat unfold 100 e'4 f'1}
> git = {
>\removeTabStaff
>R1*10
>\repeat unfold 60 c'4
>\break
>\unsetRemoveTabStaff
>d'1
> }
>
> <<
>   \new Staff \bla
>   \new Staff \with { \RemoveAllEmptyStaves } \git
>   \new TabStaff \with { \RemoveAllEmptyStaves }\git
> >>
>
>
> HTH,
>   Harm



Re: TabStaff.keepAliveInterfaces

2019-11-02 Thread Thomas Morley
Am Sa., 2. Nov. 2019 um 09:41 Uhr schrieb Malte Meyn :
>
> Hi list,
>
> what am I (or what is LilyPond) doing wrong here?
>
> %%%
>
> \version "2.19.83"
>
> bla = { \repeat unfold 100 e'4 }
> git = {
>\set TabStaff.keepAliveInterfaces = #'()
>R1*10
>\repeat unfold 60 c'4
> }
>
> <<
>\new Staff \bla
>\new Staff \with { \RemoveAllEmptyStaves } \git
>\new TabStaff \with { \RemoveAllEmptyStaves } \git
>  >>
>
> %%%
>
> A stub for the first TabStaff is printed (clef and short staff lines). If I
> • don’t \set TabStaff.keepAliveInterfaces or
> • \set Staff.keepAliveInterfaces = #'() too
> the TabStaff is hidden as expected. Seems like the \set TabStaff… partly
> revives the TabStaff from being hidden. But why does the \set Staff…
> have an effect at all?
>
> Cheers,
> Malte
>

Hi Malte,

you initiate TabStaff last, thus there is no TabStaff at the time \set
TabStaff is read (in Staff). So LilyPond creates a TabStaff herself.

(1)
You could use that autogenerated TabStaff. Though, because then the
TabStaff is already there a \with comes too late, so you need to go
for score-layout.
Makes for:

bla = { \repeat unfold 100 e'4 f'1}
git = {
   \set TabStaff.keepAliveInterfaces = #'()
   R1*10
   \repeat unfold 60 c'4
   \break
   \unset TabStaff.keepAliveInterfaces
   d'1
}

\score {
  <<
 \new Staff \bla
 \new Staff \with { \RemoveAllEmptyStaves } \git
 \context TabStaff \git
  >>
  \layout {
\context {
  \TabStaff
  \RemoveAllEmptyStaves
}
  }
}

Though, fiddling with autogenerated contexts is not really nice...

(2)
You could initiate the TabStaff before Staff and align it properly.
Makes for:

bla = { \repeat unfold 100 e'4 f'1}
git = {
   \set TabStaff.keepAliveInterfaces = #'()
   R1*10
   \repeat unfold 60 c'4
   \break
   \unset TabStaff.keepAliveInterfaces
   d'1
}

<<
   \new Staff \bla
   \new TabStaff = "tab" \with { \RemoveAllEmptyStaves } \git
   \new Staff \with { alignAboveContext = "tab" \RemoveAllEmptyStaves } \git
>>

Though, speaking only for me, I don't like this ordering and it feels
very much like a workaround. Well, it _is_ a workaround ;)

I'd go for:
(3)
_Limit_ the \set TabStaff to this context.
Makes for:

%% A simple \set TabStaff applied right at the start of some music will
%% probably causesome spurious TabStaff, because the meant TabStaff is
%% probably not (fully) initiated at that timestep.
%% Thus better make sure the \set is limited to TabStaff
%% Lateron it would not be a problem.
removeTabStaff =
  \applyContext
#(lambda (ctx)
   (if (eq? (ly:context-name ctx) 'TabStaff)
   (ly:context-set-property! ctx 'keepAliveInterfaces '(

%% Unset keepAliveInterfaces in TabStaff (now the settings from Score apply)
unsetRemoveTabStaff = \unset TabStaff.keepAliveInterfaces

bla = { \repeat unfold 100 e'4 f'1}
git = {
   \removeTabStaff
   R1*10
   \repeat unfold 60 c'4
   \break
   \unsetRemoveTabStaff
   d'1
}

<<
  \new Staff \bla
  \new Staff \with { \RemoveAllEmptyStaves } \git
  \new TabStaff \with { \RemoveAllEmptyStaves }\git
>>


HTH,
  Harm



\RemoveAllEmptyStaves, TabStaff and \set commands [was: TabStaff.keepAliveInterfaces]

2019-11-02 Thread Malte Meyn




Am 02.11.19 um 09:39 schrieb Malte Meyn:
Seems like the \set TabStaff… partly 
revives the TabStaff from being hidden.


I just realized that other \set commands (not involving 
keepAliveInterfaces) show the same problem:


\version "2.19.83"

bla = { \repeat unfold 100 e'4 }
git = {
  \set TabStaff.middleCPosition = 0
  R1*10
  \repeat unfold 60 c'4
}

<<
  \new Staff \bla
  \new Staff \with { \RemoveAllEmptyStaves } \git
  \new TabStaff \with { \RemoveAllEmptyStaves } \git
>>




TabStaff.keepAliveInterfaces

2019-11-02 Thread Malte Meyn

Hi list,

what am I (or what is LilyPond) doing wrong here?

%%%

\version "2.19.83"

bla = { \repeat unfold 100 e'4 }
git = {
  \set TabStaff.keepAliveInterfaces = #'()
  R1*10
  \repeat unfold 60 c'4
}

<<
  \new Staff \bla
  \new Staff \with { \RemoveAllEmptyStaves } \git
  \new TabStaff \with { \RemoveAllEmptyStaves } \git
>>

%%%

A stub for the first TabStaff is printed (clef and short staff lines). If I
• don’t \set TabStaff.keepAliveInterfaces or
• \set Staff.keepAliveInterfaces = #'() too
the TabStaff is hidden as expected. Seems like the \set TabStaff… partly 
revives the TabStaff from being hidden. But why does the \set Staff… 
have an effect at all?


Cheers,
Malte