Hi all!

I've been working (ever so slowly) on my ABC parser, and one item which came
up was the specification of the clef field as listed in 2.0 spec.  (Note
that this message is 2.0 specific -- I'm aware there are other issues in
what various pre-2.0 programs did that may be relevant, but that's another
discussion...)  It's mostly fairly clear, except for one area which I see as
a potentially serious parsing problem.

Specifically, it mentions that "clef=" may be omitted, but then later it
says that "More clef names may be allowed in the future, therefore unknown
names should be ignored."

What bothers me is that means you could have pretty much any space delimited
word mixed into a Key or Voice line, and not know if it meant a clef or
something else.  I'd like to see it changed so that "clef=" is required for
any clef name *except* for "treble", "bass", "tenor", "alto", and "perc".

Note I didn't specify "none" in that list -- that's because "none" by itself
can be specified as the key signature, making "K:none" be ambiguous - does
it mean a key signature of none, or no clef?  (This was what originally
triggered my examination of this part of the spec...)  So I think "none"
requires the "clef=" to be unambiguous.

Given the added concept that the clef data may include pretty much anything
in the form "<propertyname>=<value>", I suggest we might change section 6 to
read something like this:


========

6. Clef Properties

Any number of Clef Properties may be provided in any combination in K: and
V: fields, separated by whitespace.  All clef properties are strings which
follow the normal property syntax:

    <propertyname>=<value>

...where propertyname and value may be any strings not containing
whitespace.  The standard clef properties include:

clef=<clef name>[<line number>][+8 | -8]
    - Specifies the clef for the current staff.  <clef name> May be
    "treble", "alto", "tenor", "bass", "perc" or "none". "perc" selects the
    drum clef.  Other names (that do not contain digits or the '+'/'-'
    characters) may be used as well -- if your program does not
    recognize the clef name, it should use the default (treble) clef.

    As a special case, the "treble", "alto", "tenor", "bass", and "perc"
    clef names can be used as abbreviations for "clef=treble", "clef=alto",
    "clef=tenor", "clef=bass", and "clef=perc", respectively.  The "none"
    clef name may NOT be used in this fashion.

    <line number>, if specified, indicates on which staff line the base clef
    is written. Defaults are: treble: 2; alto: 3; tenor: 4; bass: 4.  This
    is useful when notating other common clefs.  For example:

        clef=bass3      -- for the baritone clef
        clef=alto2      -- for the mezzosoprano clef
        clef=alto1      -- for the soprano clef

    +8 | -8  - draws '8' either above or below the staff. The player will
    transpose the notes one octave higher or lower.

middle=<pitch>
    - is an alternate way to define the line number of the clef. The pitch
    indicates what note is displayed on the 3rd line of the staff. Defaults
    are: treble: B; alto: C; tenor: A,; bass: D,; none: B.  "middle=" may be
    abbreviated as "m=".  This specifier can be handy when working in the
    bass clef. Setting K: clef=bass middle=d will save you from adding comma
    specifiers to the notes.

transpose=<semitones>
    - When playing, transpose the current voice by the indicated amount of
    semitones. This does not affect the printed score. Default is 0.
    "transpose=" may be abbreviated as "t=".  The transpose specifier is
    useful for e.g. a Bb clarinet, for which the music is written in the key
    of C, although the instrument plays it in the key of Bb:

        [V:Clarinet] [K:C transpose=-2]

stafflines=<lines>
    - The number of lines in the staff. Default is 5.
    
Note that although this standard supports the drum clef, there is currently
no support for special percussion notes.

Applications may introduce their own properties.  Their property name should
start with the name of the application, followed a colon, followed by the
name of the specifier.

For example:
    V:p1 clef=perc stafflines=3 m=C  mozart:noteC=snare-drum
 
Applications which encounter a property they do not recognize should ignore
it.

===============


The other area I'd like some clarification of related to clef properties is
in the K: line.  First, where can clef properties can occur?  Is it possible
to have clef properties *before* a key signature, ie.:

    K:clef=treble Dm

...or must the key come first, if it's present?  If the key can come second,
is it possible to have properties before *and* after, ie.:

    K:clef=treble C transpose=-2

IMHO, I'd prefer limiting it so that the key would always come first if
present.


Finally, what key should be used if the first (and perhaps only) K: line in
a tune doesn't contain a key, only clef properties?  Or should we require
that the first K: line must have a key (or "none") specified?

Thanks,
-->Steve Bennett

To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html

Reply via email to