xiRetimer

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

commit
75e48c1740adf56f717555a1743a438659936e1e
parent
3ecc0c1fd734e114b42400575607eeffe55027d1
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-12-26 08:34
fix zero devision

Diffstat

M src/curve.cpp 13 +++++++------

1 files changed, 7 insertions, 6 deletions


diff --git a/src/curve.cpp b/src/curve.cpp

@@ -54,13 +54,14 @@ float Curve::getSeeker() {
   54    54 
   55    55 
   56    56 float Curve::getBars() {
   57    -1 	int beats = sample->getGuessedLength() / sample->sfinfo.samplerate;
   58    -1 	beats *= tempo / 60 / 4;
   59    -1 	if (beats != 0) {
   60    -1 		return beats;
   61    -1 	} else {
   62    -1 		return 1;
   -1    57 	if (sample->sfinfo.samplerate != 0) {
   -1    58 		int beats = sample->getGuessedLength() / sample->sfinfo.samplerate;
   -1    59 		beats *= tempo / 60 / 4;
   -1    60 		if (beats != 0) {
   -1    61 			return beats;
   -1    62 		}
   63    63 	}
   -1    64 	return 1;
   64    65 }
   65    66 
   66    67