Hi again,
thanks a lot for the pointers in the right direction, I finally got my problem
solved. It is based on the solution found here:
http://www.mailinglistarchive.com/[email protected]/msg02286.html
In case someone else stumbles upon this problem, here is my (shortened)
solution:
% correct markup for "b" and "#" (use symbols from current font...)
chordFlat = \markup { \hspace #0.2 \fontsize #-1 \raise #0.1 "b" }
chordSharp = \markup { \hspace #0.1 \fontsize #-1 \lower #0.3 "#" }
% define custom chords
mhPopChordsMusic =
{
<c e g bes>-\markup { \super "7" }
% ... define all other possible chords here...
}
% Add to existing exceptions
mhPopChordsAdd = #(append
(sequential-music-to-chord-exceptions mhPopChordsMusic #t)
ignatzekExceptions)
% fix accidentals with some Scheme (using the current font's symbols)
#(define (mh-chord-name->pop-markup pitch)
(let* ((alt (ly:pitch-alteration pitch)))
(make-line-markup
(list
(make-simple-markup (vector-ref #("C" "D" "E" "F" "G" "A" "B"
(ly:pitch-notename pitch)))
;; If it's natural, do nothing
(if (= alt 0)
(make-line-markup (list empty-markup))
(if (= alt FLAT)
;; Otherwise, handle adding the flat symbol
(make-line-markup
(list
(make-hspace-markup 0.3) ;; WAS: 0.4
(make-small-markup (make-raise-markup 0.7
(make-text-markup "b")))
))
;; or handle adding the sharp symbol
(make-line-markup
(list
(make-hspace-markup 0.1) ;; WAS: 0.2
(make-small-markup (make-raise-markup 0.7
(make-text-markup "#")))
))
)))))
)
% % use like this:
%
% {
% popChords =
% {
% \set chordNameExceptions = #mhPopChordsAdd
% \set chordRootNamer = #mh-chord-name->pop-markup
% }
% }
%
% % or like this:
%
% \layout
% {
% \context
% {
% \Score
% chordNameExceptions = #mhPopChordsAdd
% chordRootNamer = #mh-chord-name->pop-markup
% }
% }
Thanks again!
Matthias
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user