Library Manager and Remote Control API show note-length options one value too short

Library Manager and Remote Control API show note-length options one value too short (Dorico Pro 6.2.30)

Dorico Pro 6.2.30, macOS 27.0.1

Summary

Engraving and notation options whose value is a note length are displayed one note value shorter than their
actual setting by the Library Manager and returned that way by the Remote Control API (getoptions). The setting
itself is fine. The options dialogs, the saved project, copying in the Library Manager, and writing through the API all
use the correct value. It looks like a label lookup that is off by one.

Steps to reproduce (Library Manager)

  1. Open any project.
  2. In Engraving Options ▸ Ornaments ▸ Auxiliary Notes, set Shift auxiliary note for values shorter than or equal to
    to 1/8 note (quaver). Apply.
  3. Open the Library Manager and compare with Factory settings. Find Ornaments ▸ Auxiliary Notes.

Expected: this project shows 1/8 note (quaver), and the factory column shows 1/16 note (semiquaver), matching the dialogs.

Actual: this project shows 1/16 note (semiquaver), and factory shows 1/32 note (demisemiquaver). Both are one note value too short.

What is correct, and what isn’t

Value shown Correct?
Engraving Options dialog 1/8 note (quaver) yes
Saved project (score.dtn) kQuaver yes
Library Manager display 1/16 note (semiquaver) no
Remote Control API getoptions kSemiQuaver no
Copying the option to another project with the Library Manager the target gets 1/8, and its dialog shows 1/8 yes
Writing through the API (Engrave.SetEngravingOptions, label or integer) stored correctly yes

This is consistent across values. With the factory setting (1/16 note), the Library Manager shows 1/32. With 1/8 it shows 1/16.

Scope

I wrote every enum option through the Remote Control API, first to its first value and then to its last, and read it
back each time: 292 engraving, 37 notation and 37 layout enum options. Only the two options that use the note-length
enum were wrong
, and both were one step short:

  • ornamentAndTrillOptions.shiftingAuxiliaryNoteThreshold (Engraving Options, shown above)
  • rhythmSlashNotationOptions.maximumDurationForAutomaticRhythmSlashes (Notation Options). Seen through the API (stored
    kCrotchet, read kQuaver). I haven’t checked how the Library Manager displays this one.

All other enum options read back exactly as written.

Probable cause

The value list that the API reports for this enum starts and ends with range markers:

kMinimumLogDuration, k1024Note, k512Note, k256Note, k128Note, kHemiDemiSemiQuaver, kDemiSemiQuaver, kSemiQuaver, kQuaver, kCrotchet, kMinim, kSemibreve, kBreve, kLong, kMaxima, kMaximumLogDuration, kNumNoteLengths

When I set 1/8 in the dialog, the macro recorder wrote it as an integer:

Engrave.SetEngravingOptions?Dictionary=list: {string: "ornamentAndTrillOptions.shiftingAuxiliaryNoteThreshold"}\, {int: 7}

So a quaver is 7 (k1024Note = 0 … kSemiQuaver = 6, kQuaver = 7). In the label list above, position 7 is
kSemiQuaver, because kMinimumLogDuration takes position 0. Presumably kMinimumLogDuration is an alias of
k1024Note that got its own slot in the integer-to-label table, which pushes every label one place along. The
results fit this: writing k1024Note through the API reads back as kMinimumLogDuration, and writing kMaxima reads back as kLong.

Consequences

  • Users comparing options in the Library Manager see wrong values for these options, and might “correct” a setting that is fine.
  • For API clients, reading the value and writing it back makes the setting one note value shorter on every round trip.
  • Recorded macros and Lua scripts are not affected, because they write the value as an integer.

Not tested: whether Save as Default (engravingOptions.xml / notationOptions.xml) writes these values correctly.