Skip to content

2.1

Choose a tag to compare

@sbeitzel sbeitzel released this 04 Oct 22:29
· 6 commits to main since this release
a9bae96

Clefs, octaves and stems, as abcm2ps draws them.

A minor release. Notes are placed for the clef in force, clef changes part way through a
voice are drawn, octave= takes effect, and stems and beams follow abcm2ps's rules. The
model gains Event.clefChange. See Upgrading.

Clefs and octaves

  • Notes follow the clef (#222). Every notehead, stem, ledger line, accidental, tie and
    slur used to be placed at its treble-clef position whatever clef the staff carried. Staff
    position is now counted from the clef's bottom line (ClefSpec.staffPosition(of:)). An
    octave clef (treble-8) moves nothing, as in abcm2ps.
  • octave= on K: and V: (#224) shifts Note.pitch in the semantic pass, scoped as
    abcm2ps scopes it: a header K: covers every voice, a body K: or a V: its own voice,
    and each lasts until another octave= replaces it. Transposition.statesOctave lets
    octave=0 reset it.
  • A K: with a clef and no key (#223). K:bass, K:clef=bass and [K:clef=bass] are
    read as options only (§3.1.14, §4.6) instead of being rejected. KeySignature records
    what was stated (statesKey, statesClef); what was left unsaid carries on from what is
    in force, so K:G after K:bass stays in the bass clef. An unreadable K: still warns,
    and now changes nothing.
  • Clef changes are drawn (#223). A clef change part way through a voice is a new
    Event.clefChange where the field was written. A change against a bar line is a small
    clef before that bar (a courtesy clef at the end of a line, with the new clef full size
    at the head of the next); a change mid-bar is a small clef between the notes; a clef
    change alone draws no key signature. Measure.key is set only by a K: that names a key.

Stems and beams

  • Only notes shorter than a quarter are beamed (#217), whatever the meter (§4.7). In
    6/8, 2/2 and 3/2, quarter notes were beamed to their neighbours.
  • One stem direction per beam group (#218). Each group's direction is decided before
    any of it is drawn: down where the highest note is farther above the middle line than the
    lowest is below, up in the opposite case, and a group as far above as below follows the
    part's previous stem (up if none). Every stem in the group is placed for that direction.
  • A middle-line note follows the stem before it (#221) in an .auto voice, across bar
    lines and rests, and stems up where there is none. stem=, pipe format and a shared
    staff's opposition still decide outright.

What's Changed

Full Changelog: v2.0.0...v2.1.0

Upgrading

Event has a new case, clefChange(ClefSpec). An exhaustive switch over Event needs a
branch for it; everything else is source-compatible with 2.0.0. The new KeySignature and
Transposition initializer parameters have defaults.

Engraved output changes for tunes in a clef other than treble, tunes using octave=, beamed
quarter notes in compound meter, and some stem directions on beam groups and middle-line
notes. Each now matches abcm2ps 8.14 -g.