Transposing pitches with minimum accidentals (“smart” transpose): Difference between revisions

No edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
This example uses some Scheme code to enforce enharmonic modifications for notes in order to have the minimum number of accidentals. In this case, the following rules apply:
This example uses some Scheme code to enforce enharmonic modifications for notes in order to have the minimum number of accidentals. In this case, the following rules apply:


Double accidentals should be removed
* double accidentals should be removed
 
* b sharp → c
B sharp -> C
* e sharp → f
 
* c flat → b
E sharp -> F
* f flat → e
 
C flat -> B
 
F flat -> E


In this manner, the most natural enharmonic notes are chosen.
In this manner, the most natural enharmonic notes are chosen.
Line 74: Line 70:
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Workaround]]
[[Category:Workaround]]
[[Category:Scheme]][[Category:Snippet]]
[[Category:Scheme]]
[[Category:Snippet]]