Re: strict notespacing with lyrics

2017-04-24 Thread Simon Albrecht

Am 24.04.2017 um 19:19 schrieb Urs Liska:

Maybe we could revive the stalled lyric project?  Janek did a lot of
work breaking lyric issues down into manageable chunks.

Where is this available?


They are around a dozen issues, around #2450. I don’t know if the Lyrics 
project label made its way to sourceforge.


Best, Simon

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


Re: strict notespacing with lyrics

2017-04-24 Thread Urs Liska


Am 24. April 2017 18:50:47 MESZ schrieb David Nalesnik 
:

>>
>
>This seems to me to be an extremely complex undertaking, involving a
>rewrite of a lot of spacing code.  I would vote to implement something
>more modest, a simple adjustment of self-alignment-X, as per Abraham's
>suggestion.  Much more likely to get takers.
>

Sounds reasonable.

>Maybe we could revive the stalled lyric project?  Janek did a lot of
>work breaking lyric issues down into manageable chunks.

Where is this available?

Urs
>
>My 2 cents...
>
>David
>
>___
>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: strict notespacing with lyrics

2017-04-24 Thread David Nalesnik
On Mon, Apr 24, 2017 at 11:13 AM, Kieren MacMillan
 wrote:
> Abraham,
>
>> So, the real question is this: can we make LyricText.self-alignment-X 
>> dynamic instead of static? In other words, can we use a springs-like 
>> mechanism between LyricText syllables, but that are more flexible than the 
>> springs-and-rods between NoteColumns? That way, the NoteColumns would more 
>> likely get into their normal rhythmic positions and the LyricText grobs 
>> could float horizontally a bit, pushing each other around within their -1 to 
>> 1 self-alignment-X range.
>
> This sounds really familiar…  ;)
>
>> Looking forward to everyone's thoughts on the matter.
>
> Love the basic idea — now let’s polish it, and implement it!
>
> 1. There should be a way to “group” a set of notes [with attached lyrics] — 
> from 2 adjacent notes all the way up to “the whole score” — and then set the 
> rigidity of the note-springs and lyric-springs as separate parameters.
>
> 2. There should be a parameter for how much “flex" the block has. Say you set 
> notes.spring-rigidity = #1, so that Lilypond forces the notes to be “in 
> perfect proportion” (essentially ignoring the lyrics). If the block of lyrics 
> underneath are (e.g.) twice as wide as the set of notes, it would be nice for 
> Lilypond to take that into account. Naively: perhaps Lily should try to 
> compute the minimum amount of horizontal space required for the associated 
> lyrics, and use that width as a ‘frame’ in which the notes are then 
> distributed “perfectly”?
>

This seems to me to be an extremely complex undertaking, involving a
rewrite of a lot of spacing code.  I would vote to implement something
more modest, a simple adjustment of self-alignment-X, as per Abraham's
suggestion.  Much more likely to get takers.

Maybe we could revive the stalled lyric project?  Janek did a lot of
work breaking lyric issues down into manageable chunks.

My 2 cents...

David

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


Re: strict notespacing with lyrics

2017-04-24 Thread Kieren MacMillan
Abraham,

> So, the real question is this: can we make LyricText.self-alignment-X dynamic 
> instead of static? In other words, can we use a springs-like mechanism 
> between LyricText syllables, but that are more flexible than the 
> springs-and-rods between NoteColumns? That way, the NoteColumns would more 
> likely get into their normal rhythmic positions and the LyricText grobs could 
> float horizontally a bit, pushing each other around within their -1 to 1 
> self-alignment-X range.

This sounds really familiar…  ;)

> Looking forward to everyone's thoughts on the matter.

Love the basic idea — now let’s polish it, and implement it!

1. There should be a way to “group” a set of notes [with attached lyrics] — 
from 2 adjacent notes all the way up to “the whole score” — and then set the 
rigidity of the note-springs and lyric-springs as separate parameters.

2. There should be a parameter for how much “flex" the block has. Say you set 
notes.spring-rigidity = #1, so that Lilypond forces the notes to be “in perfect 
proportion” (essentially ignoring the lyrics). If the block of lyrics 
underneath are (e.g.) twice as wide as the set of notes, it would be nice for 
Lilypond to take that into account. Naively: perhaps Lily should try to compute 
the minimum amount of horizontal space required for the associated lyrics, and 
use that width as a ‘frame’ in which the notes are then distributed “perfectly”?

Looking forward to seeing where this goes!
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: strict notespacing with lyrics

2017-04-24 Thread tisimst
On Sun, Apr 23, 2017 at 8:09 AM, Kieren MacMillan [via Lilypond] <
ml+s1069038n202546...@n5.nabble.com> wrote:

> Hi Johannes,
>
> any ideas how to get a more even - ot lets say rhytmic - distribution of
> the notes with lyrics?
>
>
> This is an ongoing frustration I have. (I *just* talked about this
> off-list with Abraham a few days ago!)
>
> may be there is a way to get a little bit more even spacing?
>
>
> There are many ways — but they all require manual effort.
>

So, the real question is this: can we make LyricText.self-alignment-X
dynamic instead of static? In other words, can we use a springs-like
mechanism between LyricText syllables, but that are more flexible than the
springs-and-rods between NoteColumns? That way, the NoteColumns would more
likely get into their normal rhythmic positions and the LyricText grobs
could float horizontally a bit, pushing each other around within their -1
to 1 self-alignment-X range. I'm only brainstorming, but it seems that this
would be a generally good approach to provide the least disruption of note
spacing.

Looking forward to everyone's thoughts on the matter.

Best,
Abraham




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/strict-notespacing-with-lyrics-tp202543p202588.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: strict notespacing with lyrics

2017-04-23 Thread Simon Albrecht

Am 23.04.2017 um 21:43 schrieb Noeck:

Hi Simon,

so far I used quite a few self-alignment tweaks (with a short-cut
command). Your function looks helpful. Could you explain a bit what it
does. IIUC the extreme cases are "centered" if there is only few space
and "almost left aligned" if there is a lot of space and in between you
interpolate smoothly.

But what how is the space determined? It does not use the durations,
does it? Is it about the available space or the with of a syllable or both?


Actually the function is very naive. It exclusively looks at the width 
of the syllable. If that width is 3 (staff-spaces) or less, 
self-alignment-X is set to 0, if it is 11 or more, self-alignment-X is 
-0.8. Between that, I interpolate smoothly with a ridiculous amount of 
effort that I only made for fun :-) (i.e. the kind of fun that I have 
recalling/finding out again how to solve a quadratic equation and 
implementing that in Scheme)

For everything else, an engraver would be needed.

Best, Simon

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


Re: strict notespacing with lyrics

2017-04-23 Thread Noeck
Hi Simon,

so far I used quite a few self-alignment tweaks (with a short-cut
command). Your function looks helpful. Could you explain a bit what it
does. IIUC the extreme cases are "centered" if there is only few space
and "almost left aligned" if there is a lot of space and in between you
interpolate smoothly.

But what how is the space determined? It does not use the durations,
does it? Is it about the available space or the with of a syllable or both?

Cheers,
Joram

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


Re: strict notespacing with lyrics

2017-04-23 Thread Simon Albrecht

Am 23.04.2017 um 13:00 schrieb Johannes Roeßler:
any ideas how to get a more even - ot lets say rhythmic - distribution 
of the notes with lyrics?


To add to Kieren’s suggestions:
– Obviously, fonts with an overall smaller width help. LilyPond’s 
default (Century Schoolbook) isn’t the best choice in that regard.
– I even use a script to automatically tweak self-alignment-X for longer 
syllables, see attachment. It greatly reduces the need for manual 
intervention.
–  and 
: there’s a lot 
of work to be done on lyrics, and Janek put some of it up as this 
‘Lyrics project’, which unfortunately nobody has tackled yet…


HTH, Simon
\version "2.19.25"

#(define (lyric-text::interpolate-alignment grob)
   (let*
((width (cdr (ly:grob-property grob 'X-extent)))

 (lower-threshold 3)
 (upper-threshold 11)
 (maximum (- 4/5))
 
 ;; calculate parameters for use in the ‘sigmoid’ cubic function with
 ;; (sigmoid lower-threshold) --> 0
 ;; (sigmoid upper-threshold) --> maximum
 ;; and zero ‘slope’ in both these points, i.e. a smooth transition between
 ;; constants and interpolation
 
 (a (/ (* 2 maximum)
  (+ (- (expt upper-threshold 3))
(* 3 upper-threshold upper-threshold lower-threshold)
(* -3 upper-threshold lower-threshold lower-threshold)
(expt lower-threshold 3
 (b (/ (- maximum (* a (+ (expt upper-threshold 3)
 (* 2 (expt lower-threshold 3))
 (* -3 upper-threshold (expt lower-threshold 2)
  (expt (- upper-threshold lower-threshold) 2)))
 (c (/ (- maximum
  (* b (- (expt upper-threshold 2) (expt lower-threshold 2)))
  (* a (- (expt upper-threshold 3) (expt lower-threshold 3
   (- upper-threshold lower-threshold)))
 (d (- maximum
  (* upper-threshold c)
  (* (expt upper-threshold 2) b)
  (* (expt upper-threshold 3) a)))

 (sigmoid (lambda (x) (+ (* a x x x) (* b x x) (* c x) d

;(format #t "The four parameters have been determined as: \n a ~a \n b ~a 
\n c ~a \n d ~a\n" a b c d)

(cond
 ((<= width lower-threshold) 0)
 ((< lower-threshold width upper-threshold)
  (sigmoid width))
 ((>= width upper-threshold) maximum

\layout {
  \context {
\Lyrics
\override LyricText.self-alignment-X = #lyric-text::interpolate-alignment
  }
}___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: strict notespacing with lyrics

2017-04-23 Thread Kieren MacMillan
Hi Johannes,

> any ideas how to get a more even - ot lets say rhytmic - distribution of the 
> notes with lyrics?

This is an ongoing frustration I have. (I *just* talked about this off-list 
with Abraham a few days ago!)

> may be there is a way to get a little bit more even spacing?

There are many ways — but they all require manual effort. Here are two obvious 
ones.

SOLUTION #1: Increase the default score spacing.

Add

\layout {
  \context {
\Score
\override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/128)
  }
}

at the top of your score (adjusting the 1/128 as desired). Result:



SOLUTION #2: Shift the ‘Herrn’ to the right [from its default, which is centred 
on the notehead].

Add

\tweak self-alignment-X #-0.5

right before “Herrn” (adjusting the -0.5 as desired). Result:


This isn’t perfect, but it’s better — and you can do more, by adjusting other 
syllables.

There are other ways, but this should get you started.

Hope this helps!
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


strict notespacing with lyrics

2017-04-23 Thread Johannes Roeßler

Hi,

any ideas how to get a more even - ot lets say rhytmic - distribution of 
the notes with lyrics?
In this example I don't like the gap after the 4th quaver in the upper 
voice caused by the long syllable "Herrn" in the second voice.
I know, it will become ugly for very long syllables - but may be there 
is a way to get a little bit more even spacing?
(and yes - I searched the archive - but maybe my english isn't good 
enough to find the matching search terms :( )


-8<--

\version "2.19.58"

global = {
  \autoBeamOff
}

soprano = \relative c'' {
  \global
  a8 a a a a a a4
}

alto = \relative c' {
  \global
  a4 a8 a a4 a8 a
}

sopranoVerse = \lyricmode {
  sein, da -- heim zu sein da -- heim
}

altoVerse = \lyricmode {
  sein bei dem Herrn und da
}

\score {
  \new ChoirStaff <<
\new Staff  \soprano
\addlyrics { \sopranoVerse }
\new Staff  \alto
\addlyrics { \altoVerse }
  >>
}

->8--

cheers Joei

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