vexflow icon indicating copy to clipboard operation
vexflow copied to clipboard

Support more flexible key signatures

Open infojunkie opened this issue 8 years ago • 10 comments

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:

  1. allowing key signatures containing arbitrary accidentals, by explicitly enumerating the accidentals
  2. 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).

infojunkie avatar Mar 12 '16 20:03 infojunkie

@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

infojunkie avatar Mar 12 '16 20:03 infojunkie

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.

Huji avatar Mar 13 '16 04:03 Huji

In theory, but, in the practice?

SalahAdDin avatar Mar 13 '16 19:03 SalahAdDin

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. screenshot- domain date time

infojunkie avatar Mar 20 '16 02:03 infojunkie

Still have to review other parts of the functionality (e.g. Automatic Accidentals) to make sure they remain consistent.

infojunkie avatar Mar 20 '16 02:03 infojunkie

:+1: Offtopic: how can we put more one stave in a single canvas?

SalahAdDin avatar Mar 20 '16 04:03 SalahAdDin

@SalahAdDin look at the tests, that's what they do.

infojunkie avatar Mar 20 '16 08:03 infojunkie

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 avatar Jun 16 '16 07:06 infojunkie

@infojunkie what is still missing here?

rvilarl avatar May 08 '22 20:05 rvilarl

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.

infojunkie avatar May 08 '22 20:05 infojunkie