lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Instrument" as first class citizen (Was: ...)


From: Xavier Scheuer
Subject: Re: "Instrument" as first class citizen (Was: ...)
Date: Thu, 23 Apr 2015 09:50:05 +0200

On 23 April 2015 at 04:28, Gilles <address@hidden> wrote:
>
> 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
http://lilypond.org/doc/v2.18/Documentation/notation/writing-parts#instrument-names

Cheers,
Xavier

-- 
Xavier Scheuer <address@hidden>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]