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

2011-02-16 Thread Matthias Hüsken
Hi again,

thx so far. Sorry for my English, I think I did not make myself clear enough, 
so I'll try to elaborate a little more.

What I have:

- I am setting notes and chords.
- I changed the font for the chords to a custom one (real book style).
- Notes (and related accidentals like flat and sharp) are set as usual.
- Chord names (and options like 7, sus4 etc.) are set in the custom font.
- Chord accidentals (like the b in A flat (Ab) or the # in F sharp (F#)
  are set with the symbols from Lilypond's font (i.e. accidentals.sharp and
  accidentals.flat from the Feta font).
- Accidentals in chord options (like the b in 7/b9) are set using Feta.

What I'd like to have:

- The output of notes and related accidentals should remain as is.
- Chord accidentals (i.e. for chord names like Ab as well as for chord.
  options like 7/#9) should be set using the b and # from the custom
  font.

Possible options and problems:

1. I could make Lilypond use the custom font's symbols for flat and sharp by
   default like suggested (i.e. fiddling with the font directory).
   Disadvantage: Accidentals for regular notes would also be set with b
   and # from the custom font.
2. I could make Lilypond set chord options (7/b5 etc.) using the custom b
   and # by adding exceptions for all needed chords to
   sequential-music-to-chord-exceptions. Problem: All accidentals in chords
   (e.g. in Ab or F#) would still use the symbols from Feta.

While option 1. is not viable (I do not want to lose Lilypond's accidentals 
for regular notes), option 2. partly solves the problem (for chord options), 
but then I would have two different types of accidentals when setting chords.

So, what I would ideally like to have is a way of making Lilypond use b 
and # from a custom font, but exclusively in chord mode. I did quite some 
searching but did not come up with anything useful, so I already feared it 
might not be easy (or doable at all...).

Any ideas?

Thanks

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

2011-02-16 Thread Marc Hohl

Am 16.02.2011 10:29, schrieb Matthias Hüsken:

Hi again,

thx so far. Sorry for my English, I think I did not make myself clear enough,
so I'll try to elaborate a little more.

What I have:

- I am setting notes and chords.
- I changed the font for the chords to a custom one (real book style).
- Notes (and related accidentals like flat and sharp) are set as usual.
- Chord names (and options like 7, sus4 etc.) are set in the custom font.
- Chord accidentals (like the b in A flat (Ab) or the # in F sharp (F#)
   are set with the symbols from Lilypond's font (i.e. accidentals.sharp and
   accidentals.flat from the Feta font).
- Accidentals in chord options (like the b in 7/b9) are set using Feta.

What I'd like to have:

- The output of notes and related accidentals should remain as is.
- Chord accidentals (i.e. for chord names like Ab as well as for chord.
   options like 7/#9) should be set using the b and # from the custom
   font.

Possible options and problems:

1. I could make Lilypond use the custom font's symbols for flat and sharp by
default like suggested (i.e. fiddling with the font directory).
Disadvantage: Accidentals for regular notes would also be set with b
and # from the custom font.
2. I could make Lilypond set chord options (7/b5 etc.) using the custom b
and # by adding exceptions for all needed chords to
sequential-music-to-chord-exceptions. Problem: All accidentals in chords
(e.g. in Ab or F#) would still use the symbols from Feta.

While option 1. is not viable (I do not want to lose Lilypond's accidentals
for regular notes), option 2. partly solves the problem (for chord options),
but then I would have two different types of accidentals when setting chords.

So, what I would ideally like to have is a way of making Lilypond use b
and # from a custom font, but exclusively in chord mode. I did quite some
searching but did not come up with anything useful, so I already feared it
might not be easy (or doable at all...).

I think you can achieve what you want by writing a scheme function
similar to those defined in scm/chord-names.scm.

See for example the definition of note-name-german-markup.
There you find that accidentals are replaced by -es -eses -is or -isis,
respectively. So you could copy most of this definition and place
your custom glyphs in there.

HTH

Marc




Any ideas?

Thanks

Matthias

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




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


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

2011-02-16 Thread Matthias Hüsken
Hi everyone,

I'm new to Lilypond and impressed with the ease of writing music and the 
quality of the output.

For writing lead sheets, I changed Lilypond's standard font for printing chord 
names to a custom font. While this works perfectly, the style difference 
between the chord symbols and Lilypond's flat and sharp symbols is very 
obvious. Is there a way to make Lilypond use the custom font's b and # 
symbols instead of the internal ones?

Thanks in advance,

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

2011-02-16 Thread Matthias Hüsken
  So, what I would ideally like to have is a way of making Lilypond use b
  and # from a custom font, but exclusively in chord mode. I did quite
  some searching but did not come up with anything useful, so I already
  feared it might not be easy (or doable at all...).

 I think you can achieve what you want by writing a scheme function
 similar to those defined in scm/chord-names.scm.

 See for example the definition of note-name-german-markup.
 There you find that accidentals are replaced by -es -eses -is or -isis,
 respectively. So you could copy most of this definition and place
 your custom glyphs in there.

That's actually quite a good idea. Based on your idea, the following should do 
the trick:

#(define my-alteration-glyph-name-alist
 '(
   ;; ordered for optimal performance.
   (0 . )
   (-1/2 . #)
   (1/2 . b)

   ))

#(define (my-alteration-text-accidental-markup alteration)
  (make-smaller-markup
   (make-raise-markup
(if (= alteration FLAT)
0.3
0.6)
(make-text-markup
 (assoc-get alteration my-alteration-glyph-name-alist )


My only problem is: How do I get this code to work, i.e. how do I get LilyPond 
to use this code in chord-mode? I assume I would need to somehow activate it 
in the ChordNames context, bit how does this actually work?

Matthias


-- 

Matthias Hüsken  Phone: +49 202 439-3362
Fachbereich Mathematik   Fax:   +49 202 439-2912
Bergische Universität
Gaußstraße 20
D - 42097 Wuppertal

e-mail: matthias.hues...@math.uni-wuppertal.de


___
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 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

2011-02-16 Thread Carl Sorensen
On 2/16/11 2:29 AM, Matthias Hüsken
matthias.hues...@math.uni-wuppertal.de wrote:

 Hi again,
 
 thx so far. Sorry for my English, I think I did not make myself clear enough,
 so I'll try to elaborate a little more.

Your English is great.  I just think that none of us knew how to answer you.

 
 So, what I would ideally like to have is a way of making Lilypond use b
 and # from a custom font, but exclusively in chord mode.

I think you mean exclusively in the ChordNames context, rather than
exclusively in chord mode

 I did quite some
 searching but did not come up with anything useful, so I already feared it
 might not be easy (or doable at all...).
 

I think you can redefine alteration-text-accidental-markup  (it's found in
scm/chord-name.scm.

I don't think that you need to edit scm/chord-name.scm.  A definition in
your input file should redefine the existing procedure.

HTH,

Carl


___
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


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

2011-02-15 Thread Matthias Hüsken
Hi everyone,

I'm new to Lilypond and impressed with the ease of writing music and the 
quality of the output.

For writing lead sheets, I changed Lilypond's standard font for printing chord 
names to a custom font. While this works perfectly, the style difference 
between the chord symbols and Lilypond's flat and sharp symbols is very 
obvious. Is there a way to make Lilypond use the custom font's b and # 
symbols instead of the internal ones?

Thanks in advance,

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

2011-02-15 Thread James Lowe
Matthias,

)-Original Message-
)From: lilypond-user-bounces+james.lowe=datacore@gnu.org
)[mailto:lilypond-user-bounces+james.lowe=datacore@gnu.org] On
)Behalf Of Matthias Hüsken
)Sent: 15 February 2011 15:53
)To: lilypond-user@gnu.org
)Subject: Use custom font's flat (b) and sharp (#) symbols for chords
)
)Hi everyone,
)
)I'm new to Lilypond and impressed with the ease of writing music and the
)quality of the output.
)
)For writing lead sheets, I changed Lilypond's standard font for printing
)chord names to a custom font. While this works perfectly, the style
)difference between the chord symbols and Lilypond's flat and sharp
)symbols is very obvious. Is there a way to make Lilypond use the custom
)font's b and #
)symbols instead of the internal ones?
)
---

Not easily. The flat and sharp glyphs are 'hard coded' as it were. 

http://lilypond.org/doc/v2.13/Documentation/notation/the-feta-font#accidental-glyphs

While LilyPond can use other specially design fonts, for instance see:

http://www.chiark.greenend.org.uk/~sgtatham/gonville/  (we do mention this in 
our Documentation but all the installation instructions are here)

This still has a hard coded glyph. It may be nearer to what you need though?

You would need to replace the specific glyph for the sharp and flat manually 
within the 'fonts' directory that is installed with LilyPond - which is what 
the above link does for its own font. I don't know how easy that would be for 
you to do - it's certainly beyond my knowledge.

Alternatively you could use the LilyPond glyph within the chordname by using 
the \flat and \sharp markup.

James



___
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

2011-02-15 Thread Matthias Hüsken
Thx for the answer!

 )For writing lead sheets, I changed Lilypond's standard font for printing
 )chord names to a custom font. While this works perfectly, the style
 )difference between the chord symbols and Lilypond's flat and sharp
 )symbols is very obvious. Is there a way to make Lilypond use the custom
 )font's b and #
 )symbols instead of the internal ones?
 )
 ---

 Not easily. The flat and sharp glyphs are 'hard coded' as it were.

 http://lilypond.org/doc/v2.13/Documentation/notation/the-feta-font#accident
al-glyphs

 While LilyPond can use other specially design fonts, for instance see:

 http://www.chiark.greenend.org.uk/~sgtatham/gonville/  (we do mention this
 in our Documentation but all the installation instructions are here)

 This still has a hard coded glyph. It may be nearer to what you need
 though?

 You would need to replace the specific glyph for the sharp and flat
 manually within the 'fonts' directory that is installed with LilyPond -
 which is what the above link does for its own font. I don't know how easy
 that would be for you to do - it's certainly beyond my knowledge.

I already found this solution, but to me, it looks like overkill to simply 
replace two symbols. Especially as I need the changed symbols only in 
chordmode - for notes, LiliPond's are perfect.

 Alternatively you could use the LilyPond glyph within the chordname by
 using the \flat and \sharp markup.

I'm not sure I understand - I do not want to use LilyPond's glyphs in chord 
names, but custom ones...


For my purposes, it would just like to be able to redefine the sharp and flat 
symbols only for the chord mode, but I did not find any easy solution... and 
I do not know if this is even possible.

Matthias


-- 

Matthias Hüsken  Phone: +49 202 439-3362
Fachbereich Mathematik   Fax:   +49 202 439-2912
Bergische Universität
Gaußstraße 20
D - 42097 Wuppertal

e-mail: matthias.hues...@math.uni-wuppertal.de


___
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

2011-02-15 Thread James Lowe
Hello

)-Original Message-
)From: lilypond-user-bounces+james.lowe=datacore@gnu.org
)[mailto:lilypond-user-bounces+james.lowe=datacore@gnu.org] On
)Behalf Of Matthias Hüsken
)Sent: 15 February 2011 17:25
)To: lilypond-user@gnu.org
)Subject: Re: Use custom font's flat (b) and sharp (#) symbols for chords
)


)I already found this solution, but to me, it looks like overkill to simply
)replace two symbols. Especially as I need the changed symbols only in
)chordmode - for notes, LiliPond's are perfect.

It may be possible to refer using a markup option to refer to a specific 
character within a font - what I mean by that is that we can print UTF 
characters by using a specific markup command along with the UTF number (so you 
can show accents and diacritics etc.). I am not really knowledgeable if you can 
refer to a non-standard character in a font by using this method, someone else 
may know - for example I know that the 'hash' character on a mac is 'alt-3' if 
you use the keyboard but there maybe a mapping reference we can use to tell 
LilyPond to print that character instead. That way you could then use that 
custom font character 'as if' you were typing it on the keyboard. I hope that 
makes sense to someone?

)
) Alternatively you could use the LilyPond glyph within the chordname by
) using the \flat and \sharp markup.
)
)I'm not sure I understand - I do not want to use LilyPond's glyphs in chord
)names, but custom ones...
)

Well you said the chord font didn't match the lilypond ones, so I suggested 
replacing the chord font accidentals with Lilyponds' so the accidentals all 
look the same. :)

regards

James

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