[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tie settings question
From: |
David Nalesnik |
Subject: |
Re: Tie settings question |
Date: |
Wed, 26 Oct 2016 07:41:47 -0500 |
On Wed, Oct 26, 2016 at 6:20 AM, Karol Majewski <address@hidden> wrote:
> OK, David, so let's move one square backward and try to use staff-position.
> The following code does compile but doesn't do what I want. Perhaps what I'm
> trying to achieve is just not possible.
I don't think it is.
Carl's email explains why the staff-position approach will probably not work.
>
> %%%%%%%%%%%%%%%%%%%%%%
>
> tweakTie =
> #(lambda
> (grob)
> (let*
> ((ties
> (ly:grob-array->list
> (ly:grob-object grob 'ties)))
> (notehead
> (ly:spanner-bound
> (car ties) LEFT))
> (notehead-pos
> (ly:grob-property notehead 'staff-position))
> (stem
> (ly:grob-object notehead 'stem))
> (flag
> (ly:grob-object stem 'flag))
> (dot
> (ly:grob-object notehead 'dot))
> (dot-pos
> (if
> (ly:grob? dot)
> (ly:grob-property dot 'staff-position) #f)))
> (if
> (>
> (length ties) 1)
> (begin
> (if
> (ly:grob? flag)
> (ly:grob-set-property! flag 'Y-extent
> (cons 4 0)))
The indentation style (which I normalize somewhat each time I return
code) makes the code harder to follow. In particular, it's not
obvious what we're iterating over in this and the other for-each
statements.
> (for-each
> (lambda
> (tie)
> (ly:grob-set-nested-property! tie '(details skyline-padding) 5))
> ties)))
> (if
> (ly:grob? dot)
> (if
This comparison doesn't do what you expect, because--when a
number--Dots.staff-position seems to be 0 for the most part. Refer to
Carl's post.
> (> dot-pos notehead-pos)
> (for-each
> (lambda
> (tie)
> (let
Consulting Tie.direction so early (before-line-breaking) has
disastrous results for the tie. It is reduced to a tiny flyspeck. You
could try after-line-breaking, but possibly your modifications won't
take effect so late.
> ((tie-dir
> (ly:grob-property tie 'direction)))
> (if
> (= tie-dir 1)
> (begin
> (ly:grob-set-nested-property! tie '(details
> skyline-padding) 5)
> (ly:grob-set-property! tie 'Y-offset -0.25))))) ties)))
> (if
> (ly:grob? dot)
> (if
> (< dot-pos notehead-pos)
> (for-each
> (lambda
> (tie)
> (let
> ((tie-dir
> (ly:grob-property tie 'direction)))
> (if
> (= tie-dir -1)
> (begin
> (ly:grob-set-nested-property! tie '(details
> skyline-padding) 5)
> (ly:grob-set-property! tie 'Y-offset 0.25))))) ties)))))
>
Sorry, I doubt that I can be of any more assistance.
This will probably require work in C++. Something to return the
individual Dot positions rather than (I presume) the position of the
dot-complex. Better would be another--yet another--Tie property,
though. (And you'd do that in C++, too.)
Best,
David
- Re: Tie settings question, (continued)
- Re: Tie settings question, Karol Majewski, 2016/10/25
- Re: Tie settings question, Karol Majewski, 2016/10/25
- Re: Tie settings question, Karol Majewski, 2016/10/25
- Re: Tie settings question, Karol Majewski, 2016/10/25
- Re: Tie settings question, Karol Majewski, 2016/10/26
- Re: Tie settings question,
David Nalesnik <=
- Re: Tie settings question, Karol Majewski, 2016/10/26
- Re: Tie settings question, David Nalesnik, 2016/10/26