ydelta -- calculate numeric differences for concurrent Humdrum data


ydelta [-o] [-s regexp] -i '**interpretation' [inputfile]


The ydelta command outputs a single spine containing numeric data representing the numeric differences for concurrent tokens in specified input spines. For example, ydelta may be used to characterize the semitone distances separating pitches in a given vertical sonority or chord.

The user indicates which spines in the input stream are to be processed by specifying an interpretation via the -i option. The output interpretation is automatically assigned a new name by prepending the upper-case letter `Y' to the given input interpretation. For example, a specified input of **semits will result in an output interpretation named **Ysemits.


The ydelta command provides the following option:
-hdisplays a help screen summarizing the command syntax
-i **interpprocess input spines with interpretations **interp
-oin square brackets output lowest value ("origin") from which
differences are calculated
-s regexpskip over records matching regexp; If all target spines contain the same
token; token is output. If the tokens differ, the entire record is output
(although all tabs are replaced by spaces).
Options are specified in the command line.


The operation of ydelta is best illustrated using an example. Consider the following input file called praetorius:
!! Praetorius, Es ist ein' Ros' entsprungen.
Given the following command line:

ydelta -o -i '**semits' praetorius > chords

the above input file would result in the following output:

!! Praetorius, Es ist ein' Ros' entsprungen.
[-7] 7 16
[-7] 7 16
[-7] 4 12
[-2] 0 7
[-7] 4 12
[-12] 7 16
[-10] 3 12
[-14] 7 16
[-7] 4 7
[-8] 8
[-10] 8 12
[-12] 12
[-19] 16 19
Only those input spines labelled **semits have been processed; both **text and **kern have been ignored. The first value (given in square brackets) represents the lowest numerical value found in the processed spine(s) for the current data record. This value appears only when the -o option is invoked. Successive numerical values indicate the differences between the lowest value and the remaining numeric values in the other spines. For example, the first input record contains the **semits values -7, 0, and 9. The lowest of these values is -7 -- which is placed in square brackets. The next lowest value (0) is 7 units above the lowest value, whereas the value 9 is 16 units above the lowest value. These other values are sorted and printed in ascending order in the output token. Notice that the output is typically in the form of Humdrum multiple stops. If no numerical values are present, a null token (.) is output (see for example, the barlines).


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


hint (4), regexp (4), regexp (6), xdelta (4)