3.1. Calculator¶
The Calculator program extracts rhythmic partitioning data from given digital scores and saves it into a JSON file.
Output JSON file contains:
texture_datawith events’ data split in separate lists:Index (
measure number + offset)Measure number
Offset
Global offset
Duration
Partition
Density number
Agglomeration index
Dispersion index
offset_mapwith a map of measure numbers and their global offsetsvalues_mapwith partitions and the values of their agglomeration and dispersion indexespartitionswith a single list of each event partitions
Its basic usage is:
rpscripts calc score.xml
The option -h prints the program help:
rpscripts calc -h
Output:
usage: rpscripts calc [-h] [-d] [-m] [-c] [-e] filename
positional arguments:
filename digital score filename (XML, MXL, and KRN)
options:
-h, --help show this help message and exit
-d, --dir folder with digital score files
-m, --multiprocessing
multiprocessing
-c, --csv output data in a CSV file.
-e, --equally_sized generate equally-sized events
The -c option also creates a CSV file with the events data (see Converter section).
The combined -e and -c options create a CSV file with equally-sized events. This procedure is helpful for statistical operations such as frequency analysis.
rpscripts calc -e score.xml
The -d option runs the program in all available digital scores available in the given directory (XML, MXL, and KRN):
rpscripts calc -d path-to-folder
The -m option runs the program using multiple processor cores when available. This option runs in combination with -d:
rpscripts calc -m -d path-to-folder