mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 17:11:40 -05:00
-Updated Looper with fixme, updated for -Werror
This commit is contained in:
parent
e99250b231
commit
6bd8a5ac47
6 changed files with 21 additions and 10 deletions
|
@ -44,7 +44,7 @@ class Background : public Fl_Widget
|
||||||
|
|
||||||
label = _label;
|
label = _label;
|
||||||
|
|
||||||
printf("AVTK background label: %s\n", label );
|
//printf("AVTK background label: %s\n", label );
|
||||||
|
|
||||||
highlight = false;
|
highlight = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@ class DBMeter
|
||||||
fRec0[1] = -96.f;
|
fRec0[1] = -96.f;
|
||||||
fRec1[0] = -96.f;
|
fRec1[0] = -96.f;
|
||||||
fRec1[1] = -96.f;
|
fRec1[1] = -96.f;
|
||||||
|
|
||||||
|
fvbargraph0 = -96.f;
|
||||||
|
fvbargraph1 = -96.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getNumInputs() { return 2;}
|
int getNumInputs() { return 2;}
|
||||||
|
|
|
@ -22,7 +22,8 @@ extern Gui* gui;
|
||||||
|
|
||||||
void luppp_tooltip(std::string s)
|
void luppp_tooltip(std::string s)
|
||||||
{
|
{
|
||||||
gui->setTooltip(s);
|
return;
|
||||||
|
//gui->setTooltip(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::setTooltip( std::string s )
|
void Gui::setTooltip( std::string s )
|
||||||
|
@ -68,7 +69,7 @@ Gui::Gui() :
|
||||||
{
|
{
|
||||||
stringstream s;
|
stringstream s;
|
||||||
s << "Track " << i+1;
|
s << "Track " << i+1;
|
||||||
printf("track name %s\n", s.str().c_str() );
|
//printf("track name %s\n", s.str().c_str() );
|
||||||
tracks.push_back( new GTrack(8 + i * 118, 40, 110, 600, s.str().c_str() ) );
|
tracks.push_back( new GTrack(8 + i * 118, 40, 110, 600, s.str().c_str() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,9 @@ int Jack::process (jack_nframes_t nframes)
|
||||||
memset( buffers.audio[Buffers::POST_SIDECHAIN],0, sizeof(float) * nframes );
|
memset( buffers.audio[Buffers::POST_SIDECHAIN],0, sizeof(float) * nframes );
|
||||||
|
|
||||||
for(int i = 0; i < NTRACKS; i++)
|
for(int i = 0; i < NTRACKS; i++)
|
||||||
|
{
|
||||||
memset( buffers.audio[Buffers::TRACK_0 + i], 0, sizeof(float) * nframes );
|
memset( buffers.audio[Buffers::TRACK_0 + i], 0, sizeof(float) * nframes );
|
||||||
|
}
|
||||||
|
|
||||||
jack_midi_clear_buffer( buffers.midi[Buffers::APC_OUTPUT] );
|
jack_midi_clear_buffer( buffers.midi[Buffers::APC_OUTPUT] );
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,10 @@ void Looper::setSample(int sc, AudioBuffer* ab)
|
||||||
void Looper::process(int nframes, Buffers* buffers)
|
void Looper::process(int nframes, Buffers* buffers)
|
||||||
{
|
{
|
||||||
float* in = buffers->audio[Buffers::MASTER_INPUT];
|
float* in = buffers->audio[Buffers::MASTER_INPUT];
|
||||||
|
|
||||||
|
// FIXME:
|
||||||
|
// using the track output causes distortion: clipping / not proper writing.
|
||||||
|
// writing to master fixes issue, so its due to trackOutput or Looper writing...?
|
||||||
//float* out = buffers->audio[Buffers::TRACK_0 + track];
|
//float* out = buffers->audio[Buffers::TRACK_0 + track];
|
||||||
float* out = buffers->audio[Buffers::MASTER_OUTPUT];
|
float* out = buffers->audio[Buffers::MASTER_OUTPUT];
|
||||||
|
|
||||||
|
@ -190,10 +194,10 @@ void Looper::process(int nframes, Buffers* buffers)
|
||||||
{
|
{
|
||||||
tmpBuffer[i] = sample[int(playPoint)] * gain;
|
tmpBuffer[i] = sample[int(playPoint)] * gain;
|
||||||
}
|
}
|
||||||
playPoint += playbackSpeed;
|
playPoint += 1.0; //playbackSpeed;
|
||||||
|
|
||||||
*out++ = 0.f;//sin( playPoint * 440 * 6.24 );
|
|
||||||
|
|
||||||
|
//*out++ = sin( playPoint * 440 * 6.24 );
|
||||||
|
*out++ = tmpBuffer[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// now pitch-shift the audio in the buffer
|
// now pitch-shift the audio in the buffer
|
||||||
|
|
|
@ -20,7 +20,7 @@ class TrackOutput : public AudioProcessor
|
||||||
printf("trackOutput ID: %i\n", track);
|
printf("trackOutput ID: %i\n", track);
|
||||||
|
|
||||||
// UI update
|
// UI update
|
||||||
uiUpdateConstant = 44100 / 20;
|
uiUpdateConstant = 44100 / 30;
|
||||||
uiUpdateCounter = 44100 / 30;
|
uiUpdateCounter = 44100 / 30;
|
||||||
|
|
||||||
_toReverb = 0.0;
|
_toReverb = 0.0;
|
||||||
|
@ -59,17 +59,18 @@ class TrackOutput : public AudioProcessor
|
||||||
previousInChain->process( nframes, buffers );
|
previousInChain->process( nframes, buffers );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
float* buf = buffers->audio[Buffers::TRACK_0 + track];
|
float* buf = buffers->audio[Buffers::TRACK_0 + track];
|
||||||
dbMeter.process( nframes, buf, buf );
|
dbMeter.process( nframes, buf, buf );
|
||||||
|
|
||||||
if (uiUpdateCounter > uiUpdateConstant )
|
if (uiUpdateCounter > uiUpdateConstant )
|
||||||
{
|
{
|
||||||
//EventTrackSignalLevel e( track, dbMeter.getLeftDB(), dbMeter.getRightDB() );
|
EventTrackSignalLevel e( track, dbMeter.getLeftDB(), dbMeter.getRightDB() );
|
||||||
//writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
uiUpdateCounter = 0;
|
uiUpdateCounter = 0;
|
||||||
}
|
}
|
||||||
uiUpdateCounter += nframes;
|
uiUpdateCounter += nframes;
|
||||||
|
*/
|
||||||
|
|
||||||
/// copy audio data into reverb / sidechain / master buffers
|
/// copy audio data into reverb / sidechain / master buffers
|
||||||
float* trackBuf = buffers->audio[Buffers::TRACK_0 + track];
|
float* trackBuf = buffers->audio[Buffers::TRACK_0 + track];
|
||||||
|
|
Loading…
Add table
Reference in a new issue