Dual mono, also starting to add hooks to bypass the plugin for A/B

testing at the user interface.
audioplugins
Elliott Liggett 2021-08-02 01:21:01 -07:00
rodzic 66cceb4e5c
commit 92b2ab8249
4 zmienionych plików z 43 dodań i 22 usunięć

Wyświetl plik

@ -400,12 +400,16 @@ void audioHandler::setupLADSP()
if (psDescriptor->activate != NULL)
psDescriptor->activate(handle);
// open_files();
//pthread_create(&ladspa_thread, NULL, run_plugin, NULL);
pluginOutputEnable = true;
}
void audioHandler::enablePluginOutput(bool enable)
{
this->pluginOutputEnable = enable;
}
void audioHandler::runPlugin()
{
// numread actually sets the
@ -745,10 +749,10 @@ void audioHandler::incomingAudio(audioPacket inPacket)
// // Modify controls: Dyson Compressor:
// controls[0] = 0.0f; // peak limit (dB) -30 to 0, default 0. For the amp plugin, this is the gain.
// controls[1] = 0.01f; // release time, in seconds
// controls[2] = 1.0f; // "fast compression ratio", 0 to 1
// controls[3] = 1.0f; // compression ratio, 0 to 1
controls[0] = 0.0f; // peak limit (dB) -30 to 0, default 0. For the amp plugin, this is the gain.
controls[1] = 0.01f; // release time, in seconds
controls[2] = 0.8f; // "fast compression ratio", 0 to 1
controls[3] = 0.8f; // compression ratio, 0 to 1
// Modify controls: sc1_1425.so
@ -761,7 +765,7 @@ void audioHandler::incomingAudio(audioPacket inPacket)
// Modify controls: fad_delay_1192.so
// controls[0] = 1.0f; // delay in seconds, 1 to 10
// controls[1] = -12.0f; // feedback (dB), -70 to 0
// controls[1] = -6.0f; // feedback (dB), -70 to 0
// Modify controls: gold reverv gverb_1216.so
// controls[0] = 75.0f; // "Roomsize (m)" input, control, 1 to 300, default 75.75
@ -775,10 +779,10 @@ void audioHandler::incomingAudio(audioPacket inPacket)
// multi-band EQ. Experiment to see if I only adjust one if the defaults hold out.
// file: mbeq_1197.so
controls[3] = 12.0f; // 220 Hz
controls[4] = 12.0f; // 440 Hz
controls[8] = -25.0f; // "1250Hz gain" input, control, -70 to 30, default 0
controls[9] = -12.0f;
// controls[3] = 12.0f; // 220 Hz
// controls[4] = 12.0f; // 440 Hz
// controls[8] = -25.0f; // "1250Hz gain" input, control, -70 to 30, default 0
// controls[9] = -12.0f;
@ -790,20 +794,28 @@ void audioHandler::incomingAudio(audioPacket inPacket)
// Maybe the issue is here?
// For now, force "dual mono" since most plugins we are looking at are mono output anyway.
for (int n = 0; n+1 < BUF_SIZE; n += 2) {
pluginOutput16bitInterlaced[n] = (pOutBuffer[0][n/2] + 1) * mid;
pluginOutput16bitInterlaced[n+1] = (pOutBuffer[1][n/2] + 1) * mid;
pluginOutput16bitInterlaced[n] = (pOutBuffer[0][n/2] + 1) * mid; // L
pluginOutput16bitInterlaced[n+1] = (pOutBuffer[0][n/2] + 1) * mid; // Copy L
//pluginOutput16bitInterlaced[n+1] = (pOutBuffer[1][n/2] + 1) * mid; // R
}
// copyDataOut();
// CAREFUL, get the 16 bits of plugin output into the 8 bit inPacket format:
for(int i=0; i < BUF_SIZE*2; i+=2)
{
inPacket.data[i] = pluginOutput16bitInterlaced[i/2] & 0x00ff;
inPacket.data[i+1] = (pluginOutput16bitInterlaced[i/2] & 0xff00) >> 8;
// To bypass the function temporarly, just comment out this final copy loop:
if(pluginOutputEnable)
{
for(int i=0; i < BUF_SIZE*2; i+=2)
{
inPacket.data[i] = pluginOutput16bitInterlaced[i/2] & 0x00ff;
inPacket.data[i+1] = (pluginOutput16bitInterlaced[i/2] & 0xff00) >> 8;
}
}

Wyświetl plik

@ -92,6 +92,7 @@ public:
~audioHandler();
int getLatency();
void enablePluginOutput(bool enable);
#if !defined (RTAUDIO) && !defined(PORTAUDIO)
bool setDevice(QAudioDeviceInfo deviceInfo);
@ -197,8 +198,8 @@ private:
// char *pcPluginLabel = (char*)"amp_stereo";
// Testing:
char *pcPluginFilename = (char*)"mbeq_1197.so";
char *pcPluginLabel = (char*)"mbeq";
char *pcPluginFilename = (char*)"dyson_compress_1403.so";
char *pcPluginLabel = (char*)"dysonCompress";
int inBufferIndex = 0;
int outBufferIndex = 0;
@ -213,9 +214,9 @@ private:
LADSPA_Data control;
LADSPA_Data pre_control = 0.2f;
LADSPA_Data controls[15]; // twelve controls
LADSPA_Data controls[15]; // 15 controls
bool pluginOutputEnable = true;
void setupLADSP();
void runPlugin();

Wyświetl plik

@ -881,6 +881,11 @@ void udpAudio::setVolume(unsigned char value)
emit haveSetVolume(value);
}
void udpAudio::enableRXAudioPlugin(bool enable)
{
rxaudio->enablePluginOutput(enable);
}
void udpAudio::dataReceived()
{
while (udp->hasPendingDatagrams()) {

Wyświetl plik

@ -179,6 +179,7 @@ signals:
public slots:
void changeLatency(quint16 value);
void setVolume(unsigned char value);
void enableRXAudioPlugin(bool enable);
private:
@ -222,6 +223,7 @@ public slots:
void receiveAudioData(const audioPacket &data);
void changeLatency(quint16 value);
void setVolume(unsigned char value);
//void setEnableRXAudioPlugins(bool enable);
void init();
signals:
@ -230,6 +232,7 @@ signals:
void haveNetworkError(QString, QString);
void haveChangeLatency(quint16 value);
void haveSetVolume(unsigned char value);
//void haveSetEnableRXAudioPlugins(bool enable);
void haveNetworkStatus(QString);
void haveBaudRate(quint32 baudrate);