rend -- split data tokens from specified Humdrum spines into component sub-tokens


rend [-s] -i 'target_interp' -f reassign-file [inputfile ...]



Humdrum data tokens often contain more than one type of information or type of signfier. For example, the **pitch representation consists of three parts (not including cents deviation): the pitch letter name, the accidental, and the octave number (e.g. A#4). In some tasks it may be useful to split such information into separate spines. For example, a user may wish to reformat the following spine:

as three independent spines:

The above transformation may be achieved by invoking the following command:

rend -i '**pitch' -f reassign




The rend command provides the following options:
-f reassignmaps input tokens to output tokens according to definitions given in the
file reassign
-hdisplays a help screen summarizing the command syntax
-i target_interpprocess all input spines whose exclusive interpretations are labelled
-smatches a single instance of the given pattern rather than all instances
Options are specified in the command line.


Consider the following example:

rend -i '**kern' -f noterest song01

and the associated reassignment file named noterest:

**rests [\\.0-9r]+|^=+[0-9]*

This command specifies that each **kern spine in the file song01 is to be split into two new spines dubbed **notes and **rests. The first regular expression -- '[]A-Ga-g[#-]+|^=+[0-9]*' -- indicates that the following strings should be echoed in the data records for **notes: the upper-case letters A to G and the lower-case letters a to g, plus the characters [, ], #, and -. Alternatively, rend will echo any data token beginning with one or more equals-signs, followed by zero or more numbers.

Similarly, the second **rests spine will contain characters that match the regular expression '[\\.0-9r]+|^+=[0-9]*'. This includes the period (.), all numbers (0-9), plus the letter r. Alternatively, rend will echo any data token beginning with one or more equals-signs, followed by zero or more numbers.

Given this command, the following input:

!! Commented input.
2C 2Ehum.2r
will produce the following output:
!! Commented input.
C E2 2hum..2r









rend -i '**ex1' -f reassign input

and the associate reassignment file (reassign):

**let [a-z]
**num [0-9]

Given the following input:
