Transposition class

Written-to-sounding transposition of a transposing instrument.

MusicXML <transpose>; MEI <staffDef @trans.diat @trans.semi>. A B-flat clarinet is Transposition(diatonic: -1, chromatic: -2): written C4 sounds B-flat 3.

Why the pitch is not rewritten at import

The notated pitch is what the engine draws, so it has to stay written; the transposition is a property of the INSTRUMENT and is applied when the score is turned into sound. Rewriting the pitches at import would produce a correct-sounding, wrong-looking score.

Before 2.7.1 the declaration was parsed into Score.metadata and nothing read it: applyMusicXmlTransposition existed but was never called from lib/, test/ or example/, so a B-flat clarinet part played back a major second high with the information sitting inertly beside it.

Constructors

Transposition({int diatonic = 0, int chromatic = 0, int octaveChange = 0, bool doubled = false, bool doubledAbove = false})
const

Properties

chromatic → int
Semitones to add to the written pitch to obtain the sounding pitch, EXCLUDING octaveChange.
final
diatonic → int
Diatonic steps to add to the written pitch to obtain the sounding pitch.
final
doubled → bool
MusicXML <double/>: the part is doubled an octave away.
final
doubledAbove → bool
MusicXML 4.0 <double above="yes"/>: the doubling is an octave UP.
final
hashCode → int
The hash code for this object.
no setteroverride
isConcertPitch → bool
True when this declaration leaves the pitch unchanged.
no setter
octaveChange → int
Extra octaves added on top of chromatic.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semitones → int
Total semitone offset from written to sounding pitch.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override