Hi Federico,

2015-10-10 20:36 GMT+02:00 Federico Bruni <[email protected]>:
...

> Instead of "polluting" the lilypond sources with \tag(s), I'd rather set a
> custom field (level) in the \header block and write a script which parses
> the header and process the files accordingly.
>
...

I don't know if it's feasible but how about creating a 'labels' which would
be equivalent to the 'header' without the printing, just a simple data base
:

 "my-library.ly" :
 ...
 scarlatti-sonate-KOne-guitar = {
   \score {
     \new Staff <<
       \key d \minor
       \clef "G_8"
       \new Voice {
         \voiceOne
         | % mes. 1
           d'16 e' f' g' a' a cis' a d'4. e'8
         | % mes. 2
           f'16 d' g' e' a' f' e' d' cis'8 a' a'4\trill
       }
       \new Voice {
         \voiceTwo
         | % mes. 1
           e2\rest d16 e f g a a, cis a,
         | % mes. 2
          d8 e f g a a a a
       }
     >>
     \header {
       piece = "Sonate K 1"
     }
     \labels {
       title = "sonate"
       composer = "scarlatti"
       opus = #1
       arranger = "taylor"
       instrument = "guitar"
       key = "d min"
       area = "baroque"
       genre = "sonate"
       level = #3
     }
   }
 }
 ...

Then, if I want to create a book including selected pieces within
"my-library", here's my request :

%% Selected pieces
\include "my-library.ly"
\book {
  \header {
    title = "Sonatas"
    composer = "Domenico Scarlatti (1685-1757)"
    arranger = "Peter Taylor"
    opus = "K 1"
  }
  \labels {
    composer = "scarlatti"
    genre = "sonate"
    opus = #'(0 - 1000) %% 0 to 1000, in order to cover all sonatas without
remembering the right ones
    instrument "guitar"
    level = #'(3 - 5) %% 3 to 5
  }
}

where 'labels' would select the pieces accordingly.
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to