|home||tune search||software||learn abc||discuss||about||blog||Starbound/LOTRO||contact|
[abc standard: home | current | route-map | updating | proposals]
Transposition proposal - summary: This page contains the ninth draft of a proposal to extend the transcription capabilities within abc (following hundreds of messages on the abcusers mailing list in Sep 2011, Dec 2011 - Feb 2012 and Aug 2012). It is based on numerous comments, suggestions and proposals from lots of contributors.
The important aspects of this proposal are:
instrumentmodifier that operates on the
V:voicefields and provides syntax for transposing instruments reminiscent of standard transposing instrument terminology
I:transposeinstructions which provide arbitrary transposition of the sound and / or the typeset score
I:transposefollows an identical syntax (I think) to the
%%transposedirective available in abcm2ps, so that they are effectively interchangeable
V:voicefields. However, it now seems preferable that 4.6 should just discuss clefs, and that transposition should appear as a separate chapter 13 (with the existing chapters 13 Examples and 14 Appendix moving up to 14 and 15 respectively).
Although consensus was close back in Feb 2012, I temporarily stopped work on this proposal because of long-running arguments which I found difficult to keep up with. Since then I have introduced what I hope is a more robust system for updating the standard and other proposals have been published. I have therefore published this ninth draft, an updated and simplified version of the previous one.
This ninth draft is a moderate change from the eighth and omits the complex overloading of the instrument operator to cope with temporary changes in transposing instrument. These can easily be dealt with using the low-level operators (indeed, this is a good justification for including both low- and high-level systems).
In addition I have been convinced by the arguments that abc should be WYSIWYG as far as possible and so in this version the instrument modifiers are declarative only with regards to the typeset score. (That is not true for playback, but since there is no merit in ever having playback at written pitch, this means the proposal is WYSINNWYH - what you see is not necessarily what you hear - in other words, the playback is always at concert pitch even if the abc code is transcribed at written pitch).
Corrections: This proposal was first published on 22nd Aug 2012. Since then a couple of minor changes have been made including:
I:scorealready exist (which I knew very well but had temporarily forgotten) and therefore conflict with
I:score=written-pitch. Although Marc Sabatella also pointed out that the existing setting might well be a good place to specify concert / written pitch, the precise syntax is not crucial at this stage and I don't want to complicate the proposal, so I have changed the settings to
Additional text for section 4.6 Clefs and transposition
This section discusses support within abc for clefs and other features which affect the placement of the notes relative to the staff. It briefly mentions transposition, because some of the relevant syntax appears in the
V:voice fields, but this topic is discussed in full in section 13, Transposition.
Clef, transposing instrument and related indications appear as modifiers to the
V:voice fields; the general syntax is:
[clef=]<clef name>[<line number>][+8|-8] [stafflines=<lines>] [instrument=<key>[<options>]] [octave=<number>]
<…> denotes a value,
[…] denotes an optional modifier, and
| separates alternative values).
Within a given voice, unless overriden the modifiers of each
V: field are inherited from the previous
V: field - see scope and inheritance of modifiers for more details.
… unchanged …
instrument=<key>[<options>]is used when writing abc code for transposing instruments (see below);
… unchanged …
middle=<pitch>modifier of abc 2.1 and earlier has been compromised in terms of what it was supposed to do and how it has actually been implemented. It is therefore deprecated.
TODO: Update deprecated list.
… unchanged …
TODO: This section needs thorough checking and probably some discussion (although it is based on how abcm2ps currently propagates modifiers from one field to another).
The modifiers may be arranged in any order but there must be no more than one of each modifier in the same field.
Within a given voice, unless overridden the modifiers of each
V: field are inherited from the previous
Recommendation: In single-voice tunes these modifiers will normally be applied to the
K:key field. In multi-voice tunes it is recommended that they are only applied to
V:voice fields (an additional
V:voice field can even be introduced if one of the modifiers needs to change at a
K:key change). If a single-voice tune contains
V:voice fields (for example, if it is a part extracted from a multi-voice score), then it is recommended that modifiers are applied to the
In a tune which just contains
K: fields, a single rule applies:
K:field inherits the modifiers of the previous one (unless it specifically overrides them).
Example: In the following, the notes after the
K:G are set in the bass clef as the modifier is inherited from the
K:C clef=bass CDEF| K:G CDEF|
In tunes which contain
V: fields (either multi-voice or single-voice), two rules apply:
K:field inherits the modifiers of the previous
K:field (unless it specifically overrides them).
Note: in other words, within a voice
V: inherits from a
K: field as well as from another
V: field (and vice-versa).
To make the modifiers absolutely explicit at any point in the tune, you could just propagate them throughout the
V: fields for each voice.
Consider the following multi-voice tune (for the purposes of this example, assume that everything is transcribed at concert pitch):
V:violin V:clarinet instrument=Bb K:C [V:violin] CDEF| [V:clarinet] CDEF| [V:violin] [K:A]ABcd| [V:clarinet instrument=A] [K:A]ABcd| [V:violin] dcBA| [V:clarinet instrument=Bb] dcBA|
Firstly, the clarinet voice should be left unchanged if the violin voice is removed, so the clarinet voice is equivalent to the following:
V:clarinet instrument=Bb K:C [V:clarinet] CDEF| [V:clarinet instrument=A] [K:A]ABcd| [V:clarinet instrument=Bb] dcBA|
Finally to make the modifiers completely explicit, you could just propagate them through the voice, making the above equivalent to the following:
V:clarinet instrument=Bb K:C instrument=Bb [V:clarinet instrument=Bb] CDEF| [V:clarinet instrument=A] [K:A instrument=A]ABcd| [V:clarinet instrument=Bb] dcBA|
Transposing instruments sound notes at a different pitch to which they are written. For example, a C written on a Bb clarinet score would be sounded as a Bb (and similarly a written D would be sounded as a C).
This section uses written pitch (i.e. the pitch that is written on a transposing instrument's score) and concert pitch (i.e. the pitch that is actually sounded) to distinguish between the two.
Note: The term "concert pitch" is also used elsewhere in the musical lexicon to indicate "play A (above middle C) at 440Hz". However, here it refers to the pitches that transposing instruments actually sound.
To write abc code for a transposing instruments, each transposing instrument's voice has an
instrument modifier and which indicates how the abc code should be interpreted. Typically these appear in the
V: field although they may also be used in the
K: field (for example, in a tune transcribed for a single voice).
Abc code written for transposing instruments is always rendered by playback software at concert pitch. By default typesetting software will render it as transcribed (so abc code transcribed at concert pitch produces a typeset score at concert pitch). However, instructions can be used to typeset a concert score from abc transcribed at written pitch and vice-versa (see extracting a score in concert/written pitch).
The following example illustrates the principles, which are then discussed in more detail below.
Suppose a Bb clarinet player and a violinist wish to play the same piece which simply consists of the notes CDEF in the key of C.
Since the violin is not a transposing instrument, the violinist's part is written (and sounded):
V:violin K:C CDEF|
For the clarinet part, there is a choice. If, say, the composer of the piece prefers to work at concert pitch, the clarinet part can be transcribed as sounded:
V:clarinet instrument=Bb;concert K:C CDEF|
This will be rendered by abc typesetting software as transcribed (
CDEF). If a written pitch score is required it can be typeset by adding a
I:written_pitch_score instruction (see extracting a score in concert/written pitch).
Alternatively, if the clarinet player wants the abc code at written pitch, the same piece can be transcribed:
V:clarinet instrument=Bb;written K:D DEFG|
This will be rendered by abc typesetting software as transcribed (
DEFG). If a concert pitch score is required it can be typeset by adding a
I:concert_pitch_score instruction (see extracting a score in concert/written pitch).
Note: Written pitch voices will almost always need their own
K: field to set the key correctly (which will be different from concert pitch voices).
In both cases, the abc code will be rendered by abc playback software as the notes
CDEF (i.e., in the case of written pitch abc code, transposed down two semitones).
The whole piece could then be transcribed at concert pitch as:
K:C V:violin CDEF| V:clarinet instrument=Bb;concert CDEF|
Alternatively to transcribe the clarinet part at written pitch the whole piece could be written any one of a number of ways including the following three excerpts. The first sets up headers as they are required, the second sets up defaults in the file header and the third additionally compresses the abc code with inline headers.
K:C V:violin CDEF| V:clarinet instrument=Bb;written K:D DEFG|
V:violin V:clarinet instrument=Bb;written K:C V:violin CDEF| V:clarinet K:D DEFG|
V:violin V:clarinet instrument=Bb;written K:C [V:violin] CDEF| [V:clarinet][K:D] DEFG|
instrument modifier specifies the "key" of the transposing instrument (closely mimicking typical language used by musicians who play such instruments) together with an abc-pitch setting which indicates whether the abc code is transcribed at written or concert pitch.
Optionally the abc-pitch can be omitted and an
I:abc-pitch instruction used instead (see the abc-pitch instruction) to instruct software to treat every transposing instrument voice as either
written pitch (much in the same way that a typeset score may have the words "concert pitch" or "written pitch" at the top).
Example: Abc code transcribed at concert pitch for a Bb instrument can be indicated as follows. In these two excerpts, which are equivalent to each other, the settings are purely declarative and would have no effect (unless used in conjunction with a
I:written_pitch_score instruction - see extracting a score in concert/written pitch):
I:abc-pitch=concert V:clarinet instrument=Bb
Example: Abc code transcribed at written pitch for a Bb instrument can be indicated as follows. In these two excerpts, which are equivalent to each other, the settings mean that playback would be transposed down two semitones from the abc code. However for typesetting they are purely declarative and would have no effect (unless used in conjunction with a
I:concert_pitch_score instruction - see extracting a score in concert/written pitch):
I:abc-pitch=written V:clarinet instrument=Bb
Available key settings match those of existing transposing instruments (for a list of typical transposing instrument keys and their transpositions in semitones see the instrument transposition table in the appendices).
For high and low transposing instruments, the instrument key can be followed by a
- together with the number of octaves.
instrument=Bb-1. For a low Bb instrument, if the abc is transcribed at written pitch, the playback is transposed down by an octave and two semitones (i.e. 14 semitones).
instrument=Eb+1. For a high Eb instrument, if the abc is transcribed at written pitch, the playback is transposed up by 3 semitones.
instrument=C+1. For a high C instrument, if the abc is transcribed at written pitch, the playback is transposed up by 12 semitones (i.e. an octave transposition).
The abc-pitch (i.e. the pitch at which the abc code is transcribed) is set by appending either
;written after the "key" to indicate that the abc code is transcribed at concert or written pitch, respectively.
I:abc-pitch instruction can be used to set a default abc-pitch for a tune (or file) and thus to instruct software how the
instrument modifiers are to be interpreted. If either of the following instructions is inserted in the tune (or file) header it is applied to all voices in the tune (or file) containing an
Example: In the following excerpt, both voices are treated as if the abc code is transcribed at written pitch:
I:abc-pitch=written V:clarinet instrument=Bb V:sax instrument=Bb-1
I:abc-pitch only indicates how the
instrument modifiers are to be interpreted; it has no effect on any voice that does not contain an
instrument modifier, so voices written for non-transposing instruments are completely unchanged by it.
An abc-pitch setting contained in the
instrument modifier overrides the
I:abc-pitch instruction. This override only lasts until the next
V: field (in the same voice) that contains an
Example: The following excerpt alternates between concert and written pitch:
I:abc-pitch=concert V:clarinet instrument=Bb % concert pitch - the "I:abc-pitch" setting is applied V:clarinet instrument=A;written % written pitch - the "I:abc-pitch" is now overridden to "written" V:clarinet instrument=A % concert pitch - the override is cancelled and the "I:abc-pitch" applies once more
However, this is not recommended and if it is desired to switch between concert and written pitch in an abc transcription, for clarity it is recommend that the abc-pitch should be made completly explicit using the
Example: For clarity, the previous excerpt could be written:
V:clarinet instrument=Bb;concert V:clarinet instrument=A;written V:clarinet instrument=A;concert
I:abc-pitch instruction may not appear in the tune body and if more than one applies (e.g. if there is one in the file header and one in a tune header), the latter overrides the former.
If the abc-pitch setting is omitted from the
instrument modifier and no
I:abc-pitch instruction is in force, the default abc-pitch is assumed to be
concert. However, it is recommended that the abc-pitch should always be set explicitly.
Example: The following voice regarded as being transcribed at concert pitch.
Comment: Legacy tunes transcribed prior to the introduction of the
instrument syntax, are sometimes transcribed in written pitch (with a
transpose modifier to change the playback output). However, since they will not have an
instrument modifier, and since the
transpose modifier is not affected by
abc-pitch, the default to
concert pitch will not affect them.
If one or more voices in a tune are transcribed for transposing instruments parts are produced at written pitch, but the conductor score can be printed either at written or concert pitch. Since playback is always at concert pitch, the following instructions affect only typesetting software.
I:concert_pitch_score instruction can be used in the tune header (or even the file header) to typeset a tune (or even all the tunes in a file) at concert pitch.
I:concert_pitch_score instruction has the following effects:
I:concert_pitch_scorehas the effect of applying the transposition, indicated by the key setting of the
instrumentmodifier, to the typeset score. For example, a Bb instrument transcribed at written pitch has its typeset score transposed down by two semitones from the transcribed abc code (since Bb is two semitones below C).
I:written_pitch_score instruction can be used in the tune header to typeset a tune (or even all the tunes in a file) at written pitch.
I:written_pitch_score instruction has the following effects:
I:written_pitch_scorehas the effect of applying the transposition, indicated by the key setting of the
instrumentmodifier, to the typeset score. For example, a Bb instrument transcribed at concert pitch has its typeset score transposed up by two semitones from the transcribed abc code (since C is two semitones above Bb).
TODO (elsewhere in the standard): Limit the range of key signatures supported by abc to
K:Cb (7 flats) through to
K:C# (7 sharps). (Also limit accidentals - e.g. double sharp and double flat accidentals should be supported, but triples are entirely optional.)
In general the written key signature is specified precisely by the instrument "key" and so transposing instruments should not need to choose an enharmonic alternative: specifically, in terms of steps through the cycle of fifths, the relationship between the concert key and the written key is the same as the relationship between the instrument key and C.
Example: For a Bb instrument there are two steps up through the cycle of fifths to C, therefore a concert key signature of Cb is transposed to a written key signature of Db (not C#) and concert B is transposed to written C# (not Db). However, this is limited by the range of available key signatures, so a concert key signature of F# is transposed to written Ab (since G# is not supported) and C# is transposed to Eb (since D# is not supported).
Although not recommended, it is possible to get the enharmonic alternative using an
I:transpose instruction with zero semitone transposition and an appropriate enharmonic indicator (see enharmonic alternatives for transposition and transposition for transposing instruments).
Example (esoteric): The following excerpt would be typeset in
K:C# rather than
K:Db because of the enharmonic indicator in the
I:written_pitch_score K:Cb instrument=Bb;concert I:transpose-score 0#
Sometimes it is necessary to change, temporarily, the transposition in a voice to that for a different transposing instrument. This can be achieved using the low level
I:transpose operators - see transposition for transposing instruments.
Many abc software tools offer transposition facilities - either by modifying the output (so that the typeset score and/or the playback is output at a different pitch from the abc transcription), or even by writing or displaying a transposed version of the abc music code.
However, there are often occasions when it is preferable to record the transposition as (semi-permanent) change in the abc tunebook. For example, the tunebook might record how the tune was originally transcribed but a band may wish to play it in a different key. The following syntax allows this without the need to generate an additional transposed duplicate of the abc code.
Transposition can be specified within the abc code using the following
I:transpose <semitones>- transpose both the typeset score and the playback by the indicated number of semitones (positive numbers transpose up, negative down);
I:transpose-score <semitones>- transpose the typeset score by the indicated number of semitones (this setting does not affect playback);
I:transpose-sound <semitones>- transpose the playback by the indicated number of semitones (this setting does not affect the typeset score).
These instructions describe how abc software must treat the abc code in order to produce the required output and provide an arbitrary way of transposing the typeset score and the playback either independently or together. They can even be used for transposing instruments as a lower-level alternative to the
instrument modifier, although this is not recommended.
Example: The following excerpt would be transposed up a fifth (7 semitones) from C into G.
I:transpose 7 K:C CDEF|
The semitone transposition table (in the appendices) shows the number of semitones required to achieve any transposition between every key from
K:Cb (seven flats) through to
K:C# (seven sharps).
The following rules apply to
I:transposeinstruction in the file header is applied to all tunes in the file;
I:transposeinstruction in the tune header is applied to all voices in the tune;
I:transposeinstruction in the tune body is applied to the current voice from where it appears to the end of the tune.
I:transpose setting overrides the score and / or sound transposition individually as follows:
I:transpose-scoreinstruction overrides any existing
I:transpose-scoreinstruction, but leaves
I:transpose-soundinstruction overrides any existing
I:transpose-soundinstruction, but leaves
I:transpose <n>instruction is equivalent to
Example 1: If both
I:transpose instructions are of the same type then second simply overrides the first. Thus the following two lines are considered identical (spaces added for easy comparison):
[K:C] CDE| [I:transpose 7]CDE| [I:transpose 5]CDE| [K:C] CDE| GAB| FGA|
Example 2: If the
I:transpose instructions are different then the override is carried out indiviudally by sound or score. Thus the following two lines are considered identical:
[I:transpose 7][I:transpose-sound 5] [I:transpose-score 7][I:transpose-sound 5]
Recommendation: The examples above are somewhat esoteric, provided for the purpose of explaining the scoping rules and not to demonstrate typical usage. Indeed, an abc tune is difficult to read if it contains more than one
I:tranpose instruction and so it is recommended to keep them to an absolute minimum, either once in the file header or in individual tune headers or possibly at the start of specific voices.
The transposition produced by
I:tranpose instructions is always to the enharmonic key with the smallest number of sharps or flats. In the one ambiguous case,
K:F# (6 sharps) is the default, rather than
K:Gb (6 flats).
Enharmonic alternatives are possible, within the range of supported key signatures (a maximum of 7 flats,
K:Cb, through to a maximum of 7 sharps,
K:C#), and to get an enharmonic key:
<semitone>indicator to get a sharp key;
<semitone>indicator to get a flat key;
<semitone>indicator to get a choice; in this case transposition from a flat key gives a flat enharmonic and transposition from a sharp key gives a sharp enharmonic (transposition from
K:Cdefaults to the enharmonic key with the smallest number of sharps or flats).
The enharmonic indicators have no effect if the resulting key does not have an enharmonic equivalent within the supported range.
Examples: The following examples demonstrate the enharmonic rules in full (the comments show the resulting key):
[I:transpose 2] [K:D] % K:E [I:transpose 2b][K:D] % K:E despite the enharmonic indicator, as K:Fb is outside the range of supported key signatures [I:transpose 2] [K:A] % K:B [I:transpose 2b][K:A] % K:Cb because of the enharmonic indicator [I:transpose 2] [K:E] % K:F# because of the default [I:transpose 2b][K:E] % K:Gb because of the enharmonic indicator [I:transpose 2] [K:B] % K:Db because it has 5 flats whereas K:C# has 7 sharps [I:transpose 2#][K:B] % K:C# because of the enharmonic indicator [I:transpose 2*][K:B] % K:C# because of the enharmonic indicator (the * gives a sharp enharmonic rather than a flat one) [I:transpose 2#][K:F#] % K:Ab despite the enharmonic indicator, as K:G# is outside the range of supported key signatures
Note that enharmonic indicators apply to playback and typesetting alike, although they will only make a difference to the playback if the software can handle non-equal temperaments (since in equal temperament a Gb, say, will sound exactly the same as an F#).
Generally, the low-level
I:transpose instructions should not be used alongside the high-level
instrument modifiers as they represent different approaches to transposition (included in the abc specification to support the diversity of views when the topic was discussed). However, they can be used together if the need arises to transpose a piece which contains one or more voices transcribed for transposing instruments.
The result of transposition applied to transposing instrument voices is, in effect, the same as if all the high-level
instrument modifiers were to be translated into low-level
I:transpose instructions and then combined with the
They are combined by adding their semitone values together and ignoring the enharmonic indicator implied by the
instrument modifier. The instrument transposition table (in the appendices) lists the standard transposing instrument "keys" together with their corresponding
I:transpose values together with implied enharmonic indicators.
Example: Consider the following excerpt:
I:written_pitch_score V:clarinet instrument=Bb;concert I:transpose 7 K:C CDEF|
I:transpose 7 instruction is equivalent to applying
I:transpose-score 7 and
I:transpose-sound 7. Meanwhile the
instrument=Bb;concert, together with the
I:written_pitch_score is equivalent to
I:transpose-score 2* (see the instrument transposition table). Once the semitone values are added together, the excerpt above is equivalent to the following:
V:clarinet I:transpose-score 9 I:transpose-sound 7 K:C CDEF|
Recommendation for developers: As this section indicates, high-level and low-level systems can be combined by converting all the high-level modifiers to low level instructions. Also
I:transpose <n> is equivalent to
I:transpose-score <n> and
I:transpose-sound <n>. Therefore to support both transposing instruments and arbitrary transposition, it suffices to write code which internally converts the
instrument modifiers to
I:transpose instructions (as per the instrument transposition table). Once the conversion is done, typesetting software need only implement
I:transpose-score and playback software need only implement
A list of intervals and their corresponding semitones equivalences can be found at Wikipedia.
The following table shows the upward semitone transpositions (i.e. transposing up from the original key to the required key) to be used with the
I:transpose instructions (see transposition of a tune or file) for every key from
K:Cb (seven flats) through to
K:C# (seven sharps).
To calculate downward transpositions, look up the number in the table and subtract 12 from it (leaving the enharmonic indicator unchanged).
Example: To transposing up from
K:G (the row headed
K:C and the column headed
G) is a positive transposition of 7 semitones and hence
I:transpose 7 is used. Transposing down from
K:G is (7 - 12) = -5 semitones and hence
I:transpose -5 is used.
The transposition can also go beyond an octave.
[I:transpose 19][K:C] would transpose the tune up an octave and a fifth from
K:G (i.e. the note
C is transposed to the note
The enharmonic indicators,
b, are shown (if required) in order to select the enharmonic alternative - see transposition of a tune or file for more details.
Note that even though they are not specifically mentioned in the table, the semitone transpositions also work for minor and modal keys, provided that both original and required key signatures are both minor or both in the same mode.
Example: To transpose up from
K:Gmin is a positive transposition of 7 semitones (the same semitone transposition as for
The following table lists the standard transposing instrument "keys" (see Wikipedia for a full list) together with their corresponding
I:transpose values when going from concert to written pitch or vice-versa. Here the enharmonic indicator,
*, clarifies which enharmonic alternative should be chosen although, since most key signatures don't have enharmonic equivalents, it would be superfluous in most cases.
| || || ||example|
| || || |
| || || ||Bb clarinet|
| || || ||A clarinet|
| || || |
| || || ||alto flute|
| || || ||cor anglais|
| || || |
| || || ||alto sax|
| || || |
| || || |
Example: The following two excerpts indicate the same transposition:
I:written_pitch_score [V:clarinet instrument=Bb;concert]
For instruments in high and low keys, the
I:transpose-score equivalent has 12 subtracted from it for each octave the instrument is raised and 12 added for each octave it lowered. Similarly the
I:transpose-sound has 12 added for each octave it is raised and 12 subtracted for each it is lowered.
I:transposeequivalents are therefore
I:transpose-score 14*(= 2 + 12) to transpose a concert pitch transcription to written pitch and
I:transpose -14*(= -2 - 12) to transpose a written pitch transcription to concert pitch (for both the typeset score and the playback).
I:transposeequivalents are therefore
I:transpose-score -3*(= 9 - 12) to transpose a concert pitch transcription to written pitch and
I:transpose 3*(= -9 + 12) to transpose a written pitch transcription to concert pitch (for both the typeset score and the playback).