pyampact.symbolic.nmats

pyampact.symbolic.nmats(piece, json_path=None, include_cdata=False)[source]

Return a dictionary of DataFrames, one for each voice, with information about the notes and rests in that voice.

Each DataFrame has the following columns:

MEASURE ONSET DURATION PART MIDI ONSET_SEC OFFSET_SEC

In the MIDI column, notes are represented with their MIDI pitch numbers (0 to 127), and rests are represented with -1s. The ONSET_SEC and OFFSET_SEC columns are taken from the audio analysis from the json_path file if one is given. The XML_IDs of each note or rest serve as the index for this DataFrame. If include_cdata is True and a json_path is provided, the cdata from the json file is included in the DataFrame.

Parameters:
  • json_path – Optional path to a JSON file containing audio analysis data.

  • include_cdata – Boolean, default False. If True and a json_path is provided, the cdata from the json file is included in the DataFrame.

Returns:

A dictionary of DataFrames, one for each voice.

See also

fromJSON(), insertAudioAnalysis(), jsonCDATA(), xmlIDs()