We want to add “scalar transposition” to a plugin. But we allow users to introduce accidentals into a selected Key/Scale setting. So, for example, the user selects C Major as the kay/scale setting, which enables all the white keys on the keyboard.
But suppose they need to introduce an accidental, such as C#. Normally, scalar transposition of two intervals in the key of C Major would transpose C to E and D to F. But what if they have added C# as an accidental (by enabling the C# black key on the keyboard). What should it transpose to, given that the purpose of using the scalar transpose is to keep the results in the key of C Major? Using normal (chromatic) transposition, that would be up four half-steps, to F. But D transposes to F already. What should C# transpose to in this case?
Or say they used the new scalar transpose to go up 1 interval (2 half-steps), so that C goes to D and D goes to E. What would C# transpose to? D#? D? E?
I’ve read some people saying that scalar transpose is simply not allowed if there are accidentals. I’ve read other places that use the staff notation, and simply apply the same accidental “direction” to the accidentals, after adjusting the notes up or down on the staff.
I know that we’re telling the user that this feature keeps the result “in scale”, but if a note didn’t start in scale, should the result also not be in scale? Or should it be mapped to a note that is in the key of C Major? Should accidentals always be preserved, or should the result be that all notes are in the original key of C Major?
In my first example, if preserving accidentals, that would make C# go to E#, which would happen to be the same pitch as F, while in the second example, it would make C# go to D#, even though D# is not in the key of C Major. Is this the proper approach?
I don’t have a strong music theory background, and haven’t been able to find a definitive answer to this question.
