Am Mi., 19. März 2025 um 01:53 Uhr schrieb Eric C <[email protected]>:
> Hello,
>
>
> I'm trying in vain to align annotations made with TextMark with the names
> of the chords produced on a harmonic grid. Is there a way to do this?
>
>
> Thank you for your help.
>
>
> [image]
>
> My code :
>
>
> \version "2.24.4"
>
> \paper {
> #(set-paper-size "letter landscape")
> indent = 0
> ragged-right = ##f
> }
>
> chExceptionMusic = {
> 1-\markup { \super "dim" } % c:dim
> -\markup { \super "dim7"} %c:dim7
> <c e g bes aes' >-\markup { \super "7(b13)" } % c:3.5.7.13-
> -\markup { \super "7(#5)"} % c:7.5+
> -\markup { \super "Maj7"} % c:7+
> }
> chExceptions = #(append (sequential-music-to-chord-exceptions
> chExceptionMusic #t) ignatzekExceptions)
>
> \markup vF = \markup \italic \fontsize #-2 \with-color #blue \etc %
> formatage des doigtés d'accords
>
> mesAccords = \chordmode { \set chordNameExceptions = #chExceptions
> \textMark \markup \vF "(5 x 5 6 6 x)" a:3.5.7.13-
> \textMark \markup \vF "(x 5 4 5 3 x)" d:7
> \textMark \markup \vF "(4 x 3 4 4 x)" aes2.:m6 \textMark \markup \vF "(x x
> 3 4 4 3)" g4:7.5+
> \textMark \markup \vF "(x x 5 5 5 7)" c1:7+
> \textMark \markup \vF "(x x 4 5 4 5)" fis2:dim7 \textMark \markup \vF "(x
> x 7 8 7 8)" a:dim7
> }
>
> %+++++++++++++++++ Grille harmonique ++++++++++++++++++
> \score {
> \new ChordGrid \mesAccords
> }
>
Probably:
\version "2.24.4"
\paper {
#(set-paper-size "letter landscape")
indent = 0
ragged-right = ##f
}
\markup vF = \markup \italic \fontsize #-2 \with-color #blue \etc
addGC =
#(define-music-function (text)(markup?)
#{
\override GridChordName.stencil =
#(grob-transformer 'stencil
(lambda (grob orig)
(ly:stencil-combine-at-edge
(ly:stencil-aligned-to orig X CENTER)
Y
DOWN
(ly:stencil-aligned-to
(grob-interpret-markup grob (make-vF-markup text))
X
CENTER)
1 ;; padding, adjust to taste
)))
#})
mesAccords = \chordmode {
\addGC "(5 x 5 6 6 x)" a1:3.5.7.13-
\addGC "(x 5 4 5 3 x)" d:7
\addGC "(4 x 3 4 4 x)" aes2.:m6
\addGC "(x x 3 4 4 3)" g4:7.5+
\addGC "(x x 5 5 5 7)" c1:7+
\addGC "(x x 4 5 4 5)" fis2:dim7
\addGC "(x x 7 8 7 8)" a:dim7
}
\new ChordGrid \mesAccords
But I'm not convinced.
Cheers,
Harm