OpenSheetMusicDisplay
    Preparing search index...

    Class IntervalTransposeCalculator

    Transposes notes and chord symbols by interval, so that their spelling stays consistent with the key signature.

    The default TransposeCalculator only counts halftones and chooses each note's enharmonic spelling (sharp or flat) by the transposed key signature. Notes that aren't in the key then change their function: in C major, transposing the leading tone A# (to B) down a whole tone to Bb major gives Ab instead of G#, because Bb major prefers flats. The result sounds the same, but it isn't what an engraver (or MuseScore, Sibelius, Finale...) would write.

    This calculator moves every note by the same interval instead: a number of letter steps (MusicXML's ) plus the number of halftones (), like MuseScore's "transpose chromatically". The letter steps follow from the original and transposed key signatures, e.g. C major -> Bb major is one letter down, so A# -> G#, D# -> C#, and C -> Bb.

    Key signatures are still transposed by the default TransposeCalculator (keyMapping), so the choice of Db vs C# etc. is unchanged. If the interval would need more than a double sharp/flat, or the pitch has a microtonal accidental, the default calculator is used for that note.

    Chord symbols are spelled more simply by default (SimpleChordSymbolSpelling): a root or bass that the interval would spell with a double sharp/flat or as Fb, Cb, E# or B# is spelled like the default calculator does, e.g. Ebmaj7 in D major transposed by +1 (Eb major) is Emaj7, not Fbmaj7, as lead sheet readers expect.

    Opt-in, like the default calculator: osmd.TransposeCalculator = new IntervalTransposeCalculator(); osmd.Sheet.Transpose = -2;

    Implements

    Index

    Constructors

    Properties

    AvoidDoubleAccidentals: boolean = false

    Spell a note or chord symbol that the interval would spell with a double sharp/flat like the default calculator does instead, e.g. Ab in C major transposed by +1 (Db major) as A instead of Bbb. Default: false, i.e. double sharps/flats are used (like MuseScore with "Use double sharps and flats").

    SimpleChordSymbolSpelling: boolean = true

    Spell a chord symbol root or bass that the interval would spell with a double sharp/flat or as Fb, Cb, E# or B# like the default calculator does, e.g. Ebmaj7 in D major transposed by +1 as Emaj7 instead of Fbmaj7. The notes keep their interval spelling. Default: true.

    Methods