diff --git a/CHANGELOG.md b/CHANGELOG.md index 090aec1..c1c73b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# recent changes + +## Improvements + +* Improve BPM Dial to avoid jitter +* Make tempo ramps possible again (without pitch correction) + # 1.2.1 Monday 15th April 2019 ## Features: diff --git a/src/looper.cxx b/src/looper.cxx index a513905..de2ac53 100644 --- a/src/looper.cxx +++ b/src/looper.cxx @@ -126,9 +126,8 @@ void Looper::process(unsigned int nframes, Buffers* buffers) clips[clip]->record( nframes, inputL, inputR); } else if ( clips[clip]->playing() ) { - // copy data into tmpBuffer, then pitch-stretch into track buffer long targetFrames = fpb; - long actualFrames = clips[clip]->getRecFpb();//getBufferLenght(); + long actualFrames = clips[clip]->getRecFpb(); #ifdef DEBUG_TIME cout << "FPB: " << fpb << "\n"; cout << "Target: " << targetFrames << " - Actual: " << actualFrames << "\n"; diff --git a/src/looperclip.cxx b/src/looperclip.cxx index ffb25dc..f829b73 100644 --- a/src/looperclip.cxx +++ b/src/looperclip.cxx @@ -258,8 +258,6 @@ void LooperClip::bar() if ( _playing ) { _barsPlayed++; - cout << "Clip " << track << ":" << scene << " " << _playhead - << "\n"; } // FIXME assumes 4 beats in a bar @@ -443,28 +441,28 @@ bool LooperClip::newBufferInTransit() return _newBufferInTransit; } -void LooperClip::getSample(long double playSpeed, float* L, float* R) +void +LooperClip::getSample(long double playSpeed, float *L, float *R) { - if ( _buffer && (_buffer->getSize() > 0)) { - if ( _playhead >= _recordhead || - _playhead >= _buffer->getSize() || - _playhead < 0 ) { + if(_buffer && (_buffer->getSize() > 0)) { + if(_playhead >= _recordhead || + _playhead >= _buffer->getSize() || _playhead < 0) { resetPlayHead(); - + // FIXME is there a better way than just output 0 if frames are missing? *L = 0.f; *R = 0.f; _playhead += playSpeed; return; - EventGuiPrint e( "LooperClip resetting _playhead" ); - //writeToGuiRingbuffer( &e ); + EventGuiPrint e("LooperClip resetting _playhead"); + writeToGuiRingbuffer( &e ); } - std::vector& vL = _buffer->getDataL(); - std::vector& vR = _buffer->getDataR(); - *L = vL[_playhead+0.5]; - *R = vR[_playhead+0.5]; + std::vector &vL = _buffer->getDataL(); + std::vector &vR = _buffer->getDataR(); + *L = vL[_playhead + 0.5]; + *R = vR[_playhead + 0.5]; _playhead += playSpeed; } else { *L = 0.f; diff --git a/src/metronome.cxx b/src/metronome.cxx index cb3514b..7568a83 100644 --- a/src/metronome.cxx +++ b/src/metronome.cxx @@ -104,9 +104,6 @@ void Metronome::beat() void Metronome::setFpb(double f) { fpb = f; - - // disable play until next beat - //playPoint = endPoint + 1; } void Metronome::process(int nframes, Buffers* buffers) diff --git a/src/timemanager.cxx b/src/timemanager.cxx index dbc3e6f..d76fee0 100644 --- a/src/timemanager.cxx +++ b/src/timemanager.cxx @@ -43,7 +43,6 @@ TimeManager::TimeManager(): samplerate = jack->getSamplerate(); // 120 BPM default _fpb = samplerate / 2; - _fpbLag = _fpb; //Counter for current bar/beat barCounter = 0; @@ -103,14 +102,9 @@ void TimeManager::queueFpbChange( double f ) void TimeManager::setFpb(double f) { - // barCounter = 0; - // beatCounter = 0; - // beatFrameCountdown = -1; - + // allign beatFrameCountdown long double ratio = (long double)f / (long double)_fpb; - cout << "Faktor: " << ratio << "alt: " << beatFrameCountdown << "\n"; beatFrameCountdown = beatFrameCountdown * ratio; - cout << "Countdown: " << beatFrameCountdown << "\n"; _fpb = f; int bpm = ( samplerate * 60) / f; @@ -205,12 +199,8 @@ void TimeManager::setTransportState( TRANSPORT_STATE s ) void TimeManager::process(Buffers* buffers) { if(_bpmChangeQueued) { - _fpbLag = _nextFpb; - cout << "Lag: " << _fpbLag << " Next: " << _nextFpb - << " Actual: " << _fpb << "\n"; - setFpb(_fpbLag); + setFpb(_nextFpb); _bpmChangeQueued = false; - cout << "finish\n"; } // time signature? //buffers->transportPosition->beats_per_bar = 4; diff --git a/src/timemanager.hxx b/src/timemanager.hxx index 3a92429..0187a59 100644 --- a/src/timemanager.hxx +++ b/src/timemanager.hxx @@ -68,7 +68,6 @@ private: /// number of frames per beat double _fpb; double _nextFpb; - double _fpbLag; /// holds the number of frames processed long long totalFrameCounter;