Repository navigation
fix(musicxml): import harmonics and fold touching and sounding pitch notes - #2947
Merged
Merged
Conversation
…out string Artificial, pinch, tap, semi and feedback harmonics sound an interval above the played pitch, which does not need a string. On pitched notes without string the harmonic diamond was drawn on top of the note head and the played pitch was heard. The harmonic value to interval table moves to ModelUtils to be shared with importers.
…notes (#2942) MusicXML writes a harmonic as chord notes for the base, touching and sounding pitch. These were imported as additional played notes, on tablature staves without string and fret (NaN positions). The touching and sounding notes now define the harmonic value of their base pitch note, matching how Guitar Pro 8 writes and reads them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
AI-authored disclosure (
alphatab-ai-authored-v1)Portions of this content were authored by an AI agent. The agent has read
AGENTS.md and the human submitter accepts responsibility for
compliance with the rules in that document.
Issues
Fixes #2942
Proposed changes
MusicXML writes a harmonic as separate chord notes: the base pitch (the played note), the touching pitch (where the string is touched) and the sounding pitch (what is heard). alphaTab ignored
<harmonic>, so the touching and sounding notes were imported as extra played notes:<string>/<fret>, which gave NaN positions: a "NaN" label on develop, an exception in 1.8.4;Importer
<technical><harmonic>is read before the note is attached. Touching and sounding chord notes are folded into their base pitch note: they only set its harmonic value and are never added to the beat.numberattribute also groups them.<staff>on the touching and sounding notes of a tablature staff, so they belong to staff 1 and are written in its (octave transposed) pitch.Mapping, checked against Guitar Pro 8
GP8 exports and imports were inspected through its automation API (export to MusicXML, import back, read the resulting gpif).
<natural/>(+ base or touching pitch) on a node fret<harmonic/>(GP8's export of pinch, tap, semi)<artificial/>without touching or sounding pitchWhere GP loses information (the third and sixth rows), the spec semantics are kept. Files written by GP8 import the same either way.
Model
Artificial, pinch, tap, semi and feedback harmonics sound an interval above the played pitch, which needs no string. On pitched notes without a string (MusicXML notation staves, alphaTex
C4{ah 12}),harmonicPitchwas 0: the harmonic diamond was drawn on top of the note head and the base pitch was played. The interval now applies to these notes too. Natural harmonics without a string are unchanged, because there is no open string to derive them from. The value → interval table moved toModelUtils.harmonicValueToPitchand is shared with the importer.Reference change
32a-Notations.png(bars 11–13): the base/touching/sounding chords are now single harmonic notes.Not part of this PR
A pitch-only note on a MusicXML tablature staff (no
<string>/<fret>) still gets NaN tab positions. This PR removes the trigger from #2942, but the general case needs its own issue and design.Checklist
AI authorship disclosure
(
alphatab-ai-authored-v1) is present at the top of this body, and I havepersonally reviewed every change and can explain each one
Further details