The transpose filter can be used transpose music by a specified interval or to a specific key.
Transposing by key
Here is an example of transposing a four-part chorale
from G major to A-flat major, using the
-k option to change
!!!filter: transpose -k a-
a on the first line of the example to transpose
to A major instead.
The transpose filter is identical to the Humdrum Extras command-line tool transpose. See its documentation for more examples of how to use the transpose filter.
Transposing by musical interval
-k option requires a key interpretation present in the data, such
*C: for C major, or
*b-: for B-flat minor. If this is not then case,
then you can still transpose by a specific interval using the
Transposing down a major third:
!!!filter: transpose -t -M3
Transposing down a minor sixth:
!!!filter: transpose -t m6
Transposing down a perfect fourth:
!!!filter: transpose -t -P4
Transposing up a diminished fifth:
!!!filter: transpose -t d5
Transposing down an augmented unison, such as from E major to E-flat
!!!filter: transpose -t -A1
Try various interval transpositions in the following example, which
starts out in the key of C major (but there is no key indication, so
-k option cannot be used).
Transposing by base-40 interval number
The Base-40 representation for pitches allows for integer values for various intervals. All of these interval numbers can be calculated from two pieces of information: A major second is a 6 in the system, and a minor second is a 5. For example a perfect fifth is composed of three major seconds and one minor second, so the base-40 interval is 3 * 6 + 1 * 5 = 23. An octave is 5 major seconds and 2 minor seconds, which translates to 5 * 6 + 2 * 5 = 40 (hence the name of the system). Note that an augmented unison is the difference between a major and minor second, which is 1.
Try transposing the following example by base-40 interval, which is
given as an integer after the
-b option flag in the transpose
filter. Also note that the base-40 system is limited to a range of
double-flats to double-sharps, so intervals that transpose to/by
triple-flats will not work in the system.
Chord symbols imported from MusicXML are stored in an
These symbols are understood by the transpose tool and will be transposed
along with any
**kern spines in the data.
Below is an example work containing an
**mxhm data spine. The original
key is C major, but the transpose tool is changing the key of the piece
to D major. Try transposing the music to other keys by changing the
d on the first line of the text box below to another tonic pitch.