tonh -- translate selected Humdrum pitch-related representations to German pitch notation


tonh [-tx] [inputfile ...] [ > outputfile.tnh]


The tonh command transforms various pitch-related inputs to the corresponding German system for designating pitches (Tonhöhe). It outputs one or more Humdrum **Tonh spines. German pitch designations are similar to the common A-G designations used by English speakers. The letter `H' signifies the English `B', whereas the letter `B' signifies English `B-flat'. Sharps and flats are indicated via the suffixes "is" and "es" respectively -- hence `Cis' for `C#' and `Ges' for `Gb'. Special exceptions include `Heses' for B double-flat rather than `Bes', `As' and `Es' rather than `Aes' or `Ees', and `S' as an alias for `Es' (E-flat).

The tonh command is able to translate any of the pitch-related representations listed below. In each case, a tuning standard of A4 equals 440 hertz is assumed. For descriptions of the various input representations (including **Tonh) refer to Section 2 (Representation Reference) of this reference manual.

It is recommended that output files produced using the tonh command should be given names with the distinguishing `.tnh' extension.

**centshundredths of a semitone with respect to middle C=0
**degreekey-related scale degree
**freqfundamental frequency (in hertz)
**fretfretted-instrument pitch tablature
**kerncore pitch/duration representation
**MIDIMusic Instrument Digital Interface tablature
**pitchAmerican National Standards Institute pitch notation (e.g. "A#4")
**semitsequal-tempered semitones with respect to middle C=0 (e.g. 12 = C5)
**solfgFrench solfège system (fixed `doh')
**specCspectral centroid (in hertz)
Input representations processed by tonh.


The tonh command provides the following options:

-hdisplays a help screen summarizing the command syntax
-tsuppresses printing of all but the first not of a group of tied **kern notes
-xsuppresses printing of non-Tonh data
Options are specified in the command line.

The -t option ensures that only a single output value is given for tied **kern notes; the output coincides with the first note of the tie.

In default operation, tonh outputs non-pitch-related signifiers in addition to the Tonhöhe value. For example, the **pitch token "Gb5zzz" will result in the output "Ges5zzz" -- that is, after translating Gb5 to Ges5, the "zzz" signifiers are retained in the output. For some applications, echoing non-pitch-related signifiers in the output is useful. However, in other situations, the result can prove confusing -- especially, when the non-pitch-related signifiers are numbers. Consider the case of the **kern token "8aa#"; after translating `aa#' to Ais5, the non-pitch-related signifier `8' will also be output, hence the value 8Ais5 -- which may cause confusion. Commands such as pitch and tonh treat the first number encountered in an input token as the octave designation. So further processing of this token may lead to it's interpretation as A#8 -- or even A#85 -- rather than A#5.

The -x option is useful for eliminating non-pitch-related signifiers from the output. For most **kern inputs, the -x option is recommended.


The following example illustrates the use of tonh. The input contains six pitch-related spines -- two of which (**degree and **cocho) cannot be processed by tonh. In addition, there are two non-pitch-related spines (**embell and **metpos).
!! `tonh' example.
4a-]D4/48/ /52/128.116+/4ct
.D4 F4/-52/237.33 6.43/4 5/4ct
rG4.r1r3/4 1/5.
Executing the command

tonh -tx input > output

produces the following result:

!! `tonh' example.
.D4C3 E3128.11H4ct
.D4 F4.237.33 6.4F4 A4ct
rG4.r1rF4 D5.
Both processed and unprocessed spines are output. Notice that the tied note at the beginning of measure 2 in the **kern spine has been rendered as a single note rather than as two notes (due to the -t option). Also notice that the non-pitch-related signifiers (e.g. foo) in the first notes of the **pitch and **MIDI spines have been stripped away (due to the -x option). In the case of the **degree input, tonh recognizes the spelling of various pitches in the context of the key of D minor. Hence, the raised third degree is Fis (F#), and the raised sixth degree is H (B natural).


The file x_option.awk is used by this program when the -x option is invoked.


DOS 2.0 and up, with the MKS Toolkit. OS/2 with the MKS Toolkit. UNIX systems supporting the Korn shell or Bourne shell command interpreters, and revised awk (1985).


**cents (2), cents (4), **degree (2), degree (4), **freq (2), freq (4), **fret (2), hint (4), **kern (2), kern (4), **MIDI (2), midi (4), mint (4), **pitch (2), pitch (4), **semits (2), semits (4), **solfg (2), solfg (4), **specC (2), specC (4), **Tonh (2)