Re: Centered full-measure rest in 3/4?

2018-03-07 Thread Jacques Menu Muzhic
Hello Torsten,

Thanks for this quite interesting example of Lily’s capabilities!

JM

> Le 7 mars 2018 à 21:14, Torsten Hämmerle  a écrit :
> 
> Hi Karen,
> 
> We all know that your client's preferred solution is against the rules, but,
> if she wants it that way, this is a good exercise. :)
> 
> Overriding the MultiMeasureRest stencil is not too easy, because the dots
> are a case of their own and generally not used for whole-bar rests at all.
> 
> There are two things to be considered:
> 
> (1) LilyPond will only use semibreve (or longer) rest symbols, but we want
> minim rests in this special case.
> Solution: There's a property "usable-duration-logs" containing a list of
> allowed duration-log values. We need to add a 1 there (for minim rests). If
> we add a 2 and a 3, LilyPond will even use crotchet rests and quaver rests:
> 
>  \override MultiMeasureRest.usable-duration-logs = #'(-3 -2 -1 0 1 2 3)
> 
> 
> (2) We still have a remaining problem: the missing dot. Dots are not a part
> of ordinary whole-bar rests, and that's why we have to build our own
> stencil.
> I've used the standard MultiMeasureRest.stencil and added the standard "dot"
> stencil, just shifted up by 0.5 stave units. If you set dot-count to 3, you
> will get three dots.
> 
> It's a bit inelegant that you'll have to explicitly set the number of dots
> you want to have displayed, but, as a result, you can specify any rest you
> want as a multi measure rest (whole-bar rest). 
> 
> Here's a minimal example demonstrating the use of the new custom-mm-rest
> stencil, even with dotted crotchet rests just for fun (knowing that they
> should not be centered).
> 
> %%%
> \version "2.18.2"
> 
> #(define (custom-mm-rest grob)
>   (ly:stencil-combine-at-edge
>(ly:multi-measure-rest::print grob) X RIGHT
>(ly:stencil-translate-axis (ly:dots::print grob) 0.5 Y) 0))
> 
> 
> \new PianoStaff <<
>   \new Staff \relative {
> \time 3/4
> 2 8-. q-. |
> 2 q4 |
> c,16 d e f g a b c g e c8 |
> \time 3/8
> c8 e g |
> f d b |
> c16 e g f d b |
>   }
>   \new Staff \relative {
> \time 3/4
> \override MultiMeasureRest.stencil = #custom-mm-rest
> \override MultiMeasureRest.usable-duration-logs = #'(-3 -2 -1 0 1 2 3
> 4)
> \override MultiMeasureRest.dot-count = #1
> R2.*3
> \time 3/8
> R4.*3
>   }
>>> 
> 
> In short:
> (1) set custom stencil
> (2) extending the usable-duration-logs list by adding minim, crotchet,
> quaver rests
> (3) explicitly set the dot-count to 1 so that a dotted rest symbol will be
> printed.
> Voilà ! :)
> 
> dotted-mm-rests.png
>   
> 
> All the best,
> Torsten
> 
> 
> 
> 
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
> 
> ___
> 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: Centered full-measure rest in 3/4?

2018-03-07 Thread Torsten Hämmerle
Hi Karen,

We all know that your client's preferred solution is against the rules, but,
if she wants it that way, this is a good exercise. :)

Overriding the MultiMeasureRest stencil is not too easy, because the dots
are a case of their own and generally not used for whole-bar rests at all.

There are two things to be considered:

(1) LilyPond will only use semibreve (or longer) rest symbols, but we want
minim rests in this special case.
Solution: There's a property "usable-duration-logs" containing a list of
allowed duration-log values. We need to add a 1 there (for minim rests). If
we add a 2 and a 3, LilyPond will even use crotchet rests and quaver rests:

  \override MultiMeasureRest.usable-duration-logs = #'(-3 -2 -1 0 1 2 3)


(2) We still have a remaining problem: the missing dot. Dots are not a part
of ordinary whole-bar rests, and that's why we have to build our own
stencil.
I've used the standard MultiMeasureRest.stencil and added the standard "dot"
stencil, just shifted up by 0.5 stave units. If you set dot-count to 3, you
will get three dots.

It's a bit inelegant that you'll have to explicitly set the number of dots
you want to have displayed, but, as a result, you can specify any rest you
want as a multi measure rest (whole-bar rest). 

Here's a minimal example demonstrating the use of the new custom-mm-rest
stencil, even with dotted crotchet rests just for fun (knowing that they
should not be centered).

%%%
\version "2.18.2"

#(define (custom-mm-rest grob)
   (ly:stencil-combine-at-edge
(ly:multi-measure-rest::print grob) X RIGHT
(ly:stencil-translate-axis (ly:dots::print grob) 0.5 Y) 0))


 \new PianoStaff <<
   \new Staff \relative {
 \time 3/4
 2 8-. q-. |
 2 q4 |
 c,16 d e f g a b c g e c8 |
 \time 3/8
 c8 e g |
 f d b |
 c16 e g f d b |
   }
   \new Staff \relative {
 \time 3/4
 \override MultiMeasureRest.stencil = #custom-mm-rest
 \override MultiMeasureRest.usable-duration-logs = #'(-3 -2 -1 0 1 2 3
4)
 \override MultiMeasureRest.dot-count = #1
 R2.*3
 \time 3/8
 R4.*3
   }
 >>

In short:
(1) set custom stencil
(2) extending the usable-duration-logs list by adding minim, crotchet,
quaver rests
(3) explicitly set the dot-count to 1 so that a dotted rest symbol will be
printed.
Voilà ! :)

dotted-mm-rests.png
  

All the best,
Torsten




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: Centered full-measure rest in 3/4?

2018-03-07 Thread Karen Billings
Thank you for the moral support, Simon!
My "client", as you so kindly call her, is a bit headstrong, and I'll leave it 
at that.
Thanks again!
Karen

On Wednesday, March 7, 2018 11:01 AM, Simon Albrecht 
 wrote:
 

 On 06.03.2018 23:07, Karen Billings wrote:
> I am setting an interlude for a colleague. She has specified a 
> full-measure centered rest, notated as a dotted half-rest.

The answer is very simple: Don’t do it. Tell your client it’s wrong 
notation. One has to do that as an engraver.
Exception: your client is very well aware of the rules, but she wants to 
change them deliberately.

> I have searched the documentation for several hours and cannot seem to 
> figure out how to do this.

This is one of the cases where if LilyPond can’t do it (within 
reasonable effort) it’s a bad thing to do.

Best, Simon


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


Re: Centered full-measure rest in 3/4?

2018-03-07 Thread Simon Albrecht

On 06.03.2018 23:07, Karen Billings wrote:
I am setting an interlude for a colleague. She has specified a 
full-measure centered rest, notated as a dotted half-rest.


The answer is very simple: Don’t do it. Tell your client it’s wrong 
notation. One has to do that as an engraver.
Exception: your client is very well aware of the rules, but she wants to 
change them deliberately.


I have searched the documentation for several hours and cannot seem to 
figure out how to do this.


This is one of the cases where if LilyPond can’t do it (within 
reasonable effort) it’s a bad thing to do.


Best, Simon

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


Re: Centered full-measure rest in 3/4?

2018-03-07 Thread Karen Billings
Kieren,
Thank you so much for trying to help me. I couldn't figure out how to override 
the stencil (I'm afraid I'm still too much of a novice), but I finally figured 
out how to shift a regular rest horizontally so it appears a bit more centered.
Thank you again!
Karen 

On Tuesday, March 6, 2018 5:45 PM, Kieren MacMillan 
 wrote:
 

 Hi Karen,

> I am setting an interlude for a colleague. She has specified a full-measure 
> centered rest, notated as a dotted half-rest. I have searched the 
> documentation for several hours and cannot seem to figure out how to do this.
> 
> I want the rest in measure 2, but centered like the rest in measure 1. Advice?

I assume you’d want to use a MultiMeasureRest (i.e., R2.), and override the 
stencil to look like you want it to.

Hope that puts you on the right path!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: Centered full-measure rest in 3/4?

2018-03-06 Thread Kieren MacMillan
Hi Karen,

> I am setting an interlude for a colleague. She has specified a full-measure 
> centered rest, notated as a dotted half-rest. I have searched the 
> documentation for several hours and cannot seem to figure out how to do this.
> 
> I want the rest in measure 2, but centered like the rest in measure 1. Advice?

I assume you’d want to use a MultiMeasureRest (i.e., R2.), and override the 
stencil to look like you want it to.

Hope that puts you on the right path!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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