Skip to contents

This function takes a humdrumR object and "expands" the content of any spine paths by filling them in with the content of their parent path(s).

Usage

expandPaths(x, asSpines)

Arguments

asSpines

Should paths expanded into new spines?

Defaults to TRUE.

Must be a singleton logical value: an on/off switch.

If TRUE, the expanded paths are copied into their own new spines (shifting higher spines over as needed).

humdrumR

HumdrumR data.

Must be a humdrumR data object.

Details

For example, imagine that in humdrum representation of a eight-measure piano score, the annotator included an ossia passage in the seventh measure. If we want to simply ignore the ossia passage, we can just specify a subset() where Path == 0. If we want to study only the ossia passage, we can grab a subset() where Path == 1. However, what if we want to study the ossia as it would be performed, with the ossia measure swapped in for measure 7, but still using measures 1-6 and 8 from the main path? expandPaths() will help us do just this: expandPaths() will copy the contents of measure 1-6 and 8 into the second path and, if asSpines = TRUE, then copy the path into it's own new spine. We can then treat that new "full" path/spine just like any other path/spine.

See also

Other Humdrum table reshaping functions: cleave(), collapseHumdrum(), rend()