[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Toujours les positions des # et des b
From: |
Valentin Villenave |
Subject: |
Re: Toujours les positions des # et des b |
Date: |
Fri, 29 Jan 2010 21:31:09 +0100 |
2010/1/27 Éric Bouvéron <address@hidden>:
> Mais je me demande si c'est possible.
À la va-vite, je peux vous proposer la solution suivante (pompée dans
le code source) :
#(define (conditional-kern-before markup bool amount)
"Add AMOUNT of space before MARKUP if BOOL is true."
(if bool
(make-line-markup
(list (make-hspace-markup amount)
markup))
markup))
#(define-public (alteration->text-accidental-markup alteration)
(make-smaller-markup
(make-raise-markup
(if (= alteration FLAT)
1.7
2)
(make-musicglyph-markup
(assoc-get alteration standard-alteration-glyph-name-alist "")))))
#(define (accidental->markup alteration)
"Return accidental markup for ALTERATION."
(if (= alteration 0)
(make-line-markup (list empty-markup))
(conditional-kern-before
(alteration->text-accidental-markup alteration)
(= alteration FLAT) 0.2)))
#(define-public (special-note-name->markup pitch)
"Return pitch markup for PITCH."
(make-line-markup
(list
(make-simple-markup
(vector-ref #("C" "D" "E" "F" "G" "A" "B") (ly:pitch-notename pitch)))
(accidental->markup (ly:pitch-alteration pitch)))))
\layout {
\context {
\Score
chordRootNamer = #special-note-name->markup
}
}
\chords {
cis1 fis:7 fis:m
}
Cordialement,
Valentin