[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Positioning text below notes at the same height
From: |
David Kastrup |
Subject: |
Re: Positioning text below notes at the same height |
Date: |
Thu, 02 Aug 2012 20:24:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
"address@hidden" <address@hidden> writes:
> On 2012-08-02 18:46, Thomas Morley wrote:
>> fN =
>> #(define-music-function (parser location fretp) (string?)
>> (let ((m (make-music 'TextScriptEvent 'text fretp)))
>> (set! (ly:music-property m 'tweaks)
>> (acons 'staff-padding 4 (ly:music-property m 'tweaks)))
>> m))
>
> Hello Thomas,
>
> You almost nailed it! I wanted a box around the fretnumber. changed
> your function to this which I'm happy with!
>
> fN =
> #(define-music-function (parser location fretp) (string?)
> (let ((m (make-music 'TextScriptEvent 'text (markup #:line (#:box
> fretp)))))
> (set! (ly:music-property m 'tweaks)
> (acons 'staff-padding 5 (ly:music-property m 'tweaks)))
> m))
>
Ah, "version 2.14.2". In a current version, you could just write
fN =
#(define-event-function (parser location fretp) (markup?)
#{ -\tweak #'staff-padding #5 -\markup \line { \box #fretp } #})
And that's it. You might still want to consider exchanging the string?
predicate with markup? though: it would still accept strings (possibly
only without # though: I don't quite remember what 2.14.2 did here), but
also more complex markups.
--
David Kastrup