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
|
# 1.2.1 Monday 15th April 2019
|
||||||
|
|
||||||
## Features:
|
## Features:
|
||||||
|
|
|
@ -126,9 +126,8 @@ void Looper::process(unsigned int nframes, Buffers* buffers)
|
||||||
|
|
||||||
clips[clip]->record( nframes, inputL, inputR);
|
clips[clip]->record( nframes, inputL, inputR);
|
||||||
} else if ( clips[clip]->playing() ) {
|
} else if ( clips[clip]->playing() ) {
|
||||||
// copy data into tmpBuffer, then pitch-stretch into track buffer
|
|
||||||
long targetFrames = fpb;
|
long targetFrames = fpb;
|
||||||
long actualFrames = clips[clip]->getRecFpb();//getBufferLenght();
|
long actualFrames = clips[clip]->getRecFpb();
|
||||||
#ifdef DEBUG_TIME
|
#ifdef DEBUG_TIME
|
||||||
cout << "FPB: " << fpb << "\n";
|
cout << "FPB: " << fpb << "\n";
|
||||||
cout << "Target: " << targetFrames << " - Actual: " << actualFrames << "\n";
|
cout << "Target: " << targetFrames << " - Actual: " << actualFrames << "\n";
|
||||||
|
|
|
@ -258,8 +258,6 @@ void LooperClip::bar()
|
||||||
|
|
||||||
if ( _playing ) {
|
if ( _playing ) {
|
||||||
_barsPlayed++;
|
_barsPlayed++;
|
||||||
cout << "Clip " << track << ":" << scene << " " << _playhead
|
|
||||||
<< "\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME assumes 4 beats in a bar
|
// FIXME assumes 4 beats in a bar
|
||||||
|
@ -443,28 +441,28 @@ bool LooperClip::newBufferInTransit()
|
||||||
return _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(_buffer && (_buffer->getSize() > 0)) {
|
||||||
if ( _playhead >= _recordhead ||
|
if(_playhead >= _recordhead ||
|
||||||
_playhead >= _buffer->getSize() ||
|
_playhead >= _buffer->getSize() || _playhead < 0) {
|
||||||
_playhead < 0 ) {
|
|
||||||
resetPlayHead();
|
resetPlayHead();
|
||||||
|
|
||||||
// FIXME is there a better way than just output 0 if frames are missing?
|
// FIXME is there a better way than just output 0 if frames are missing?
|
||||||
*L = 0.f;
|
*L = 0.f;
|
||||||
*R = 0.f;
|
*R = 0.f;
|
||||||
_playhead += playSpeed;
|
_playhead += playSpeed;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EventGuiPrint e( "LooperClip resetting _playhead" );
|
EventGuiPrint e("LooperClip resetting _playhead");
|
||||||
//writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<float>& vL = _buffer->getDataL();
|
std::vector<float> &vL = _buffer->getDataL();
|
||||||
std::vector<float>& vR = _buffer->getDataR();
|
std::vector<float> &vR = _buffer->getDataR();
|
||||||
*L = vL[_playhead+0.5];
|
*L = vL[_playhead + 0.5];
|
||||||
*R = vR[_playhead+0.5];
|
*R = vR[_playhead + 0.5];
|
||||||
_playhead += playSpeed;
|
_playhead += playSpeed;
|
||||||
} else {
|
} else {
|
||||||
*L = 0.f;
|
*L = 0.f;
|
||||||
|
|
|
@ -104,9 +104,6 @@ void Metronome::beat()
|
||||||
void Metronome::setFpb(double f)
|
void Metronome::setFpb(double f)
|
||||||
{
|
{
|
||||||
fpb = f;
|
fpb = f;
|
||||||
|
|
||||||
// disable play until next beat
|
|
||||||
//playPoint = endPoint + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Metronome::process(int nframes, Buffers* buffers)
|
void Metronome::process(int nframes, Buffers* buffers)
|
||||||
|
|
|
@ -43,7 +43,6 @@ TimeManager::TimeManager():
|
||||||
samplerate = jack->getSamplerate();
|
samplerate = jack->getSamplerate();
|
||||||
// 120 BPM default
|
// 120 BPM default
|
||||||
_fpb = samplerate / 2;
|
_fpb = samplerate / 2;
|
||||||
_fpbLag = _fpb;
|
|
||||||
|
|
||||||
//Counter for current bar/beat
|
//Counter for current bar/beat
|
||||||
barCounter = 0;
|
barCounter = 0;
|
||||||
|
@ -103,14 +102,9 @@ void TimeManager::queueFpbChange( double f )
|
||||||
|
|
||||||
void TimeManager::setFpb(double f)
|
void TimeManager::setFpb(double f)
|
||||||
{
|
{
|
||||||
// barCounter = 0;
|
// allign beatFrameCountdown
|
||||||
// beatCounter = 0;
|
|
||||||
// beatFrameCountdown = -1;
|
|
||||||
|
|
||||||
long double ratio = (long double)f / (long double)_fpb;
|
long double ratio = (long double)f / (long double)_fpb;
|
||||||
cout << "Faktor: " << ratio << "alt: " << beatFrameCountdown << "\n";
|
|
||||||
beatFrameCountdown = beatFrameCountdown * ratio;
|
beatFrameCountdown = beatFrameCountdown * ratio;
|
||||||
cout << "Countdown: " << beatFrameCountdown << "\n";
|
|
||||||
|
|
||||||
_fpb = f;
|
_fpb = f;
|
||||||
int bpm = ( samplerate * 60) / f;
|
int bpm = ( samplerate * 60) / f;
|
||||||
|
@ -205,12 +199,8 @@ void TimeManager::setTransportState( TRANSPORT_STATE s )
|
||||||
void TimeManager::process(Buffers* buffers)
|
void TimeManager::process(Buffers* buffers)
|
||||||
{
|
{
|
||||||
if(_bpmChangeQueued) {
|
if(_bpmChangeQueued) {
|
||||||
_fpbLag = _nextFpb;
|
setFpb(_nextFpb);
|
||||||
cout << "Lag: " << _fpbLag << " Next: " << _nextFpb
|
|
||||||
<< " Actual: " << _fpb << "\n";
|
|
||||||
setFpb(_fpbLag);
|
|
||||||
_bpmChangeQueued = false;
|
_bpmChangeQueued = false;
|
||||||
cout << "finish\n";
|
|
||||||
}
|
}
|
||||||
// time signature?
|
// time signature?
|
||||||
//buffers->transportPosition->beats_per_bar = 4;
|
//buffers->transportPosition->beats_per_bar = 4;
|
||||||
|
|
|
@ -68,7 +68,6 @@ private:
|
||||||
/// number of frames per beat
|
/// number of frames per beat
|
||||||
double _fpb;
|
double _fpb;
|
||||||
double _nextFpb;
|
double _nextFpb;
|
||||||
double _fpbLag;
|
|
||||||
|
|
||||||
/// holds the number of frames processed
|
/// holds the number of frames processed
|
||||||
long long totalFrameCounter;
|
long long totalFrameCounter;
|
||||||
|
|
Loading…
Reference in New Issue