You can write this:

\version "2.24.0"

movement.17.tenore.2.lyrics.it = \new Lyrics \lyricsto "v1" { Come si chia -- ma? }
movement.17.tenore.2.notes = { a'2 4 4 1 }

<<
  \new Voice="v1" { \movement.17.tenore.2.notes }
  \movement.17.tenore.2.lyrics.it
>>

The full stop characters are not part of the variable name, but LilyPond syntax that builds a nested structure of Scheme association lists. I think commas work similarly. The part before the first full stop must be a legal LilyPond variable name.

Right! I completely forgot about this! If the instrumentation is similar between movements you can make a scheme function that transforms this kind of structure automatically --- or even in general, perhaps something like this


%%%

movements.1.order = #'((#:vocal (soprano alto tenore basso)) (violin1 violin2 viola (#:figures cello)))

movements.1.soprano.music = { ... }

%% Hypothetically the function would know to expect lyrics because of the #:vocal key

movements.1.soprano.lyrics = \new Lyrics { ... }

...


makeScore = #(define-scheme-function (data) %{ this is the fun part %})


\book {

  \makeScore #(assq-ref movements '1)

}

%%%


This can end up needlessly reinventing \score, but with better-looking and more convenient definitions. I might explore this in the future (if this doesn't already exist)!

Reply via email to