-Fixed #95, glitch in output. JACK return ports broken in fixing, buffer coping issue.

This commit is contained in:
Harry van Haaren 2014-11-13 01:47:21 +00:00
parent 68bbfdb26d
commit f7846d238b
2 changed files with 21 additions and 9 deletions

View file

@ -387,7 +387,7 @@ int Jack::process (jack_nframes_t nframes)
/// update "time" from JACK master, or write master? /// update "time" from JACK master, or write master?
buffers.transportFrame = jack_get_current_transport_frame(client); buffers.transportFrame = jack_get_current_transport_frame(client);
// time manager deals with detecting bar() / beat() events, and calls // time manager deals with detecting bar() / beat() events, and calls
// processFrames() with the appropriate nframes // processFrames() with the appropriate nframes
@ -405,6 +405,14 @@ void Jack::processFrames(int nframes)
return; return;
} }
/*
// extreme debugging of timemanager process-split functionality
char buffer [50];
sprintf (buffer, "Jack::processFrames() got %i", nframes );
EventGuiPrint e2( buffer );
writeToGuiRingbuffer( &e2 );
*/
/// process each MidiIO registered MIDI port /// process each MidiIO registered MIDI port
for(unsigned int i = 0; i < midiIO.size(); i++ ) for(unsigned int i = 0; i < midiIO.size(); i++ )
{ {
@ -430,6 +438,7 @@ void Jack::processFrames(int nframes)
float returnL = buffers.audio[Buffers::MASTER_RETURN_L][i]; float returnL = buffers.audio[Buffers::MASTER_RETURN_L][i];
float returnR = buffers.audio[Buffers::MASTER_RETURN_R][i]; float returnR = buffers.audio[Buffers::MASTER_RETURN_R][i];
if ( inputToMixEnable ) if ( inputToMixEnable )
{ {
// if sending to mix, scale by volume *and* by XSide send // if sending to mix, scale by volume *and* by XSide send
@ -447,11 +456,14 @@ void Jack::processFrames(int nframes)
buffers.audio[Buffers::SIDECHAIN_KEY][i] += input; buffers.audio[Buffers::SIDECHAIN_KEY][i] += input;
} }
buffers.audio[Buffers::SIDECHAIN_SIGNAL][i] += input * inputToXSideVol; buffers.audio[Buffers::SIDECHAIN_SIGNAL][i] += input * inputToXSideVol;
/// mixdown returns into master buffers /// mixdown returns into master buffers
buffers.audio[Buffers::MASTER_OUT_L][i] = (L + returnL*returnVol) * masterVol; // FIXME: Returns broken, due to metronome glitch in master output: buffer
buffers.audio[Buffers::MASTER_OUT_R][i] = (R + returnR*returnVol) * masterVol; // writing issue or such. See #95 on github
buffers.audio[Buffers::JACK_MASTER_OUT_L][i] = L * masterVol;// (L + returnL*returnVol) * masterVol;
buffers.audio[Buffers::JACK_MASTER_OUT_R][i] = R * masterVol;// (R + returnR*returnVol) * masterVol;
/// write SEND content to JACK port /// write SEND content to JACK port
buffers.audio[Buffers::JACK_SEND_OUT][i] = buffers.audio[Buffers::SEND][i]; buffers.audio[Buffers::JACK_SEND_OUT][i] = buffers.audio[Buffers::SEND][i];
@ -462,7 +474,7 @@ void Jack::processFrames(int nframes)
/// db meter on master input & output /// db meter on master input & output
inputMeter->process( nframes, buffers.audio[Buffers::MASTER_INPUT], buffers.audio[Buffers::MASTER_INPUT]); inputMeter->process( nframes, buffers.audio[Buffers::MASTER_INPUT], buffers.audio[Buffers::MASTER_INPUT]);
masterMeter->process(nframes, buffers.audio[Buffers::MASTER_OUT_L], buffers.audio[Buffers::MASTER_OUT_R] ); masterMeter->process(nframes, buffers.audio[Buffers::JACK_MASTER_OUT_L], buffers.audio[Buffers::JACK_MASTER_OUT_R] );
if ( uiUpdateCounter > uiUpdateConstant ) if ( uiUpdateCounter > uiUpdateConstant )
{ {
@ -477,7 +489,7 @@ void Jack::processFrames(int nframes)
uiUpdateCounter += nframes; uiUpdateCounter += nframes;
/*
// memcpy the internal MASTER_OUTPUT buffer to the JACK_MASTER_OUTPUT // memcpy the internal MASTER_OUTPUT buffer to the JACK_MASTER_OUTPUT
memcpy( buffers.audio[Buffers::JACK_MASTER_OUT_L], memcpy( buffers.audio[Buffers::JACK_MASTER_OUT_L],
buffers.audio[Buffers::MASTER_OUT_L], buffers.audio[Buffers::MASTER_OUT_L],
@ -488,7 +500,7 @@ void Jack::processFrames(int nframes)
//buffers.audio[Buffers::POST_SIDECHAIN], //buffers.audio[Buffers::POST_SIDECHAIN],
//buffers.audio[Buffers::SEND], // uncomment to listen to reverb send only //buffers.audio[Buffers::SEND], // uncomment to listen to reverb send only
sizeof(float)*nframes); sizeof(float)*nframes);
*/
// move buffer pointers up nframes: allows processing of one "nframes" from // move buffer pointers up nframes: allows processing of one "nframes" from
// JACK in multiple parts internally in Luppp: used for processing bar() / beat() // JACK in multiple parts internally in Luppp: used for processing bar() / beat()

View file

@ -173,12 +173,11 @@ void TimeManager::process(Buffers* buffers)
if ( before < nframes && after < nframes && before + after == nframes ) if ( before < nframes && after < nframes && before + after == nframes )
{ {
/*
char buffer [50]; char buffer [50];
sprintf (buffer, "Timing OK: beat after %i", before ); //sprintf (buffer, "Timing OK: before %i, after %i, b+a %i", before, after, before+after );
EventGuiPrint e2( buffer ); EventGuiPrint e2( buffer );
writeToGuiRingbuffer( &e2 ); writeToGuiRingbuffer( &e2 );
*/
} }
else else
{ {
@ -216,6 +215,7 @@ void TimeManager::process(Buffers* buffers)
writeToGuiRingbuffer( &e ); writeToGuiRingbuffer( &e );
beatFrameCountdown = fpb; beatFrameCountdown = fpb;
beatCounter++; beatCounter++;
} }