[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

chord symbols as plain text

From: Tao Cumplido
Subject: chord symbols as plain text
Date: Mon, 09 Feb 2009 21:10:17 +0100


in the past I used to create chord symbols as plain text by just placing a 
Lyrics context above the staff used with an own font.
I don't like the way LP handles chordsymbols right now, nor do I like the font 
it uses.
The only thing I was missing in my way was the possibility to transpose the 
chord symbols. Now the thread started by Carl Sorensen some time ago made me 
get into scheme and write a function which makes this possible.

Well, I finally finished my function and wanted to share it here in case 
someone might find it useful. Thanks to Carl for all the great help.

I am not entirely sure yet why everythings works the way it does but basically 
I made a function \chordSymbols which returns the chord symbol for each music 
input as a LyricEvent. Also these music inputs can be put inside a 
\transpose-block inside the \chordSymbols, i.e.
\chordSymbols {\transpose bes c {music}}
There are three basic valid input forms:

c will print a C chordsymbol
<c e> will print a slashchord, in this case C/E
r will return an empty string and is used to skip parts

All these forms can be extended by a markup string:
c-"7" will print a C7 chordsymbol
<c e>-"7" will print C7/E
r-"N.C." will print a N.C. symbol which is not affected by transposition

I suppose any other input will return an error while compiling.

Right now the function is configured to be used with my JazzChords font which 
is basically the standard LilyPond's text and music font tweaked to print chord 
symbols. I am no experienced font designer so a purist might find quite some 
typographical errors. I also tried to define a kerning table with fontforge to 
make especially the slashchords better looking but it doesn't really seem to 
work in LilyPond.
Now that notenaming is taken over by my function I am thinking about extending 
the font by putting all the notename relevant glyphs into some special unicode 
area to have more ASCII free for possible suffix variations. I attached a table 
which shows all the possible characters at this moment.

Well, I hope there are some people who can make use of this function.
I think that it's also easy to adjust the function to work with other chord 
symbol fonts like the ones from for example.

Here is a short sample how this function can be used.

\include ""

\new Staff = "s" \new Voice = "v" { g'2 c' f'1 bes'2 es' a' d' }
\new Lyrics \with { alignAboveContext = "s" }
        \override LyricText #'font-name = "JazzChords"
        \set associatedVoice = "v"
        { \chordSymbols { \transpose c f { d2-"m7" <g b>-"13" c1-"M{k}" f2-"7x" 
bes-"mg" e-"h" a-"7a" } } }

Although the duration in the input is taken into account it's right now not 
possible to print two halfnote chordsymbols above a bar which contains only a 
whole note. This seems to be a general problem of LilyPond with directly 
specified durations in Lyrics. I am not entirely sure but I think this wasn't 
the case in earlier versions.
A workaround might be to associate the Lyrics with a Devnull context instead of 
a Voice context.

So far. Any criticism on code improvement and general use is apreciated.



Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
für nur 17,95 Euro/mtl.!*

Description: Text Data

Attachment: charlist.pdf
Description: Adobe PDF document

Attachment: JazzCho0.ttf
Description: Binary data

Attachment: sample.png
Description: PNG image

reply via email to

[Prev in Thread] Current Thread [Next in Thread]