[Top][All Lists]

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

Re: Stem.stem-begin-position not giving desired output on beamed stems (

From: Carl Williams
Subject: Re: Stem.stem-begin-position not giving desired output on beamed stems (tablature)
Date: Fri, 16 Dec 2016 22:09:02 +1300
User-agent: Mailbird/

Thanks Harm, 

That's just what I was after. 
I'm keen to learn more about how beam positions and stems are calculated. Then 
maybe I can calculate it using only 2 input variables. 
I think I'll have a look in the .scm files, and see what I can find. I'm not 
sure yet which one it'll be in.

Thanks for adding the feature request too. 

On 16/12/2016 12:39:08, Thomas Morley <address@hidden> wrote:
Hi Carl,

2016-12-14 8:14 GMT+01:00 Carl Williams :
> Hi Everyone,
> First time using a mailing list.
> I've raked through the documentation pages all today and yesterday (and 
> learnt a lot), but still couldn't solve this.
> So I want to create (ukulele) tablature where all the stems and beams are 
> above the staff.
> I use the \override Stem.stem-begin-position to set the unbeamed stems above, 
> but I think it aught to affect the beamed stems too (they are stems too after 
> all!). bug?

I don't think so.
If I understand correctly, beamed stems are not really calculated on
their own, but mostly rely on the calculations of the beam.
Thus you need to make some effort to have it work.

> Does anyone know any workarounds?

Maybe something at the lines of:

\version "2.18.2"

testFunc =
#(define-music-function (parser location beg-end-beam-pos)(list?)
"Takes a list containing values for
- the stem-start in Y-direction
- the stem-length
- the positions of a possible beam.
TODO: The relationship between those values currently escapes me.
It should be possible to calculate the beam-positions, if the other values
are known.
\override Beam.after-line-breaking =
#(lambda (grob)
(let ((stems (ly:grob-array->list (ly:grob-object grob 'stems))))
grob 'positions (cons (last beg-end-beam-pos) (last beg-end-beam-pos)))
(lambda (stem)
(ly:stem::calc-stem-begin-position stem)
stem 'length (second beg-end-beam-pos))
stem 'stem-begin-position (first beg-end-beam-pos)))
\override Stem.stem-begin-position = #(first beg-end-beam-pos)
\override Stem.length = #(second beg-end-beam-pos)


\testFunc #'(5 6 5.25)
c''8[ d'']
c''16[ d'']
c''32[ d'']
c''8 d''16 e''32

\new TabStaff \with {
stringTunings = #ukulele-tuning
} {

\relative c' {
\testFunc #'(4.6 5 4.75)
r8 g'\4 c,4 e2 |
a1 |
g8\4 c, e a c,[ c] a'8 a |

2016-12-15 1:24 GMT+01:00 Carl Williams :
> I think the original issue of Stem.stem-begin-position not working for 
> beamed-stems should be fixed. If it's not a bug, I call it a feature request.

Added as


reply via email to

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