lilypond-devel
[Top][All Lists]
Advanced

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

RE: Fret Diagram markup


From: Han-Wen Nienhuys
Subject: RE: Fret Diagram markup
Date: Tue, 25 May 2004 23:20:05 +0200

address@hidden writes:
> address@hidden writes:
> > > -----Original Message-----
> > > From: Han-Wen Nienhuys [mailto:address@hidden 
> > > Sent: Tuesday, May 18, 2004 2:10 PM
> > > 
> > > I would like to start integrating your file into scm/fret-diagrams.scm
> > > - however, could I ask you to use hyphenated chord names? 
> > > When fret-diagrams.scm enters the Lilypond distribution, we 
> > > have to take over maintainership (for name changes in the 
> > > Scheme API).  Having a uniform coding style really helps us 
> > > work with the code.
> > > 
> > 
> > Attached is a copy of fret-diagrams.ly which has been converted to
> > hyphenated variable names.  It has been tested to work on lilypond
> > 2.2.0-1, which is the latest package provided by Bert Folodor.
> 
> I've added this to 2.3 cvs.

This was also an opportunity for me to take a closer look at your
code. I still have some remarks:

 * We want to separate formatting machinery from syntax.  Your
fret-diagram command accepts a string containing items separated by
semicolons.  It would be better style to put the items in a Scheme
list, eg.

  \fret-diagram-verbose #0.75 #'(6-x 5-x 4-o 1-2)

or even better,

  \fret-diagram-verbose #0.75
    #'((cross 6) (cross 5) (open 4) (barre 1 2))

A separate frontend could translate the current string syntax to a
Scheme list. 

 * The diagram items include settings for linethickness, height,
   width, etc.

   It would be better style to put these settings into properties, so
   you could do

           \translator { \StaffContext
             \override FretDiagram #'thickness = #0.2
           }

   and change all fret diagrams in one fell swoop.

   The properties delivered to the markup command through the props
   argument (which is a list of alists)

 * for multi-choice alternatives, such as

         f:number -- set fingering label type (0 = none, 1 = in circle
                  on string, 2 = below string) Default 0

   we use symbols instead of numbers. They are more descriptive.

 * For the same reason, I frown on single character command
   names. Write


     thickness, barre, radius

   instead of

     t, c, d

 * for alists, we generally use symbols, not strings as keys.

 * Unlike LISP, Scheme does not have nil pre-defined. Simply use '()

 * It would be nice if the width of a diagram were computed, from the
   length of the stringTunings property.

 * linethicknesses are generally expressed relative to the
   linethickness \paper variable. The default usually is 1.0


I should be grateful if you could address these issues. If possible,
can you work from the version that is in the CVS repository, and send
us a diff? You can download it from

  
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/fret-diagrams.scm

and clicking HEAD

(if you need to install it in your distribution, just plonk the file
next to the other scheme files, and add it to the list of filenames in
lily.scm)


Thanks for your work!


-- 

 Han-Wen Nienhuys   |   address@hidden   |   http://www.xs4all.nl/~hanwen 





reply via email to

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