>
> On Wed, 22 Apr 2015 19:17:53 -0700, Flaming Hakama by Elaine wrote:
>>
>> [...]
>> Without getting too technical, objects are things that you can create, have
>> properties and relationships with other well-defined objects.
>>
>> This is true for things like staves, staff groups, scores, books, etc.
>> You can say: \new Staff = { ... } to create a new staff because there is
>> an object class called Staff that is well-defined.
>> It has known properties like Staff.TimeSignature, Staff.extraNatural, etc.
>> Other objects (Staff Groups, Books, etc.) know how to handle this Staff
>> object, or several Staff objects.
>>
>> However, in the case of "instrument", there is no such object so you cannot
>> create one.
>> There are certainly properties of other objects (namely, staves) that have
>> "instrument" in the name, like Staff.instrumentName,
>> Staff.shortInstrumentName, Staff,midiInstrument.
>> However, these are *properties of a Staff object*.
>> There is no way to create an "instrument" outside the context of a staff,
>> or identify or change its properties.
>> You cannot add an instrument to a staff or any other object.
>>
>> If there were, the syntax might be more like:
>>
>> violin = \new Instrument {
>> Instrument.name = 'violin'
>> Instrument.shortName = 'v.'
>> Instrument.midi = 'violin'
>> Instrument.clef = treble
>> ...
>> }
>>
>> \new Staff {
>> Staff.Instrument = \violin
>> \violinMusic
>> }
>
>
> From the viewpoint of the encoder, this is quite sensible.
> This would be a nice syntax simplification.
Actually there is the \addInstrumentDefinition command (used in
combination with \instrumentSwitch) which does *part* of that.
See NR 1.6.3 Writing parts > Instrument names
Cheers,
Xavier
--