Re: Combining full bar rests with omitted grobs in between

2018-05-19 Thread Saul Tobin
I wrote a function that does something similar to what you need. There may
be newer or better ways to do it, but it's what I use.

Saul

On Fri, May 18, 2018 at 1:12 AM, Davide Liessi 
wrote:

> Dear all,
> is there a way to combine the two full bar rests in one multimeasure
> rest in the following example?
>
> \version "2.19.81"
> \new Staff <<
>   \compressFullBarRests
>   {
> s1
> \once \omit Score.MetronomeMark
> \tempo "test"
>   }
>   {
> R1*2
>   }
> >>
>
> Use case: I have all tempo marks for the full score and parts in one
> variable, but I need to hide a couple of tempo marks in one of the
> parts (requested by the conductor).
>
> I tried the approaches mentioned in the thread
> http://lists.gnu.org/archive/html/lilypond-user/2014-11/msg00267.html
> but they didn't work, probably because omitting the grob only makes it
> invisible and with null extent but does not delete it.
>
> Is there a solution?
> Is there a way to actually delete an omitted grob?
>
> Best wishes.
> Davide
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


rest_combiner.ily
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Combining full bar rests with omitted grobs in between

2018-05-19 Thread David Kastrup
Davide Liessi  writes:

> 2018-05-18 11:02 GMT+02:00 David Kastrup :
>> You'd need to work with tags and alternative passages.
>
>> Thomas Morley  writes:
>>> The different length of s1 and R1*2 will always result into a splitted
>>> MultiMeasureRest, afaik.
>
> Thanks for your answers.
>
> For the record, I solved my problem using tags to filter the \tempo
> marks and then applying \mergeSkips from
> http://lists.gnu.org/archive/html/lilypond-user/2013-12/msg01085.html
> to merge the spacer rests and avoid splitting the multimeasure rests
> (in the original file I had spacer rests filling the full length of
> the piece).
>
> Indeed, I noticed that elements inside removed tags are not shown by
> \displayMusic (hence \mergeSkips can merge the spacer rests).
> At what point is tagged content removed?

When you call \remove/keepWithTags.  The music function returns the
cleaned music expression.  This is completely obvious and transparent
functionality, meaning that if you call \remove/keepWithTags inside of
\relative, you might get inconvenient octave differences due to the
removed sequences.

> What parts of LilyPond's code are responsible for that?

\remove/keepWithTags .  They are only called explicitly by the user so
far.  It's conceivable that we'll add command line options for such
effects and/or some default tags for midi/layout processing, but so far
nothing of the kind has been done yet.  And the midi/layout stuff would
actually be tricky since the obvious place for such processing is during
scorification, and at that time the output to be used is not yet fixed.
And we don't have similarly employed hooks during "bookification" so it
would seem a bit heavy-handed to introduce that kind of stuff there.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Combining full bar rests with omitted grobs in between

2018-05-19 Thread Davide Liessi
2018-05-18 11:02 GMT+02:00 David Kastrup :
> You'd need to work with tags and alternative passages.

> Thomas Morley  writes:
>> The different length of s1 and R1*2 will always result into a splitted
>> MultiMeasureRest, afaik.

Thanks for your answers.

For the record, I solved my problem using tags to filter the \tempo
marks and then applying \mergeSkips from
http://lists.gnu.org/archive/html/lilypond-user/2013-12/msg01085.html
to merge the spacer rests and avoid splitting the multimeasure rests
(in the original file I had spacer rests filling the full length of
the piece).

Indeed, I noticed that elements inside removed tags are not shown by
\displayMusic (hence \mergeSkips can merge the spacer rests).
At what point is tagged content removed?
What parts of LilyPond's code are responsible for that?

Best wishes.
Davide

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Combining full bar rests with omitted grobs in between

2018-05-18 Thread David Kastrup
Thomas Morley  writes:

> 2018-05-18 10:12 GMT+02:00 Davide Liessi :
>> Dear all,
>> is there a way to combine the two full bar rests in one multimeasure
>> rest in the following example?
>>
>> \version "2.19.81"
>> \new Staff <<
>>   \compressFullBarRests
>>   {
>> s1
>> \once \omit Score.MetronomeMark
>> \tempo "test"
>>   }
>>   {
>> R1*2
>>   }

>>
>> Use case: I have all tempo marks for the full score and parts in one
>> variable, but I need to hide a couple of tempo marks in one of the
>> parts (requested by the conductor).

[...]

>> Is there a solution?
>> Is there a way to actually delete an omitted grob?

You'd need to work with tags and alternative passages.

> Yes, there is, but the result is not what you want.
> \once \override Score.MetronomeMark.before-line-breaking = #ly:grob-suicide!
>
> The different length of s1 and R1*2 will always result into a splitted
> MultiMeasureRest, afaik.

It's instructive and/or sobering to see what \expandFullBarRests (the
actual default setting) does.  It just makes the internal timer tick at
every bar.  It creates no grob, does no typesetting, nothing.  Other
engravers then create objects like bars and stuff.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Combining full bar rests with omitted grobs in between

2018-05-18 Thread bobr...@centrum.is
I’m responding from my phone so I can’t create an example, but you use tags.  
See the docs:

http://lilypond.org/doc/v2.19/Documentation/notation/different-editions-from-one-source


- Davide Liessi  wrote:
> Dear all,
> is there a way to combine the two full bar rests in one multimeasure
> rest in the following example?
> 
> \version "2.19.81"
> \new Staff <<
>   \compressFullBarRests
>   {
> s1
> \once \omit Score.MetronomeMark
> \tempo "test"
>   }
>   {
> R1*2
>   }
> >>
> 
> Use case: I have all tempo marks for the full score and parts in one
> variable, but I need to hide a couple of tempo marks in one of the
> parts (requested by the conductor).
> 
> I tried the approaches mentioned in the thread
> http://lists.gnu.org/archive/html/lilypond-user/2014-11/msg00267.html
> but they didn't work, probably because omitting the grob only makes it
> invisible and with null extent but does not delete it.
> 
> Is there a solution?
> Is there a way to actually delete an omitted grob?
> 
> Best wishes.
> Davide
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Combining full bar rests with omitted grobs in between

2018-05-18 Thread Thomas Morley
2018-05-18 10:12 GMT+02:00 Davide Liessi :
> Dear all,
> is there a way to combine the two full bar rests in one multimeasure
> rest in the following example?
>
> \version "2.19.81"
> \new Staff <<
>   \compressFullBarRests
>   {
> s1
> \once \omit Score.MetronomeMark
> \tempo "test"
>   }
>   {
> R1*2
>   }
>>>
>
> Use case: I have all tempo marks for the full score and parts in one
> variable, but I need to hide a couple of tempo marks in one of the
> parts (requested by the conductor).
>
> I tried the approaches mentioned in the thread
> http://lists.gnu.org/archive/html/lilypond-user/2014-11/msg00267.html
> but they didn't work, probably because omitting the grob only makes it
> invisible and with null extent but does not delete it.
>
> Is there a solution?
> Is there a way to actually delete an omitted grob?
>
> Best wishes.
> Davide


Yes, there is, but the result is not what you want.
\once \override Score.MetronomeMark.before-line-breaking = #ly:grob-suicide!

The different length of s1 and R1*2 will always result into a splitted
MultiMeasureRest, afaik.

See:

\new Staff <<
  \compressFullBarRests
  { s1 }
  { R1*2 }
>>

Same for { s1 s1 }, only { s1*2 } would work.

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user