0xfe / vexflow

A JavaScript library for rendering music notation and guitar tablature.

Home Page:http://www.vexflow.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Presentation of StaveNote keys in chords

newlandsvalley opened this issue · comments

Does Vexflow require the keys in a chord to be presented in order - lowest pitch to highest? This is perhaps what the Accidental tests seem to suggest. I am finding that if I present them in another order (say highest to lowest) then accidentals become attached to the wrong keys.

@newlandsvalley could you provide a jsfiddle with the error?

I think it is identical to this issue - #104. From what I can make out from the comments, the keys do indeed need to be sorted lowest to highest. Is this still true? Is this behaviour documented anywhere?

This is no longer needed. StaveNote sorts the keys internally. See sortedKeyProps in StaveNote. I am not sure though what is the index used in addModifier (sorted or unsorted)

Many thanks, @rvilarl. I think it only makes sense from the user's point of view if the index is to the original unsorted keys. I'll try to investigate the very latest release and provide a jsfiddle as you suggest if I can still reproduce it.

OK - my application had been using Vexflow 4.0.2 where this behaviour happens, but it's fixed in v 4.2.3. I'll close this issue.