Re: [frogs] Changing subproperties with grob-set-property (working on bug #40) |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: frogs@xxxxxxxxxxx
- Subject: Re: [frogs] Changing subproperties with grob-set-property (working on bug #40)
- From: Marc Hohl <marc@xxxxxxxxxx>
- Date: Sat, 31 Oct 2009 10:48:26 +0100
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1256982508; l=2827; s=domk; d=hohlart.de; h=Content-Type:In-Reply-To:References:Subject:To:MIME-Version:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=HD+r+arZIFs5Wya/z9IUI+8lu/E=; b=mwufK7XqIu10mq76meLJG4QadVc5XB4J28CVW+hgQlT8rmOIC0MYr+0PHtpklazuMgO 0NvZthanJ8EiHEZwXyPIKfqWpdhJOC1uj4VHr9nVIuv6mj5p3hpZDuNg/n1m28hXNT4HY +mlC5PwHM8lNcE+PGOyp69ZXLdOocm5duTE=
Marc Hohl schrieb:
[...]
(Attached is the full file)
Arrgh! Now it is...
\version "2.13.6"
\paper {
indent = 0
ragged-right = ##f
}
#(define (glissando::calc-extra-dy grob)
(let* ((original (ly:grob-original grob))
(left-bound (ly:spanner-bound original LEFT))
(right-bound (ly:spanner-bound original RIGHT))
(left-pitch (ly:event-property (event-cause left-bound) 'pitch))
(right-pitch (ly:event-property (event-cause right-bound) 'pitch)))
(if (and (= (ly:pitch-octave left-pitch) (ly:pitch-octave right-pitch))
(= (ly:pitch-notename left-pitch) (ly:pitch-notename right-pitch)))
(- (ly:pitch-alteration right-pitch) (ly:pitch-alteration left-pitch))
0 )))
#(define (glissando::calc-accidental-X grob)
(let* ((original (ly:grob-original grob))
(right-bound (ly:spanner-bound original RIGHT))
(right-bound-info (ly:line-spanner::calc-right-bound-info grob))
(right-X (assoc-get 'X right-bound-info 0))
(accidental (ly:grob-object right-bound 'accidental-grob)))
(if (ly:grob? accidental)
(set! right-X (- right-X 30)))
(ly:grob-set-property! grob '(bound-details right X) right-X)
(ly:line-spanner::print grob)))
noten = \relative c {
c4 \glissando cis
c4 \glissando cis
c4 \glissando ces
c4 \glissando ces
c4 \glissando d \glissando e \glissando f
c2 \glissando c
c4 \glissando dis e \glissando ges
}
\score {
\new Staff { \clef "G_8"
\noten \break
\override Glissando #'extra-dy = #glissando::calc-extra-dy
\override Glissando #'stencil = #glissando::calc-accidental-X
\noten }
}