Hi List,

I have an included file, "default.ily" that I use for my stylesheet,
comprising the following \paper block:

\paper {
   %% Set system-system distance

  system-system-spacing.basic-distance = #32

  indent = 18\mm
  two-sided = "true"
  inner-margin = 15.0\mm
  outer-margin = 3.3\mm
  top-margin = 8.0\mm
  bottom-margin = 12.0\mm

  %% Set Page numbers to the bottom
  oddHeaderMarkup = \markup \fill-line { " " }
     evenHeaderMarkup = \markup \fill-line { " " }
     oddFooterMarkup = \markup \abs-fontsize #10 \fill-line {
         \on-the-fly #not-part-first-page \line {Klang Büro xx.xxx }
         \on-the-fly #print-page-number-check-first \fromproperty
#'page:page-number-string
     }
     evenFooterMarkup = \markup \abs-fontsize #10 \fill-line {
         \on-the-fly #print-page-number-check-first \fromproperty
#'page:page-number-string
         \on-the-fly #not-part-first-page \line {Klang Büro xx.xxx }
     }

   %% Set default page size
   #(set-paper-size "a4")

}

What I'm interested in are the lines with the "xx.xxx" part. I'd like to
automate that to output, on a per-book basis, some string that uniquely
identifies the piece as some combination of composer name and serial
number. This is taken from the Carus Verlag's practice of numbering, by
which Bach's works are numbered as 31.xxx, with "xxx" replaced by the BWV
number.

It doesn't have to be purely numerical. I'd be happy to, say, just take the
first two letters of the composer's last name, and then number the pieces
sequentially as I finish them. What I would really like to do, though, is
to set that number of the piece as a variable in the master .ly file, and
have the .ily file pull it and the composer's identifier on the fly (so
that I don't have to change the .ily file each time I work on a piece with
a different number).

So, I have my .ly file, and there's a line of pseudo-code like:
composer = { Bob Smith }
catalognumber = { 001 }

and the .ily file automatically replaces "xx.xxx" with "Sm.001".

Is there a way to do that?

Cheers,

A
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to