Re: Bar number position and text (especially for anacruses)

2018-06-26 Thread Torsten Hämmerle
*PS:* I should probably have mentioned that TextScript, Dynamics etc. behave
in exactly the same way and the usual remedy to vertically align them on a
common baseline is to use staff-padding.

The problem with bar numbers is that they are not in a Staff context but in
the Score context and staff-padding will have no effect there.

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: Bar number position and text (especially for anacruses)

2018-06-26 Thread Torsten Hämmerle
Stephen Cummings wrote
> Anyone with suggestions for points 1 and 2?
> 
> 
> 
> Stephen Cummings wrote on 6/23/2018 8:07 AM:
>  >
>   1. Vertical alignment/positioning of  bar numbers. In the output the 
> parenthetical bar number for the anacrusis is higher than the remaining 
> bar numbers.


Hi Stephen,

Unfortunately (and surprisingly), bar numbers ignore descenders, it's rather
like putting a tightly fitting box around and placing this box on the
baseline. That way, there are no descenders (the parentheses should descend
below the baseline and the "p" in "pickup" should, too).

Normally, the figures used for bar numbers don't have descenders and this
does not matter much, but, as soon as we use parentheses or letters with
descenders, the vertical spacing starts looking uneven.

A quick and dirty way out is to set suitable Y-extents, as in

  \override BarNumber.Y-extent = #'(0 . 1.6)

to make LilyPond think there were no descenders. 
The following image illustrates how the default bar numbers never descend
below an imaginary line (shown in red).
Below, the Y-extent override makes everything sit on the baseline as
expected.

 

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: Bar number position and text (especially for anacruses)

2018-06-26 Thread Simon Albrecht

On 26.06.2018 20:02, Stephen Cummings wrote:


That crude trial-and-error gave me a working adaptation that shrinks 
the text so that it more or less fits:


... (markup  #:tiny #:italic"pickup"))

and I now see how markups in lambda functions or whatever they're 
called can be formatted.




See 
 
for more on this.


Best, Simon

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


Re: Bar number position and text (especially for anacruses)

2018-06-26 Thread Stephen Cummings

Thanks so much, Andrew--never would have figured that out.

Have a long way to go before I understand the sort of code you provided 
so I just experimented with various examples I found that contained the 
word "markup" until I got successful compilation. That crude 
trial-and-error gave me a working adaptation that shrinks the text so 
that it more or less fits:


... (markup  #:tiny #:italic"pickup"))

and I now see how markups in lambda functions or whatever they're called 
can be formatted.


Anyone with suggestions for points 1 and 2?



Stephen Cummings wrote on 6/23/2018 8:07 AM:
>
 1. Vertical alignment/positioning of  bar numbers. In the output the 
parenthetical bar number for the anacrusis is higher than the remaining 
bar numbers.


 a. How can I lower it, and how can I raise the others? Are there 
commands that would automatically ensure that all are at the same 
vertical position?


 b. Not as important: is there a way to raise/lower any given bar 
number independently?


  2.  Full control over horizontal alignment of bar numbers. I (think 
I) want the bar number for the anacrusis to appear just right of the 
clef. I found commands that change the object its aligned to, but none 
of those positions were satisfactory. How can move it horizontally 
exactly where I want it? Not as important: Is the procedure different 
for other individual bar numbers?


andrew.bern...@gmail.com wrote on 6/25/2018 4:36 PM:

Hi Steve,


Re point 3:

You can do this:

  \once \set Score.barNumberFormatter =  #(lambda (bar-number 
measure-position alternative-number extra)


(markup "pickup"))

But note that the length of the text in this case is problematic. 
Nevertheless, you may find this formatter very adaptable.


Andrew

*From:*lilypond-user 
 *On Behalf Of 
*Stephen Cummings

*Sent:* Sunday, 24 June 2018 1:08 AM
*To:* lilypond-user@gnu.org
*Subject:* Bar number position and text (especially for anacruses)

3.  Changing bar number text. Can I change the text for the anacrusis 
bar number to something other than "(1)"? Like "0" or "pickup"?





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


RE: Bar number position and text (especially for anacruses)

2018-06-25 Thread andrew.bernard
Hi Steve,

 

Re point 3:

 

You can do this:

 

  \once \set Score.barNumberFormatter =  #(lambda (bar-number
measure-position alternative-number extra)

(markup "pickup"))

 

But note that the length of the text in this case is problematic.
Nevertheless, you may find this formatter very adaptable.

 

Andrew

 

 

From: lilypond-user 
On Behalf Of Stephen Cummings
Sent: Sunday, 24 June 2018 1:08 AM
To: lilypond-user@gnu.org
Subject: Bar number position and text (especially for anacruses)

 

3.  Changing bar number text. Can I change the text for the anacrusis bar
number to something other than "(1)"? Like "0" or "pickup"?

 

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


RE: Bar number position and text (especially for anacruses)

2018-06-25 Thread andrew.bernard
Hi Steve,

 

Not nitpicking, but in 2.19.82 at least, 'staff' must be 'Staff'. A warning
is issued if not.

 

I can verify the same horizontal alignment issue with the (1) in the partial
bar exists in 2.19.82. Could this be a bug? I'm not sure.

 

Andrew

 

 

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


Bar number position and text (especially for anacruses)

2018-06-23 Thread Stephen Cummings

With code below as reference, please help me with:

1. Vertical alignment/positioning of  bar numbers. In the output the 
parenthetical bar number for the anacrusis is higher than the remaining 
bar numbers.


    a. How can I lower it, and how can I raise the others? Are there 
commands that would automatically ensure that all are at the same 
vertical position?


    b. Not as important: is there a way to raise/lower any given bar 
number independently?


2.  Full control over horizontal alignment of bar numbers. I (think I) 
want the bar number for the anacrusis to appear just right of the clef. 
I found commands that change the object its aligned to, but none of 
those positions were satisfactory. How can move it horizontally exactly 
where I want it? Not as important: Is the procedure different for other 
individual bar numbers?


3.  Changing bar number text. Can I change the text for the anacrusis 
bar number to something other than "(1)"? Like "0" or "pickup"? Not as 
important: Is that also possible for any arbitrary bar number?


I can't find instructions on how to include or post example output so 
I've taken a chance and embedded an image of the output below after the 
code.


Thank you,

Steve Cummings


Code:

%---

% please note that this example "omits" the SystemStartBar, in case part 
of the solution to #2 involves choosing an object to which to align the 
bar number to.


\version "2.19.48"

\score {
  \new StaffGroup
<<
    \new staff {
  \time 2/4
  \bar ""
  \partial 8
    r8   |   %  0
    a'8 r8 r4    |   %  1
    b'8 c'8 r4   |   %  2
    }

    \new staff {
  \time 2/4
  \bar ""
  \partial 8
    b'8  |   %  0
    r4 e'8 d'8   |   %  1
    r4 r8 g'8    |   %  2
    }

>>
\layout {
  \context {
    \Score
  \omit SystemStartBar
    \override BarNumber.break-visibility = ##(#f #t #t4f/)
    \override BarNumber.self-alignment-X = #LEFT
    \override BarNumber #'break-align-symbols = #'(staff-bar clef) 
% #'(left-edge)

    \override BarNumber.font-size = #0.35
    barNumberVisibility = #all-bar-numbers-visible
  }
}
}

%---



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