lilypond-user
[Top][All Lists]
Advanced

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

Re: "Instrument" as first class citizen


From: Gilles
Subject: Re: "Instrument" as first class citizen
Date: Thu, 23 Apr 2015 14:19:58 +0200
User-agent: Scarlet Webmail

On Thu, 23 Apr 2015 09:50:05 +0200, Xavier Scheuer wrote:
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.

IMHO, a list of all instrument definitions would be useful.
Perhaps in individual files for inclusion ("violin.instrument.ily")
and files of families ("strings.family.instrument.ily"), and files of
musical ensembles ("quartet.ensemble.instrument.ily")...
[With accompanying "LilyPond" (not scheme) syntax for overriding
the default settings or selecting variants (e.g. something like
"\bassoon \with { \clef tenor }".]

Regards,
Gilles

See NR 1.6.3 Writing parts > Instrument names

http://lilypond.org/doc/v2.18/Documentation/notation/writing-parts#instrument-names

Cheers,
Xavier




reply via email to

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