12. Frequently asked questions

I don’t like the variable names, can I use a different order?

If you don’t like that the variables are generated as \PieceInstrumentVarname, you can override this behavior by redefining the scheme function (namedPieceInstrObject piece instr name). The default implementation is:

#(define (namedPieceInstrObject piece instr name)
  (let* (
         (fullname  (string->symbol (string-append piece instr name)))
         (instrname (string->symbol (string-append instr name)))
         (piecename (string->symbol (string-append piece name)))
      ((defined? fullname) (primitive-eval fullname))
      ((defined? instrname) (primitive-eval instrname))
      ((defined? piecename) (primitive-eval piecename))
      (else '())

Now it’s up to you to write a different implementation... (e.g. use varnames of the style \VarnameInstrPiece) But be careful with the order of evaluation, since some large scores might depend on instrname overriding piecename (e.g. a globally-defined key for transposing instruments!).

I don’t like the structure of the score hierarchy list, can I change it?

Sure, there is only one function that interprets the entries (factory pattern!): (oly:create_staff_or_group parser piece instr). It looks up the \PieceInstrumentStaff variable and if that does not exist, it looks at a possible entry in the score structure descriptions and depending on its form, calls different methods to create a staff, a group, a part-combined staff or a staff with multiple voices.

If you redefine this function, you have complete control about the decision when to create each type of staff/group.

Table of Contents

This document was generated by Reinhold Kainhofer on June, 4 2008 using texi2html 1.79.