Re: left-aligned dynamics

2010-01-26 Thread Reinhold Kainhofer
Am Dienstag, 26. Januar 2010 07:15:47 schrieb James Bailey:
 that, and always get the alignment I want. However, you did give me a
 brilliant idea. Chain the two together. instead of having a variable
 assigned to the dynamic + text and a variable to the shift, I can
 just have a variable assigned to do both at the same time, i.e.,
 pcantabile = \once \override … #( make-dynamic-script…

Doesn't work, since you want to attach the dynamic script to the previous 
note, which \override does not support... You'll run into the same problems as 
the \textCresc commands (ie. they appear a note too late).

Cheers,
Reinhold

-- 
--
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial  Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org


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


Re: left-aligned dynamics

2010-01-26 Thread David Nalesnik
Hello James,

Yes, that is certainly a much easier solution.  For some reason when I tried
your override last night, it had no effect -- hence my experimenting.  I
suppose I must have placed it badly, because now it works just fine.

Anyway, best of luck!

On Tue, Jan 26, 2010 at 12:15 AM, James Bailey
derhindem...@googlemail.comwrote:


 On 26.01.2010, at 02:01, David Nalesnik wrote:

 Hello,

 Fiddling around with the snippet Centering markup on noteheads
 automatically, http://lsr.dsi.unimi.it/LSR/Item?id=637 I came up with
 something which might be useful (or duplicate a far easier solution!). I
 realize that it doesn't address the problem of center-aligning only the
 dynamic (the function seems to align the left edge of the dynamic with the
 note -- hence my guess at an offset of 0.6).  Of course, this offset would
 have to be adjusted for pp ppp, etc.  At least this will give similar
 results for p, dolce p, espressivo and so on.

 \version 2.12.3

 pcantabile = #(
   make-dynamic-script (
markup #:line (
 #:dynamic p #:hspace -1 #:normal-text   #:italic , cantabile
)
  )
 )

 dynamicTextLeftAlign = \once \override DynamicText #'X-offset =
 #(lambda (grob)
 (-
   (+
 (ly:self-alignment-interface::x-aligned-on-self grob)
 (interval-center
 (ly:grob-robust-relative-extent grob grob X)))
  0.6))

 {
   \dynamicTextLeftAlign
   a'\pcantabile b' c' d'
 }


 Given that the values would probably have to be changed in different
 context, hard-coding a number to this is really not a very good solution.
 Also, since the alignment is easily achieved with \once \override
 DynamicText #'X-offset = -1. It's far easier to just use that, and always
 get the alignment I want. However, you did give me a brilliant idea. Chain
 the two together. instead of having a variable assigned to the dynamic +
 text and a variable to the shift, I can just have a variable assigned to do
 both at the same time, i.e., pcantabile = \once \override … #(
 make-dynamic-script…

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


left-aligned dynamics

2010-01-25 Thread James Bailey

I use the Scheme hack to get dynamics that sound properly with text:
pcantabile = #(
   make-dynamic-script (
markup #:line (
 #:dynamic p #:hspace -1 #:normal-text #:italic , cantabile
)
  )
)

Since I really don't understand any of how that works (I mean, I  
understand that it's markup written in Scheme language, I just don't  
understand the Scheme bits) can someone tell me how to modify this so  
that it's left-aligned, rather than center aligned like normal  
dynamics. I already have a shortcut defined for \once \override  
DynamicText #'direction = #-1, but it would be nice to not have to  
put that in, since every time I use one of these dynamic scripts, I  
want it left-aligned.


Any help is much appreciated.


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


Re: left-aligned dynamics

2010-01-25 Thread Reinhold Kainhofer
Am Montag, 25. Januar 2010 20:18:10 schrieb James Bailey:
 I use the Scheme hack to get dynamics that sound properly with text:
[...]
 Since I really don't understand any of how that works (I mean, I
 understand that it's markup written in Scheme language, I just don't
 understand the Scheme bits) can someone tell me how to modify this so
 that it's left-aligned, rather than center aligned like normal
 dynamics. I already have a shortcut defined for \once \override
 DynamicText #'direction = #-1, but it would be nice to not have to
 put that in, since every time I use one of these dynamic scripts, I
 want it left-aligned.

See
http://lsr.dsi.unimi.it/LSR/Item?id=393
for some hints.

Cheers,
Reinhold

-- 
--
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial  Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org


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


Re: left-aligned dynamics

2010-01-25 Thread James Bailey


On 25.01.2010, at 21:49, Reinhold Kainhofer wrote:


Am Montag, 25. Januar 2010 20:18:10 schrieb James Bailey:

I use the Scheme hack to get dynamics that sound properly with text:

[...]

Since I really don't understand any of how that works (I mean, I
understand that it's markup written in Scheme language, I just don't
understand the Scheme bits) can someone tell me how to modify this so
that it's left-aligned, rather than center aligned like normal
dynamics. I already have a shortcut defined for \once \override
DynamicText #'direction = #-1, but it would be nice to not have to
put that in, since every time I use one of these dynamic scripts, I
want it left-aligned.


See
http://lsr.dsi.unimi.it/LSR/Item?id=393
for some hints.

Cheers,
Reinhold


Thanks for the link. I realize now that I asked a poor question.  
(Mostly because I didn't understand it myself. What I really want to  
do is set the X-offset to LEFT inside the Scheme defintion. Is that  
possible? If not, I'm okay with it, I've lived with it this long, I  
just thought I'd ask.



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


Re: left-aligned dynamics

2010-01-25 Thread James Bailey


On 25.01.2010, at 21:49, Reinhold Kainhofer wrote:


Am Montag, 25. Januar 2010 20:18:10 schrieb James Bailey:

I use the Scheme hack to get dynamics that sound properly with text:

[...]

Since I really don't understand any of how that works (I mean, I
understand that it's markup written in Scheme language, I just don't
understand the Scheme bits) can someone tell me how to modify this so
that it's left-aligned, rather than center aligned like normal
dynamics. I already have a shortcut defined for \once \override
DynamicText #'direction = #-1, but it would be nice to not have to
put that in, since every time I use one of these dynamic scripts, I
want it left-aligned.


See
http://lsr.dsi.unimi.it/LSR/Item?id=393
for some hints.

Cheers,
Reinhold


Thanks for the link. I realize now that I asked a poor question.  
(Mostly because I didn't understand it myself. What I really want to  
do is set the X-offset to LEFT inside the Scheme defintion. Is that  
possible? If not, I'm okay with it, I've lived with it this long, I  
just thought I'd ask.



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


Re: left-aligned dynamics

2010-01-25 Thread Kieren MacMillan
Hi James,

 What I really want to do is set the X-offset to LEFT inside the Scheme 
 defintion.
 Is that possible? If not, I'm okay with it, I've lived with it this long, I 
 just thought I'd ask.

IIRC, we discussed this when that snippet was being developed — and the answer 
ended up being No.  =(
However, you can always write a music function which would do the alignment for 
you.

Cheers,
Kieren.

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


Re: left-aligned dynamics

2010-01-25 Thread Reinhold Kainhofer
Am Dienstag, 26. Januar 2010 00:53:16 schrieben Sie:
 Hi James,
 
  What I really want to do is set the X-offset to LEFT inside the Scheme
  defintion. Is that possible? If not, I'm okay with it, I've lived with it
  this long, I just thought I'd ask.
 
 IIRC, we discussed this when that snippet was being developed — and the
  answer ended up being No.  =( However, you can always write a music
  function which would do the alignment for you.

IIRC, the snippet had some deeper requirements, namely that pp and sempre 
pp should be lined up exactly, where the pp is center-aligned. That's much 
harder than simply setting the dynamic text to left/right aligned.

Simply changing the DynamicText to left-aligned might be possible including 
the equivalent of a \tweak in the scheme code. But then, it might be the case 
that the make-dynamic-script command does not return the dynamic text object, 
and then this approach is not possible, either (like you cannot change e.g. 
the color of a stem using a \tweak, since the note like c4 does not return 
the stem object).

Cheers,
Reinhld
-- 
--
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial  Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org


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


Re: left-aligned dynamics

2010-01-25 Thread Kieren MacMillan
Hi Reinhold,

 IIRC, the snippet had some deeper requirements, namely that pp and sempre 
 pp should be lined up exactly, where the pp is center-aligned. That's much 
 harder than simply setting the dynamic text to left/right aligned.

Why can't the process be:

  1. Vertically combine the NoteColumn and dynamic text (centered).
  2. Add the text, baseline-aligned with the dynamic.

That would solve the problem, yes?

Cheers,
Kieren.

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


Re: left-aligned dynamics

2010-01-25 Thread Reinhold Kainhofer
Am Dienstag, 26. Januar 2010 01:09:18 schrieben Sie:
 Hi Reinhold,
 
  IIRC, the snippet had some deeper requirements, namely that pp and
  sempre pp should be lined up exactly, where the pp is center-aligned.
  That's much harder than simply setting the dynamic text to left/right
  aligned.
 
 Why can't the process be:
 
   1. Vertically combine the NoteColumn and dynamic text (centered).
   2. Add the text, baseline-aligned with the dynamic.

Basically, I think so, but to be honest, I have no idea how that could be 
achieved automatically (nor how it could be implemented)...

 That would solve the problem, yes?

You are more than welcome to provide a proper solution instead of the nasty 
hacks that I collected for that snippet...

Cheers,
Reinhold
-- 
--
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial  Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org


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


Re: left-aligned dynamics

2010-01-25 Thread David Nalesnik
Hello,

Fiddling around with the snippet Centering markup on noteheads
automatically, http://lsr.dsi.unimi.it/LSR/Item?id=637 I came up with
something which might be useful (or duplicate a far easier solution!). I
realize that it doesn't address the problem of center-aligning only the
dynamic (the function seems to align the left edge of the dynamic with the
note -- hence my guess at an offset of 0.6).  Of course, this offset would
have to be adjusted for pp ppp, etc.  At least this will give similar
results for p, dolce p, espressivo and so on.

\version 2.12.3

pcantabile = #(
  make-dynamic-script (
   markup #:line (
#:dynamic p #:hspace -1 #:normal-text   #:italic , cantabile
   )
 )
)

dynamicTextLeftAlign = \once \override DynamicText #'X-offset =
#(lambda (grob)
(-
  (+
(ly:self-alignment-interface::x-aligned-on-self grob)
(interval-center
(ly:grob-robust-relative-extent grob grob X)))
 0.6))

{
  \dynamicTextLeftAlign
  a'\pcantabile b' c' d'
}


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

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


Re: left-aligned dynamics

2010-01-25 Thread James Bailey


On 26.01.2010, at 02:01, David Nalesnik wrote:


Hello,

Fiddling around with the snippet Centering markup on noteheads  
automatically, http://lsr.dsi.unimi.it/LSR/Item?id=637 I came up  
with something which might be useful (or duplicate a far easier  
solution!). I realize that it doesn't address the problem of center- 
aligning only the dynamic (the function seems to align the left  
edge of the dynamic with the note -- hence my guess at an offset of  
0.6).  Of course, this offset would have to be adjusted for pp  
ppp, etc.  At least this will give similar results for p, dolce  
p, espressivo and so on.


\version 2.12.3

pcantabile = #(
  make-dynamic-script (
   markup #:line (
#:dynamic p #:hspace -1 #:normal-text   #:italic ,  
cantabile

   )
 )
)

dynamicTextLeftAlign = \once \override DynamicText #'X-offset =
#(lambda (grob)
(-
  (+
(ly:self-alignment-interface::x-aligned-on-self grob)
(interval-center
(ly:grob-robust-relative-extent grob grob X)))
 0.6))

{
  \dynamicTextLeftAlign
  a'\pcantabile b' c' d'
}


Given that the values would probably have to be changed in different  
context, hard-coding a number to this is really not a very good  
solution. Also, since the alignment is easily achieved with \once  
\override DynamicText #'X-offset = -1. It's far easier to just use  
that, and always get the alignment I want. However, you did give me a  
brilliant idea. Chain the two together. instead of having a variable  
assigned to the dynamic + text and a variable to the shift, I can  
just have a variable assigned to do both at the same time, i.e.,  
pcantabile = \once \override … #( make-dynamic-script…___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user