bell notificationshomepageloginNewPostedit profiledmBox

Hoots : Is there a way, in Lilypond, to eliminate the instrument name from a staff from outside of the staff context? Here is my situation. I'm using Lilypond 2.18.2. I am working on a lilypond edition of an opera, which will include - freshhoot.com

10% popularity   0 Reactions

Is there a way, in Lilypond, to eliminate the instrument name from a staff from outside of the staff context?
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?


Load Full (2)

Login to follow hoots

2 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

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).


10% popularity   0 Reactions

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).


Back to top Use Dark theme