Re: space the width of key signature

2016-07-04 Thread David Nalesnik
On Mon, Jul 4, 2016 at 8:35 PM, David Nalesnik  wrote:
> You could extend
> the procedure for determining line beginnings by looking at
> 'right-column for line ends.


Sorry, 'right-neighbor

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


Re: space the width of key signature

2016-07-04 Thread David Nalesnik
On Mon, Jul 4, 2016 at 2:15 PM, Thomas Morley  wrote:

>
> thanks a lot for your research and findings.

You're welcome!

> Your suggestions are all implemented leading to geat simplifications.
> In `keep-at-line-begin' I added some fool-proof.
> Regrettable StanzaNumber does not respond correctly for 'break-visibility...

I did some further investigation.

break-visibility would work on StanzaNumber if it were associated with
a NonMusicalPaperColumn.  "Non-musical"  grobs such as Clef and
KeySignature are copied twice and exist in three forms per measure at
one point: one for beginning-of-line, one for mid-line, one-for
end-of-line, to be used or discarded when line breaks are decided --
lots of grobs are suicided.  The unneeded grobs are thrown out based
on the break-direction.

If you apply ly:item-break-dir to StanzaNumber you will always get 0 =
unbroken, so break-visibility is useless.  The extra copies aren't
made for "musical" items, anyway.

The trick I used was to locate a neighboring NonMusicalPaprtColumn,
which would have break-directions of -1, 0, or 1.  You could extend
the procedure for determining line beginnings by looking at
'right-column for line ends.

David

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


Re: space the width of key signature

2016-07-04 Thread Thomas Morley
2016-07-04 23:44 GMT+02:00 Br. Gabriel-Marie | SSPX :
>
> Okay, fellas, I have a problem with this stanza code then.
>
> When I plug it into my script, this code numbers every word as well as every 
> line.
> I've attached a minimal example along with the include and my pdf output.
>
> Maybe I'm doing it wrong.
>
>
>
> \header {  title = "Stanza Test"  }
> \include "stanza-number-every-line.ly"
>
> verses = \new Voice = "verses" \relative c' {
> \time 4/4
> \key c \major
> a4 b4 c4 d4 | e2 f2 \bar "||"
> }
>
> wordsOne = \new Lyrics  \with \numberLyrics 1 \lyricsto "verses" {
>  Here are some words to sing
> }
> wordsTwo = \new Lyrics \with \numberLyrics 2 \lyricsto "verses" {
> And line up with them -- selves
> }
> wordsThree = \new Lyrics \with \numberLyrics 3 \lyricsto "verses" {
> See the stanz -- as line up in place
> }
>
> \score { <<
>\new Staff{   \verses }
>\wordsOne
> \wordsTwo
>\wordsThree
> >>

%% try:
  \layout { \keepLineStartStanzaNumbers }


>
> }
>
>
>
>
> On 7/4/2016 2:15 PM, Thomas Morley wrote:
>
> 2016-07-04 18:49 GMT+02:00 Br. Gabriel-Marie | SSPX :
>
> Gabriel-Marie, attached you'll find the most recent coding. It indeed needs a 
> newer devel-version because of `ly:item-get-column'-usage David, thanks a lot 
> for your research and findings. Your suggestions are all implemented leading 
> to geat simplifications. In `keep-at-line-begin' I added some fool-proof. 
> Regrettable StanzaNumber does not respond correctly for 'break-visibility... 
> Thanks, Harm
>
>

Cheers,
  Harm

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


Re: space the width of key signature

2016-07-04 Thread Br. Gabriel-Marie | SSPX

Uh, (slaps self on forehead).

I forgot this in the layout{}

\keepLineStartStanzaNumbers

That fixes the numbering problem.

On 7/4/2016 4:44 PM, Br. Gabriel-Marie | SSPX wrote:

Okay, fellas, I have a problem with this stanza code then.

When I plug it into my script, this code numbers every 
word as well as every line.
I've attached a minimal example along with the include and 
my pdf output.


Maybe I'm doing it wrong.



\header {  title = "Stanza Test"  }
\include "stanza-number-every-line.ly"

verses = \new Voice = "verses" \relative c' {
\time 4/4
\key c \major
a4 b4 c4 d4 | e2 f2 \bar "||"
}

wordsOne = \new Lyrics  \with \numberLyrics 1 \lyricsto 
"verses" {

 Here are some words to sing
}
wordsTwo = \new Lyrics \with \numberLyrics 2 \lyricsto 
"verses" {

And line up with them -- selves
}
wordsThree = \new Lyrics \with \numberLyrics 3 \lyricsto 
"verses" {

See the stanz -- as line up in place
}

\score { <<
   \new Staff{   \verses }
   \wordsOne
\wordsTwo
   \wordsThree
>>
\layout {}
}




On 7/4/2016 2:15 PM, Thomas Morley wrote:

2016-07-04 18:49 GMT+02:00 Br. Gabriel-Marie | SSPX:
Gabriel-Marie, attached you'll find the most recent 
coding. It indeed needs a newer devel-version because of 
`ly:item-get-column'-usage David, thanks a lot for your 
research and findings. Your suggestions are all 
implemented leading to geat simplifications. In 
`keep-at-line-begin' I added some fool-proof. Regrettable 
StanzaNumber does not respond correctly for 
'break-visibility... Thanks, Harm 




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


Re: space the width of key signature

2016-07-04 Thread Br. Gabriel-Marie | SSPX

Okay, fellas, I have a problem with this stanza code then.

When I plug it into my script, this code numbers every word 
as well as every line.
I've attached a minimal example along with the include and 
my pdf output.


Maybe I'm doing it wrong.



\header {  title = "Stanza Test"  }
\include "stanza-number-every-line.ly"

verses = \new Voice = "verses" \relative c' {
\time 4/4
\key c \major
a4 b4 c4 d4 | e2 f2 \bar "||"
}

wordsOne = \new Lyrics  \with \numberLyrics 1 \lyricsto 
"verses" {

 Here are some words to sing
}
wordsTwo = \new Lyrics \with \numberLyrics 2 \lyricsto 
"verses" {

And line up with them -- selves
}
wordsThree = \new Lyrics \with \numberLyrics 3 \lyricsto 
"verses" {

See the stanz -- as line up in place
}

\score { <<
   \new Staff{   \verses }
   \wordsOne
\wordsTwo
   \wordsThree
>>
\layout {}
}




On 7/4/2016 2:15 PM, Thomas Morley wrote:

2016-07-04 18:49 GMT+02:00 Br. Gabriel-Marie | SSPX :
Gabriel-Marie, attached you'll find the most recent 
coding. It indeed needs a newer devel-version because of 
`ly:item-get-column'-usage David, thanks a lot for your 
research and findings. Your suggestions are all 
implemented leading to geat simplifications. In 
`keep-at-line-begin' I added some fool-proof. Regrettable 
StanzaNumber does not respond correctly for 
'break-visibility... Thanks, Harm 


\version "2.19.44"

%% Thanks to David Nalesnik
%% http://lists.gnu.org/archive/html/lilypond-user/2016-07/msg00028.html

#(define create-stanza-number-grob-engraver
;; puts out a StanzaNumber for every LyricText-grob
  (lambda (context)
(let ((stanza (ly:context-property context 'stanza)))
  `((acknowledgers
  (lyric-syllable-interface .
,(lambda (engraver grob source-engraver)
  (let ((new-stanza-grob 
  (ly:engraver-make-grob engraver 'StanzaNumber '(
  (ly:grob-set-property! new-stanza-grob 'text stanza)

#(define (at-line-beginning? grob)
   (let* ((col (ly:item-get-column grob))
  (ln (ly:grob-object col 'left-neighbor))
  (col-to-check (if (ly:grob? ln) ln col)))
 (and (eq? #t (ly:grob-property col-to-check 'non-musical))
  (= 1 (ly:item-break-dir col-to-check)

#(define (keep-at-line-begin grob)
   (if (and (ly:item? grob) (not (at-line-beginning? grob)))
   (ly:grob-suicide! grob)
   grob))

keepLineStartStanzaNumbers =
\layout {
  \context {
  \Lyrics
  \override StanzaNumber.after-line-breaking =
#keep-at-line-begin
  }
}

numberLyrics =
#(define-scheme-function (nmbr)(number?)
"Return a context-modification setting @code{stanza} and consisting 
@code{create-stanza-number-grob-engraver}."
#{
  \with {
stanza = \markup \italic #(format #f "~a." nmbr)
\consists #create-stanza-number-grob-engraver
  }
#})
\header {
title = "Stanza Test"
}

\include "stanza-number-every-line.ly"


verses = \new Voice = "verses" \relative c' {
\time 4/4
\key c \major
a4 b4 c4 d4 | e2 f2 \bar "||"
}


wordsOne = \new Lyrics  \with \numberLyrics 1 \lyricsto "verses" {
 Here are some words to sing
}
wordsTwo = \new Lyrics \with \numberLyrics 2 \lyricsto "verses" {
And line up with them -- selves
}
wordsThree = \new Lyrics \with \numberLyrics 3 \lyricsto "verses" {
See the stanz -- as line up in place
}

\score {
		<<
\new Staff{   \verses }
   \wordsOne
\wordsTwo
   \wordsThree
		>>
	\layout {}
}



Stanza-Test.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: space the width of key signature

2016-07-04 Thread Thomas Morley
2016-07-04 18:49 GMT+02:00 Br. Gabriel-Marie | SSPX :
> So, Mr. Harm, I'd like to use your stanza-number-every-line but I am running
> the release version of lilypond: 2.18.2-1 and your code calls for version
> 2.19.44.  It won't compile using the older lilypond either.
>
> So, the download page only provides version 2.18.2-1.
>
> Where can I get a Windows binary for 2.19.44?
>
>
>>Meanwhile I tried to make StanzaNumber at every line-begin work, see
>> attached. Though, it's stacking workarounds, thus pretty expensive. At
>> >least it _is_ possible, even now. Maybe someone steps in futher improving
>> it. Cheers, Harm

Gabriel-Marie,

attached you'll find the most recent coding.
It indeed needs a newer devel-version because of `ly:item-get-column'-usage


David,

thanks a lot for your research and findings.
Your suggestions are all implemented leading to geat simplifications.
In `keep-at-line-begin' I added some fool-proof.
Regrettable StanzaNumber does not respond correctly for 'break-visibility...

Thanks,
  Harm
\version "2.19.44"

%% Thanks to David Nalesnik
%% http://lists.gnu.org/archive/html/lilypond-user/2016-07/msg00028.html

#(define create-stanza-number-grob-engraver
;; puts out a StanzaNumber for every LyricText-grob
  (lambda (context)
(let ((stanza (ly:context-property context 'stanza)))
  `((acknowledgers
  (lyric-syllable-interface .
,(lambda (engraver grob source-engraver)
  (let ((new-stanza-grob 
  (ly:engraver-make-grob engraver 'StanzaNumber '(
  (ly:grob-set-property! new-stanza-grob 'text stanza)

#(define (at-line-beginning? grob)
   (let* ((col (ly:item-get-column grob))
  (ln (ly:grob-object col 'left-neighbor))
  (col-to-check (if (ly:grob? ln) ln col)))
 (and (eq? #t (ly:grob-property col-to-check 'non-musical))
  (= 1 (ly:item-break-dir col-to-check)

#(define (keep-at-line-begin grob)
   (if (and (ly:item? grob) (not (at-line-beginning? grob)))
   (ly:grob-suicide! grob)
   grob))

keepLineStartStanzaNumbers =
\layout {
  \context {
  \Lyrics
  \override StanzaNumber.after-line-breaking =
#keep-at-line-begin
  }
}

numberLyrics =
#(define-scheme-function (nmbr)(number?)
"Return a context-modification setting @code{stanza} and consisting 
@code{create-stanza-number-grob-engraver}."
#{
  \with {
stanza = \markup \italic #(format #f "~a." nmbr)
\consists #create-stanza-number-grob-engraver
  }
#})


%% EXAMPLE


\paper { ragged-last-bottom = ##f }

\score {
  <<
\new Staff { \key cis \major \repeat unfold 6 {  c''4 d'' e'' } }
\new Lyrics \with \numberLyrics 1
  \lyricmode {
\repeat unfold 6 {  foo -- bar -- buzz }
  }
  
\new Lyrics \with \numberLyrics 2
  \lyricmode {
\repeat unfold 6 {  very-very-long-syllable bur -- buuuzz }
  }
  
\new Lyrics \with \numberLyrics 3
  \lyricmode {
\repeat unfold 6 {  fuu -- bla -- blibbb }
  }
  >>
  \header { piece = \markup \rounded-box \fill-line { "Using StanzaNumber" } }
  \layout { \keepLineStartStanzaNumbers }
}

\score {
  <<
\new Staff { \key cis \major \repeat unfold 6 {  c''4 d'' e'' } }
\new Lyrics \with { instrumentName = "1." shortInstrumentName = "1." }
  \lyricmode {
\repeat unfold 6 {  foo -- bar -- buzz }
  }
  
\new Lyrics \with { instrumentName = "2." shortInstrumentName = "2." }
  \lyricmode {
\repeat unfold 6 {  very-very-long-syllable bur -- buuuzz }
  }
  
\new Lyrics \with { instrumentName = "3." shortInstrumentName = "3." }
  \lyricmode {
\repeat unfold 6 {  fuu -- bla -- blibbb }
  }
  >>
  \header { piece = \markup \rounded-box \fill-line { "Using InstrumentName" } }
  \layout {
  	\context {
  \Score
  \override InstrumentName.X-offset = #'()
  \override InstrumentName.font-series = #'bold
  \override InstrumentName.font-shape = #'italic
}
  	\context {
  \Lyrics
  \revert InstrumentName.font-size
}
  }
}___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: space the width of key signature

2016-07-04 Thread Brian Barker

At 11:49 04/07/2016 -0500, Br. Gabriel-Marie | SSPX wrote:

So, the download page only provides version 2.18.2-1.


Go back to the front page and follow "Unstable Release".


Where can I get a Windows binary for 2.19.44?


http://download.linuxaudio.org/lilypond/binaries/mingw/lilypond-2.19.44-1.mingw.exe

Brian Barker 



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


Re: space the width of key signature

2016-07-04 Thread Br. Gabriel-Marie | SSPX
So, Mr. Harm, I'd like to use your stanza-number-every-line 
but I am running the release version of lilypond: 2.18.2-1 
and your code calls for version 2.19.44.  It won't compile 
using the older lilypond either.


So, the download page only provides version 2.18.2-1.

Where can I get a Windows binary for 2.19.44?

>Meanwhile I tried to make StanzaNumber at every line-begin 
work, see attached. Though, it's stacking workarounds, thus 
pretty expensive. At >least it _is_ possible, even now. 
Maybe someone steps in futher improving it. Cheers, Harm


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


Re: space the width of key signature

2016-07-04 Thread David Nalesnik
On Mon, Jul 4, 2016 at 11:05 AM, Br. Gabriel-Marie | SSPX
 wrote:
> Thanks for the discussion, fellas,
>
> So, is there an easy way for me to do this?  I only want to number every
> line.
> If I use \stanza then it only numbers the first line.
> If I use \instrumentName then it numbers correctly, but doesn't leave room
> for the repeating clef.  I can adjust the position with
>
> \layout {
> \context{ \Lyrics
>   \override LyricText #'extra-offset = #'(1.2 . 0)
> }}
>
> but that causes the top number to overlap the tail of the G-clef.
>
> Harm suggested a code he made for fixing stanza - is that okay to use?  I
> was trying to keep up with the coding discussion, but am not sure where
> things stand.

Of course, you can use his code.  It was designed specifically to
allow the use of StanzaNumber instead of InstrumentName for your
request to have stanzas marked at the beginning of every line.  Stanza
numbers simply make more sense here that coopting another type of
object.

I suggested a streamlining of his work.

It would be very helpful if you could provide a compiling tiny example
to which one of us might add in the code suggestions on the thread to
show how it all fits together.

Best,
David

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


Re: space the width of key signature

2016-07-04 Thread Br. Gabriel-Marie | SSPX

Thanks for the discussion, fellas,

So, is there an easy way for me to do this?  I only want to 
number every line.

If I use \stanza then it only numbers the first line.
If I use \instrumentName then it numbers correctly, but 
doesn't leave room for the repeating clef.  I can adjust the 
position with


\layout {
\context{ \Lyrics
  \override LyricText #'extra-offset = 
#'(1.2 . 0)

}}

but that causes the top number to overlap the tail of the 
G-clef.


Harm suggested a code he made for fixing stanza - is that 
okay to use?  I was trying to keep up with the coding 
discussion, but am not sure where things stand.


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


Re: space the width of key signature

2016-07-02 Thread David Nalesnik
On Sat, Jul 2, 2016 at 8:10 PM, David Nalesnik  wrote:

>
> I think your method is sound.  Besides the fact that it works, I
> believe that items that respond to break-visibility are treated in a
> similar manner.  I could be wrong -- and please correct me if I am --
> but multiple copies of such things as Clef are made and then thrown
> away when not needed
>
> David

Yes, Clef grobs are created at every barline and suicided later.

(The snippet

{
  c1 c c c
}

creates *5* clefs.  I simply added a printf to
Clef_engraver::create_clef to verify this.)

There is just no way to know where line breaks will be when grobs are
created, so your method is probably the only one feasible.  As
wasteful as it seems, it is the way things are done with breakable
items.

So, kudos!

David

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


Re: space the width of key signature

2016-07-02 Thread David Nalesnik
On Sat, Jul 2, 2016 at 7:53 PM, David Nalesnik  wrote:
> On Sat, Jul 2, 2016 at 7:21 PM, David Nalesnik  
> wrote:
>> On Sat, Jul 2, 2016 at 6:25 PM, Thomas Morley  
>> wrote:
>>
>>>
>>> Thanks for your code, it will be a great simplification.
>>> Now I'd love to get rid of the engraver. All those StanzaNumber-grobs,
>>> first they are created and then most of them thrown away...
>>> The exercise is to set the stanza-context-property exactly at line-break...
>>>
>>
>> Though it works :)
>>
>> Possibly some hint is to be had by looking at how clefs are managed.
>> How are clefs created by default at the beginning of staffs?
>>
>> At the moment I'm not getting very far looking at the Clef engraver
>> myself.  I'm not understanding what would trigger an explicit clef at
>> a line break, since I see no reference to line breaks anywhere.
>>
>
>
> Oh, that would be break-visibility.  I suppose StanzaNumber would have
> to support that.
>


I think your method is sound.  Besides the fact that it works, I
believe that items that respond to break-visibility are treated in a
similar manner.  I could be wrong -- and please correct me if I am --
but multiple copies of such things as Clef are made and then thrown
away when not needed

David

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


Re: space the width of key signature

2016-07-02 Thread David Nalesnik
On Sat, Jul 2, 2016 at 7:21 PM, David Nalesnik  wrote:
> On Sat, Jul 2, 2016 at 6:25 PM, Thomas Morley  
> wrote:
>
>>
>> Thanks for your code, it will be a great simplification.
>> Now I'd love to get rid of the engraver. All those StanzaNumber-grobs,
>> first they are created and then most of them thrown away...
>> The exercise is to set the stanza-context-property exactly at line-break...
>>
>
> Though it works :)
>
> Possibly some hint is to be had by looking at how clefs are managed.
> How are clefs created by default at the beginning of staffs?
>
> At the moment I'm not getting very far looking at the Clef engraver
> myself.  I'm not understanding what would trigger an explicit clef at
> a line break, since I see no reference to line breaks anywhere.
>


Oh, that would be break-visibility.  I suppose StanzaNumber would have
to support that.

DN

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


Re: space the width of key signature

2016-07-02 Thread David Nalesnik
On Sat, Jul 2, 2016 at 6:25 PM, Thomas Morley  wrote:

>
> Thanks for your code, it will be a great simplification.
> Now I'd love to get rid of the engraver. All those StanzaNumber-grobs,
> first they are created and then most of them thrown away...
> The exercise is to set the stanza-context-property exactly at line-break...
>

Though it works :)

Possibly some hint is to be had by looking at how clefs are managed.
How are clefs created by default at the beginning of staffs?

At the moment I'm not getting very far looking at the Clef engraver
myself.  I'm not understanding what would trigger an explicit clef at
a line break, since I see no reference to line breaks anywhere.

David

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


Re: space the width of key signature

2016-07-02 Thread Thomas Morley
2016-07-02 20:07 GMT+02:00 David Nalesnik :
> Hi,
>
> On Sat, Jul 2, 2016 at 12:49 PM, David Nalesnik
>  wrote:
>> Hi Harm,
>>
>> On Sat, Jul 2, 2016 at 10:43 AM, Thomas Morley  
>> wrote:
>>> 2016-07-01 20:43 GMT+02:00 Br. Gabriel-Marie | SSPX :
 Because stanza numbers only appear on the first line.  Using instrumentName
 to label verse numbers provides automatic numbering on every line.  It
 wasn't my idea, actually, credit for that goes to Thomas Morley  a few
 issues ago in Vol 163:issue 95.  It works quite well.

 On 7/1/2016 1:30 PM, lilypond-user-requ...@gnu.org wrote:
>
> Why not use StanzaNumbers instead of instrumentName to label verse
> numbers?
>>>
>>>
>>> Meanwhile I tried to make StanzaNumber at every line-begin work, see 
>>> attached.
>>> Though, it's stacking workarounds, thus pretty expensive.
>>> At least it _is_ possible, even now.
>>> Maybe someone steps in futher improving it.
>>
>> It is possible to check the break status of the NonMusicalPaperColumn
>> to the left of the StanzaNumber.  This eliminates the need to filter a
>> list of all grobs on the line.
>>
>> First, you need the StanzaNumber's column.  Then you can get its left
>> neighbor (which is needed b/c the stanza's column is a PaperColumn and
>> won't carry useful break info.).  If the neighbor is non-musical and
>> right-broken, we're at the start of the line.
>>
>> &=
>>
>> #(define (at-line-beginning? grob)
>>(let* ((col (ly:item-get-column grob))
>>   (ln (ly:grob-object col 'left-neighbor)))
>>  (not (and (eq? #t (ly:grob-property ln 'non-musical))
>>(= 1 (ly:item-break-dir ln))
>>
>> #(define (keep-stanza-number-at-line-begin grob)
>>(if (at-line-beginning? grob)
>>(ly:grob-suicide! grob)))
>>
>> &
>
> Sorry, logic fail:
>
> #(define (at-line-beginning? grob)
>(let* ((col (ly:item-get-column grob))
>   (ln (ly:grob-object col 'left-neighbor))
>   (col-to-check (if (ly:grob? ln) ln col)))
>  (and (eq? #t (ly:grob-property col-to-check 'non-musical))
>   (= 1 (ly:item-break-dir col-to-check)
>
> #(define (keep-stanza-number-at-line-begin grob)
>(if (not (at-line-beginning? grob))
>(ly:grob-suicide! grob)))
>
> %
>
> This should work with grobs whose column is itself non-musical.  So
> you could do this:
>
> \new Staff {
>   \override Staff.Clef.after-line-breaking =
>   #(lambda (grob)
>  (if (at-line-beginning? grob)
>  (set! (ly:grob-property grob 'color) red)))
>
>   c1
>   \break
>   c1 \clef bass c1
>   \break
>   \clef treble c1
> }
>
>
> %%%
>
> Best,
> DN

Thanks for your code, it will be a great simplification.
Now I'd love to get rid of the engraver. All those StanzaNumber-grobs,
first they are created and then most of them thrown away...
The exercise is to set the stanza-context-property exactly at line-break...

Thanks,
  Harm

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


Re: space the width of key signature

2016-07-02 Thread David Nalesnik
Hi,

On Sat, Jul 2, 2016 at 12:49 PM, David Nalesnik
 wrote:
> Hi Harm,
>
> On Sat, Jul 2, 2016 at 10:43 AM, Thomas Morley  
> wrote:
>> 2016-07-01 20:43 GMT+02:00 Br. Gabriel-Marie | SSPX :
>>> Because stanza numbers only appear on the first line.  Using instrumentName
>>> to label verse numbers provides automatic numbering on every line.  It
>>> wasn't my idea, actually, credit for that goes to Thomas Morley  a few
>>> issues ago in Vol 163:issue 95.  It works quite well.
>>>
>>> On 7/1/2016 1:30 PM, lilypond-user-requ...@gnu.org wrote:

 Why not use StanzaNumbers instead of instrumentName to label verse
 numbers?
>>
>>
>> Meanwhile I tried to make StanzaNumber at every line-begin work, see 
>> attached.
>> Though, it's stacking workarounds, thus pretty expensive.
>> At least it _is_ possible, even now.
>> Maybe someone steps in futher improving it.
>
> It is possible to check the break status of the NonMusicalPaperColumn
> to the left of the StanzaNumber.  This eliminates the need to filter a
> list of all grobs on the line.
>
> First, you need the StanzaNumber's column.  Then you can get its left
> neighbor (which is needed b/c the stanza's column is a PaperColumn and
> won't carry useful break info.).  If the neighbor is non-musical and
> right-broken, we're at the start of the line.
>
> &=
>
> #(define (at-line-beginning? grob)
>(let* ((col (ly:item-get-column grob))
>   (ln (ly:grob-object col 'left-neighbor)))
>  (not (and (eq? #t (ly:grob-property ln 'non-musical))
>(= 1 (ly:item-break-dir ln))
>
> #(define (keep-stanza-number-at-line-begin grob)
>(if (at-line-beginning? grob)
>(ly:grob-suicide! grob)))
>
> &

Sorry, logic fail:

#(define (at-line-beginning? grob)
   (let* ((col (ly:item-get-column grob))
  (ln (ly:grob-object col 'left-neighbor))
  (col-to-check (if (ly:grob? ln) ln col)))
 (and (eq? #t (ly:grob-property col-to-check 'non-musical))
  (= 1 (ly:item-break-dir col-to-check)

#(define (keep-stanza-number-at-line-begin grob)
   (if (not (at-line-beginning? grob))
   (ly:grob-suicide! grob)))

%

This should work with grobs whose column is itself non-musical.  So
you could do this:

\new Staff {
  \override Staff.Clef.after-line-breaking =
  #(lambda (grob)
 (if (at-line-beginning? grob)
 (set! (ly:grob-property grob 'color) red)))

  c1
  \break
  c1 \clef bass c1
  \break
  \clef treble c1
}


%%%

Best,
DN

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


Re: space the width of key signature

2016-07-02 Thread David Nalesnik
Hi Harm,

On Sat, Jul 2, 2016 at 10:43 AM, Thomas Morley  wrote:
> 2016-07-01 20:43 GMT+02:00 Br. Gabriel-Marie | SSPX :
>> Because stanza numbers only appear on the first line.  Using instrumentName
>> to label verse numbers provides automatic numbering on every line.  It
>> wasn't my idea, actually, credit for that goes to Thomas Morley  a few
>> issues ago in Vol 163:issue 95.  It works quite well.
>>
>> On 7/1/2016 1:30 PM, lilypond-user-requ...@gnu.org wrote:
>>>
>>> Why not use StanzaNumbers instead of instrumentName to label verse
>>> numbers?
>
>
> Meanwhile I tried to make StanzaNumber at every line-begin work, see attached.
> Though, it's stacking workarounds, thus pretty expensive.
> At least it _is_ possible, even now.
> Maybe someone steps in futher improving it.

It is possible to check the break status of the NonMusicalPaperColumn
to the left of the StanzaNumber.  This eliminates the need to filter a
list of all grobs on the line.

First, you need the StanzaNumber's column.  Then you can get its left
neighbor (which is needed b/c the stanza's column is a PaperColumn and
won't carry useful break info.).  If the neighbor is non-musical and
right-broken, we're at the start of the line.

&=

#(define (at-line-beginning? grob)
   (let* ((col (ly:item-get-column grob))
  (ln (ly:grob-object col 'left-neighbor)))
 (not (and (eq? #t (ly:grob-property ln 'non-musical))
   (= 1 (ly:item-break-dir ln))

#(define (keep-stanza-number-at-line-begin grob)
   (if (at-line-beginning? grob)
   (ly:grob-suicide! grob)))

&

The override to use would be:

%
\override StanzaNumber.after-line-breaking =
#keep-stanza-number-at-line-begin
&

I don't know how infallible this is :)

Hope this is useful!

David

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


Re: space the width of key signature

2016-07-02 Thread Thomas Morley
2016-07-01 20:43 GMT+02:00 Br. Gabriel-Marie | SSPX :
> Because stanza numbers only appear on the first line.  Using instrumentName
> to label verse numbers provides automatic numbering on every line.  It
> wasn't my idea, actually, credit for that goes to Thomas Morley  a few
> issues ago in Vol 163:issue 95.  It works quite well.
>
> On 7/1/2016 1:30 PM, lilypond-user-requ...@gnu.org wrote:
>>
>> Why not use StanzaNumbers instead of instrumentName to label verse
>> numbers?


Meanwhile I tried to make StanzaNumber at every line-begin work, see attached.
Though, it's stacking workarounds, thus pretty expensive.
At least it _is_ possible, even now.
Maybe someone steps in futher improving it.

Cheers,
  Harm
\version "2.19.44"

#(define create-stanza-number-grob-engraver
;; puts out a StanzaNumber for every LyricText-grob
  (lambda (context)
   (let ((stanza (ly:context-property context 'stanza)))
 `((acknowledgers
 (lyric-syllable-interface .
   ,(lambda (engraver grob source-engraver)
 (let ((new-stanza-grob 
 (ly:engraver-make-grob engraver 'StanzaNumber '(
 ;; set 'id to select them later
 (ly:grob-set-property! new-stanza-grob 'id (markup->string stanza))
 (ly:grob-set-property! new-stanza-grob 'text stanza)
 
#(define (delete-adjacent-duplicates lst)
"Delete all duplicates in a list of strings."
  (if (and (not (null? lst)) (every string? lst))
  (fold-right (lambda (elem ret)
(if (equal? elem (first ret))
ret
(cons elem ret)))
  (list (last lst))
  (sort lst stringlist (ly:grob-object sys 'all-elements)))
   ;; get all StanzaNumbers
   (stanzas
 (filter
   (lambda (e)
 (grob::has-interface e 'stanza-number-interface))
   all-elts))
   ;; get all stanza-ids, without duplicates
   (stanza-ids
 (delete-adjacent-duplicates
   (filter
 string?
 (map
   (lambda (x)
 (ly:grob-property x 'id))
   stanzas
   ;; put StanzaNumbers into sub-lists according to the 'id
   (id-selected-stanzas
 (map
   (lambda (val)
 (filter
   (lambda (x)
 (equal? (ly:grob-property x 'id) val))
   stanzas))
   stanza-ids)))
  ;; keep only the first StanzaNumber of every line
  ;; all other's stencil is set #f
  ;; TODO there may be a StanzaNumber not catchable this way
  (for-each
 (lambda (lst)
   (if (not (null? (cdr lst)))
   (for-each
 (lambda (stz)
   (ly:grob-set-property! stz 'stencil #f))
 (cdr lst
 id-selected-stanzas)

keepLineStartStanzaNumbers =
\layout {
  \context {
  \Score
  \override NonMusicalPaperColumn.after-line-breaking = 
#keep-stanza-number-at-line-begin
  }
}

numberLyrics =
#(define-scheme-function (nmbr)(number?)
"Return a context-modification setting @code{stanza} and consisting 
@code{create-stanza-number-grob-engraver}."
#{
  \with {
stanza = \markup \italic #(format #f "~a." nmbr)
\consists #create-stanza-number-grob-engraver
  }
#})


%% EXAMPLE


\paper { ragged-last-bottom = ##f }

\score {
  <<
\new Staff { \key cis \major \repeat unfold 6 {  c''4 d'' e'' } }
\new Lyrics \with \numberLyrics 1
  \lyricmode {
\repeat unfold 6 {  foo -- bar -- buzz }
  }
  
\new Lyrics \with \numberLyrics 2
  \lyricmode {
\repeat unfold 6 {  very-very-long-syllable bur -- buuuzz }
  }
  
\new Lyrics \with \numberLyrics 3
  \lyricmode {
\repeat unfold 6 {  fuu -- bla -- blibbb }
  }
  >>
  \header { piece = \markup \rounded-box \fill-line { "Using StanzaNumber" } }
  \layout { \keepLineStartStanzaNumbers }
}

\score {
  <<
\new Staff { \key cis \major \repeat unfold 6 {  c''4 d'' e'' } }
\new Lyrics \with { instrumentName = "1." shortInstrumentName = "1." }
  \lyricmode {
\repeat unfold 6 {  foo -- bar -- buzz }
  }
  
\new Lyrics \with { instrumentName = "2." shortInstrumentName = "2." }
  \lyricmode {
\repeat unfold 6 {  very-very-long-syllable bur -- buuuzz }
  }
  
\new Lyrics \with { instrumentName = "3." shortInstrumentName = "3." }
  \lyricmode {
\repeat unfold 6 {  fuu -- bla -- blibbb }
  }
  >>
  \header { piece = \markup \rounded-box \fill-line { "Using InstrumentName" } }
  \layout {
  	\context {
  \Score
  \ove

Re: space the width of key signature

2016-07-02 Thread Simon Albrecht
This kind of problems clearly shows that it would be better to have a 
possibility of using actual stanza numbers. I created 
.


Best, Simon

On 01.07.2016 17:46, Br. Gabriel-Marie | SSPX wrote:
There is this one song that is in c-minor and so the key signature 
shows the three flat signs at the beginning of each staff.


But c-major doesn't need any extra signs.

However, I am numbering my lyrics like this so that I get numbers on 
every line:

\new Lyrics \with { instrumentName = "8." shortInstrumentName = "8." }

\context{
\Lyrics
%  Verse numbering using instrumentname
\override InstrumentName.X-offset = 3
\override InstrumentName.font-size = 0
}

This puts my numbering just under the three flat signs in c-minor.

But my problem is that in c-major the lyric text overlaps the numbers.

So, how can I insert a "blank" in the staff where I'd normally have 
the three flats?  (I'm looking in the docs at \staff and horizontal 
spacing)



___
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: space the width of key signature

2016-07-01 Thread Karlin High
On 7/1/2016 12:18 PM, Dominic wrote:
> Why not use StanzaNumbers instead of instrumentName to label verse numbers?
> http://lilypond.org/doc/v2.19/Documentation/notation/stanzas
>
Br. Gabriel Marie: Is the need for a stanza number at each line caused 
by having so many stanza that readers lose their places when they move 
to a new line?

Karlin High
Missouri, USA

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


Re: space the width of key signature

2016-07-01 Thread Br. Gabriel-Marie | SSPX
Because stanza numbers only appear on the first line.  Using 
instrumentName to label verse numbers provides automatic 
numbering on every line.  It wasn't my idea, actually, 
credit for that goes to Thomas Morley  a few issues ago in 
Vol 163:issue 95.  It works quite well.


On 7/1/2016 1:30 PM, lilypond-user-requ...@gnu.org wrote:

Why not use StanzaNumbers instead of instrumentName to label verse numbers?



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


Re: space the width of key signature

2016-07-01 Thread Dominic
Why not use StanzaNumbers instead of instrumentName to label verse numbers?
http://lilypond.org/doc/v2.19/Documentation/notation/stanzas



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/space-the-width-of-key-signature-tp192079p192083.html
Sent from the User mailing list archive at Nabble.com.

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


Re: space the width of key signature

2016-07-01 Thread Br. Gabriel-Marie | SSPX

Ah!  I think I got this one:

 \override LyricText #'extra-offset = #'(0.8 . 0)

This will allow me to add extra space between the numbers 
(which are in the right place) and the start of the lyric text.


On 7/1/2016 10:46 AM, Br. Gabriel-Marie | SSPX wrote:
There is this one song that is in c-minor and so the key 
signature shows the three flat signs at the beginning of 
each staff.


But c-major doesn't need any extra signs.

However, I am numbering my lyrics like this so that I get 
numbers on every line:
\new Lyrics \with { instrumentName = "8." 
shortInstrumentName = "8." }


\context{
\Lyrics
%  Verse numbering using instrumentname
\override InstrumentName.X-offset = 3
\override InstrumentName.font-size = 0
}

This puts my numbering just under the three flat signs in 
c-minor.


But my problem is that in c-major the lyric text overlaps 
the numbers.


So, how can I insert a "blank" in the staff where I'd 
normally have the three flats?  (I'm looking in the docs 
at \staff and horizontal spacing)


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


space the width of key signature

2016-07-01 Thread Br. Gabriel-Marie | SSPX
There is this one song that is in c-minor and so the key 
signature shows the three flat signs at the beginning of 
each staff.


But c-major doesn't need any extra signs.

However, I am numbering my lyrics like this so that I get 
numbers on every line:
\new Lyrics \with { instrumentName = "8." 
shortInstrumentName = "8." }


\context{
\Lyrics
%  Verse numbering using instrumentname
\override InstrumentName.X-offset = 3
\override InstrumentName.font-size = 0
}

This puts my numbering just under the three flat signs in 
c-minor.


But my problem is that in c-major the lyric text overlaps 
the numbers.


So, how can I insert a "blank" in the staff where I'd 
normally have the three flats?  (I'm looking in the docs at 
\staff and horizontal spacing)
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user