Re: is the lyric tie tweakable?

2018-04-24 Thread Risto Vääräniemi
Hi Kieren, David & all,

I was searching for a way to shift the lyric tie around and I found this
thread from a year back. It looked promising and so I tried David's cool
looking tiedLyricOverrides thingy but it only worked partially. I can
adjust the word-space but the left-pad does not have any effect. It doesn't
matter if I enter positive or negative values. The word-space accepts
negative values, though. How should the left-pad affect the text-tie-text
combo?

For most of the time the default results are fine for me but if there's a
comma between the syllables, e.g. "ro,~e" I'd like to move the tie just a
little bit to the left (negative padding) while keeping the space as it is.
I'm currently using 2.19.65 but I tested it also on .55 with similar
results. I attached the default results and the desired results as an image.

As a plan B I tried to use markup as the text following the tie (so I could
use negative hspace or something to shift the second part) but that did not
seem to work. The text inside the markup was attached to the following note.

Now we get to plan C... I found a way to cheat the system to get what I
wanted but I'd really appreciate a "proper" way to move the tie around. If
I use it for different text I'll have to tweak the X-offset of the tie
glyph.
\markup \combine "ro, e" { \translate #'(3 . 0)  \musicglyph
#"ties.lyric.default" }

Any other pointers? Did I miss something? Perfectionist? Moi? :-)

BR,
Risto



On 26 April 2017 at 03:48, David Nalesnik  wrote:

> On Tue, Apr 25, 2017 at 7:45 PM, David Nalesnik
>  wrote:
> > On Tue, Apr 25, 2017 at 7:16 PM, Kieren MacMillan
> >  wrote:
> >> Hi David,
> >>
> >>> \markup \tied-lyric \override #'(word-space . 2) #"le,~au”
> >>
> >> Bingo! Didn’t even need to add the extra parameters!
> >>
> >>> Don't know at the moment how to make this less cumbersome.
> >>
> >> I don’t need this to be less cumbersome — this completely solves my
> original problem.
> >> (But this exercise did serve to fractionally increase my Scheme-fu…)
> >>
> >
> > Nice to hear!
> >
> > In any case, here's an experiment.  It allows for varying the
> > parameters within the lyricmode expression:
> >
> > \version "2.19.59"
> >
> > #(define (lyric-text::special-print overrides)
> >(lambda (grob)
> >  (let ((text (ly:grob-property grob 'text)))
> >(grob-interpret-markup
> > grob
> > (if (string? text)
> > (fold
> >  make-override-markup
> >  (make-tied-lyric-markup text)
> >  overrides)
> > text)
> >
> > tiedLyricOverrides =
> > #(define-music-function (overrides) (list?)
> >#{
> >  \override Lyrics.LyricText.stencil = #(lyric-text::special-print
> overrides)
> >#})
> > {
> >   \relative {
> > \autoBeamOff
> > r8 b' c fis, fis c' b e,
> >   }
> >   \addlyrics {
> > \tiedLyricOverrides #'((word-space . 5) (left-pad . 3))
> > Che~in ques -- ta~e~in quel -- l'al -- tr'on -- da
> >   }
> > }
> >
> > %%
> >
> > Of course, you'd need to add the left-pad property and functionality
> > to \tied-lyric for it to have any effect.
> >
>
> One more thing: you can use \once too.
>
> ___
> 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: is the lyric tie tweakable?

2017-04-25 Thread David Nalesnik
On Tue, Apr 25, 2017 at 7:45 PM, David Nalesnik
 wrote:
> On Tue, Apr 25, 2017 at 7:16 PM, Kieren MacMillan
>  wrote:
>> Hi David,
>>
>>> \markup \tied-lyric \override #'(word-space . 2) #"le,~au”
>>
>> Bingo! Didn’t even need to add the extra parameters!
>>
>>> Don't know at the moment how to make this less cumbersome.
>>
>> I don’t need this to be less cumbersome — this completely solves my original 
>> problem.
>> (But this exercise did serve to fractionally increase my Scheme-fu…)
>>
>
> Nice to hear!
>
> In any case, here's an experiment.  It allows for varying the
> parameters within the lyricmode expression:
>
> \version "2.19.59"
>
> #(define (lyric-text::special-print overrides)
>(lambda (grob)
>  (let ((text (ly:grob-property grob 'text)))
>(grob-interpret-markup
> grob
> (if (string? text)
> (fold
>  make-override-markup
>  (make-tied-lyric-markup text)
>  overrides)
> text)
>
> tiedLyricOverrides =
> #(define-music-function (overrides) (list?)
>#{
>  \override Lyrics.LyricText.stencil = #(lyric-text::special-print 
> overrides)
>#})
> {
>   \relative {
> \autoBeamOff
> r8 b' c fis, fis c' b e,
>   }
>   \addlyrics {
> \tiedLyricOverrides #'((word-space . 5) (left-pad . 3))
> Che~in ques -- ta~e~in quel -- l'al -- tr'on -- da
>   }
> }
>
> %%
>
> Of course, you'd need to add the left-pad property and functionality
> to \tied-lyric for it to have any effect.
>

One more thing: you can use \once too.

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


Re: is the lyric tie tweakable?

2017-04-25 Thread David Nalesnik
On Tue, Apr 25, 2017 at 7:16 PM, Kieren MacMillan
 wrote:
> Hi David,
>
>> \markup \tied-lyric \override #'(word-space . 2) #"le,~au”
>
> Bingo! Didn’t even need to add the extra parameters!
>
>> Don't know at the moment how to make this less cumbersome.
>
> I don’t need this to be less cumbersome — this completely solves my original 
> problem.
> (But this exercise did serve to fractionally increase my Scheme-fu…)
>

Nice to hear!

In any case, here's an experiment.  It allows for varying the
parameters within the lyricmode expression:

\version "2.19.59"

#(define (lyric-text::special-print overrides)
   (lambda (grob)
 (let ((text (ly:grob-property grob 'text)))
   (grob-interpret-markup
grob
(if (string? text)
(fold
 make-override-markup
 (make-tied-lyric-markup text)
 overrides)
text)

tiedLyricOverrides =
#(define-music-function (overrides) (list?)
   #{
 \override Lyrics.LyricText.stencil = #(lyric-text::special-print overrides)
   #})
{
  \relative {
\autoBeamOff
r8 b' c fis, fis c' b e,
  }
  \addlyrics {
\tiedLyricOverrides #'((word-space . 5) (left-pad . 3))
Che~in ques -- ta~e~in quel -- l'al -- tr'on -- da
  }
}

%%

Of course, you'd need to add the left-pad property and functionality
to \tied-lyric for it to have any effect.

Hope this is useful.  I'm not sure!

David

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


Re: is the lyric tie tweakable?

2017-04-25 Thread Kieren MacMillan
Hi David,

> \markup \tied-lyric \override #'(word-space . 2) #"le,~au”

Bingo! Didn’t even need to add the extra parameters!

> Don't know at the moment how to make this less cumbersome.

I don’t need this to be less cumbersome — this completely solves my original 
problem.
(But this exercise did serve to fractionally increase my Scheme-fu…)

Thanks,
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: is the lyric tie tweakable?

2017-04-25 Thread David Nalesnik
On Tue, Apr 25, 2017 at 6:38 PM, Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi David,
>
> \override is actually a markup command here,
>
> and as such needs to be preceded by \markup.
>
>
> But then it doesn’t execute the lyric tie function *at all*:
>
>
>
>
\markup \tied-lyric \override #'(word-space . 2) #"le,~au"

Don't know at the moment how to make this less cumbersome.

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


Re: is the lyric tie tweakable?

2017-04-25 Thread Kieren MacMillan
Hi David,

> \override is actually a markup command here,
> and as such needs to be preceded by \markup.

But then it doesn’t execute the lyric tie function *at all*:



Thanks,
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: is the lyric tie tweakable?

2017-04-25 Thread David Nalesnik
On Tue, Apr 25, 2017 at 5:50 PM, Kieren MacMillan
 wrote:
> Hi David,
>
>> These properties are accessed like
>> \override #'(left-pad . -1)
>> as any markup override.
>
> I tried that, of course — it returns
>
> error: not a key
>   \override
> #'(left-pad . -1) le,~au soir, __ à __ la chan -- del -- le, __
>
> This is in a \lyricmode block, if that makes a difference.
>

\override is actually a markup command here, and as such needs to be
preceded by \markup.

-David

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


Re: is the lyric tie tweakable?

2017-04-25 Thread Kieren MacMillan
Hi David,

> These properties are accessed like
> \override #'(left-pad . -1)
> as any markup override.

I tried that, of course — it returns

error: not a key
  \override 
#'(left-pad . -1) le,~au soir, __ à __ la chan -- del -- le, __

This is in a \lyricmode block, if that makes a difference.

Thanks,
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: is the lyric tie tweakable?

2017-04-25 Thread David Nalesnik
On Tue, Apr 25, 2017 at 4:09 PM, Kieren MacMillan
 wrote:
> Hi David (et al.),
>
 Is the built-in** lyric tie/elision tweakable?
>>
>>> There's no LyricTie grob, so no convenient way to tweak it.   You
>>> could modify "tied-lyric" in scm/define-markup-commands.scm, since
>>> that's what's engaged with the tilde.
>>
>> I can’t seem to figure out how to add left-pad and right-pad as properties 
>> (with default 0)
>
> Okay, I believe I’ve solved that problem:
>
>   #:properties ((word-space)
> (left-pad 0)
> (right-pad 0))
>
> But how do I tweak the parameter in my input? I’ve tried things like
>
> \tweak left-pad #-1 le,~au
>

These properties are accessed like

\override #'(left-pad . -1)

as any markup override.

-David

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


Re: is the lyric tie tweakable?

2017-04-25 Thread Kieren MacMillan
Hi David (et al.),

>>> Is the built-in** lyric tie/elision tweakable?
> 
>> There's no LyricTie grob, so no convenient way to tweak it.   You
>> could modify "tied-lyric" in scm/define-markup-commands.scm, since
>> that's what's engaged with the tilde.
> 
> I can’t seem to figure out how to add left-pad and right-pad as properties 
> (with default 0)

Okay, I believe I’ve solved that problem:

  #:properties ((word-space)
(left-pad 0)
(right-pad 0))

But how do I tweak the parameter in my input? I’ve tried things like

\tweak left-pad #-1 le,~au

to no avail. Any help appreciated.

Thanks,
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: is the lyric tie tweakable?

2017-04-24 Thread Kieren MacMillan
Hi David (et al.),

>> Is the built-in** lyric tie/elision tweakable?

> There's no LyricTie grob, so no convenient way to tweak it.   You
> could modify "tied-lyric" in scm/define-markup-commands.scm, since
> that's what's engaged with the tilde.

I manually tweaked that function (see snippet, below), by adding an #:hspace 
-1.25 and #:hspace -1 as “[negative] padding”. The default gives


while the tweaked version gives the far more pleasing


But I can’t seem to figure out how to add left-pad and right-pad as properties 
(with default 0) — I keep getting “unbound variable” errors. If anyone could 
help, I’d appreciate it.

Thanks,
Kieren.

%%%  SNIPPET BEGINS
(define-markup-command (tied-lyric layout props str)
  (string?)
  #:category music
  #:properties ((word-space))
  "
@cindex simple text strings with tie characters

Like simple-markup, but use tie characters for @q{~} tilde symbols.

@lilypond[verbatim,quote]
\\markup \\column {
  \\tied-lyric #\"Siam navi~all'onde~algenti Lasciate~in abbandono\"
  \\tied-lyric #\"Impetuosi venti I nostri~affetti sono\"
  \\tied-lyric #\"Ogni diletto~e scoglio Tutta la vita~e~un mar.\"
}
@end lilypond"
  (define (replace-ties tie str)
(if (string-contains str "~")
(let*
((half-space (/ word-space 2))
 (parts (string-split str #\~))
 (tie-str (markup #:hspace half-space #:hspace -1.25
  #:musicglyph tie
  #:hspace half-space #:hspace -1))
 (joined  (list-join parts tie-str)))
  (make-concat-markup joined))
str))

  (define short-tie-regexp (make-regexp "~[^.]~"))
  (define (match-short str) (regexp-exec short-tie-regexp str))

  (define (replace-short str mkp)
(let ((match (match-short str)))
  (if (not match)
  (make-concat-markup (list
   mkp
   (replace-ties "ties.lyric.default" str)))
  (let ((new-str (match:suffix match))
(new-mkp (make-concat-markup (list
  mkp
  (replace-ties "ties.lyric.default"
(match:prefix 
match))
  (replace-ties "ties.lyric.short"
(match:substring 
match))
(replace-short new-str new-mkp)

  (interpret-markup layout
props
(replace-short str (markup
  SNIPPET ENDS


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: is the lyric tie tweakable?

2017-04-20 Thread David Nalesnik
On Thu, Apr 20, 2017 at 6:02 PM, Kieren MacMillan
 wrote:
> Hi all,
>
> Is the built-in** lyric tie/elision tweakable? I’ve found that the 
> kerning/positioning changes fairly dramatically depending on the font being 
> used. I’d like to try to set its position globally (rather than having to 
> adjust each lyric pair it appears under), but couldn’t find the appropriate 
> grobs/interfaces/properties to attack.
>
> Thanks,
> Kieren.
>
> ** I know I can roll my own undertie glyph — I was doing that as early as 
> 2006 — but I’d rather adjust the built-in glyph/curve.
> 
>

There's no LyricTie grob, so no convenient way to tweak it.   You
could modify "tied-lyric" in scm/define-markup-commands.scm, since
that's what's engaged with the tilde.

-David

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