hint – determine harmonic intervals between concurrent pitches for Humdrum inputs
`` hint [-a|-l|-v] [-cdu] [-s regexp] [inputfile ...] [> outputfile.hnt]``
The hint command outputs the harmonic interval distances between simultaneous notated pitches. Output pitch intervals are expressed as a combination of diatonic interval size and interval quality (such as a `perfect fifth’ or `minor ninth’). Standard musical abbreviations are used (e.g., m2 - minor second; P4 - perfect fourth; A6 - augmented sixth; dd7 - doubly diminished seventh). By way of illustration, hint will change the `` **pitch`` diad C4-E4 (or E4-C4) – to the interval token M3.
The hint command determines harmonic intervals for pitch tokens spanning all pitch-related spines in an input record; this includes multiple-stops within spines. In the default operation, a single output interpretation `` (hint)`` is generated for any given input. All pitches in a given sonority (sounding moment) are first sorted in ascending pitch order. If the **-u option is selected, duplicate pitches (unisons) are treated as a single pitch-instance when calculating the intervening intervals. Intervals are then calculated between successive pairs of pitches – ordered from low to high. A single data token is output – representing all intervals in a given sonority. If more than one interval is present, the interval tokens are assembled as Humdrum multiple-stops within the output data token.
Input records containing no pitch tokens result in the outputting of a null token (.). Input records containing only rests result in the outputting of a rest token (r). Input records containing only a single pitch result in the outputting of a hyphen (-). Input records containing only a single duplicated pitch result in the outputting of the interval (P1) – unless the -u option is selected, in which case the a hyphen is output (-).
The hint command recognizes and echoes “common-system” barlines (see barlines (2)). It is also able to handle multiple-stops.
By defining regular expression patterns, the user may select which data records should be ignored by hint. (See EXAMPLES below.)
Note that the output spine generated by hint preserves the same record-type structure as the input, and so may readily be pasted with the input file using the Humdrum assemble command.
The hint command is able to accept any of the pitch-related representations listed below. For descriptions of the various input representations refer to Section 2 (Representation Reference) of this reference manual.
It is recommended that output files produced using the hint command should be given names with the distinguishing `.hnt’ extension.
**kern core absolute pitch representation **Tonh German pitch system **pitch American National Standards Institute pitch notation (e.g. “A#4”) **solfg French solfège system (fixed `doh’)
Input representations processed by **hint*.*
The hint command provides the following options:
-a calculate all intervals by permuting all pitches present -c output compound intervals as non-compound intervals -d output diatonic interval size only, without the interval quality -h displays a help screen summarizing the command syntax -l calculate intervals with respect to the lowest pitch present -s regexp skip; completely ignore records matching regexp; (output null token) -u eliminate unisons from the output
The -a and -l options are mutually exclusive.
Options are specified in the command line.
The -a option causes all permuted intervals within a sonority to be output rather than only those intervals between successive pitch-ordered pitches. Hence, the sonority (E4 G4 C5) will produce the output m3 m6 P4 rather than m3 P4. A tandem interpretation (*all) is added to the output in order to indicate that the interval content is exhaustive. Note that the order of the intervals in the output token no longer has any significance when the -a option is invoked.
The -c option causes all compound intervals to be output as non-compound equivalents. Compound intervals are defined as those intervals greater than or equal to an octave in size. Hence, a major tenth interval will be output as a major third, and an octave will be output as a perfect unison.
The -d option causes only the diatonic interval size to be output. In this case, the interval quality signifiers (AdmMP) will be suppressed. For example, with the -d option, the output token `3’ signifies any interval of a third, including major, minor, diminished, etc.
The -l option causes hint to calculate all intervals with respect to the lowest notated pitch present. Hence, the input sonority (G4 E4 C4) will produce the output M3 P5 rather than M3 m3.
The -s option allows the user to define a regular expression, that if matched, causes a null token to be output for the given record.
The -u option eliminates duplicate pitches in interval calculations. For example, rather than outputting P1 M3 P1 for the sonority (C4 C4 E4 E4), the -u option will result in the output M3. In the case of a sonority consisting of a repeated single pitch, the -u option will cause a hyphen (-) to be output.
**kern **kern **pitch **commentary =1 =1 =1 barline 8c 8e G4 C major triad 8g 8c E4 reordered pitches 4r 4r r rest . . . null tokens 4C 4e G5 open position triad =2 =2 =2 barline 4C 4E 4G 4c C5 multiple-stops 4CC 4r 4e 4g r mixed notes & rest 8C 8C . unison 8C 8r . single pitch =3 =3 =3 barline *- *- *- *-
**hint =1 M3 m3 M3 m3 . M10 m10 =2 M3 m3 P4 P8 M17 m3 P1
The hint command correctly echoes (and ignores) both rests and kern-like barlines – as illustrated in the first and fourth output data records. The second output data record (M3 m3) indicates that two intervals are present: the first interval is a major third above the lowest pitch, and the second interval is a minor third above the other pitch. The third data record shows that rearranging the order of the input pitches has no effect on the output.
Notice that the null-token in the sixth record has been echoed. Null-tokens have no effect on interval calculations and are treated as though they are non-existent. Multiple-stops are treated the same as if each pitch was in a separate spine (eighth data record), and rests within a sonority containing pitches are ignored (ninth data record). The perfect unison signifier (P1) is output only if more than one pitch is present (tenth data record). If a single pitch is present in the input, a hyphen is output rather than the P1 token (eleventh data record).
**hint =1 3 3 3 3 . 10 10 =2 3 3 4 8 17 3 1
The -s (skip) option can be used to allow the user to selectively identify records that should not be involved in processing. Consider the command
`` hint -s r input > output.hnt``
will cause any data token containing the letter `r’ to suspend the calculation of any harmonic intervals for the current record. The corresponding **hint output for data records matching the pattern will consist simply of a null token. Given the sample input, intervals will be calculated only when none of the pitch-related spines contain a rest.
Given the first three spines of the above sample input (i.e. without the **commentary spine), the command
`` hint -cu -s r input > output``
**hint =1 M3 m3 M3 m3 . M3 m3 =2 M3 m3 P4 .
Notice that the major and minor tenths in the sixth data record have been rendered as major and minor thirds. Also note that the perfect unison in the tenth data record has been output as a hyphen – and that the P1 formerly present in the eighth data record has disappeared. The presence of the rest in the original ninth data record has caused the outputting of a simple null token.
The -l option causes hint to calculate intervals with respect to the lowest pitch present in the sonority. For example, with the above sample input, the -l option would produce the following output: ````
**hint * =1 M3 P5 M3 P5 . M10 P19 =2 M3 P5 P8 P15 M17 P19 P1
The -a option calculates all possible intervals by pairing all pitches present in a given sonority. The order of the output intervals conforms to the following standard: all pitches are sorted from low to high; intervals are determined as 1-2, 1-3, 1-4, etc., 2-3, 2-4, etc. By way of example, the following input: ````
**kern **kern 4C 4E 4G 4c 4c 4r *- *-
**hint *all M3 P5 P8 P8 m3 m6 m6 P4 P4 P1 *-
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).
- **Pertinent description in the Humdrum User Guide**
- **Index to Humdrum Commands**
- **Table for Contents for Humdrum User Guide**