lilypond-user
[Top][All Lists]
Advanced

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

Re: Selected pieces in a book


From: Pierre Perol-Schneider
Subject: Re: Selected pieces in a book
Date: Sun, 11 Oct 2015 10:40:07 +0200

Hi Federico,

2015-10-10 20:36 GMT+02:00 Federico Bruni <address@hidden>:
...
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.


reply via email to

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