Cleanup Code, Remove Debug prints, Add Changelog
parent
cdfd7a858b
commit
985db72d8d
|
@ -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:
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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<float>& vL = _buffer->getDataL();
|
||||
std::vector<float>& vR = _buffer->getDataR();
|
||||
*L = vL[_playhead+0.5];
|
||||
*R = vR[_playhead+0.5];
|
||||
std::vector<float> &vL = _buffer->getDataL();
|
||||
std::vector<float> &vR = _buffer->getDataR();
|
||||
*L = vL[_playhead + 0.5];
|
||||
*R = vR[_playhead + 0.5];
|
||||
_playhead += playSpeed;
|
||||
} else {
|
||||
*L = 0.f;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue