vexflow
vexflow copied to clipboard
Support more flexible key signatures
Arabic key signatures include half-flat accidentals, e.g. Rast, Bayati, Sikah... It would be great to support these in VF, and I suggest the following changes to the core VF key signature handling:
- allowing key signatures containing arbitrary accidentals, by explicitly enumerating the accidentals
- specifying known key signatures that list or generate their own accidentals
The second issue is trickier for Arabic key signatures, because Rast is actually a mode that can be transposed to any key (more or less).
@Huji, @SalahAdDin, @alejandroiglesias: I would appreciate your feedback here. For reference, here's how Lilypond supports Arabic key signatures: http://lilypond.org/doc/v2.18/Documentation/notation/arabic-music#arabic-key-signatures
I think the first is the way to go. As for the second, many Dastgah's in Iranian music can at least in theory be transposed to any key. Even though practically they are often played only in a few keys.
In theory, but, in the practice?
Made initial commit for Arabic and arbitrary accidentals in key signature. The order of accidentals remains the same, but each accidental can now be arbitrarily modified explicitly by passing a new argument alterKeySpec
to the KeySignature
class. Test output attached.
Still have to review other parts of the functionality (e.g. Automatic Accidentals) to make sure they remain consistent.
:+1: Offtopic: how can we put more one stave in a single canvas?
@SalahAdDin look at the tests, that's what they do.
An update on this issue: Although the above result shows that "standard" key signatures is supported, we still need the ability to specify non-standard ones, e.g. Bb Eb F#.
@infojunkie what is still missing here?
The KeySignature
class currently accepts an option called alterKeySpec
which alters the individual accidentals in a given keySpec
. However, to achieve full generality and support for different music systems, the concept of the diatonic key signature (i.e. C => G => D etc. following the circle of 5ths) itself has to be made optional and allow an arbitrary set of accidentals to be placed on the staff. That's what is missing.