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 sixth 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.

This sixth version does a number of things (and is quite a big step from the fifth):

4.6 Transposition and clefs

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 K:key and 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 I:transpose instructions.

Transposing instrument, clef and related indications appear as modifiers to the K:key and V:voice fields; the general syntax is:

[clef=]<clef name>[<line number>][+8|-8] [middle=<pitch>] [stafflines=<lines>]
 [instrument=<key>[<options>]] [octave=<number>]

(where <…> denotes a value, […] denotes an optional modifier, and | separates alternative values).

Within a given voice, unless overriden the modifiers of each K: or V: field are inherited from the previous K: or V: field - see scope and inheritance of modifiers for more details.

… unchanged …

… unchanged …

Note: the 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 …

4.6.1 Writing abc code for transposing instruments

TODO: Here or elsewhere, clarify how the instrument modifiers affect the clef - see messages 6316 and 6324.

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.

Transposing instruments - extended example

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 [K:D] DEFG

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.

The abc-pitch setting

The 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

The 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.

If the I:abc-pitch directive is omitted, the default abc-pitch is assumed to be concert.

Comment: Legacy tunes transcribed prior to the introduction of the abc-pitch and 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.

The instrument modifier

The 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 + or - together with the number of octaves.

Examples:

  • The sopranino saxophone is in high Eb and so would be written 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.
  • The tenor saxophone is in low Bb and so would be written 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.

Optionally, the 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 K: or V: field (in the same voice) that contains an instrument modifier.

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 instrument modifier.

Example: For clarity, the previous example could be written:

V:clarinet instrument=Bb;concert
V:clarinet instrument=A;written
V:clarinet instrument=A;concert
Enharmonic alternatives for transposing instruments

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.)

If there is an enharmonic alternative (within the range of supported key signatures - i.e. a maximum of 7 flats, K:Cb, through to a maximum of 7 sharps, K:C#), the key is determined by the instrument modifier as follows:

  • an instrument in a flat key should always have its score typeset in a sharp key
  • an instrument in a sharp key should always have its score typeset in a flat key

Example: The following field would result in the score being typeset as K:C# rather than the enharmonic alternative of K:Db.

K:B instrument=Bb;concert

To choose the other enharmonic alternative, add ;# or ;b to the instrument setting to pick sharp or flat keys, respectively.

Example: The following field would result in the score being typeset as K:Db rather than K:C#.

K:B instrument=Bb;concert;b
Temporary changes to transposing instruments

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 V: or K: field.

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-pitch setting:

  • If the abc code is transcribed at concert pitch then, in effect, the second modifier simply overrides the first one, by specifying how the score should be typeset; there would be no difference to the result if the first modifer were left out.
  • If the abc code is transcribed at written pitch, then the interaction is a little more subtle; in effect, the first modifier describes how the code could be transposed back to concert pitch and the second modifier then describes how it should be typeset. As a result, it makes no sense for the second modifier to indicate an abc-pitch setting 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 K: or V: field (in the same voice) that contains an instrument modifier.

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
Extracting a score in concert pitch

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).

The 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.

The I:concert-score instruction has the following effects:

  • for voices transcribed at concert pitch, I:concert-score has the effect of ignoring any instrument modifiers;
  • for voices transcribed at written pitch, I:concert-score has the effect of applying the playback transposition (specified by the instrument modifier) 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-score instruction would also apply the same transposition to the typeset score.

4.6.2 Transposition of a tune or file

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 instructions:

  • 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).

Scope and inheritance of transpose instructions

The following rules apply to I:tranpose instructions:

  • an I:transpose instruction in the file header is applied to all tunes in the file;
  • an I:transpose instruction in the tune header is applied to all voices in the tune;
  • an I:transpose instruction in the tune body is applied to the current voice from where it appears to the end of the tune.

Unusually, rather than overriding any existing transposition setting, each successive I:transpose instruction combines with it (or with a high-level instrument modifier) by adding together their semitone values.

Example: The following two lines are considered identical (spaces added for easy comparison); here the effect of the second I:transpose instruction is to change the transposition to 5 (= 7 - 2):

[K:C] CDE| [I:transpose 7]CDE| [I:transpose -2]CDE|
[K:C] CDE|                GAB|                 FGA|

As a consequence of this combining rule:

  • I:transpose 0 has no effect (other than on enharmonic alternatives - see below);
  • to cancel an I:transpose instruction, you must include another one which negates it.

Example: The following two lines are considered identical (spaces added for easy comparison):

[K:C] CDE| [I:transpose 7]CDE| [I:transpose -7] CDE|
[K:C] CDE|                GAB|                  CDE|

Also, in terms of combinations, I:transpose <n> is equivalent to I:transpose-score <n> and I:transpose-sound <n>.

Example: The following two lines are considered identical:

[I:transpose 7][I:transpose-sound -2]
[I:transpose-score 7][I:transpose-sound 5]

Finally, the inclusion of an I:transpose-sound instruction has no effect on the I:transpose-score setting and vice-versa.

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 file is very difficult to read if more than one I:tranpose instruction is in force at any one time 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.

Enharmonic alternatives for transposition

The transposition produced by I:tranpose instructions is always to the key with the smallest number of sharps or 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:

  • add a # after the <semitone> indicator to get a sharp key;
  • add a b after the <semitone> indicator to get a flat key.

In the one ambiguous case, K:F# (6 sharps) is the default, rather than K:Gb (6 flats).

The enharmonic indicators have no effect if the resulting key would lie outside the range of supported key signatures (or 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:F#] % K:Ab despite the enharmonic indicator, as K:G# is outside the range of supported key signatures

In the event of I:tranpose instructions combining, the most recent enharmonic indicator (i.e. # or b or nothing) is used.

Example: The following (esoteric) example demonstrates how enharmonic indicators combine:

K:C
I:transpose -1 % transposes to K:B (5 sharps)
I:transpose 0b % no change to the semitone transposition, but the enharmonic indicator changes the key to K:Cb (7 flats)
I:transpose 0  % no change to the semitone transposition, but the empty enharmonic indicator changes the key back to K:B

Finally note that enharmonic indicators do also make sense for playback, although they will only make a difference to the sound if the software can handle non-equal temperaments (since in equal temperament a Gb, say, will sound exactly the same as an F#).

Transposition for transposing instruments

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 translated into low-level I:transpose instructions and then the rules for scope and inheritance of transpose instructions applied. The instrument transposition table (in the appendices) lists the standard transposing instrument "keys" together with their corresponding I:transpose values.

Example: Consider the following excerpt:

I:transpose 7
V:clarinet instrument=Bb
K:C
CDEF|

The 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#. The excerpt above is therefore directly equivalent to the following:

I:transpose-score 7
I:transpose-sound 7
V:clarinet
I:transpose-score 2#
K:C
CDEF|

Finally the combined effect of the transpose instructions is equivalent to the following, where the two I:transpose-score instructions are added together to give 9 and the enharmonic indicator of the second is adopted:

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 I:transpose-sound.

4.6.3 Scope and inheritance of modifiers

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 K: or V: field are inherited from the previous K: or V: field.

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 V:voice fields.

In a tune which just contains K: fields, a single rule applies:

  • each successive 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 field.

K:C clef=bass
CDEF|
K:G
CDEF|

In tunes which contain V: fields (either multi-voice or single-voice), two rules apply:

  • each voice is left unchanged if all of the other voices are removed;
  • in each voice, each successive V: or K: field inherits the modifiers of the previous V: or 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).

Modifier scope - extended example

To make the modifiers absolutely explicit at any point in the tune, you can just propagate them throughout the K: and 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|

Appendix

Transposition tables

Interval and semitone equivalences

A list of intervals and their corresponding semitones equivalences can be found at Wikipedia.

Semitone transposition table

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).

key required
original key Cb Gb Db Ab Eb Bb F C G D A E B F# C#
K:Cb 0b 7b 2 9 4 11 6 1 8 3 10 5 0 7 2#
K:Gb 5b 0b 7 2 9 4 11 6 1 8 3 10 5 0 7#
K:Db 10b 5b 0 7 2 9 4 11 6 1 8 3 10 5 0#
K:Ab 3b 10b 5 0 7 2 9 4 11 6 1 8 3 10 5#
K:Eb 8b 3b 10 5 0 7 2 9 4 11 6 1 8 3 10#
K:Bb 1b 8b 3 10 5 0 7 2 9 4 11 6 1 8 3#
K:F 6b 1b 8 3 10 5 0 7 2 9 4 11 6 1 8#
K:C 11b 6b 1 8 3 10 5 0 7 2 9 4 11 6 1#
K:G 4b 11b 6 1 8 3 10 5 0 7 2 9 4 11 6#
K:D 9b 4b 11 6 1 8 3 10 5 0 7 2 9 4 11#
K:A 2b 9b 4 11 6 1 8 3 10 5 0 7 2 9 4#
K:E 7b 2b 9 4 11 6 1 8 3 10 5 0 7 2 9#
K:B 0b 7b 2 9 4 11 6 1 8 3 10 5 0 7 2#
K:F# 5b 0b 7 2 9 4 11 6 1 8 3 10 5 0 7#
K:C# 10b 5b 0 7 2 9 4 11 6 1 8 3 10 5 0#

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:C to 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:C to K:G is (7 - 12) = -5 semitones and hence I:transpose -5 is used.

The transposition can also go beyond an octave.

Example: [I:transpose 19][K:C] would transpose the tune up an octave and a fifth from K:C to K:G (i.e. the note C is transposed to the note g).

The enharmonic indicators, # and 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:Cmin to K:Gmin is a positive transposition of 7 semitones (the same semitone transposition as for K:C to K:G).

Instrument transposition table

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 indicators clarify which alternative is chosen although, since most key signatures don't have enharmonic equivalents, they would be superfluous in most cases.

abc-pitch
instrument concert written example
instrument=C I:transpose-score 0 I:transpose-sound 0
instrument=Bb I:transpose-score 2# I:transpose-sound -2b Bb clarinet
instrument=A I:transpose-score 3b I:transpose-sound -3# A clarinet
instrument=Ab I:transpose-score 4# I:transpose-sound -4b
instrument=G I:transpose-score 5b I:transpose-sound -5# alto flute
instrument=F I:transpose-score 7# I:transpose-sound -7b cor anglais
instrument=E I:transpose-score 8b I:transpose-sound -8#
instrument=Eb I:transpose-score 9# I:transpose-sound -9b alto sax
instrument=D I:transpose-score 10b I:transpose-sound -10#
instrument=Db I:transpose-score 11# I:transpose-sound -11b

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.

Examples:

  • The sopranino saxophone is in high Eb and so would be written instrument=Eb+1. The I:transpose equivalents 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.
  • The tenor saxophone is in low Bb and so would be written instrument=Bb-1. The I:transpose equivalents 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.
abc/standard/v2.1/proposals/transposition/v6.txt · Last modified: 2012/02/17 09:15 by cwalshaw
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki