|
From: | Olivier Biot |
Subject: | Re: String number spanner |
Date: | Sat, 29 Dec 2012 14:08:36 +0100 |
On Fri, Dec 28, 2012 at 6:14 PM, Phil Burfitt <address@hidden> wrote:
From: "Nick Payne"
I'm stuck on the last part of getting this working - the part that is eluding me is getting a short vertical line drawn at the RH end of the spanner. According the the Internals reference, UP = 1 and DOWN = -1, and that works fine when I use the return value from the updown function to set TextSpanner.direction in beginStringNum. But when I try to use the value returned from updown in the section of code that is commented out in beginStringNum, I get an error. If I hardcode 1 or -1 instead of updown then the line is drawn as expected.
I also tried the righttext function below to draw the line: no error is indicated but neither is the vertical line drawn.
This is a spanner with an end 'hook' - I use it for telling in which cello position a passage should be played:\version "2.16.1"
% Allows to draw a dashed text spanner for highlighting sections with a given playng position in a score
stringNumberSpanner =
#(define-music-function (parser location stringNumber) (string?)
#{
\override TextSpanner #'style = #'dashed-line
\override TextSpanner #'dash-period = #1.5
\override TextSpanner #'dash-fraction = #0.5
\override TextSpanner #'font-size = #-5
\override TextSpanner #'font-shape = #'upright
\override TextSpanner #'(bound-details left stencil-align-dir-y) = #CENTER
\override TextSpanner #'(bound-details left text) = \markup { \number $stringNumber }
\override TextSpanner #'(bound-details right text) = \markup { \draw-line #'(0 . -1) }
\override TextSpanner #'outside-staff-priority = 500
#}
)
[Prev in Thread] | Current Thread | [Next in Thread] |