kopia lustrzana https://gitlab.com/eliggett/wfview
Correct scaling from int to float now... I hope!
rodzic
e4ffe54d4d
commit
0ec96fbb9c
|
@ -96,10 +96,17 @@ bool audioHandler::init(audioSetup setupIn)
|
|||
// plugin->setupPlugin((char*)"");
|
||||
// plugin->setupPlugin((char*)"");
|
||||
|
||||
//char* pname = (char*)"http://gareus.org/oss/lv2/fil4#mono";
|
||||
|
||||
plugin->setupPlugin((char*)"http://drobilla.net/plugins/mda/Dynamics"); // gate and compressor together. Gate is too rough though.
|
||||
|
||||
|
||||
|
||||
|
||||
//plugin->setupPlugin((char*)"http://eq10q.sourceforge.net/gate"); // works well
|
||||
|
||||
//plugin->setupPlugin((char*)"http://plugin.org.uk/swh-plugins/gate"); // works well
|
||||
plugin->setupPlugin((char*)"http://eq10q.sourceforge.net/compressor"); // works very well
|
||||
//plugin->setupPlugin((char*)"http://eq10q.sourceforge.net/compressor"); // works very well
|
||||
|
||||
//plugin->setupPlugin((char*)"http://eq10q.sourceforge.net/eq/eq1qm"); // malloc double-free error
|
||||
//plugin->setupPlugin((char*)"http://eq10q.sourceforge.net/eq/eq6qm"); // malloc double-free error
|
||||
|
@ -118,7 +125,7 @@ bool audioHandler::init(audioSetup setupIn)
|
|||
|
||||
|
||||
//plugin->setupPlugin((char*)"http://plugin.org.uk/swh-plugins/dj_eq_mono"); // loads ok
|
||||
//plugin->setupPlugin((char*)"http://plugin.org.uk/swh-plugins/sc2"); // loads ok
|
||||
//plugin->setupPlugin((char*)"http://plugin.org.uk/swh-plugins/sc4"); // loads ok
|
||||
//plugin->setupPlugin((char*)"http://plugin.org.uk/swh-plugins/amp");
|
||||
|
||||
//plugin->setupPlugin((char*)"http://plugin.org.uk/swh-plugins/fake_fail_plugin"); // fail, of course...
|
||||
|
|
|
@ -508,16 +508,16 @@ void audioPlugin::convertInputBuffer()
|
|||
|
||||
// externalSourceBuffer --> scale --> inputBuffer
|
||||
|
||||
float max = 65535.0f;
|
||||
float mid = max / 2.0f;
|
||||
float max = 65535.0f / 2.0f;
|
||||
//float mid = max / 2.0f;
|
||||
float scalingFactor = 1.0f / max;
|
||||
|
||||
// Note, we have already cast the 8MSB, 8LSB type data into a 16-bit holder
|
||||
// So accessing one member should result in a full 16-bit number.
|
||||
|
||||
for (int n = 0; n < sourceBufferSampleCount; n += 2) {
|
||||
inputBuffer[0][n/2] = ( externalSourceBuffer[n] - mid) * scalingFactor;
|
||||
inputBuffer[1][n/2] = ( externalSourceBuffer[n+1] - mid) * scalingFactor;
|
||||
inputBuffer[0][n/2] = ( externalSourceBuffer[n]) * scalingFactor;
|
||||
inputBuffer[1][n/2] = ( externalSourceBuffer[n+1]) * scalingFactor;
|
||||
|
||||
// inputBuffer[0][n/2] = (externalSourceBuffer[n] - mid) * scalingFactor;
|
||||
// inputBuffer[1][n/2] = (externalSourceBuffer[n+1] - mid) * scalingFactor;
|
||||
|
@ -554,14 +554,14 @@ void audioPlugin::convertOutputBuffer()
|
|||
if(forceOutputMono)
|
||||
{
|
||||
for (int n = 0; n+1 < sourceBufferSampleCount; n += 2) {
|
||||
externalSinkBuffer[n] = (outputBuffer[0][n/2] + 1) * mid; // L
|
||||
externalSinkBuffer[n+1] = (outputBuffer[0][n/2] + 1) * mid; // Copy L
|
||||
externalSinkBuffer[n] = (outputBuffer[0][n/2]) * mid; // L
|
||||
externalSinkBuffer[n+1] = (outputBuffer[0][n/2]) * mid; // Copy L
|
||||
}
|
||||
} else {
|
||||
|
||||
for (int n = 0; n+1 < sourceBufferSampleCount; n += 2) {
|
||||
externalSinkBuffer[n] = (outputBuffer[0][n/2] + 1) * mid; // L
|
||||
externalSinkBuffer[n+1] = (outputBuffer[1][n/2] + 1) * mid; // R
|
||||
externalSinkBuffer[n] = (outputBuffer[0][n/2]) * mid; // L
|
||||
externalSinkBuffer[n+1] = (outputBuffer[1][n/2]) * mid; // R
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue