lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross-staff beam slope - can it be specified?


From: David Sumbler
Subject: Re: Cross-staff beam slope - can it be specified?
Date: Wed, 08 Nov 2017 18:03:26 +0000

On Sun, 2017-10-29 at 19:00 +0000, David Sumbler wrote:
> On Sat, 2017-10-28 at 08:49 -0400, Ben wrote:
> > 
> > On 10/27/2017 1:33 PM, David Sumbler wrote:
> > > 
> > > In the above rather silly example, the beam between the 2 cross-
> > > staffnotes slopes slightly upwards.  If I add a dynamic, say \f ,
> > > after <c' g>2. in line 7, the staves are forced further apart,
> > > and the beam slopes slightly downwards.
> > > 
> > > If I now add a further dynamic, say ^\p , to the lower staff
> > > after <e c>2. in line 9, the staves are forced still further
> > > apart and the beam now has a large downward slope.
> > > 
> > > The problem I have is that, in "real life", I don't know how far
> > > apart the staves will be because of the space requirements of
> > > other parts of the music.  Generally I would prefer to allow
> > > Lilypond to determine where line ends etc. should be, so I don't
> > > even know which bits of the music will affect the slope of the
> > > beam.  And even if I did know, an alteration to the music in the
> > > closely preceding and following bars might well affect the
> > > spacing of the staves and hence the slope of the
> > > beam.
> > > 
> > > Is there any way of ensuring that the beam always has a
> > > predetermined slope - say 10° downwards - and that the stem
> > > lengths will automatically be adjusted to allow for this?
> > > 
> > > David
> >  
> > Hello,
> > 
> > Check out this older post here, it deals with cross beam slopes:
> > http://lilypond.1069038.n5.nabble.com/Adjusting-beam-slope-with-
> > cross-staff-notes-td140283.html
> > 
> > David Nalesnik wrote a function where instead of specifying the
> > absolute values for positions, it allows you to indicate
> > displacements from the values LilyPond would use by default.
> > 
> > It sounds like that's what you are looking for, does this help?
> Thanks for your reply.  I have had a look at David's function, but it
> doesn't seem to be suitable in this case.  It allows one to specify
> vertical off-sets for the ends of a beam relative to the offsets
> Lilypond would use by default.  But my problem is that those defaults
> may change depending on spacing issues caused by changes in the music
> in the few bars before or after the notes with the beam.
> 
> What I really need is some way of specifying the relative vertical
> heights of the ends of the beam whilst leaving Lilypond to determine
> the absolute vertical position.  If I had sufficient understanding of
> the inner workings of Lilypond, I am sure that I could fairly easily
> write the necessary Scheme code.  But I don't have that
> understanding, so I shall have to make do with tweaking the beam
> position once the rest of the music is absolutely finalized.
> 
> David

Further to my comments above, it eventually occurred to me that the
required interfacing between Scheme and Lilypond is already there in
David Nalesik's function.  So all I would need to do would be to change
what Scheme does with the values passed to it in order to achieve what
I was looking for.

I have now managed to do this.  My new routine - really just a
modification of David N's function - needs a single value to be passed
to it.  It then effectively rotates the beam about its mid-point so
that the parameter represents the difference in vertical height between
the end and the beginning of the beam - e.g. if the value passed is 2,
then the beam will slope upwards by 2 staff-spaces.  A second parameter
can optionally be given, which will cause a vertical shift in the
position of the beam with the required slope maintained.  The function
works with beams on a single stave as well as cross-staff beams,
although the latter is where it is most likely to be useful.

It can be argued that everything my function does can be achieved using
David Nalesik's original.  So it can, but considerably more trial and
error (and some trivial mental arithmetic) would be needed in the kind
of situation I originally described; in those cases, my function will
save a little time and mental effort.

I am afraid that my alterations are unlikely to please anybody who
likes programs to be concise and elegant, and I am somewhat embarrassed
to reveal it.  But if I think it is useful, then there may be a few
others who would find it so.  And if anyone with better programming
skills and more experience than I have would like to tidy it up a bit,
then I would be delighted to receive their improved version.

I attach the function including examples, and also the result of
compiling it.

David

Attachment: beam-sloper.png
Description: PNG image

Attachment: beam-sloper.ly
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]