Subject: Bogue en bass chiffrée?

From: Bernard Meylan <[email-masked]>
Date: Mon, 21 Aug 2023 11:29:12 +0200

Bonjour à tout le groupe!

Avec ce code

\version "2.24.0" #(set-global-staff-size 20) \header {   % Supprimer le 
pied de page par défaut   tagline = ##f } #(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 #(or 
fig-markup #{ \markup \number "1" #}) #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 0 fig-markup)         (make-null-markup)))) global 
= {   \key c \major   \time 4/4 } bcMusic = \relative c {   \global   c4 
c c d e2 d } bcFigures = \figuremode {   \global   \set 
figuredBassAlterationDirection = #RIGHT   \override BassFigure.font-name 
= #"Garamond Premier Pro"   % \override BassFigure.font-size = #2   
<5\\>4 <4+> <_-> } \score {   <<     \new FiguredBass \bcFigures     
\new Staff { \clef bass \bcMusic }   >>   \layout {     \context {       
\Score       figuredBassFormatter = #modified-format-bass-figure     }   
} }

soit de vouloir un accord de «petite quinte» (quinte diminuée), donc un 
«5» barré obliquement, j'utilise ceci <5\\> et obtiens ce message de 
grève générale:

Démarrage lilypond 2.24.2 [Sans titre]...

Traitement de « /tmp/frescobaldi-uu7s426q/tmpjsy98edb/document.ly »

Analyse...

Interprétation en cours de la musique...

/home/bameylan/lilypond-2.24.2/share/lilypond/2.24.2/ly/init.ly:65:2: 
Erreur : Guile a signalé une erreur pour l'expression débutant ici

#

(let ((book-handler (if (defined? 'default-toplevel-book-handler)

Unbound variable: and-let*

Arrêté avec le code de retour 1.

et puis plus rien.

Si j'ôte le code aimablement fourni par Jean (#(define 
figbass-accidental-alist etc.), tout rentre dans l'ordre.

Amitiés.

Bernard

---

From: Jean Abou Samra <[email-masked]>
Date: Mon, 21 Aug 2023 11:32:39 +0200

Bonjour Bernard,

C'est mon code qui est bugué, j'ai oublié cette ligne au tout début :

#(use-modules (srfi srfi-2))

Cordialement,
Jean

---

From: Bernard Meylan <[email-masked]>
Date: Mon, 21 Aug 2023 12:00:36 +0200

C'est parfait. Merci Jean!

Bernard