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 sixteenth draft of a proposal to extend the transcription capabilities within abc. It is somewhat scaled back from the fifteenth proposal but with a few additional features:

  • the shift modifier is now independent from score and sound
  • additional V:* syntax for applying modifiers to all voices
  • shorthand score=<note> as a synonym for score=<note>c, useful for transcribing at concert pitch for transposing instruments (July 2015)
  • I:no-shift for cancelling all shift modifiers throughout a file/tune (July 2015)

The important aspects of this proposal are the same as versions 10 - 13 and 15:

  • a unified system for transposition consisting of the well-establised score and sound operators (shortened from shift-score and shift-sound), which allow the typeset score and playback to be modified independently
  • transposition by interval (e.g. C to G), rather than by semitones as previously
  • the instrument modifier (defined in terms of score and sound) to give an intuitive specification for transposing instruments (syntax simplified slightly from instrument=<note1>;abc@<note2> to instrument=<note1>/<note2>, July 2015)

As most of the syntax is agreed, this is a working draft, meaning that I will make changes to it as we go along. Possible changes include:

Chris Walshaw, February 2015


4.6 Clefs and key/voice parameters

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 the relevant syntax appears in the K:key and 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 K:key and V:voice fields; the possible modifiers are:

clef=<clef name> stafflines=<lines> octave=<number>
  score=<note1>[<note2>] sound=<note1><note2> shift=<note1><note2>
  instrument=<note1>[/<note2>] clef-c=<clef name>

(where <…> denotes a value, […] denotes an optional parameter).

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

… unchanged …

  • score=<note1><note2> transposes the typeset score according to the specified interval (the playback is not affected) - for more information see transposition operators;
  • sound=<note1><note2> transposes the playback according to the specified interval (the typeset score is not affected) - for more information see transposition operators;
  • shift=<note1><note2> transposes the typeset score and the playback according to the specified interval and may be used independently of score and sound - for more information see transposition operators;
  • instrument=<note1>/<note2> is a synonym for score=<note1><note2> sound=c<note2> - for more information see writing abc code for transposing instruments;
  • clef-c=<clef name> specifies the clef to be used for a concert/sounding pitch score

… unchanged …

Note:

  • The transpose=<semitones> modifier of abc 2.1 and earlier is now deprecated (replaced by the sound modifier - see transposition). It may still be used, but not in conjunction with sound or score modifiers - if it is, software should ignore the transpose setting and issue a warning message.
  • The middle=<pitch> modifier of abc 2.0 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 …

4.6.4 Scope and inheritance of modifiers

As a fundamental rule, within 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).

Recommendation: In single-voice tunes these modifiers will normally be applied to the K: field. In multi-voice tunes it is recommended that they are only applied to V: fields (an additional V: field can even be introduced if one of the modifiers needs to change at a K: change). If a single-voice tune contains V: 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: fields.

Modifiers written in each successive K: or V: field override modifiers inherited from previous fields. Within each K: or V: field, modifiers may be arranged in any order but should not be repeated (if they are, the second overrides the first).

To evaluate overriding of instrument shorthands, expand them to their score and sound equivalents (although it is not recommended to mix shorthands with direct operators - see transposition operators).

Finally note that there are a number of ways to specify octave shifts and, for example, octave=1 has the same effect as shift=Cc and score=Cc sound=Cc. However all of these operators can be used independently and so their effects add up.

7 Multiple voices

… unchanged, with the following additional content before the Zocharti Loch example …

The syntax V:*, when it appears in either the file or tune header, applies all of its modifiers globally to every voice in the file or tune respectively (although these global modifiers may be overridden by later modifiers).

Example: All voices in this piece are set in the bass clef with the exception of the first one where the clef=treble modifier overrides the global clef=bass.

V:* clef=bass
V:1 clef=treble
V:2
V:3

13. Transposition

13.1 Transposition operators

There are three direct transposition operators, score, sound and shift, which are modifiers for K:key and V:voice fields and act on each voice they are applied to:

  • score=<note1><note2> transposes the typeset score according to the specified interval (the playback is not affected); if the second note is omitted it is assumed to be a c (see writing abc code for transposing instruments)
  • sound=<note1><note2> transposes the playback according to the specified interval (the typeset score is not affected)
  • shift=<note1><note2> transposes the typeset score and the playback according to the specified interval

The transposition interval is specified by two notes, <note1><note2>. Here <note1> refers to the transcribed abc code and <note2> refers to the rendered output (i.e. the typeset score in the case of score, the playback in the case of sound, or both in the case of shift).

Example: In the following the typeset score is raised by a fifth and is rendered the same as if the abc code was transcribed as [K:D] efga. The playback is lowered by a tone and is rendered the same as if the abc code were [K:F] GABc.

K:G score=CG sound=DC
ABcd

The operators are independent so their effects add up.

Transpositions are applied to notes, grace notes, chord symbols and key signatures (except K:none).

13.1.1 Shorthands for transposing instruments

There is also a shorthand modifier, instrument, for transposing instruments, which is defined in terms of score and sound:

  • instrument=<note1>/<note2> is defined as score=<note1><note2> sound=c<note2>

If the abc code is transcribed at written pitch, the two values <note1> and <note2> will be the same: in this case the modifier can be shortened to instrument=<note1> - see writing abc code for transposing instruments.

Recommendation: It is strongly recommended that the instrument shorthand is not mixed with score and sound modifiers in the same file. See writing abc code for transposing instruments and custom transposition for diatonic instruments for examples of typical usage.

13.1.2 Enharmonics

The interval system is clear with regard to enharmonics so, for example, the interval C to _G is distinct from C to ^F. However, to compute transpositions it may be helpful to use the MusicXML concept of specifying the interval as a combination of diatonic steps and semitones. Both of these can be easily calculated and make it simple to work out what the resulting note is using the diatonic steps to give the letter and the semitones to indicate whether it is flat, natural or sharp.

Notes for developers: You should correct any transposition which goes beyond the specified abc limits to available key signatures, K:Cb (7 flats) to K:C# (7 sharps), and double/triple accidentals. For example, in principle K:C# score=CG raises the key up to K:G# (8 sharps), so to keep with the limits it should be rendered as K:Ab (4 flats) and a warning issued to the user.

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

13.2 Transposing a file/tune

To transpose an entire file (or all the voices in a tune), use the a global V:* shift=<note1><note2> in the file (or tune) header. Alternatively, V:* score=<note1><note2> and V:* sound=<note3><note4> will transpose the transposed score and playback independently.

Note, however, that global settings such as these will be overridden by existing modifiers within a tune. Therefore it makes sense to choose a preferred transposition method and modifier(s) (i.e. transposing instrument using instrument modifiers, fixed pitch using score and sound, or moveable pitch using shift - see writing abc code for transposing instruments and custom transposition for diatonic instruments) and to stick to it. This will then give the freedom to achieve global file/tune transposition using a different modifier.

13.3 Writing abc code for transposing instruments

Transposing instruments sound notes at a different pitch to which they are written. For example, a C written on a B♭ clarinet score would be sounded as a B♭ (and similarly a written D would be sounded as a C).

The transposition operator for transposing instruments is instrument=<note1>/<note2>, where <note1> expresses the written pitch of the transposing instrument (relative to c) and <note2> expresses the pitch at which the abc is encoded (also relative to c). This operator, instrument=<note1>/<note2>, is a synonym for score=<note1><note2> sound=c<note2>.

There are two typical ways of writing abc code for transposing instruments:

  1. The abc code can be transcribed at sounding pitch using instrument=<note>/c (or if preferred score=<note>, which is a shorthand for score=<note>c).
  2. The abc code can be transcribed at written pitch using instrument=<note>/<note> (or sound=c<note>, if preferred). Since, in this case, the abc code is at the same pitch as the typeset output (and so the <note> value is the same for both instrument= and abc@), the /<note> may be omitted and so the modifier shortened to instrument=<note>.

A third less common possibility occurs if the abc code is transcribed at a different pitch from both sounding and written pitches (as can happen in the case of re-transposition - see below) and in this case the full instrument=<note1>/<note2> must be used to express the written pitch of the instrument in question (in the <note1> value) and the pitch at which the abc is encoded (in the <note2> value).

NB: The <note1> and <note2> in the instrument=<note1>/<note2> syntax are notes and not keys (so that different octaves may be specified and so that the letter b is not ambiguous). Therefore, for a B♭ instrument you must write instrument=_B and not instrument=Bb.

In all cases the typeset score is rendered at written pitch (unless a concert score is requested).

The extended example below (section 13.3.2) illustrates the principles of writing abc code for transposing instruments.

13.3.1 Generating a concert/sounding pitch score

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.

If a concert pitch score is required the I:concert-score or I:sounding-score instructions can be applied, either in the file header (or the tune header) which will result in the file (or tune) being typeset at concert/sounding pitch.

The distinction between these two instructions is that I:sounding-score typesets every voice at sounding pitch whereas I:concert-score does the same but leaves octave-transposing voices (e.g. piccolo, double bass) at written pitch.

Notes for developers: To evaluate this formally, resolve all of the instrument= shorthands to their score= and sound= equivalents and then apply the sound transposition interval to the score modifier, so that score=<note1><note2> sound=<note3><note4> would effectively be changed by I:sounding-score to score=<note3><note4> sound=<note3><note4>. The same changes apply for I:concert-score unless both <note1> and <note3> are a C (in any octave) in which case score= is left unchanged.

Generally the clef on the concert score will be the same as on the written score, but to change it, use clef-c=<clef-name> as a K: or V: modifier. To restore the clef, mid-voice, to the same as the written score, use clef-c= with no <clef-name> which will cancel the clef-c setting.

13.3.2 Transposing instruments - extended example

Suppose a B♭ 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:1 name=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:2 name=clarinet instrument=_B/c
K:C
CDEF|

or alternatively, using score

V:2 name=clarinet score=_B
K:C
CDEF|

Either will be rendered by abc typesetting software according to the transposition for a B♭ instrument (i.e. [K:D] DEFG) but sounded as transcribed (i.e. CDEF).

Aside: An important difference between the two versions is that, although score is shorter, it does not reset the sound modifier. Therefore, if you mix written pitch and concert pitch transcriptions in the same piece, it will need to be reset explicitly using sound=cc for each concert pitch voice which follows a written pitch voice. For this reason it is not recommended to mix score (or sound) modifiers with instrument.

Returning to the example, if the composer wants the abc code at written pitch, the clarinet part can be transcribed:

V:2 name=clarinet instrument=_B/_B
K:D
DEFG|

Furthermore, since the <note1> and <note2> parts of the instrument= are the same (i.e. _B), this may be shortened to:

V:2 name=clarinet instrument=_B
K:D
DEFG|

These will be rendered by abc typesetting software as transcribed (DEFG) but sounded according to the transposition (i.e. CDEF).

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

The whole piece could then be transcribed at concert pitch as:

K:C
V:1 name=violin
CDEF|
V:2 name=clarinet instrument=_B/c
CDEF|

or using score

K:C
V:1 name=violin
CDEF|
V:2 name=clarinet score=_B
CDEF|

Alternatively it could be transcribed at written pitch as:

K:C
V:1 name=violin
CDEF|
V:2 name=clarinet instrument=_B
K:D
DEFG|

In either case the typeset score will be rendered at written pitch (and the playback at concert pitch).

To obtain a concert pitch score, add an I:concert-pitch or I:sounding-pitch instruction in the file or tune header (since there are no octave transposing instruments in this piece the result will be the same for either instruction).

Re-transposition: Finally, suppose that the clarinet player has fallen ill and is to be replaced by an alto sax player who now needs a differently transposed part to read. Whether the abc code has been transcribed at concert pitch or at written pitch this is easy by changing the instrument=_B part of the instrument=_B/<note> modifier to instrument=_E.

Since this is a temporary transposition it is probably worth retaining the original clarinet information in a separate V: field and then overriding it, so if the abc code is at concert pitch, the clarinet part then becomes:

V:2 name=clarinet instrument=_B/c
V:2 name="alto sax" instrument=_E/c
CDEF|

If the abc code is at written pitch, the modifier simply changes to instrument=_E/_B, indicating that the voice should be typeset for an Eb instrument but that the abc code is still transposed at written pitch for a Bb instrument (in this case the instrument=<note> shorthand is insufficient as it only applies when both instrument and encoding pitches are the same.)

The resulting code is:

V:2 name=clarinet instrument=_B
V:2 name="alto sax" instrument=_E/_B
K:D
DEFG|

Finally note that all of the transposing instrument information would normally be collected up in the tune header to make it more visible (it only needs to appear in the body if something changes halfway through, such as a switch from Bb clarinet to A clarinet). So the written pitch clarinet to alto sax re-transposition excerpt could be transcribed as:

T:Duet for violin and clarinet (actually played on an alto sax)
V:1 name=violin
V:2 name=clarinet instrument=_B
V:2 name="alto sax" instrument=_E/_B
K:C
V:1
CDEF|
V:2
K:D
DEFG|

13.3.3 Transposing instrument examples

The following table lists some example transposing instruments and the modifiers they would need

abc at concert pitch abc at written pitch
Instrument instrument=<n>/c score=<n> instrument=<n>/<n> instrument=<n>
piccolo instrument=c'/c score=c' instrument=c'/c' instrument=c'
Bb clarinet instrument=_B/c score=_B instrument=_B/_B instrument=_B
soprano sax instrument=_B/c score=_B instrument=_B/_B instrument=_B
A clarinet instrument=A/c score=A instrument=A/A instrument=A
alto flute instrument=G/c score=G instrument=G/G instrument=G
cor anglais instrument=F/c score=F instrument=F/F instrument=F
alto sax instrument=_E/c score=_E instrument=_E/_E instrument=_E
double bass instrument=C/c score=C instrument=C/C instrument=C
tenor sax instrument=_B,/c score=_B, instrument=_B,/_B, instrument=_B,

13.4 Custom transposition for diatonic instruments

Non-standardised transpositions are commonly used in various folk and traditional musics and the transposition system has been deliberately designed as flexible as possible to allow for custom transpositions.

13.4.1 Fixed pitch transpositions

At its most straightforward custom transposition echoes the usage (if not the terminology) of transposing instruments.

For example, music for the Great Highland Bagpipes is almost always written in A mixolydian but the sounding pitch has been creeping upwards over the years and is now around Bb. If writing solely for the pipes one way to notate this is to redefine the frequency of concert A accordingly (e.g. change it away from concert A at 440Hz).

TODO (elsewhere): Identify a mechanism for setting the frequency of concert A.

However, this will not work for ensembles with other instruments and so the simplest way is to treat the pipes as a transposing instrument and to write K:AMix sound=A_B for written pitch transcriptions (or K:BbMix score=_BA for concert pitch transcriptions).

This could instead be written instrument=_d (or instrument=_d/c respectively) but most Highland pipers would be very surprised to hear their pipes referred to as a Db transposing instrument.

13.4.2 Moveable pitch transpositions

A further, more involved way that transposition is used, particularly for diatonic instruments (e.g. flutes, whistles, bagpipes, hurdy-gurdies, diatonic accordions, etc), is to transpose tunes to a preferred fingering, usually based on the range of the instrument. Furthermore, because such instruments are often available in several different keys, the instrument chosen to play the tune may be in a different "key" from the fingering.

In the example below, the two tunes are transposed to a D fingering, where the 6-finger note is always notated as D (exactly the same as for the saxophone family of instruments). On folk woodwind this is often referred to as 6-finger D.

X:1
T:Tune 1
K:Gmin shift=GD
GABc defg:|

X:2
T:Tune 2
K:Amix shift=AD
ABcd efga:|

However, this is not necessarily the final sounding key and so, for example, if the musician chooses to play them on an F instrument, the playback for the whole file could be adjusted accordingly with an V:* sound=DF instruction at the top.

In addition, if a fellow musician happened to prefer G fingering (6-finger G) the typeset score could be easily adjusted with an V:* score=DG instruction at the top.

The resulting file would look like:

V:* sound=DF score=DG

X:1
T:Tune 1
K:Gmin shift=GD
GABc defg:|

X:2
T:Tune 2
K:Amix shift=AD
ABcd efga:|

Finally, to cancel all of the shift modifiers in a file (or tune), add the instruction I:no-shift to the file (or tune) header.

abc/standard/v2.1/proposals/transposition/v16.txt · Last modified: 2015/07/04 10:01 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