How to do quantization in Python?
Python | Decimal quantize() method
Decimal#quantize() : quantize() is a Decimal class method which returns a value equal to first decimal value (rounded) having the exponent of second decimal value. Return: a value equal to first decimal value (rounded) having the exponent of second decimal value.
What is quantize function?
In simple terms, quantization is a production technique you can use to make your imperfect timing, perfectly in time. When you quantize a note or a group of notes, it snaps the notes to the “grid” so all the notes land exactly on the beat and/or the subdivisions.