diff --git a/src/common/logging/vst2.cpp b/src/common/logging/vst2.cpp index fc30de6c..3ab68fb0 100644 --- a/src/common/logging/vst2.cpp +++ b/src/common/logging/vst2.cpp @@ -165,6 +165,9 @@ std::optional opcode_to_string(bool is_dispatch, int opcode) { case effGetTailSize: return "effGetTailSize"; break; + case effSetProcessPrecision: + return "effSetProcessPrecision"; + break; default: return std::nullopt; break; diff --git a/src/common/vst24.h b/src/common/vst24.h index 97346be3..b237370e 100644 --- a/src/common/vst24.h +++ b/src/common/vst24.h @@ -69,6 +69,26 @@ */ [[maybe_unused]] constexpr int effGetTailSize = 52; +/** + * Used to indicate that the plugin is going to receive double precision audio. + * The name was found on the JUCE VST2 implementation linked above. REAPER seems + * to call this function with value set to 1 when loading a plugin that supports + * 64-bit double precision audio. + */ +[[maybe_unused]] constexpr int effSetProcessPrecision = 77; + +/** + * When passed to `effSetProcessPrecision` as the value argument, indicates that + * the plugin gets to process 32-bit audio. Name glanced from + * https://github.com/juce-framework/JUCE/blob/c0f18670f45d268ad9557bd639f14b374ce38e65/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp#L1983. + */ +[[maybe_unused]] constexpr int kVstProcessPrecision64 = 1; +/** + * Logically if 64-bit audio gets a value of 1, regular old 32-bit audio will be + * 0. + */ +[[maybe_unused]] constexpr int kVstProcessPrecision32 = 0; + /** * The struct that's being passed through the data parameter during the * `effGetInputProperties` and `effGetOutputProperties` opcodes. Reverse diff --git a/src/plugin/bridges/vst2.cpp b/src/plugin/bridges/vst2.cpp index 3f9ceaec..12d442d4 100644 --- a/src/plugin/bridges/vst2.cpp +++ b/src/plugin/bridges/vst2.cpp @@ -302,6 +302,7 @@ class DispatchDataConverter : public DefaultDataConverter { case effEndSetProgram: case effStartProcess: case effStopProcess: + case effSetProcessPrecision: return nullptr; default: return DefaultDataConverter::read_data(opcode, index, value,