Re: Shorten hairpin

2015-03-19 Thread David Nalesnik
Hi Joram,

On Thu, Mar 19, 2015 at 8:12 AM, Noeck noeck.marb...@gmx.de wrote:

 Hi,

 I would like to shorten a hairpin like in this example:

 \relative c'' {
   b c8\ q q q\!
 }

 The left end should start with the beam, the right end should stay the
 same. How can I do this?


I suppose a decent solution to this would involve writing the stencil
callback for Hairpin to allow displacement of the endpoints.  (Some
addition to the C++ code?)  Then it would straightforward to read the
coordinates of this or that related object, and adjust the hairpin's length
accordingly.

The following works, at least for your example.  It resets the parent of
the left bound of the Hairpin spanner to a Stem object.  You asked for the
beam, specifically, but I don't know that there would be any appreciable
difference.

I haven't tested this beyond your example, so I can't say what will happen
in a real-world example.  Anyway...

%%%
\version 2.19.17

#(define (shorten-hairpin grob)
   (let ((rb (ly:spanner-bound grob LEFT)))
 (if (grob::has-interface rb 'note-column-interface)
 (let ((stem (ly:grob-object rb 'stem)))
   (if (ly:grob? stem)
   (ly:spanner-set-bound! grob LEFT stem
 ; return default for after-line-breaking
 ly:spanner::kill-zero-spanned-time))

\relative c'' {
  \override Hairpin.after-line-breaking = #shorten-hairpin
  b c8\ q q q\!
}

%%%

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


RE: Shorten hairpin

2015-03-19 Thread Stephen MacNeil
Does this work for you?


\version 2.18.2


\relative c'' {

b c8\ q q q\!b c8 q q q

}

\relative c'' {

\once \override Hairpin.X-offset = #1.35

\override Hairpin.minimum-length = #5

b c8\ q q q\!

\once \override TextScript.layer = #2

\once\override TextScript.staff-padding = #3.4

\once\override TextScript.vertical-skylines = #'() b c8

_\markup \with-dimensions #'(2 . 7) #'(0 . 0)\with-color #red \filled-box
#'(-1.8 . .2) #'(0 . 2) #0

q q q

}


\relative c'' {

\once \override Hairpin.X-offset = #1.35

\override Hairpin.minimum-length = #5

b c8\ q q q\!

\once \override TextScript.layer = #2

\once\override TextScript.staff-padding = #3.4

\once\override TextScript.vertical-skylines = #'() b c8

_\markup \with-dimensions #'(2 . 7) #'(0 . 0)\with-color #white \filled-box
#'(-1.8 . .2) #'(0 . 2) #0

q q q

}



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


RE: Shorten hairpin

2015-03-19 Thread Stephen MacNeil
actually you don't need

\once\override TextScript.vertical-skylines = #'()



so

\relative c'' {

\once \override Hairpin.X-offset = #1.35

\override Hairpin.minimum-length = #5

b c8\ q q q\!

\once \override TextScript.layer = #2

\once\override TextScript.staff-padding = #3.4

b c8

_\markup \with-dimensions #'(2 . 7) #'(0 . 0)\with-color #white \filled-box
#'(-1.8 . .2) #'(0 . 2) #0

q q q

}


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


Re: Shorten hairpin

2015-03-19 Thread Kieren MacMillan
Hi all,

On Mar 19, 2015, at 10:01 AM, David Nalesnik david.nales...@gmail.com wrote:
 I suppose a decent solution to this would involve writing the stencil 
 callback for Hairpin to allow displacement of the endpoints.

If this ever *did* happen, I would renew my (sponsor-willing) plea to have the 
ability to give dimensions in “current moments” — e.g., “shorten this hairpin 
by the width of a [current] quarter note”.

Thanks,
Kieren.

___

Kieren MacMillan, composer
www:  http://www.kierenmacmillan.info
email:  i...@kierenmacmillan.info


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


Re: Shorten hairpin

2015-03-19 Thread David Nalesnik
Hi Kieren,

On Thu, Mar 19, 2015 at 9:21 AM, Kieren MacMillan 
kieren_macmil...@sympatico.ca wrote:

 Hi all,

 On Mar 19, 2015, at 10:01 AM, David Nalesnik david.nales...@gmail.com
 wrote:
  I suppose a decent solution to this would involve writing the stencil
 callback for Hairpin to allow displacement of the endpoints.

 If this ever *did* happen, I would renew my (sponsor-willing) plea to have
 the ability to give dimensions in “current moments” — e.g., “shorten this
 hairpin by the width of a [current] quarter note”.


The width of the NoteHead grob would be easily accessible.  As far as
spacing width, I wouldn't know how to approach the problem.

You could use something like the \at function, defined here:

http://www.mail-archive.com/lilypond-devel%40gnu.org/msg49727.html

Don't know if this (or a variant)  ever reached -user.

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


Re: Shorten hairpin

2015-03-19 Thread Noeck
Dear Kieren, David and Stephen,

thanks for your answers! Stephen’s hack with a white box is not suitable
for my packed layout here.

The shorten-hairpin function does exactly what I want in this simple
example. In my real score, I have a separate Dynamics context and this
makes your function having no effect – probably because the notes are
not accessible by the function.


  \relative c'' { b c8 q q q }
  \new Dynamics {
\override Hairpin.after-line-breaking = #shorten-hairpin
s4.\ s\!
  }


I am surprised that not even the length can be specified manually (as
there is min-length already). A combination of length and offset would do.

@David: Of course it would be nice to have an adapted version of your
function that handles the different contexts. But considering the
complexity of the function you already provided, I have to say: Please
do not spend too much time on it. It is not super urgent for me.

Cheers,
Joram

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


Re: Shorten hairpin

2015-03-19 Thread Stephen MacNeil
Yes it was a hack, however this might look better and in a dynamics part it
should work

stephen



\relative c'' { b c8 q q q }

\new Dynamics {

\once \override Hairpin.X-offset = #1.35

% \override Hairpin.after-line-breaking = #shorten-hairpin

s4.*89/90\ s\!

}




On Thu, Mar 19, 2015 at 2:51 PM, Noeck noeck.marb...@gmx.de wrote:

 Dear Kieren, David and Stephen,

 thanks for your answers! Stephen’s hack with a white box is not suitable
 for my packed layout here.

 The shorten-hairpin function does exactly what I want in this simple
 example. In my real score, I have a separate Dynamics context and this
 makes your function having no effect – probably because the notes are
 not accessible by the function.

 
   \relative c'' { b c8 q q q }
   \new Dynamics {
 \override Hairpin.after-line-breaking = #shorten-hairpin
 s4.\ s\!
   }
 

 I am surprised that not even the length can be specified manually (as
 there is min-length already). A combination of length and offset would do.

 @David: Of course it would be nice to have an adapted version of your
 function that handles the different contexts. But considering the
 complexity of the function you already provided, I have to say: Please
 do not spend too much time on it. It is not super urgent for me.

 Cheers,
 Joram

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


Re: Shorten hairpin

2015-03-19 Thread Noeck
Hi Stephen,

Am 19.03.2015 um 20:05 schrieb Stephen MacNeil:
 Yes it was a hack, however this might look better and in a dynamics part
 it should work

The problem is that there is a barline across staves directly after and
other dynamics marks. But I probably can raise the barline above the
markup. Thanks.

Cheers,
Joram

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


Re: Shorten hairpin

2015-03-19 Thread David Nalesnik
On Thu, Mar 19, 2015 at 1:51 PM, Noeck noeck.marb...@gmx.de wrote:


 @David: Of course it would be nice to have an adapted version of your
 function that handles the different contexts. But considering the
 complexity of the function you already provided, I have to say: Please
 do not spend too much time on it. It is not super urgent for me.


I don't see any easy way to do this.

You could determine the X-coordinate of the object you want the hairpin to
align to and scale the hairpin stencil in the X-axis; however, this could
result in distortion.

Better would be to allow modification of the starting and ending points in
the stencil function itself--the equivalent of shorten-pair.  I can't give
you a function to plug in--it would involve converting the 220 line C++
hairpin stencil function into Scheme to make some additions.  Well, to be
fair, some of those lines are comments...

Sorry I can't be of more help.

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


Re: shorten hairpin

2014-11-08 Thread Kieren MacMillan
Hi Helge,

 How can I code this more elegant and avoid the changes?

Maybe something like this?

cello = \relative c' {
  \time 6/8
  
{ fis'2.\downbow ~ | fis4. r }
{ s8\p\ s\! }
  
}

\layout {
  \context {
\Score
\override Hairpin.minimum-length = #4
  }
}

\score { \new Staff \cello }

Hope this helps!
Kieren.

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


Re: shorten hairpin

2014-11-08 Thread Urs Liska


Am 08.11.2014 20:33, schrieb Helge Kruse:

Hello,

I have a staff for a cello where the player should reduce the tone 
during the note quite fast. Therfore the normal haiping like this is 
too long:



\version 2.18.0

cello = \relative c' {
  \time 6/8
  \key a\major
  \clef tenor
  fis2.~\downbow\p\ %%% this is the hairpin line
  |
  fis4.\! r8 r4
}

harp = \relative c' {
  \time 6/8
  \key a\major
  r16 e e e e e
  r16 e e e e e
}

\score {
  
\new Staff \cello
\new Staff \harp
  
}


I have somehow written something that looks nearly like what I want to 
achive


cello = \relative c' {
  
{ s8\p\ s\! } \\
{ fis'2.^~^\downbow | fis4.  }
  
  r8 r4
}

But this is ugly to code and not perfect to read.
- The tie sarts at a different point.
- The dots are a line too low.
- The piano is a bit too left.

How can I code this more elegant and avoid the changes?


You may have a look at the \at function in
https://github.com/openlilylib/openlilylib/tree/master/input-shorthands/articulations-not-aligned-with-notes

HTH
Urs




The original score is 
http://conquest.imslp.info/files/imglnks/usimg/a/ad/IMSLP113653-PMLP232035-HASSELMANS_confidence.pdf, 
measure 18.


Best regards
Helge



___
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: shorten hairpin

2014-11-08 Thread Pierre Perol-Schneider
Hi Helge,

2014-11-08 20:33 GMT+01:00 Helge Kruse helge.kr...@gmx.net:


 I have a staff for a cello where the player should reduce the tone during
 the note quite fast. Therfore the normal haiping like this is too long:


 \version 2.18.0

 cello = \relative c' {
   \time 6/8
   \key a\major
   \clef tenor
   fis2.~\downbow\p\ %%% this is the hairpin line
   |
   fis4.\! r8 r4
 }


Try :

cello = \relative c' {
  \time 6/8
  \key a\major
  \clef tenor
  fis2.~\downbow\p
  -\tweak bound-padding #12
  -\tweak X-offset #-11
  \ %%% this is the hairpin line
  |
  fis4.
  \! r8 r4
}

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