Re: Use custom font's flat (b) and sharp (#) symbols for chords (solved)

2011-02-16 Thread Matthias Hüsken
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/lilypond-user@gnu.org/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
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Use custom font's flat (b) and sharp (#) symbols for chords (solved)

2011-02-16 Thread Xavier Scheuer
2011/2/16 Matthias Hüsken matthias.hues...@math.uni-wuppertal.de:

 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/lilypond-user@gnu.org/msg02286.html

 In case someone else stumbles upon this problem, here is my (shortened)
 solution:

 [...]


Hi,

In case someone else stumbles upon this problem, it would be great if
the solution was on the LSR : http://lsr.dsi.unimi.it/

Could you add this as a new snippet ?
http://lsr.dsi.unimi.it/LSR/html/contributing.html

Thanks in advance.

Cheers,
Xavier

-- 
Xavier Scheuer x.sche...@gmail.com

___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Use custom font's flat (b) and sharp (#) symbols for chords(solved)

2011-02-16 Thread Phil Holmes
- Original Message - 
From: Xavier Scheuer x.sche...@gmail.com

To: Matthias Hüsken matthias.hues...@math.uni-wuppertal.de
Cc: lilypond-user@gnu.org
Sent: Wednesday, February 16, 2011 5:32 PM
Subject: Re: Use custom font's flat (b) and sharp (#) symbols for 
chords(solved)



2011/2/16 Matthias Hüsken matthias.hues...@math.uni-wuppertal.de:


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/lilypond-user@gnu.org/msg02286.html

In case someone else stumbles upon this problem, here is my (shortened)
solution:

[...]



Hi,

In case someone else stumbles upon this problem, it would be great if
the solution was on the LSR : http://lsr.dsi.unimi.it/

Could you add this as a new snippet ?
http://lsr.dsi.unimi.it/LSR/html/contributing.html

Thanks in advance.

Cheers,
Xavier

=

http://lsr.dsi.unimi.it/LSR/Item?id=750

(thanks, Matthias)

--
Phil Holmes



___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user