[Top][All Lists]

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


From: Neil Puttock
Subject: Re:
Date: Tue, 28 Apr 2009 22:25:13 +0100

2009/4/27 Carl D. Sorensen <address@hidden>:
> Neil,
> Thanks for your input.  I think it's all really good.
> On 4/26/09 1:49 PM, "Neil Puttock" <address@hidden> wrote:
>> 2009/4/25 Marc Hohl <address@hidden>:
>>> Hello tablature users*,
>> Like Carl, I'm not a tablature user, so I can only comment on matters of
>> coding.
>> Some suggestions and thoughts follow below:
> <SNIP>
>>>           (font-size (- (* num-strings 1.5) 7))
>>>           (base-skip (cond ((= 4 num-strings) 1.55)
>>>                            ((= 5 num-strings) 1.84)
>>>                            ((= 6 num-strings)  2.00)
>>>                            ((= 7 num-strings) 2.08)))
>> Can you rework these so they're not hard-coded?
>> Imagine a user doesn't like the default staff-space setting for
>> TabStaff (1.5).  If they change it, none of these empirical values
>> will work properly.
> Marc, there are probably at least two ways to do this.  The easiest one
> would be to take each of these magic numbers and divide them by the default
> staff-space setting, and then change to something like
> (base-skip (cond ((= 4 num-strings) (* staff-space 1.03))
> and so forth.  (1.03 = 1.55/1.5)  And you'd need to find the value of
> staff-space in order to be able to do this multiplication.
> The second way would be to try to define fundamental relationships for
> base-skip, but I'm not sure exactly how you'd do that, so I'm not
> recommending it right now.
> <SNIP>
>>> calligraphicTabClef = #(define-music-function (parser location tuning)
>>> (pair?)
>>>   #{
>>>      \revert TabStaff.Clef #'stencil
>>>      \set TabStaff.stringTunings = $tuning
>>>   #})
>> On a general note, I'd prefer to keep the string tunings separate from
>> setting the clef.  To set the traditional tab clef, we have the
>> command \clef tab, so it would be nice to be able to set the modern
>> style using e.g. \clef moderntab without having to use a new function.
> I'd also like to do that.  But I don't know how to help Marc do it.  Neil,
> if you can help him figure it out, I'd appreciate it.
> There are two issues that I can't address:
> 1) I wasn't able to figure out how to get stringTunings in a music function
> or a markup function.   How do we do that?

You don't need to know stringTunings, since it's possible to access
'line-count from any grob which is placed on a StaffSymbol:

(let* ((staff-symbol (ly:grob-object grob 'staff-symbol))
       (line-count (ly:grob-property staff-symbol 'line-count)))

> 2) I'm not sure how to use a markup, instead of a glyph, as a clef without
> redefining the 'stencil property, and I don't know how to redefine the
> 'stencil property by means of  a \clef cleftype command.  If you can show us
> how to do that, it would be really helpful.

If we add entries in parser-clef.scm to supported-clefs and
c0-pitch-alist (either directly or by consing the new entries within
the tablature file) for the modern tab,

("moderntab" . ("markup.moderntab" 0 0))

("markup.moderntab" . 0)

we can override the Clef 'stencil to check 'glyph before calling the
default print-function.  If the string "markup.moderntab" is found,
then it's simple to return a stencil for the new tab markup.

There's one potential pitfall: it's expected that each clef type has a
variant at a smaller size which is obtained by appending "_change" to
the glyph-name.  You'd probably want to disable this feature by
setting 'full-size-change = ##t.


reply via email to

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