[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tuning description at beginning of TabStaff
From: |
Valentin Petzel |
Subject: |
Re: Tuning description at beginning of TabStaff |
Date: |
Tue, 31 Jan 2023 15:07:18 +0100 |
Hello Jean,
this does not work on 2.24. Do you happen to know what changed to make this
work on 2.25?
Am Dienstag, 31. Jänner 2023, 14:48:26 CET schrieb Jean Abou Samra:
> On 30/01/2023 22:45, Stefan E. Mueller wrote:
> > This works for me, but I wonder if the vertical position of the individual
> > tablature lines could be accessed and used for the positioning of the
> > letters instead of doing things by hand.
>
> Yes, it's possible. Try
>
> \version "2.25.1"
>
> % doesn't exist?
> #(define (grob-interpret-markup-list grob mkuplist)
> (let* ((layout (ly:grob-layout grob))
> (defs (ly:output-def-lookup layout 'text-font-defaults))
> (chain (ly:grob-alist-chain grob defs)))
> (interpret-markup-list layout chain mkuplist)))
>
> displayTuning =
> #(define-music-function (padding tuning) (number? markup-list?)
> (let ((tuning #{ \markuplist \fontsize #-3 \general-align #X #RIGHT
> \general-align #Y #CENTER #tuning #})) #{
> \override TabStaff.StaffSymbol.stencil =
> #(grob-transformer
> 'stencil
> (lambda (grob original)
> (let* ((staff-space (ly:staff-symbol-staff-space grob)))
> (ly:stencil-add
> original
> (apply ly:stencil-add
> (map (lambda (stil pos)
> (let* ((stil (ly:stencil-translate-axis stil
> (- padding) X)) (stil (ly:stencil-translate-axis stil (* 1/2 staff-space
> pos) Y))) stil))
> (grob-interpret-markup-list grob tuning)
> (ly:grob-property grob 'line-positions)))))))
> #}))
>
>
> %%%
>
>
> \new TabStaff \with {
> \override InstrumentName.self-alignment-X = #RIGHT
> \override InstrumentName.padding = 1.5
> \displayTuning 0.6 \markuplist { d b g D A D }
> instrumentName = \markup {
> \center-column {
> " "
> \raise #-0.4
> "Ac. Guitar"
> \override #'(font-size . -1.5)
> "(Double Drop-D)"
> " "
> }
> }
> shortInstrumentName = "git"
> stringTunings = \stringTuning <d, a, d g b d'>
> } {
> d,8\6 d'\2 d\4 d'\1 d,8\6 d'\2 d4\4
> }
signature.asc
Description: This is a digitally signed message part.