pyampact.symbolic.getSpines

pyampact.symbolic.getSpines(piece, spineType)[source]

Return a pandas DataFrame of a less common spine type. This method is a window into the vast ecosystem of Humdrum tools making them accessible to pyAMPACT.

Parameters:

spineType – A string representing the spine type to return. You can pass the spine type with or without the “**” prefix.

Returns:

A pandas DataFrame of the given spine type.

Similar to the .harm, .keys, .functions, .chords, and .cdata methods, this method returns the contents of a specific spine type from a kern file. This is a generic method that can be used to get the contents of any spine type other than: **kern, **dynam, **text, **cdata, **chord, **harm, or **function. Many of the other spine types that you may be interested provide partwise data. For example, the results of Humlib’s Renaissance dissonance analysis are given as one “**cdata-rdiss” spine per part. Note that a **cdata-rdiss spine is not the same as a **cdata spine. This is why we return a DataFrame rather than an array or series. If there is just one spine of the spine type you request, the data will still be given as a 1-column dataframe. When you import a kern file, it automatically gets scanned for other spine types and if any are found you can see them with the foundSpines attribute.

This example takes a score with **cdata-rdiss spines (Renaissance dissonance analysis), and makes a DataFrame of just the **cdata-rdiss spines. The full score with color-coded dissonance labels can be seen on the Verovio Humdrum Viewer here.