Underflow on clipped outputs; Fix for Shiroverb.
This commit is contained in:
+7
-7
@@ -720,7 +720,7 @@ namespace pipedal
|
|||||||
|
|
||||||
std::vector<float *> &buffers = this->captureBuffers;
|
std::vector<float *> &buffers = this->captureBuffers;
|
||||||
int channels = this->captureChannels;
|
int channels = this->captureChannels;
|
||||||
constexpr float scale = 1.0f / (std::numeric_limits<int16_t>::max() + 1L);
|
constexpr double scale = 1.0f / (std::numeric_limits<int16_t>::max() + 1L);
|
||||||
for (size_t frame = 0; frame < frames; ++frame)
|
for (size_t frame = 0; frame < frames; ++frame)
|
||||||
{
|
{
|
||||||
for (int channel = 0; channel < channels; ++channel)
|
for (int channel = 0; channel < channels; ++channel)
|
||||||
@@ -891,7 +891,7 @@ namespace pipedal
|
|||||||
|
|
||||||
std::vector<float *> &buffers = this->playbackBuffers;
|
std::vector<float *> &buffers = this->playbackBuffers;
|
||||||
int channels = this->playbackChannels;
|
int channels = this->playbackChannels;
|
||||||
constexpr float scale = std::numeric_limits<int32_t>::max();
|
constexpr double scale = std::numeric_limits<int32_t>::max();
|
||||||
for (size_t frame = 0; frame < frames; ++frame)
|
for (size_t frame = 0; frame < frames; ++frame)
|
||||||
{
|
{
|
||||||
for (int channel = 0; channel < channels; ++channel)
|
for (int channel = 0; channel < channels; ++channel)
|
||||||
@@ -913,7 +913,7 @@ namespace pipedal
|
|||||||
|
|
||||||
std::vector<float *> &buffers = this->playbackBuffers;
|
std::vector<float *> &buffers = this->playbackBuffers;
|
||||||
int channels = this->playbackChannels;
|
int channels = this->playbackChannels;
|
||||||
constexpr float scale = 0x00FFFFFF;
|
constexpr double scale = 0x00FFFFFF;
|
||||||
for (size_t frame = 0; frame < frames; ++frame)
|
for (size_t frame = 0; frame < frames; ++frame)
|
||||||
{
|
{
|
||||||
for (int channel = 0; channel < channels; ++channel)
|
for (int channel = 0; channel < channels; ++channel)
|
||||||
@@ -935,7 +935,7 @@ namespace pipedal
|
|||||||
|
|
||||||
std::vector<float *> &buffers = this->playbackBuffers;
|
std::vector<float *> &buffers = this->playbackBuffers;
|
||||||
int channels = this->playbackChannels;
|
int channels = this->playbackChannels;
|
||||||
constexpr float scale = 0x00FFFFFF;
|
constexpr double scale = 0x00FFFFFF;
|
||||||
for (size_t frame = 0; frame < frames; ++frame)
|
for (size_t frame = 0; frame < frames; ++frame)
|
||||||
{
|
{
|
||||||
for (int channel = 0; channel < channels; ++channel)
|
for (int channel = 0; channel < channels; ++channel)
|
||||||
@@ -955,7 +955,7 @@ namespace pipedal
|
|||||||
|
|
||||||
std::vector<float *> &buffers = this->playbackBuffers;
|
std::vector<float *> &buffers = this->playbackBuffers;
|
||||||
int channels = this->playbackChannels;
|
int channels = this->playbackChannels;
|
||||||
constexpr float scale = std::numeric_limits<int32_t>::max();
|
constexpr double scale = std::numeric_limits<int32_t>::max();
|
||||||
for (size_t frame = 0; frame < frames; ++frame)
|
for (size_t frame = 0; frame < frames; ++frame)
|
||||||
{
|
{
|
||||||
for (int channel = 0; channel < channels; ++channel)
|
for (int channel = 0; channel < channels; ++channel)
|
||||||
@@ -975,7 +975,7 @@ namespace pipedal
|
|||||||
|
|
||||||
std::vector<float *> &buffers = this->playbackBuffers;
|
std::vector<float *> &buffers = this->playbackBuffers;
|
||||||
int channels = this->playbackChannels;
|
int channels = this->playbackChannels;
|
||||||
constexpr float scale = std::numeric_limits<int32_t>::max();
|
constexpr double scale = std::numeric_limits<int32_t>::max();
|
||||||
for (size_t frame = 0; frame < frames; ++frame)
|
for (size_t frame = 0; frame < frames; ++frame)
|
||||||
{
|
{
|
||||||
for (int channel = 0; channel < channels; ++channel)
|
for (int channel = 0; channel < channels; ++channel)
|
||||||
@@ -1000,7 +1000,7 @@ namespace pipedal
|
|||||||
|
|
||||||
std::vector<float *> &buffers = this->playbackBuffers;
|
std::vector<float *> &buffers = this->playbackBuffers;
|
||||||
int channels = this->playbackChannels;
|
int channels = this->playbackChannels;
|
||||||
constexpr float scale = std::numeric_limits<int32_t>::max();
|
constexpr double scale = std::numeric_limits<int32_t>::max();
|
||||||
for (size_t frame = 0; frame < frames; ++frame)
|
for (size_t frame = 0; frame < frames; ++frame)
|
||||||
{
|
{
|
||||||
for (int channel = 0; channel < channels; ++channel)
|
for (int channel = 0; channel < channels; ++channel)
|
||||||
|
|||||||
+2
-1
@@ -464,7 +464,7 @@ void Lv2Effect::SetAudioOutputBuffer(int index, float *buffer)
|
|||||||
|
|
||||||
if (this->inputAudioPortIndices.size() != 0) // i.e. we're not mixing a zero-input control
|
if (this->inputAudioPortIndices.size() != 0) // i.e. we're not mixing a zero-input control
|
||||||
{
|
{
|
||||||
if ((size_t)index < this->inputAudioPortIndices.size())
|
if ((size_t)index < this->outputAudioPortIndices.size())
|
||||||
{
|
{
|
||||||
int pluginIndex = this->outputAudioPortIndices[index];
|
int pluginIndex = this->outputAudioPortIndices[index];
|
||||||
lilv_instance_connect_port(pInstance, pluginIndex, buffer);
|
lilv_instance_connect_port(pInstance, pluginIndex, buffer);
|
||||||
@@ -562,6 +562,7 @@ void Lv2Effect::AssignUnconnectedPorts()
|
|||||||
{
|
{
|
||||||
float *buffer = bufferPool.AllocateBuffer<float>(pHost->GetMaxAudioBufferSize());
|
float *buffer = bufferPool.AllocateBuffer<float>(pHost->GetMaxAudioBufferSize());
|
||||||
int pluginIndex = this->outputAudioPortIndices[i];
|
int pluginIndex = this->outputAudioPortIndices[i];
|
||||||
|
lilv_instance_connect_port(pInstance, pluginIndex, buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ std::vector<float *> Lv2Pedalboard::PrepareItems(
|
|||||||
{
|
{
|
||||||
std::shared_ptr<IEffect> pLv2Effect;
|
std::shared_ptr<IEffect> pLv2Effect;
|
||||||
|
|
||||||
if (existingEffects && existingEffects->contains(item.instanceId()))
|
if (existingEffects && existingEffects->contains(item.instanceId())
|
||||||
|
)
|
||||||
{
|
{
|
||||||
pLv2Effect = existingEffects->at(item.instanceId());
|
pLv2Effect = existingEffects->at(item.instanceId());
|
||||||
((Lv2Effect*)pLv2Effect.get())->SetBorrowedEffect(true);
|
((Lv2Effect*)pLv2Effect.get())->SetBorrowedEffect(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user