lilypond-user-fr
[Top][All Lists]
Advanced

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

Re: Fonte pour basse chiffrée


From: Jean Abou Samra
Subject: Re: Fonte pour basse chiffrée
Date: Wed, 21 Dec 2022 11:48:45 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Le 21/12/2022 à 01:06, Bernard Meylan a écrit :
Merci Jean pour votre solution. Elle marche bien, à ceci près:

1. les altérations (maintenant rendues parfaitement en Emmentaler) sont énormes à côté des chiffres; y a t-il moyen de contrôler leur chasse (grosseur) dans le code que vous avez suggéré?


Oui, voir ci-dessous.


2. elles sont aussi «grasses» (bold en anglais), comme on le ferait avec un traitement de texte, mais un gras «flou» typique du fait que le traitement de texte, n'ayant pas de version grasse de la police, utilise un pis-aller, il la «grassifie» artificiellement. Les dièses et bémols de la basse chiffrée sont gras et flous, ce qui n'était pas le cas de leurs prédécesseurs, sous 2.22.



Alors ça, je ne sais pas si le développeur qui a révisé la basse
chiffrée va être ravi de l'entendre, car ce n'est pas un gras
artificiel, ce sont de nouveaux glyphes d'altération spécialement
prévus et adaptés pour la basse chiffrée... Ils sont censés
correspondre mieux aux éditions classiques, où la basse chiffrée
était imprimée beaucoup plus petit que ce que faisait LilyPond
2.22 par défaut. Il se peut par contre qu'ils aient l'air moche pour
vous à cause de la taille générale, car ils sont plutôt faits
pour des tailles petites, et effectivement plus gras en conséquence.


\version "2.24.0"

\markuplist \override #'(padding . 2) \table #(list CENTER CENTER) {
  \bold { "Normal" "Basse chiffrée" }
  \general-align #Y #CENTER {
    \musicglyph "accidentals.sharp"
    \number ♯
    \musicglyph "accidentals.flat"
    \number ♭
    \musicglyph "accidentals.natural"
    \number ♮
  }
}


Bien sûr, on peut toujours le changer, voici une version révisée
du code, avec une partie à ajuster où vous pouvez éditer le \markup :


\version "2.24.0"


#(define figbass-accidental-alist
  '((-1 . "accidentals.flatflat")
    (-1/2 . "accidentals.flat")
    (0 . "accidentals.natural")
    (1/2 . "accidentals.sharp")
    (1 . "accidentals.doublesharp")))

#(define (modified-format-bass-figure figure event context)
  (let* (;; User properties controlling the figured bass layout.
         (large-number-alignment
          (ly:context-property context 'figuredBassLargeNumberAlignment))
         (figbass-alist
          (ly:context-property context 'figuredBassPlusStrokedAlist))
         (alt-dir
          (ly:context-property context 'figuredBassAlterationDirection))
         (plus-dir
          (ly:context-property context 'figuredBassPlusDirection))

         (augmented (ly:event-property event 'augmented))

         ;; The digit(s), horizontally positioned, or #f.
         (fig-markup
          (if (number? figure)
              ((if (<= 10 figure)
                   (lambda (y)
                     (make-align-on-other-markup
                      X
                      large-number-alignment (make-number-markup "1")
                      large-number-alignment y))
                   identity)
               (cond
                ((eq? #t (ly:event-property event 'diminished))
                 (make-slashed-digit-markup figure))
                ((eq? #t (ly:event-property event 'augmented-slash))
                 ;; Use specially stroked digit if available and wanted.
                 (or (and-let* (((<= 6 figure 9))
                                (glyph (assv-ref figbass-alist figure)))
                       (make-musicglyph-markup glyph))
                     (make-backslashed-digit-markup figure)))
                ((eq? #t augmented)
                 ;; Use special digit with plus if available and wanted.
                 (or (and-let* (((>= 5 figure 2))
                                ((eqv? plus-dir RIGHT))
                                (glyph (assv-ref figbass-alist figure)))
                       (set! augmented #f)
                       (make-musicglyph-markup glyph))
                     (make-number-markup (number->string figure 10))))
                (else (make-number-markup (number->string figure 10)))))
              #f))

         (alt (ly:event-property event 'alteration))
         (alt-bracket (ly:event-property event 'alteration-bracket #f))
         ;; The alteration, probably bracketed but not positioned yet,
         ;; or #f.
         (alt-markup
          (if (number? alt)
              ((if alt-bracket make-bracket-markup identity)
               (let ((glyph
                      (or (assv-ref figbass-accidental-alist alt)
                          (begin
                            (ly:warning
                             (G_ "no accidental glyph found for alteration ~a")
                             alteration)
                            #\?))))
                 ;;; ====== À ajuster ==========
                 #{
                   \markup
                   \override #'(font-name . #f)
                   \fontsize #-3
                   \align-on-other #Y #CENTER #fig-markup #CENTER
                   \musicglyph #glyph
                 #}))
              #f))

         (plus-markup (if (eq? #t augmented)
                          (make-number-markup "+")
                          #f)))

    (if (and (not alt-markup) alt-bracket)
        (ly:programming-error
         "Cannot put brackets around non-existent bass figure alteration."))

    ;; We treat a solitary alteration similarly to digits.
    (if (and (not fig-markup) alt-markup)
        (begin
          (set! fig-markup
                (make-align-on-other-markup
                 X
                 CENTER (make-number-markup "1")
                 CENTER alt-markup))
          (set! alt-markup #f)))

    ;; We treat a solitary plus similarly to digits (but enlarged).
    (if (and (not fig-markup) plus-markup)
        (begin
          (set! fig-markup
                (make-align-on-other-markup
                 Y
                 CENTER (make-number-markup "1")
                 CENTER (make-align-on-other-markup
                         X
                         CENTER (make-number-markup "1")
                         CENTER (make-fontsize-markup 3 plus-markup))))
          (set! plus-markup #f)))

    ;; The alteration gets attached either to the left or the right of
    ;; the digit(s).
    (if alt-markup
        (set! fig-markup
              (make-put-adjacent-markup
               X (if (number? alt-dir)
                     alt-dir
                     LEFT)
               fig-markup
               (make-pad-x-markup 0.1 alt-markup))))

    ;; Ditto for the plus mark.
    (if plus-markup
        (set! fig-markup
              (if fig-markup
                  (make-put-adjacent-markup
                   X (if (number? plus-dir)
                         plus-dir
                         LEFT)
                   fig-markup plus-markup)
                  plus-markup)))

    (if (markup? fig-markup)
        (make-fontsize-markup -5 fig-markup)
        (make-null-markup))))

\layout {
  \context {
    \Score
    figuredBassFormatter = #modified-format-bass-figure
  }
}



\figures {
  \override BassFigure.font-name = "DejaVu Sans"
  <7+> <7-> <7!> <7--> <7++>
}




Cordialement,
Jean

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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