mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-04 16:51:37 -05:00
Merge pull request #202 from openAVproductions/cleanup
Cleanup and optimize LooperClip playback
This commit is contained in:
commit
ff34b33893
3 changed files with 15 additions and 19 deletions
|
@ -36,10 +36,12 @@ void JackSendReturn::process(unsigned int nframes, Buffers *buffers)
|
|||
|
||||
//Process previous AudioProcessor
|
||||
m_previousProcessor->process(nframes,buffers);
|
||||
float* sendL=(float*)jack_port_get_buffer(m_sendport_l,(jack_nframes_t)(buffers->nframes));
|
||||
float* sendR=(float*)jack_port_get_buffer(m_sendport_r,(jack_nframes_t)(buffers->nframes));
|
||||
float* retL=(float*)jack_port_get_buffer(m_returnport_l,(jack_nframes_t)(buffers->nframes));
|
||||
float* retR=(float*)jack_port_get_buffer(m_returnport_r,(jack_nframes_t)(buffers->nframes));
|
||||
|
||||
float* sendL=(float*)jack_port_get_buffer(m_sendport_l, (jack_nframes_t)(buffers->nframes));
|
||||
float* sendR=(float*)jack_port_get_buffer(m_sendport_r, (jack_nframes_t)(buffers->nframes));
|
||||
float* retL =(float*)jack_port_get_buffer(m_returnport_l,(jack_nframes_t)(buffers->nframes));
|
||||
float* retR =(float*)jack_port_get_buffer(m_returnport_r,(jack_nframes_t)(buffers->nframes));
|
||||
|
||||
if(offset) {
|
||||
sendL+=offset;
|
||||
sendR+=offset;
|
||||
|
@ -50,11 +52,7 @@ void JackSendReturn::process(unsigned int nframes, Buffers *buffers)
|
|||
for(int i=0; i<nframes; i++) {
|
||||
sendL[i]=m_sendvol*sendtrackL[i];
|
||||
sendR[i]=m_sendvol*sendtrackR[i];
|
||||
}
|
||||
// if(nframes!=buffers->nframes)
|
||||
// {
|
||||
// cout<<send<<endl;
|
||||
// }
|
||||
}
|
||||
|
||||
if(offset)
|
||||
assert(offset+nframes==buffers->nframes);
|
||||
|
@ -62,13 +60,11 @@ void JackSendReturn::process(unsigned int nframes, Buffers *buffers)
|
|||
if(m_active) {
|
||||
memcpy(rettrackL,retL,nframes*sizeof(float));
|
||||
memcpy(rettrackR,retR,nframes*sizeof(float));
|
||||
}
|
||||
}
|
||||
else {
|
||||
memcpy(rettrackL,
|
||||
sendtrackL,nframes*sizeof(float));
|
||||
memcpy(rettrackR,
|
||||
sendtrackR,nframes*sizeof(float));
|
||||
}
|
||||
memcpy(rettrackL, sendtrackL,nframes*sizeof(float));
|
||||
memcpy(rettrackR, sendtrackR,nframes*sizeof(float));
|
||||
}
|
||||
m_counter+=nframes;
|
||||
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ void Looper::process(unsigned int nframes, Buffers* buffers)
|
|||
// write the pitch-shifted signal to the track buffer
|
||||
//FIXME: pitchShift adds delay even for playSpeed = 1.0!!
|
||||
//we should use something better (e.g librubberband)
|
||||
if(playSpeed!=1.0f) {
|
||||
if(0) { //playSpeed!=1.0f) {
|
||||
pitchShift( 1, &tmpL, &outL[i] );
|
||||
pitchShift( 1, &tmpR, &outR[i] );
|
||||
} else {
|
||||
|
|
|
@ -430,9 +430,9 @@ void LooperClip::getSample(float playSpeed, float* L, float* R)
|
|||
|
||||
std::vector<float>& vL = _buffer->getDataL();
|
||||
std::vector<float>& vR = _buffer->getDataR();
|
||||
*L = vL.at(_playhead);
|
||||
*R = vR.at(_playhead);
|
||||
_playhead +=playSpeed;
|
||||
*L = vL[_playhead];
|
||||
*R = vR[_playhead];
|
||||
_playhead += playSpeed;
|
||||
} else {
|
||||
*L = 0.f;
|
||||
*R = 0.f;
|
||||
|
|
Loading…
Add table
Reference in a new issue