[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: |
Sat, 22 Oct 2016 08:16:04 -0500 |
Hi Karol,
On Sat, Oct 22, 2016 at 7:33 AM, Karol Majewski <address@hidden> wrote:
> Now I try to change Flag.Y-extent value in chords to: \override Flag.Y-extent
> = #'(4 . 0)
>
> Got this, but it doesn't work. What am I doing wrong?
>
> evenTies =
> #(lambda
> (grob)
> (let
> ((ties
> (ly:grob-array->list
> (ly:grob-object grob 'ties))))
> (if
> (>
> (length ties) 1)
(1) Use begin to group multiple expressions in the if clause
(2) As the log will tell you, "flag" is not defined. I assume you
arrived at this because of Harm's usage of "tie"
below. He's creating a local variable to refer to Tie grobs which
he's already obtained, not relying on some existing correspondence
between "tie" and a Tie grob.. (As such, he could have replaced 'tie'
with another identifier, like "my-variable")
You need "flag" to point to an actual Flag, which requires following
pointers from your starting object -- a TieColumn -- to Tie. In the
code below, you can see how I might do it.
(3) 'Y-extent takes a number pair.
> ((ly:grob-set-property! flag 'Y-extent 4 0)
> (for-each
> (lambda
> (tie)
> (ly:grob-set-nested-property! tie '(details skyline-padding) 5))
> ties)))))
%%%%%%%%%%%%%%%
evenTies =
#(lambda
(grob)
(let* ((ties (ly:grob-array->list (ly:grob-object grob 'ties)))
(notehead (ly:spanner-bound (car ties) LEFT))
(stem (ly:grob-object notehead 'stem))
(flag (ly:grob-object stem 'flag)))
(if (> (length ties) 1)
(begin
(ly:grob-set-property! flag 'Y-extent (cons 4 0))
(for-each
(lambda (tie)
(ly:grob-set-nested-property! tie '(details skyline-padding) 5))
ties)))))
\layout {
\context {
\Score
\override TieColumn.before-line-breaking = #evenTies
}
}
\score {
\relative c' {
<c e g c e>8~
<c e g c e>4
c8~ c4.
}
}
%%%%%%%%%%%%%%%%
Hope this helps,
David
- Tie settings question, Karol Majewski, 2016/10/20
- Re: Tie settings question, Karol Majewski, 2016/10/21
- Re: Tie settings question, Karol Majewski, 2016/10/21
- Re: Tie settings question, Karol Majewski, 2016/10/22
- Re: Tie settings question,
David Nalesnik <=
- Re: Tie settings question, Karol Majewski, 2016/10/22
- Re: Tie settings question, Karol Majewski, 2016/10/24
- Re: Tie settings question, Karol Majewski, 2016/10/25
- Re: Tie settings question, Karol Majewski, 2016/10/25