8

Here is my situation. I'm using Lilypond 2.18.2.

I am working on a lilypond edition of an opera, which will include a piano-vocal score, full score, and orchestral parts.

I have set up my score with the goal of reusing elements as much as possible, including instrument staves. So I have, for example, a \FirstViolinStaff variable defined in the Strings.ly file like so:

FirstViolinStaff = \new Staff \with {
    instrumentName = "Violin 1"
    shortInstrumentName = "Vl. 1"
    midiInstrument = "violin"
    \clef treble
    } 
    {
        <<
            \GlobalA
            \FirstViolinNotesA
        >>
        <<
            \GlobalB
            \FirstViolinNotesB
        >>  
    }

Strings.ly is importing the Global and Notes files from their own files. The full project will have multiple sections for each staff, and some more complicated code for things like doubled and tacet instruments, chorus and solo parts, etc.

I then use this \FirstViolinStaff in two separate book files: one for the orchestral score, and one for the Violin I part.

The problem is that I do want the full and short instrument names to appear in the full score, but I don't want them to appear in the violin part. The only way I've been able to come up with so far to make this happen is to use tags in the staff definitions:

\tag #'FirstViolinPart {
    \set Staff.instrumentName = #""
    \set Staff.shortInstrumentName = #""
}

This works, but it strikes me as a little klugy.

What I'd like to do is to get rid of the instrument names from within the book block, which (simplified) currently looks like this:

\book {
    \score {        
        \keepWithTag  #'FirstViolinPart         
        \FirstViolinStaff

        \layout {}
        \midi {}
    }
}

either by modifying the already-defined staff to eliminate the instrument names, or by modifying some element of the page, book or score context to suppress display of the existing instrument names. Is this possible?

2 Answers 2

8

While reorganizing your material as shown in the alephzero reply may make independent sense, if you don't want to see instrument names in staves, just adding

\context { \Staff \remove "Instrument_name_engraver" }

to the inside of your \layout block might get rid of any interpretation of the respective properties. They'll still be set. Note that most ways of creating an incipit rely on the Instrument_name_engraver, so it you show incipits, this option might become trickier (basically, you'll need to remove the Instrument_name_engraver from the score used internal to the incipit as that will be the one really attaching the instrument name).

1
  • Yes, that does it. Not using an incipit, so that's not a problem.
    – chapka
    Commented Mar 28, 2015 at 0:30
2

I would split up the data between your .ly files differently. Put the definition of \FirstViolinNotes its own file, and include that in different files for the full score, vocal score, orchestra parts, etc.

Don't worry about a bit of duplication in the different "score" files. Once you have set them up, they won't need to be changed, unless you change the instrumentation of your orchestra or your librettist decides you need a different cast of characters.

Personally I use a tags called #'score and #'parts to keep track of differences in the notation - for example any tweaks related to auto-combining 1st and 2nd instruments onto one staff in the score, but generating separate parts for each player.

As a real example, in an orchestral score I have file oboes.ly that contains

oboeImusic = \relative c' 
{
% lots of notes
}

oboeIImusic = \relative c' 
{
% lots of notes
}

The full score file contains

\score
{  <<
   \new StaffGroup
   {    
% ......
      \new Staff \with
      { instrumentName = #"2 Oboes"
        shortInstrumentName = #"Ob."
      }
      { \global \keepWithTag #'score \removeWithTag #'parts
        \partcombine \oboeImusic \oboeIImusic
      }
% .......
   }
% .......
}

and the file for the first oboe part contains

\score
{  \new Staff
   {  \global
      \keepWithTag #'parts \removeWithTag #'score \oboeImusic
   }
}

For transposing instruments, the score might be at concert pitch and the parts at the transposed pitch. I don't think it's worth trying to make an intricate web of tags to keep track of things like that - just wrap the \transpose defintions around what doesn't change, i.e. the notes being played.

I use the tags for situations like having only one set of dynamic marks in the score but both player's parts (obviously) need a full set of marks, so the 2nd oboe part might contain something like c4-\tag #'parts \p d4, to put the \p in the part but not in the score (because the 1st oboe also has a \p marking and the score doesn't need both marks on the same staff).

2
  • To clarify: I do have \FirstViolinNotes in its own FirstViolin.ly file. But where you have two files, I have three: FirstViolin.ly for the notes, Strings.ly which contains FirstViolinStaff, and then FullScore.ly which includes that. The staff files are more complicated (the music is broken up into 15-20 sections, some sections are doubled, imported, etc.) which is why I'd rather not enter them twice. And I'm currently using 2.18.2 and \keepWithTag to do other jobs in the score, so I'd have to refactor my tags or upgrade to use tags. I will if I have to, just wondering if it was avoidable.
    – chapka
    Commented Mar 21, 2015 at 17:42
  • There isn't "Only One Right Way" to organize a project. Having everything in one huge file is a bad idea. Splitting up the project into 1000 tiny files is also a bad idea, unless you use a text editor that can work easily like that. If you have 20 sections where the scores are all similar, it's pretty quick to define one score with "all" the options in it, then copy it 20 times and delete or comment out the bits you don't need in each of the 20. For what I do in Lilypond, it might take a couple of hours grunt work to set that up, but you don't need to do it more than once..
    – user19146
    Commented Mar 21, 2015 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.