HEJI accidentals are lost in a MusicXML round-trip: smufl glyph names import as blank accidentals

I notate in HEJI for scordatura instruments, and I edit Dorico’s MusicXML with an external tool (re-pitching parts, then re-importing). HEJI accidentals don’t survive that round-trip. I’ve tested what Dorico exports and imports in some detail and would like to know whether this is intended, and whether better support is possible.

Versions: Dorico 6.2.30.6245, macOS, MusicXML 4.0.

In short

  • Export writes each HEJI accidental only as a fractional alter value. There is no accidental element and no smufl attribute.
  • Import turns a bare alter value into a generic “cents” accidental drawn with a 24-EDO-style glyph. The pitch is right, but the HEJI glyph is gone.
  • Import reads an accidental element with a smufl attribute and the value “other”, and creates an accidental with the right cents, but draws it blank, even for glyphs that are in Bravura.

What Dorico exports

A HEJI accidental is written only as a fractional alter value. The same accidental gives the same value on C, F and G:

  • natural with syntonic comma down (library delta -21.5 cents): alter -0.21
  • sharp with syntonic comma down (+92.2 cents): alter 0.903
  • 11-limit raise (+53.3 cents): alter 0.522
  • natural with syntonic comma up (+21.5 cents): alter 0.21

Nothing in the file says that this is HEJI, or which glyph was used.

What Dorico does on import

I imported the same four notes, encoded in different ways:

  • Bare alter value: an accidental is drawn with a 24-EDO-style glyph. The hover shows exact cents (“21 cents flat”, “90 cents sharp”, and so on), and playback is tuned correctly.
  • Alter plus an accidental element with the smufl attribute set to a HEJI glyph name (for example accidentalNaturalOneArrowDown) and the value “other”: accidentals are created with the right cents, but drawn blank.
  • The same with a Stein-Zimmermann glyph (accidentalQuarterToneSharpStein), which is in Bravura: also blank.
  • Standard names natural-down, sharp-down and natural-up: arrow accidentals are drawn.
  • Standard quarter-sharp and similar: drawn correctly.

So smufl is clearly read, since the cents come through, but the glyph is never resolved, even for glyphs in Dorico’s own music font. The glyph names are all in Dorico’s glyphnames.json.

In one test file that mixed bare and smufl-tagged notes with identical cents, the bare notes also lost their accidentals. The Accidentals panel showed blank entries with the correct hover values.

Round trip back into a HEJI project

I copied the re-imported bars back into the original project, where the HEJI tonality system is active and displays HEJI on the original bars. The pasted bars show no accidentals at all, although playback keeps the detuning.

Why this matters

Any tool that transposes or otherwise edits Dorico’s MusicXML loses the HEJI notation. The pitch survives, but every accidental has to be redone by hand.

What would help

  1. On import, resolve the smufl glyph, including for the value “other”, so the accidental is drawn instead of blank.
  2. On export, write the SMuFL glyph name alongside the alter value. A MusicXML maintainer recommended exactly this encoding for HEJI in the W3C MusicXML issue called “Helmholtz-Ellis Accidentals for Just Intonation” (issue 263 on GitHub; Helmholtz-Ellis Accidentals for Just Intonation · Issue #263 · w3c-cg/musicxml · GitHub).
  3. Alternatively on import, map a fractional alter value to the active tonality system’s accidental with the same pitch delta.

Questions

  • Daniel Spreadbury said in 2023 (in the thread “Microtonality and musicXML”; Microtonality and musicXML) that custom-tonality accidentals “won’t be exported to MusicXML”. Is that still the intended behavior, given that the pitch values are exported?
  • Is the blank-accidental result for smufl a known bug?
  • How is the exported alter value derived? The values above differ slightly from the library deltas (for example 0.903 against +92.2 cents).

I can attach the test projects, the MusicXML files and the screenshots.

Thanks so much! I love the HEJI support in Dorico, it is so useful!

hi again, perhaps a simpler question to bump this:

  • are there plans for Dorico to be able to export and import HEJI accidentals via musicxml?

currently, this does not work, and would be super useful for a variety of applications, thanks!

Thanks for your post, @dtrueman. The honest answer is that as of today, I have no idea what would be needed to make it possible to round-trip HEJI accidentals to MusicXML. Can you point me to any other applications that have support for this in their MusicXML import/export? I’m not sure what the best, most compatible way to try to encode these accidentals would be, so working towards an existing implementation is always preferable. After all, it does nobody any good if Dorico encodes HEJI accidentals in a way that no other application can understand.

Thanks for your response @dspreadbury, and I agree it’s not obvious what the best solution might be. Musescore does seem to do this, at least partially: I was able to export and re-import HEJI accidentals, as long as there wasn’t more than one accidental for a particular note:

This screenshot is of the imported file, post-export.

It is interesting that the playback of the HEJI tuning itself survives musicxml export and import with Dorico, apparently through the “alter” flag inside “pitch”.

If it is useful to know, we’ve created a tool (the Scordatura Assistant) for assisting with “as fingered” parts for music in scordatura, as part of Project Resonance, which has multiple Hardanger-fiddle-like instruments that are typically played in scordatura to maximize resonance (among other things). We use HEJI all the time, with JI being a key element of the resonance focus as well, and have 20+ composers as part of the project, so while it is of course still niche, it is more than just me! :nerd_face:

Let me know if there is more I can do to explore this, if it’s helpful!