lilypond-user
[Top][All Lists]
Advanced

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

Re: Suggestions for macro tools to generate .ly files


From: David Raleigh Arnold
Subject: Re: Suggestions for macro tools to generate .ly files
Date: Tue, 12 Oct 2004 14:35:59 -0400
User-agent: KMail/1.6.2

On Monday 11 October 2004 08:26 pm, Jack O'Quin wrote:
> 
> I'm helping a friend write an electric bass method book.  In an effort
> to reach as many players as possible, we decided to print each
> exercise in both bass clef and tablature.  Lilypond and lilypond-book
> work great for this.
> 
> After experimenting, we came up with dozens of snippets like the
> example below.  It looks good and has lots of information about
> fingerings and where to shift hand positions.
> 
> Since I've already created dozens of these little files and will be
> creating hundreds or even thousands more, I want some tools to ease
> the chore.  There is a lot of redundent information in each example.

sly was written to organize the use of \includes for your or any similar 
purpose.  The sly file includes only the information which changes, and 
you write an .ly file to use as a template and copy it.  Run the sly
file to split that into the files to be included, and then use
lyinclude to paste them into each .ly file in turn.  Working this way,
the little included notes files become temporary files, which
you overwrite by running sly each time.  It's at openguitar.com
daveA

> All I really need to type are the note sequence, fingerings, and the
> fingerboard position of each shift.  Conceptually, something like this
> should suffice...
> 
>    %% B-flat major arpeggio, second inversion
>    \exercise{f-1  bf-1 \pos{3} d-3 f-1  bf-1 \pos{7} d-1 |
>              f-4 d-1 bf-2 f-2 \pos{5} d-1 bf-2 |}
> 
> I could write a stand-alone script to expand that into the full .ly
> file.  But, should I do it all within lilypond using SCHEME?  (I know
> SCHEME, but not the internals of lilypond.)  Or, should I use
> something like the LaTeX \newcommand{}?  M4?  Emacs lisp?
> 
> I don't understand the whole infrastructure of lilypond and LaTeX well
> enough to know what approach to use.  What do you folks suggest?
> 
>   %% B-flat major arpeggio, second inversion
>   \version "2.0.0"
>   \include "english.ly"
>   fingerings = \notes \relative c, {
>       \clef bass \key bf \major
>       \repeat volta 2 {f-1  bf-1  d-3\startGroup f-1  bf-1\stopGroup
>          d-1\startGroup | f-4 d-1 bf-2 f-2\stopGroup
>          d-1\startGroup bf-2\stopGroup}
>   }
>   tablature = \notes \relative c, {
>       f bf
>       \property TabStaff.minimumFret = #3
>       d f bf 
>       \property TabStaff.minimumFret = #7
>       d | f d bf f
>       \property TabStaff.minimumFret = #5
>       d bf |
>   }
>   \score { 
>       \include "fingerings.ly"
>   }
>   
>   %% fingerings.ly contains..
>   \notes <<
>       \time 3/4
>       \context Staff \fingerings
>       \context TabStaff \relative c, {
>    \applyoutput #(outputproperty-compatibility 
>            (make-type-checker 'staff-symbol-interface)
>            'line-count 4)
>    \property TabStaff.stringTunings =  #'(-5 -10 -15 -20)
>    \tablature
>       }
>   >> 
>   \paper{ papersize = "letter"
>    \translator {
>        \StaffContext \consists "Horizontal_bracket_engraver"
>    } }
> 
> This example uses lilypond 2.0.0, which I currently have installed.  I
> experimented with 2.2.6 briefly, discovered that my code would need
> conversion, then backed it out because I needed to get some work
> finished.  I should probably go ahead and make the conversion soon,
> before it becomes even more of a barrier.  A macro expansion tool
> might make that job a little easier.
> 
> Once again, thanks for creating such a great program.
> -- 
>   joq
> 
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 

-- 
The "information economy" is a fantasy.  Information about what?
The "global economy" is a myth.  All economics is local.
"Stateless terrorism" is a lie, to protect those who finance it.
D. Raleigh Arnold dra@ (http://www.) openguitar.com address@hidden




reply via email to

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