scamp.quantization.QuantizationRecord

class scamp.quantization.QuantizationRecord(quantized_measures: Sequence[QuantizedMeasure])[source]

Bases: SavesToJSON

Record of how a PerformancePart was quantized.

Parameters:

quantized_measures (Sequence[QuantizedMeasure]) – list of quantized measures

Variables:

quantized_measures – list of quantized measures

Inherited Methods

duplicate()

Returns a copy of this object by serializing to and from JSON.

json_dumps()

Dump this object as a JSON string.

json_loads(s)

Load this object from a JSON string.

load_from_json(file_path)

Load this object from a JSON file with the given path.

save_to_json(file_path)

Save this object to a JSON file using the given path.

Attributes

measure_lengths

Tuple of all measure lengths

time_signatures

Tuple of the TimeSignature object for each measure

property measure_lengths: Sequence[float]

Tuple of all measure lengths

property time_signatures: Sequence[TimeSignature]

Tuple of the TimeSignature object for each measure

duplicate() T

Returns a copy of this object by serializing to and from JSON.

json_dumps() str

Dump this object as a JSON string. This uses a custom encoder that recognizes and appropriately converts any attributes that are object inheriting from SavesToJSON.

classmethod json_loads(s: str) T

Load this object from a JSON string. This uses a custom decoder that looks for a “_type” key in any object/dictionary being parsed and converts it to the class specified (assuming it a subclass of SavesToJSON).

Parameters:

s – a string representing this object in JSON format

classmethod load_from_json(file_path: str) T

Load this object from a JSON file with the given path. This uses a custom decoder that looks for a “_type” key in any object/dictionary being parsed and converts it to the class specified (assuming it a subclass of SavesToJSON).

Parameters:

file_path – path for loading the file

save_to_json(file_path: str) None

Save this object to a JSON file using the given path. This uses a custom encoder that recognizes and appropriately converts any attributes that are object inheriting from SavesToJSON.

Parameters:

file_path – path for saving the file