> Although I think Mudela is quite simple to use, I dislike certain
> aspects of it. One is that it is so irregular, or context-dependent.
> 
> An example is in the following, where I want one staff for clarinet,
> one for alto sax, and one for tenor sax.
> 
>   \notes
>   ...
>   \context Staff = kl <  ...  >
>   \context Staff = as <  ...  >
>   \context Staff = ts <  ...  >
> 
> LilyPond will fail to process the second line, because it is in note
> mode, and as will parse as a note. The kl and ts will work OK.  If I
> remove the \notes it parses OK, and if I add quotation marks around as
> it also works.
> 
>   \notes
>   \context Staff = kl <  ...  >
>   \context Staff = "as" <  ...  >
>   \context Staff = ts <  ...  >
> 
> I don't have any solution this, other than disallowing unquoted
> strings...

I usually define a separate identifier for each instrument like
clarinet = \notes {...}
and then there is no need to change to note mode in the score 
declaration itself, so I've never experienced this problem.


> Another thing that I don't understand att all is the context/translate
> stuff.  It's pretty hard to realize what contexts LilyPond will
> automatically insert in my score.  If I have a \context StaffGroup <
> \context Void < ... > >, it will add a Staff etc. And somewhere it
> seems to add an OrchestralScore or something also.

Yes it's messy. At least it would be nice if Lilypond could 
output the full context structure for the score in some 
easily readible form.

> But back to Mudela. The strange part concerning Mudela in all this is
> the \translate syntax.
> 
> The current syntax i something like.
> 
> \translate {
>   \StaffContext
>   \consists "Bar_engraver"
>   \property ...
> }
> 
> Wouldn't something along the lines of the following be more natural?
> I see no point of adding a \FooContext for each context Foo, when the
> string Foo is perfectly valid as a context identifier.  Or is there
> something I don't see?
> 
> \modifycontext Staff {
>   \add "Bar_engraver"
>   \property ...
> }

I think it makes sense to be able to declare an identifier for the
context, since you could have different versions of the same context.
For example, there is a version of the standard StaffContext called
OrchestralPartStaffContext which adds bar numbers and rehearsal marks.
Both these translators have the same \name "Staff" but do slightly
different things. When you say \translator{\OrchestralPartStaffContext}
you tell Lilypond that all contexts of type "Staff" should use the
translator which includes these extra engravers. 
Your solution works well as long as you just want to make the change
to a single score, but if you want to use the same customized layout
in many scores or even share it to other users, it's much more convenient
to declare it once and use a shorthand name - an identifier.

   /Mats


Reply via email to