<lily-user <at> chubb.wattle.id.au> writes:

> 
> 
> I personally have *never* needed to use \new.  
> 
> \context implicitly instantiates a new context if the
> one named doesn't yet exist, so \new is redundant, *except* where you
> want multiple distinct contexts with the same name, or you're using
> unnamed contexts (which, internally, is the same thing)
> 

I have found a place where \new is needed.

If you would like to make a StaffGroup consisting of a TabStaff (on the top) 
and a Staff on the bottom, you would normally do:

\context StaffGroup <<
  \context TabStaff {
     \mymusic
   }
   \context Staff {
     \mymusic
   }
>>


However, if you do this, LilyPond returns errors, and the TabStaff and Staff 
are somehow combined (the clef shows on the TabStaff, for example).

However, if you do

\context StaffGroup <<
  \context TabStaff {
     \mymusic
   }
   \new Staff {
     \mymusic
   }
>>

everything works as it should.  Apparently, in the first usage, the unnamed 
Staff context had been implicitly created and was unsuccessfully reused.

Given this result, it appears to me that \new is safer than  \context for
unnamed context, so I believe it should be the preferred behavior.

Thanks,

Carl





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

Reply via email to