[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: chord names
From: |
Klaus Blum |
Subject: |
Re: chord names |
Date: |
Fri, 10 Feb 2017 17:04:13 -0700 (MST) |
Benjamin Bloomfield wrote
> I'm trying to figure out how to tweak the size of the sharp and flat
> symbol that displays when the chord name has one in it. Those symbols are
> slightly taller than the capitals in my font, and I'd like to get them
> even.
Maybe there's an easier way, but here's a first solution. It's a quick
modification of
http://www.lilypondforum.de/index.php?topic=824.0
%
----------------------------------------------------------------------------------
#(define (note-name->international-markup pitch lowercase?)
(let* (
(name (ly:pitch-notename pitch))
(alt (ly:pitch-alteration pitch))
(hspace (vector-ref #(0.15 0.15 0.05 0.05 0.15) (+ (* alt 2) 2)))
(raise (vector-ref #(0.6 0.6 0.65 0.8 0.7) (+ (* alt 2) 2)))
)
(if (>= alt 0)
(make-line-markup
(list
(make-simple-markup
(if lowercase?
(vector-ref #("c" "d" "e" "f" "g" "a" "b") name)
(vector-ref #("C" "D" "E" "F" "G" "A" "B") name)
)
)
(if (= alt 0)
;; If it's natural and not b, do nothing
(make-line-markup (list empty-markup))
;; Else add alteration
(make-line-markup
(list
(make-hspace-markup hspace)
(make-tiny-markup (make-raise-markup raise ;
make-tiny-markup instead of make-smaller-markup
(make-musicglyph-markup
(assoc-get alt
standard-alteration-glyph-name-alist ""))))
))
)))
(make-line-markup
(list
(make-simple-markup
(if lowercase?
(vector-ref #("c" "d" "e" "f" "g" "a" "b") name)
(vector-ref #("C" "D" "E" "F" "G" "A" "B") name)
)
)
(if (= alt 0)
;; If it's natural and not b, do nothing
(make-line-markup (list empty-markup))
;; Else add alteration
(make-line-markup
(list
(make-hspace-markup hspace)
(make-tiny-markup (make-raise-markup raise ;
make-tiny-markup instead of make-smaller-markup
(make-musicglyph-markup
(assoc-get alt
standard-alteration-glyph-name-alist ""))))
))
)))
)
)
)
internationalChords = {
\set Staff.chordRootNamer = #note-name->international-markup
% \unset Staff.chordNoteNamer
}
\new ChordNames \chordmode {
as a ais bes b bis
\internationalChords
as a ais bes b bis
}
%
----------------------------------------------------------------------------------
Cheers,
Klaus
--
View this message in context:
http://lilypond.1069038.n5.nabble.com/chord-names-tp199985p199990.html
Sent from the User mailing list archive at Nabble.com.
- chord names, Benjamin Bloomfield, 2017/02/10
- Re: chord names, Klaus Blum, 2017/02/10
- Re: chord names,
Klaus Blum <=
- Re: chord names, Benjamin Bloomfield, 2017/02/11
- Re: chord names, Noeck, 2017/02/11
- Re: chord names, Klaus Blum, 2017/02/11
- Re: chord names, Noeck, 2017/02/11
- Re: chord names, Noeck, 2017/02/13
- Re: chord names, Klaus Blum, 2017/02/13
- Re: chord names, Klaus Blum, 2017/02/13