|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 eighth draft of a proposal to extend the transcription capabilities within abc (following hundreds of messages on the abcusers mailing list in Sep 2011 and subsequently in Dec 2011 - Feb 2012). It is based on numerous comments, suggestions and proposals from lots of contributors.
The eighth draft is a minor change from the seventh and fixes problems with enharmonic alternatives that arose due to the adoption of pragmatic enharmonic indicators (which, in a few cases, contradict the tonal enharmonics needed by transposing instruments). The only sections affected are enharmonic alternatives for transposing instruments, enharmonic alternatives for transposition and the instrument transposition table.
The seventh draft is a minor change from the sixth and just modifies the way
I:transpose instructions interact with each other (they override rather than combine). The only sections affected are scope and inheritance of transpose instructions, enharmonic alternatives for transposition and transposition for transposing instruments.
The sixth version, however, does a number of things (and is quite a big step from the fifth):
instrumentmodifier that operates on the
K:fields and provide syntax for transposing instruments
I:transposeinstructions which provide arbitrary transposition of the sound and / or the typeset score
instrumentmodifier so that:
abc-pitch(allowing written pitch voices within concert pitch scores and vice-versa)
I:transposenow follows an identical syntax (I think) to the
%%transposedirective available in abcm2ps, so that they are effectively interchangeable
Additional text for section 4.6 Clefs and transposition
This section discusses support within abc for transposition (in terms of both transposing instruments and arbitrary transpositions), clefs and other topics which affect the placement of the notes relative to the staff. Although only loosely related they are grouped together here because most of the relevant syntax appears in the
V:voice fields (and because transposition can have an effect on the clef).
Arbitrary transpositions for the transposition of a tune or file appear as
Transposing instrument, clef and related indications appear as modifiers to the
V:voice fields; the general syntax is:
[clef=]<clef name>[<line number>][+8|-8] [middle=<pitch>] [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 …
transpose=<semitones> modifier of abc 2.1 and earlier is equivalent applying an
I:transpose-sound <semitones> instruction. However, the use of
transpose is now deprecated. TODO: Update deprecated list.
… unchanged …
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 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 instrument, the tune (or file) should indicate whether the abc code is transcribed at concert pitch or written pitch (normally using an
I:abc-pitch directive). Subsequently each transposing instrument's voice has an
instrument modifier (which can also set the
abc-pitch) 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).
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 playback software as the notes
CDEF and by abc typesetting software as follows:
TODO: include typeset score image showing
However, if the clarinet player wants the abc music code to reflect what appears on the typeset score, the abc code can be transcribed at written pitch:
V:clarinet instrument=Bb;written K:D DEFG|
This will also be rendered by abc playback software as the notes
CDEF (i.e. transposed down two semitones) and by abc typesetting software as above.
abc-pitch, which indicates how the abc code has been transcribed (and thus how the
instrument modifiers are to be interpreted), can be set for specific voices by the
instrument modifier (see below), or for all voices by using either of the following instructions in the tune (or file) header.
I:abc-pitch concert I:abc-pitch written
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.
I:abc-pitch directive is omitted, the default
abc-pitch is assumed to be
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.
instrument modifier specifies the "key" of the transposing instrument, closely mimicking typical language used by musicians who play such instruments, and hence (together with the
abc-pitch setting) indicates how the abc code should be treated.
Example: Abc code transcribed at concert pitch for a Bb instrument can be indicated as follows (in this case the playback would be at the same pitch as the abc code whereas the typeset score would be transposed up two semitones from it):
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 this case the typeset score would be at the same pitch as the abc code whereas the playback would be transposed down two semitones from it):
I:abc-pitch written V:clarinet instrument=Bb
Note: 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=Eb+1. For a high Eb instrument, if the abc is transcribed at concert pitch, the typeset score is transposed down by 3 semitones; if it is at written pitch, the playback is transposed up by the same amount.
instrument=Bb-1. For a low Bb instrument, if the abc is transcribed at concert pitch, the typeset score is transposed up by an octave and two semitones (i.e. 14 semitones); if it is at written pitch, the playback is transposed down by the same amount.
instrument modifier can override the
abc-pitch setting by adding
;concert, after the instrument key, to specify concert pitch, or by adding
;written to specify written pitch. This override only lasts until the next
V: field (in the same voice) that contains an
Example: The following example alternates between concert and written pitch:
V:clarinet instrument=Bb % if not set in thet tune header, the default "abc-pitch concert" is assumed V:clarinet instrument=A;written % the "abc-pitch" is now overridden to "written" V:clarinet instrument=A % the override is cancelled and the "abc-pitch" reverts to the default setting from the tune header
Users who prefer, for clarity, to make the
abc-pitch setting more explicit can instead specify it with every
Example: For clarity, the previous example could be written:
V:clarinet instrument=Bb;concert V:clarinet instrument=A;written V:clarinet instrument=A;concert
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: The following excerpt would be typeset in
K:C# rather than
K:Db because of the enharmonic indicator in the
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. As specific exception to the rule that only one modifier of each type is allowed, this can be handled by adding a second
instrument modifier to the
Example: In the following the voice should be typeset and / or played back as if the abc code were transcribed for an Eb transposing instrument.
V:sax instrument=Bb instrument=Eb
In such cases, the second
instrument modifier has a different effect depending on the
abc-pitchsetting and if one appears it is ignored.
Example: The following indicates a voice which has been transcribed at written pitch for a Bb instrument but which will be typeset for an Eb instrument (for example, a
D in the abc code is sounded as a C which would be typeset as an A for an Eb instrument):
V:sax instrument=Bb;written instrument=Eb
Changes specified in this way only last until the next
V: field (in the same voice) that contains an
Example: In the following, the second
V: field reverts the score back to a Bb instrument.
V:sax instrument=Bb;written instrument=Eb V:sax instrument=Bb;written
If one or more voices in a tune are transcribed for transposing instruments it is sometimes useful to produce a concert pitch score (e.g. for the conductor).
I:concert-score instruction can be used in the tune header (or even the file header) to typeset a complete score (or even all the scores in a file) at concert pitch.
I:concert-score instruction has the following effects:
I:concert-scorehas the effect of ignoring any
I:concert-scorehas the effect of applying the playback transposition (specified by the
instrumentmodifier) to the typeset score in addition. For example, a Bb instrument transcribed at written pitch has its playback transposed down by two semitones; the inclusion of an
I:concert-scoreinstruction would also apply the same transposition to the typeset score.
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:
V:clarinet instrument=Bb I:transpose 7 K:C CDEF|
I:transpose 7 directive is equivalent to applying
I:transpose-score 7 and
I:transpose-sound 7. Meanwhile the
instrument=Bb assumes the default of
I:abc-pitch concert and hence is equivalent to
I:transpose-sound 2* (see the instrument transposition table). Once the semitone values are added togther, 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
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 (with the exception of the
instrument modifier - see temporary changes to transposing instruments) there must be no more than one of each modifier in the same field; if there are two or more then the final one overrides the others.
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 can just propagate them throughout the
V: fields for each voice.
Consider the following multi-voice tune:
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, just propagate them through the voice, making the above equivalent to the following:
V:clarinet instrument=Bb K:C [V:clarinet instrument=Bb] CDEF| [V:clarinet instrument=A] [K:A instrument=A]ABcd| [V:clarinet instrument=Bb] dcBA|
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. 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 lines indicate the same transposition:
[V:clarinet instrument=Bb;concert] [V:clarinet][I:transpose-score 2*]
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 -3*(9 - 12) for abc transcriptions at concert pitch and
I:transpose-sound 3*(-9 + 12) for those at written pitch.
I:transposeequivalents are therefore
I:transpose-score 14*(2 + 12) for abc transcriptions at concert pitch and the
I:transpose-sound -14*(-2 - 12) for those at written pitch.