mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Hunting distortion artifacts
This commit is contained in:
parent
edb2913d6e
commit
6b72cc5115
4 changed files with 16 additions and 28 deletions
25
src/jack.cxx
25
src/jack.cxx
|
@ -76,6 +76,8 @@ Jack::Jack() :
|
|||
|
||||
for(int i = 0; i < NTRACKS; i++)
|
||||
{
|
||||
//buffers.audio[Buffers::TRACK_0 + i] = new float( nframes );
|
||||
|
||||
loopers.push_back( new Looper(i) );
|
||||
trackOutputs.push_back( new TrackOutput(i, loopers.back() ) );
|
||||
|
||||
|
@ -134,25 +136,16 @@ int Jack::process (jack_nframes_t nframes)
|
|||
buffers.midi [Buffers::APC_INPUT] = (void*) jack_port_get_buffer( apcMidiInput , nframes );
|
||||
buffers.midi [Buffers::APC_OUTPUT] = (void*) jack_port_get_buffer( apcMidiOutput , nframes );
|
||||
|
||||
// pre-zero output buffers
|
||||
for(uint i = 0; i < nframes; i++)
|
||||
{
|
||||
buffers.audio[Buffers::JACK_MASTER_OUT_L][i] = 0.f;
|
||||
buffers.audio[Buffers::JACK_MASTER_OUT_R][i] = 0.f;
|
||||
|
||||
buffers.audio[Buffers::MASTER_OUT_L] [i] = 0.f;
|
||||
buffers.audio[Buffers::MASTER_OUT_R] [i] = 0.f;
|
||||
buffers.audio[Buffers::REVERB] [i] = 0.f;
|
||||
buffers.audio[Buffers::SIDECHAIN] [i] = 0.f;
|
||||
buffers.audio[Buffers::POST_SIDECHAIN] [i] = 0.f;
|
||||
}
|
||||
/*
|
||||
|
||||
memset( buffers.audio[Buffers::JACK_MASTER_OUT_L] , 0, sizeof(float) * nframes );
|
||||
memset( buffers.audio[Buffers::JACK_MASTER_OUT_R] , 0, sizeof(float) * nframes );
|
||||
|
||||
memset( buffers.audio[Buffers::MASTER_OUT_L] , 0, sizeof(float) * nframes );
|
||||
memset( buffers.audio[Buffers::MASTER_OUT_R] , 0, sizeof(float) * nframes );
|
||||
memset( buffers.audio[Buffers::REVERB] , 0, sizeof(float) * nframes );
|
||||
memset( buffers.audio[Buffers::SIDECHAIN] , 0, sizeof(float) * nframes );
|
||||
memset( buffers.audio[Buffers::POST_SIDECHAIN] , 0, sizeof(float) * nframes );
|
||||
*/
|
||||
|
||||
|
||||
jack_midi_clear_buffer( buffers.midi[Buffers::APC_OUTPUT] );
|
||||
|
||||
|
@ -188,6 +181,7 @@ int Jack::process (jack_nframes_t nframes)
|
|||
// process each track, starting at output and working up signal path
|
||||
for(uint i = 0; i < NTRACKS; i++)
|
||||
{
|
||||
//loopers.at(i)->process( nframes, &buffers );
|
||||
trackOutputs.at(i)->process( nframes, &buffers );
|
||||
}
|
||||
|
||||
|
@ -205,7 +199,7 @@ int Jack::process (jack_nframes_t nframes)
|
|||
if ( reverb->getActive() )
|
||||
{
|
||||
reverbMeter->process(nframes, buffers.audio[Buffers::REVERB], buffers.audio[Buffers::REVERB] );
|
||||
//reverb->process( nframes, &buf[0], &buf[2] );
|
||||
reverb->process( nframes, &buf[0], &buf[2] );
|
||||
}
|
||||
|
||||
// db meter on master output, then memcpy to JACK
|
||||
|
@ -229,7 +223,6 @@ int Jack::process (jack_nframes_t nframes)
|
|||
|
||||
memcpy( buffers.audio[Buffers::JACK_MASTER_OUT_R],
|
||||
buffers.audio[Buffers::MASTER_OUT_R],
|
||||
//buffers.audio[Buffers::MASTER_OUT_L],
|
||||
//buffers.audio[Buffers::REVERB], // uncomment to listen to reverb send only
|
||||
sizeof(float)*nframes);
|
||||
|
||||
|
|
13
src/jack.hxx
13
src/jack.hxx
|
@ -2,14 +2,6 @@
|
|||
#ifndef LUPPP_JACK_H
|
||||
#define LUPPP_JACK_H
|
||||
|
||||
/*
|
||||
jack.hxx
|
||||
|
||||
This code contains the JACK client.
|
||||
It allows reading / writing of audio / midi.
|
||||
|
||||
*/
|
||||
|
||||
// Library
|
||||
#include <vector>
|
||||
#include <cstring>
|
||||
|
@ -29,9 +21,12 @@
|
|||
#include "dsp/dsp_reverb.hxx"
|
||||
#include "dsp/dsp_dbmeter.hxx"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
/** Jack
|
||||
This code contains the JACK client.
|
||||
It allows reading / writing of audio / midi.
|
||||
**/
|
||||
class Jack
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -201,8 +201,8 @@ void Looper::process(int nframes, Buffers* buffers)
|
|||
// 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::MASTER_OUTPUT];
|
||||
//float* out = buffers->audio[Buffers::TRACK_0 + track];
|
||||
float* out = buffers->audio[Buffers::MASTER_OUT_R];
|
||||
|
||||
// process each clip individually: this allows for playback of one clip,
|
||||
// while another clip records.
|
||||
|
|
|
@ -142,7 +142,7 @@ class LooperClip
|
|||
|
||||
float getProgress()
|
||||
{
|
||||
if ( _buffer )
|
||||
if ( _buffer && _playing )
|
||||
{
|
||||
return float(_playhead) / _buffer->getData().size();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue