xiRetimer

fit recorded audio to a tempo
git clone https://git.ce9e.org/xiRetimer.git

commit
c59c9b45563f60ea305cc469fec75e4ad7eb3ec4
parent
9b2eeb52cbf5d0d592e750ab5e140770bd87f174
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-12-27 08:04
add some comments to polygon interpolation

Diffstat

M src/intmode_poly.h 5 ++++-

1 files changed, 4 insertions, 1 deletions


diff --git a/src/intmode_poly.h b/src/intmode_poly.h

@@ -18,7 +18,7 @@ namespace _IntPoly {
   18    18 float int_poly(Marker* marker, float old) {
   19    19 	int ii = marker->getAreaOld(old);
   20    20 	if (marker->_update || ii != _IntPoly::IPi) {
   21    -1 		_IntPoly::update(marker,ii);
   -1    21 		_IntPoly::update(marker, ii);
   22    22 	}
   23    23 	marker->_update = false;
   24    24 	return _IntPoly::calculate(old);
@@ -36,6 +36,7 @@ float _IntPoly::calculate(float x) {
   36    36 
   37    37 
   38    38 void _IntPoly::update(Marker* marker, int pi) {
   -1    39 	/* qubic splines with slope fixed to secant of adjecent areas */
   39    40 	IPn = marker->getLength();
   40    41 	IPi = pi;
   41    42 	float x1 = marker->getOld(IPi);
@@ -70,6 +71,8 @@ void _IntPoly::update(Marker* marker, int pi) {
   70    71 	M[1][1] = 2 * x2;
   71    72 	M[1][2] = 1;
   72    73 
   -1    74 	// only define difference
   -1    75 	// it is easier to correct this than to invert 4x4 matrix
   73    76 	M[2][0] = x2 * x2 * x2 - x1 * x1 * x1;
   74    77 	M[2][1] = x2 * x2 - x1 * x1;
   75    78 	M[2][2] = x2 - x1;