Browse Source

Fix limits of MIDI CC parameters

Closes #989

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.1-rc1
falkTX 4 years ago
parent
commit
d17c94b3f4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
8 changed files with 10 additions and 10 deletions
  1. +1
    -1
      source/backend/engine/CarlaEngineJack.cpp
  2. +2
    -2
      source/backend/plugin/CarlaPluginFluidSynth.cpp
  3. +1
    -1
      source/backend/plugin/CarlaPluginJuce.cpp
  4. +2
    -2
      source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  5. +1
    -1
      source/backend/plugin/CarlaPluginLV2.cpp
  6. +1
    -1
      source/backend/plugin/CarlaPluginNative.cpp
  7. +1
    -1
      source/backend/plugin/CarlaPluginSFZero.cpp
  8. +1
    -1
      source/backend/plugin/CarlaPluginVST2.cpp

+ 1
- 1
source/backend/engine/CarlaEngineJack.cpp View File

@@ -418,7 +418,7 @@ public:
CARLA_SAFE_ASSERT_RETURN(fJackBuffer != nullptr, false);
CARLA_SAFE_ASSERT_RETURN(type != kEngineControlEventTypeNull, false);
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS, false);
CARLA_SAFE_ASSERT_RETURN(param < MAX_MIDI_CONTROL, false);
CARLA_SAFE_ASSERT_RETURN(param < MAX_MIDI_VALUE, false);
CARLA_SAFE_ASSERT(value >= 0.0f && value <= 1.0f);

if (type == kEngineControlEventTypeParameter) {


+ 2
- 2
source/backend/plugin/CarlaPluginFluidSynth.cpp View File

@@ -1076,7 +1076,7 @@ public:
// -------------------------------------------------------------------
// Plugin processing

void process(const float* const* const, float** const audioOut,
void process(const float* const* const, float** const audioOut,
const float* const*, float**, const uint32_t frames) override
{
// --------------------------------------------------------------------------------------------------------
@@ -1267,7 +1267,7 @@ public:
setParameterValueRT(k, value, true);
}

if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_CONTROL)
if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE)
{
fluid_synth_cc(fSynth, event.channel, ctrlEvent.param, int(ctrlEvent.value*127.0f));
}


+ 1
- 1
source/backend/plugin/CarlaPluginJuce.cpp View File

@@ -914,7 +914,7 @@ public:
setParameterValueRT(k, value, true);
}

if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_CONTROL)
if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE)
{
uint8_t midiData[3];
midiData[0] = uint8_t(MIDI_STATUS_CONTROL_CHANGE | (event.channel & MIDI_CHANNEL_BIT));


+ 2
- 2
source/backend/plugin/CarlaPluginLADSPADSSI.cpp View File

@@ -1131,7 +1131,7 @@ public:
if (DSSI_CONTROLLER_IS_SET(ctrl) && DSSI_IS_CC(ctrl))
{
const int16_t cc = DSSI_CC_NUMBER(ctrl);
if (! MIDI_IS_CONTROL_BANK_SELECT(cc))
if (cc < MAX_MIDI_CONTROL && ! MIDI_IS_CONTROL_BANK_SELECT(cc))
pData->param.data[j].mappedControlIndex = cc;
}
}
@@ -1727,7 +1727,7 @@ public:
setParameterValueRT(k, value, true);
}

if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_CONTROL)
if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE)
{
if (midiEventCount >= kPluginMaxMidiEvents)
continue;


+ 1
- 1
source/backend/plugin/CarlaPluginLV2.cpp View File

@@ -3704,7 +3704,7 @@ public:
setParameterValueRT(k, value, true);
}

if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_CONTROL)
if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE)
{
uint8_t midiData[3];
midiData[0] = uint8_t(MIDI_STATUS_CONTROL_CHANGE | (event.channel & MIDI_CHANNEL_BIT));


+ 1
- 1
source/backend/plugin/CarlaPluginNative.cpp View File

@@ -1981,7 +1981,7 @@ public:
setParameterValueRT(k, value, true);
}

if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_CONTROL)
if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE)
{
if (fMidiEventInCount >= kPluginMaxMidiEvents)
continue;


+ 1
- 1
source/backend/plugin/CarlaPluginSFZero.cpp View File

@@ -481,7 +481,7 @@ public:
setParameterValueRT(k, value, true);
}

if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_CONTROL)
if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE)
{
fSynth.handleController(event.channel+1, ctrlEvent.param, int(ctrlEvent.value*127.0f));
}


+ 1
- 1
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -1414,7 +1414,7 @@ public:
setParameterValueRT(k, value, true);
}

if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_CONTROL)
if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE)
{
if (fMidiEventCount >= kPluginMaxMidiEvents*2)
continue;


Loading…
Cancel
Save