On 4/27/09 12:47 PM, "Marc Hohl" <m...@hohlart.de> wrote:

> Carl D. Sorensen schrieb:
>> 
>> On 4/27/09 3:38 AM, "Marc Hohl" <m...@hohlart.de> wrote:
>> 
>>  
> No, I didn't get this mail. I played around with your suggestions and the
> improvements given by Neil and have now:
> 
> #(define-markup-command (customTabClef layout props tuning) (pair?)
>     (define (square x) (* x x))
>     (let* ((num-strings (min (max (length tuning) 4) 7))
>            (font-size (- (* num-strings 1.5) 7))
>            (base-skip (square (+ (* num-strings 0.2) 0.4))))
>        (interpret-markup layout props
>          (markup #:vcenter #:bold
>                  ;;#:override #'(font-family . sans)
>                  #:fontsize font-size
>                  #:override #'(cons 'baseline-skip base-skip)

I thought that there should be no ' before (cons 'baseline-skip base-skip).
But apparently it works, so perhaps it's evaluated during the markup
interpretation.

The ' is a quote that prevents evaluation.  In this case, we want to
evaluate the expression, because we want to replace the symbol base-skip
with its value, which was assigned above.  But this apparently works with
the macro expansion.

>                  #:center-column ("T" "A" "B")))))
> 
> The raise-value calculation has gone, because I use #:vcenter, but I had
> to comment
> out the font-family line, because I got an error saying "unbound
> variable: font-family"
> if it is in the source. What's going wrong here?

Try #'(cons 'font-family 'sans), and see if that will work.  It may be that
the way things are substituted by the macro expansion is causing it to work
differently than I would expect with straight Scheme.

> 
>>  
>>>> 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.
>>>> 
>>>>      
>> 
>> Here Neil points out the thing he's most concerned about.  It's not a
>> concern about the magic numbers per se, it's that they don't change with
>> staff-spacing.  In my earlier email (let me know if you didn't get it), I
>> asked for his help with that problem.
>> 
>>  
> With the definition above, I inserted #(set-global-staff-size <num>)
> and tried values from 10 to 100, and it worked as expected.
> So the quadratic equation seems to be the right way.

OK, so the baseline skip is apparently sized in terms of staff spaces, which
means your equations are right.

Thanks,

Carl



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to