Menu

#2076 Doc: improve NR 1.6.3 Instrument names (better to use \with )

Verified
nobody
None
Documentation
2013-06-01
2011-12-04
Anonymous
No

Originally created by: *anonymous

Originally created by: ColinPKC...@gmail.com
Originally owned by: pkx1...@gmail.com

Per James Lowe and Xavier Scheuer
Dear bug squad, could you add this doc improvement request to the
tracker, as asked by James in this thread?  Thanks!
http://lists.gnu.org/archive/html/lilypond-devel/2011-12/msg00041.html

In NR 1.6.3 Writing parts > Instrument names , it should be recommended
to use

\new Staff \with {
   instrumentName = #"Bassoon"
}

and _not_ (advise against)

\set Staff.instrumentName = #"Violin "

for the following reason: one _must_ use  \with {…}  to avoid the
instrument name _not to be printed!_ if a parallel voice starts with a
\grace .

This is not an "hypothetical issue", we got at least half a dozen
messages from users experiencing this "issue" (although they did
exactly what is said in the documentation) on the French users mailing
list.

Could you please change the doc, NR 1.6.3 Writing parts > Instrument
names , accordingly?

Thanks in advance.

Here is a snippet showing the relevance of this issue (typically what
a lambda user would encounter).

%%%%

\version "2.15.20"

\score {
<<
   \new Staff \with {
     instrumentName = #"OK"
   } {
     c'1
   }
   \new Staff \with {
     instrumentName = #"OK"
   } {
     \grace b8 c'1
   }
>>
}

\score {
<<
   \new Staff {
     \set Staff.instrumentName = #"NOT PRINTED!!"
     c'1
   }
   \new Staff {
     \set Staff.instrumentName = #"NOT OK"
     \grace b8 c'1
   }
>>
}

%%%%

Discussion

  • Google Importer

    Google Importer - 2011-12-06

    Originally posted by: pkx1...@gmail.com

    (No comment was entered for this change.)

    Owner: pkx1...@gmail.com
    Status: Started

     
  • Google Importer

    Google Importer - 2011-12-06

    Originally posted by: dak@gnu.org

    Hi James, you said you started.  Here is a bit more information:

    When do you want to use a context modification, and when a normal override?  A context modification is best to use for things that concern the entire life-time of a context, like the appearance of its staff, its accidental styles, its instrument name and so on.  A normal override, in contrast, starts its work at the moment it is encountered.  You might think that right at the start of your context should be enough, and since the engraver responsible for overrides is pretty much at the top of the engraver list, you are almost right, namely if every context involved in iteration starts at the same moment of time.  But this is not always the case.  Most notably, \grace notes in other contexts can start earlier.

    A context modification has the additional advantage that you can use it in layout definitions, and have _all_ contexts of a given type automatically be created with the right settings.  This is more convenient and less prone to user error than using an override every time.

    \layout {
      \context {
        \Staff
        \settingsFrom { \accidentalStyle "dodecaphonic" }
      }
    }

    { cis cis cis cis }

     
  • Google Importer

    Google Importer - 2011-12-06

    Originally posted by: pkx1...@gmail.com

    David,

    Thanks, while the first two examples in this specific section are trivial to change the next two are not:

    --snip--

    <<
      \new Staff {
        \set Staff.instrumentName = #"Flute"
        f2 g4 f
      }
      \new Staff {
        \set Staff.instrumentName = \markup \center-column {
          Clarinet
          \line { "in B" \smaller \flat }
        }
        c4 b c2
      }
    >>
    --snip--

    complains if you just change it to

    <<
      \new Staff \with {
        instrumentName = #"Flute"
        f2 g4 f
      }

    etc...

    because of the 'relative' I think - from the error I get when trying to compile it.

    So in this case should we include a \layout { } in the @lilypond example and put the context changes in there?

    Also with the next but one example:

    --snip--

    \set Staff.instrumentName = #"First"
    \set Staff.shortInstrumentName = #"one"
    c1 c c c \break
    c1 c c c \break
    \set Staff.instrumentName = #"Second"
    \set Staff.shortInstrumentName = #"two"
    c1 c c c \break
    c1 c c c \break

    --snip-

    Again it would seem excessive to change this to:

    \new Staff \with {
      instrumentName = #"First"
      shortInstrumentName = #"one"
    }
    c1 c c c \break
    c1 c c c \break
    \new Staff \with {
      instrumentName = #"second"
      shortInstrumentName = #"two"
    }
    c1 c c c \break
    c1 c c c \break

    again, while the example is not that 'pretty' is there a better way to do this?

    James

     
  • Google Importer

    Google Importer - 2011-12-06

    Originally posted by: dak@gnu.org

    Huh?!?!

    You are wildly mixing the context mod and the music.

    <<
      \new Staff \with { instrumentName = "Flute" }
      {
        f2 g4 f
      }
      \new Staff \with {
        instrumentName = \markup \center-column {
          Clarinet
          \line { "in B" \smaller \flat }
        }
      }
      {
        c4 b c2
      }
    >>

    And there is no problem wrapping this in relative or not, as you like.

    I also don't see the excessiveness in the next example once you add the missing open and closing braces for the enclosed music.

     
  • Google Importer

    Google Importer - 2011-12-06

    Originally posted by: pkx1...@gmail.com

    David,

    Thanks. with regard to the second example:

    --snip--
    @lilypond[verbatim,quote,ragged-right,relative=1]
    \set Staff.instrumentName = #"First"
    \set Staff.shortInstrumentName = #"one"
    c1 c c c \break
    c1 c c c \break
    \set Staff.instrumentName = #"Second"
    \set Staff.shortInstrumentName = #"two"
    c1 c c c \break
    c1 c c c \break
    @end lilypond

    --snip--

    If I use the \new Staff \with { } construct I get the same number of measures and lines but the last two lines split into a GroupStaff. So I cannot see how to re-write this example.

    @lilypond[verbatim,quote,ragged-right,relative=1]
    \new Staff \with {
      instrumentName = #"First"
      shortInstrumentName = #"one"
    }
    {
      c1 c c c \break
      c1 c c c \break
    }
    \new Staff \with {
      instrumentName = #"Second"
      shortInstrumentName = #"two"
    }
    {
      c1 c c c \break
      c1 c c c \break
    }
    @end lilypond

    Can you (or anyone) advise?

    James

     
  • Google Importer

    Google Importer - 2011-12-06

    Originally posted by: x.sche...@gmail.com

    If you change the instrument name in the middle of the piece, then you
    must use the  \set Staff.shortInstrumentName = #"two"  syntax and
    cannot use the  \with  "thing" since you are not at the creation of
    the context (the staff already exists).
    But this practice of changing the displayed instrument name in the
    middle of the piece is very uncommon I think.

    Here is my advice:

    %%%%

    \new Staff \with {
      instrumentName = #"First"
      shortInstrumentName = #"one"
    } {
      c1 c c c \break
      c1 c c c \break
      \set Staff.instrumentName = #"Second"
      \set Staff.shortInstrumentName = #"two"
      c1 c c c \break
      c1 c c c \break
    }

    %%%%

    Thank you.

    Xavier

     
  • Google Importer

    Google Importer - 2011-12-06

    Originally posted by: dak@gnu.org

    I agree with Xavier.

     
  • Google Importer

    Google Importer - 2011-12-07

    Originally posted by: pkx1...@gmail.com

    Thanks to you both Xavier and David.

    Patch uploaded

    http://codereview.appspot.com/5448129

    James

    Labels: Patch-new

     
  • Google Importer

    Google Importer - 2011-12-07

    Originally posted by: lilypond...@gmail.com

    Patchy the autobot says: LGTM.

    Labels: Patch-review

     
  • Google Importer

    Google Importer - 2011-12-08

    Originally posted by: pkx1...@gmail.com

    Second Draft up (corrections from David)

    http://codereview.appspot.com/5448129/

    James

     
  • Google Importer

    Google Importer - 2011-12-08

    Originally posted by: ColinPKC...@gmail.com

    (No comment was entered for this change.)

    Labels: -Patch-review Patch-countdown

     
  • Google Importer

    Google Importer - 2011-12-11

    Originally posted by: ColinPKC...@gmail.com

    Counted down to 20111211

    Labels: -Patch-countdown Patch-push

     
  • Google Importer

    Google Importer - 2011-12-12

    Originally posted by: pkx1...@gmail.com

    commit    [r692c8fc63214ea5aa541b5610f4b63d740a1e665]

    Labels: -Patch-push
    Status: Fixed

     
  • Google Importer

    Google Importer - 2011-12-15

    Originally posted by: colingh...@gmail.com

    Verified present in staging.

    Status: Verified

     
  • Google Importer

    Google Importer - 2013-06-01

    Originally posted by: dak@gnu.org

    Issue 3391 has been merged into this issue.

     

    Related

    Issues: #3391

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.