35 Commits

Author SHA1 Message Date
Xaymar 339d4f3159 Add documentation to VST_EVENT_TYPE_04 and VST_EVENT_TYPE_05 2025-08-08 06:24:25 +02:00
Xaymar ac2d40ebce vst_event_midi_sysex_t is event type 6 not 5 2025-08-08 06:24:24 +02:00
Xaymar 22bb104943 Strip out old vst3sdk support as it's unsupported by Steinberg now
Seems like the functionality to make a VST 3.x + 2.x plug-in is now no longer in their SDK or at least I can't find it. Since that code likely relied on things that were GPLv3 or Steinberg Proprietary licensed, it's better if I remove it.
2025-08-08 06:24:24 +02:00
Xaymar 779b6c55de Update README.md 2025-08-08 06:16:15 +02:00
Xaymar 7593071b9e Add modern C++ style C header include
It does the exact same as all the modern C header includes!
2025-08-08 05:34:16 +02:00
Xaymar ce82058d69 Clean and proper directory structure 2025-08-08 05:33:54 +02:00
Xaymar f32ac9b385 Minor documentation improvements 2025-08-08 05:27:59 +02:00
Xaymar a17e62c097 Support for C98 and C++98
This omits the definition for vst_host_supports_t and vst_effect_supports_t if the compiler doesn't support it. I may replace these with #define's in the future for universal compiler support.
2025-08-08 05:18:23 +02:00
Xaymar 0c87491e6f Document vst_effect_supports_t.conformsToWindowRules 2025-08-08 04:57:34 +02:00
Xaymar cb3952b5f1 Empty field in vst_events_t is likely padding
Based on where things are in the structure this is likely to be a remnant of the past. Can't verify that though.
2025-08-08 04:47:06 +02:00
Xaymar a76aa75260 Define "External" category (#5) 2025-08-08 04:42:50 +02:00
Xaymar 4246e8442c Use README.md as the documentation main page 2025-08-08 04:40:12 +02:00
Xaymar 00a9f2dc53 Effect 0x3B/0x3C: Define virtual key codes
These are probably not all but they are the ones that I could actually make happen.
2025-08-08 04:38:13 +02:00
Xaymar 4b00c75a3f Some documentation updates 2025-08-08 04:15:18 +02:00
Xaymar 93bc195dea 'cinttypes' doesn't exist prior to C++11 2025-08-08 04:09:52 +02:00
Xaymar 45194f82b9 Add @todo tags to anything that needs work 2025-08-08 04:09:12 +02:00
Xaymar bc16fce699 Fix up C99 support again
We still require a C++ compiler that treats C header files as actual C code.
2025-08-08 03:59:29 +02:00
Xaymar 6576c95a74 Add MIDI and MIDI SysEx event structures (#2, #3)
Thanks to a cheap MIDI keyboard I was able to figure out most of the structure with ease.
2025-08-08 03:55:12 +02:00
Xaymar de16483b55 Host 0x17: Query which thread is currently active
Quite useful for threading and memory safety.
2025-08-08 02:54:42 +02:00
Xaymar b5310b8922 Host 0x2D/0x2E/0x2F: Controllable crash/memory corruption via p_ptr
Doesn't appear useful so far.
2025-08-08 02:54:37 +02:00
Xaymar 098f059834 Host 0x1F/0x31: Query current input/output speaker arrangement
Seems to be completely unsupported in VST 2.4 hosts and all prior hosts seem to just return the exact data we output from VST_EFFECT_OPCODE_GET_SPEAKER_ARRANGEMENT.
2025-08-08 02:54:36 +02:00
Xaymar ca9d9de24e Host 0x15/0x16: Query which vst_effect_t is attached to an input/output stream
Basically unsupported in almost all hosts so not very useful for optimization purposes.
2025-08-08 02:54:36 +02:00
Xaymar 596cf21b71 Host 0x13/0x14: Current input/output sample latency 2025-08-08 02:54:35 +02:00
Xaymar 8204f06ca7 Host 0x11/0x12: Current effect sample rate and block size
Some hosts can randomly "forget" to send these updates to the effect and that's why we can ask the host for them. Most modern ones though do properly handle all of this.
2025-08-08 02:54:35 +02:00
Xaymar 64ddb953db Host 0x27: Query current host language
Seems to use a custom format instead of something like ISO 639 which predates VST 2.x by quite a long time. Reinventing the wheel goes back a long time it seems.
2025-08-08 02:54:34 +02:00
Xaymar 5cef1f300a Host 0x29: Retrieves the path of the currently loaded effect
Unsure what this does with container plug-ins. Does it return the container file?
2025-08-08 02:54:34 +02:00
Xaymar 9f1a61b603 Host 0x30: Some kind of path query related programs and banks
Mostly just crashes hosts but in rare cases actually works to retrieve a path to something.
2025-08-08 02:54:33 +02:00
Xaymar ac4572eff4 Host 0x2A: Plug-in requests a full refresh of information
A plug-in may call this if they believe important information has changed such as the number of parameters. This seems to work together with VST_HOST_OPCODE_IO_MODIFIED.
2025-08-08 02:54:33 +02:00
Xaymar 14688491dc Host 0x2B/0x2C: Intended behavior appears to be locking/unlocking
These calls seem to prevent compatible hosts from emitting parameter changes entirely. This is like a file lock where it prevents other processes from modifying things they shouldn't.
2025-08-08 02:54:32 +02:00
Xaymar a140b58016 Initial work towards event handling support (#3)
The VST 2.x API seems to support some sort of event handling functionality used to implement MIDI (#2) and External Processing (#5). The vst_event_t structure is currently unclear.
2025-08-08 02:54:31 +02:00
Xaymar 2551d06b0c Add "editFile" to vst_host_supports_t
This one looked like a function lookup for a LoadLibrary call. Turns out it's an actual support query!
2025-08-08 02:54:31 +02:00
Xaymar e81a1f91e2 Host 0x1E: Request a resize of the window containing our custom editor
The host is not required to accept our request and may ignore it.
2025-08-08 02:54:30 +02:00
Xaymar 0b608bec1f Slightly improve overall documentation 2025-08-08 02:54:30 +02:00
Xaymar e9fcf1408b Host 0x0E -> 0x0D: Missed one of the off-by-1 errors
This explains why my test code using the header wasn't working.
2025-08-08 02:38:09 +02:00
Xaymar d23a117ecc Add editorconfig file for automatically trimming whitespace 2025-08-08 02:38:09 +02:00
25 changed files with 1035 additions and 1752 deletions
+17
View File
@@ -0,0 +1,17 @@
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file.
[*]
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = tab
indent_size = 4
[*.{md,yml,yaml}]
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2
+6 -5
View File
@@ -74,7 +74,7 @@ PROJECT_ICON =
# entered, it will be relative to the location where Doxygen was started. If # entered, it will be relative to the location where Doxygen was started. If
# left blank the current directory will be used. # left blank the current directory will be used.
OUTPUT_DIRECTORY = build/docs OUTPUT_DIRECTORY = ./build/docs
# If the CREATE_SUBDIRS tag is set to YES then Doxygen will create up to 4096 # If the CREATE_SUBDIRS tag is set to YES then Doxygen will create up to 4096
# sub-directories (in 2 levels) under the output directory of each output format # sub-directories (in 2 levels) under the output directory of each output format
@@ -991,8 +991,8 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = vst.h \ INPUT = include/ \
vst.hpp README.md
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses # that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses
@@ -1207,7 +1207,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub # (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the Doxygen output. # and want to reuse the introduction page also for the Doxygen output.
USE_MDFILE_AS_MAINPAGE = USE_MDFILE_AS_MAINPAGE = README.md
# If the IMPLICIT_DIR_DOCS tag is set to YES, any README.md file found in sub- # If the IMPLICIT_DIR_DOCS tag is set to YES, any README.md file found in sub-
# directories of the project's root, is used as the documentation for that sub- # directories of the project's root, is used as the documentation for that sub-
@@ -2532,7 +2532,8 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator. # recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = PREDEFINED = __cplusplus:=999999L \
__STDC_VERSION__:=999999L
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The # tag can be used to specify a list of macro names that should be expanded. The
+9
View File
@@ -1,6 +1,15 @@
# About the Project # About the Project
This is a completely "clean room" untainted reverse engineered "SDK" for the VST 2.x interface. It was reverse engineered from binaries where no license restricting the reverse engineering was attached, or where the legal system explicitly allowed reverse engineering for the purpose of interoperability. This is a completely "clean room" untainted reverse engineered "SDK" for the VST 2.x interface. It was reverse engineered from binaries where no license restricting the reverse engineering was attached, or where the legal system explicitly allowed reverse engineering for the purpose of interoperability.
## At a glance
- Full reimplementation of the VST 2.x SDK.
- Header-only, so no code/object dependencies!
- Written for C99 / C++20 with (optional) backwards support down to C89 / C++98.
- Documentation available [online](https://xaymar.github.io/vst2sdk) _and_ offline with clean JavaDoc comments.
- Liberally licensed so it is usable in commercial products.
- Technically as clean room as it can legally get, but ask a lawyer first anyway.
- I don't provide licenses to Steinberg VsT, their logos, or anything.
## As seen in ## As seen in
[DISTRHO Plugin Framework](https://github.com/DISTRHO/DPF), [StompTuner](https://github.com/brummer10/StompTuner), [DF Zita Rev1](https://github.com/SpotlightKid/dfzitarev1), [TonPlugIns](https://github.com/Vhonowslend/TonPlugIns), [ToneTwistPlugs](https://github.com/brummer10/ToneTwistPlugs), [DF JPverb](https://github.com/SpotlightKid/dfjpverb), [CChorus](https://github.com/SpotlightKid/cchorus), [Dynation](https://github.com/vertver/Dynation) and likely more. [DISTRHO Plugin Framework](https://github.com/DISTRHO/DPF), [StompTuner](https://github.com/brummer10/StompTuner), [DF Zita Rev1](https://github.com/SpotlightKid/dfzitarev1), [TonPlugIns](https://github.com/Vhonowslend/TonPlugIns), [ToneTwistPlugs](https://github.com/brummer10/ToneTwistPlugs), [DF JPverb](https://github.com/SpotlightKid/dfjpverb), [CChorus](https://github.com/SpotlightKid/cchorus), [Dynation](https://github.com/vertver/Dynation) and likely more.
+30
View File
@@ -0,0 +1,30 @@
/* An attempt at an untained clean room reimplementation of the widely popular VST 2.x SDK.
* Copyright (c) 2020 Xaymar Dirks <info@xaymar.com> (previously known as Michael Fabian Dirks)
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "vst.h"
#ifdef __cplusplus
}
#endif
+974 -101
View File
File diff suppressed because it is too large Load Diff
View File
-140
View File
@@ -1,140 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vsttypes.h"
#include "vstversion.h"
#pragma pack(push, 8)
enum AEffectOpCodes {
audioEffectOpen, // Create/Open Effect
audioEffectClose, // Destroy/Close Effect
audioEffectSetProgram, // Set Program
audioEffectGetProgram, // Get Program
audioEffectSetProgramName, // Set Program Name
audioEffectGetProgramName, // Get Program Name
audioEffectGetParameterLabel, // Get Parameter Label
audioEffectGetParameterDisplay, // Get Parameter Display
audioEffectGetParameterName, // Get Parameter Name
AEffectOpCode_09,
audioEffectSetSampleRate, // Set Sample Rate
audioEffectSetBlockSize, // Set Block Size
audioEffectSuspendResume, // Suspend/Resume
audioEffectEditorGetSize, // Get Editor Size
audioEffectEditorOpen, // Create/Open Editor
audioEffectEditorClose, // Destroy/Close Editor
AEffectOpCode_10,
AEffectOpCode_11,
AEffectOpCode_12,
audioEffectEditorDoNothing,
AEffectOpCode_14,
AEffectOpCode_15,
AEffectOpCode_16, // Always FOURCC('N', 'v', 'E', 'F')? Might be different for some VST 1.x and 2.x plug-ins. Doesn't seem to be used.
audioEffectGetChunk, // Get Chunk
audioEffectSetChunk, // Set Chunk
// All OpCodes above this maximum are version 2.x
AEffectOpCodeMax
};
enum AEffectMasterOpCodes {
AEffectMasterOpCode_00,
audioMasterAutomate = AEffectMasterOpCode_00,
AEffectMasterOpCode_01,
audioMasterVersion = AEffectMasterOpCode_01,
AEffectMasterOpCode_02,
AEffectMasterOpCode_03,
AEffectMasterOpCode_04,
// All OpCodes above this maximum are version 2.x
AEffectMasterOpCodeMax,
};
enum AEffectFlags { // Guessed name based on struct+field combination.
AEffectFlagHasEditor = 1 << 0,
AEffectFlagCanReplacing = 1 << 4,
AEffectFlagProgramsAreChunks = 1 << 5, // Not sure what this means.
AEffectFlagIsSynthesizer = 1 << 8,
AEffectFlagIsSilentOnSilence = 1 << 9, // Does not generate tail samples?
};
struct AEffect {
VstInt32 magic; // Must be FOURCC('V', 's', 't', 'P')
VstIntPtr(VstFunctionAPI* control)(AEffect* self, VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value);
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
// No 2.4 host ever calls this, processReplacing and processDoubleReplacing seem to be required.
[[deprecated]]
#endif
void(VstFunctionAPI* process)(AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames);
void(VstFunctionAPI* setParameter)(AEffect* self, VstInt32 index, float value);
float(VstFunctionAPI* getParameter)(AEffect* self, VstInt32 index);
VstInt32 numPrograms;
VstInt32 numParams;
VstInt32 numInputs; // Guessing names here based on the other ones. We already know what their type is anyway.
VstInt32 numOutputs;
VstInt32 flags; // AEffectFlags, see vst.h for more.
VstIntPtr __unk04;
VstIntPtr __unk05;
VstInt32 delay;
VstInt32 __unk06;
VstInt32 __unk07;
float __unk08;
void* effect_data; // I think this is effect private data.
void* host_data; // And this is host private data.
VstInt32 uniqueID; // A very collidable unique id. 32 bit is not a lot.
VstInt32 version; // VstVersion
/** Process float data in-place.
*
* Must be present for 2.4 or later hosts. Make sure you set the proper flag.
*
* \param inputs Input buffers. Can have pointers used in outputs.
* \param outputs Output buffers. Can have pointers used in inputs.
* \param sampleFrames Number of samples in all buffers.
*/
void(VstFunctionAPI* processReplacing)(AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames);
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
// These only appear in version >= 2.4
/** Process double data in-place.
*
* \param inputs Input buffers. Can have pointers used in outputs.
* \param outputs Output buffers. Can have pointers used in inputs.
* \param sampleFrames Number of samples in all buffers.
*/
void(VstFunctionAPI* processDoubleReplacing)(AEffect* self, double** inputs, double** outputs, VstInt32 sampleFrames);
char __unk12[56];
#else
char __unk12[60];
#endif
};
// Master callback.
typedef VstIntPtr(VstFunctionAPI* audioMasterCallback)(AEffect*, VstInt32 opcode, VstInt32, VstInt32, void* ptr, float);
#pragma pack(pop)
-178
View File
@@ -1,178 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// File name based on "AudioEffectX" and "AudioEffect". Since we have a struct called "AEffect", logically there's a struct AEffectX right? Don't see any references to it though...
#pragma once
#include "aeffect.h"
#include "vstpin.h"
#include "vsttime.h"
#include "vstversion.h"
enum AEffectXFlags {
AEffectFlagCanDoubleReplacing = 1 << 12, // Only available in 2.4 or later. Name based on AudioEffect::canDoubleReplacing
};
enum AEffectXOpCodes {
__AEffectXOpCode_Lowest = 0x18, // Starts at highest OpCode from AEffect.
AEffectXOpCode_19,
audioEffectProcessEvents, // Process Events
audioEffectIsParameterAutomatable, // Is Parameter Automatable?
audioEffectConvertStringToParameter, // Convert String to Parameter index
audioEffectGetProgramNameIndexed,
AEffectXOpCode_1E,
AEffectXOpCode_1F,
AEffectXOpCode_20,
audioEffectGetInputProperties, // Get Input Properties
audioEffectGetOutputProperties, // Get Output Properties
audioEffectGetPlugCategory, // Get "Plug" Category
AEffectXOpCode_24,
AEffectXOpCode_25,
AEffectXOpCode_26,
AEffectXOpCode_27,
AEffectXOpCode_28,
AEffectXOpCode_29,
audioEffectSetSpeakerArrangement, // Set Speaker Arrangment
AEffectXOpCode_2B,
audioEffectBypass, // Bypass
audioEffectGetEffectName, // Get Effect Name
AEffectXOpCode_2E,
audioEffectGetVendorString, // Get Vendor Name
audioEffectGetProductString, // Get Product Name
audioEffectGetVendorVersion, // Get Vendor Version
audioEffectVendorSpecific, // Seems to be used rarely to implement host-specific custom behavior.
audioEffectCanDo, // Test for Feature support
audioEffectGetTailSize, // Get Tail Samples
AEffectXOpCode_35,
AEffectXOpCode_36,
AEffectXOpCode_37,
audioEffectGetParameterProperties,
AEffectXOpCode_39,
audioEffectGetVSTVersion, // Get VST Version
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2100)
// Only seen in version 2.1 or later
audioEffectEditorKeyDown, // Key Down in Editor.
audioEffectEditorKeyUp, // Key Up in Editor
audioEffectEditorKnobMode, // Editor Knob Mode, see CKnobMode in vstgui.
audioEffectMidiGetProgramName,
audioEffectMidiGetCurrentProgram,
audioEffectMidiGetProgramCategory,
audioEffectMidiHasProgramsChanged,
audioEffectMidiGetKeyName,
AEffectXOpCode_43,
AEffectXOpCode_44,
#endif
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2300)
// Only seen in version 2.3 or later
audioEffectGetSpeakerArrangement, // Get Speaker Arrangement
AEffectXOpCode_46,
audioEffectStartProcessing, // Start processing audio.
audioEffectStopProcessing, // Stop processing audio.
AEffectXOpCode_49,
AEffectXOpCode_4A,
AEffectXOpCode_4B,
AEffectXOpCode_4C,
#endif
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
// Only seen in version 2.4 or later.
audioEffectSetProcessingPrecision, // Set Processing Precision, see VstProcessPrecision
audioEffectMidiGetNumInputChannels,
audioEffectMidiGetNumOutputChannels,
#endif
// Never seen any OpCodes at or above this maximum.
AEffectXOpCodeMax
};
enum AEffectXMasterOpCodes {
__AEffectXMasterOpCodeLowest = 0x04,
AEffectXMasterOpCode_05, // Appears to be unused entirely.
AEffectXMasterOpCode_06,
audioMasterGetTimeInfo, // Get Time Info. Name guessed based on AudioEffectX::getTimeInfo
audioMasterProcessEvents, // Name guessed based on AudioEffectX::sendVstEventsToHost. Name is likely a mirror of audioEffectsProcessEvents.
AEffectXMasterOpCode_09,
AEffectXMasterOpCode_0A,
AEffectXMasterOpCode_0B,
AEffectXMasterOpCode_0C,
audioMasterIOChanged, // Notify Host that our Inputs/Outputs/etc have changed. Name guessed based on AudioEffectX::ioChanged
AEffectXMasterOpCode_0E,
audioMasterSizeWindow, // Request a resize of the editor window. Name guessed based on AudioEffectX::sizeWindow
AEffectXMasterOpCode_10,
AEffectXMasterOpCode_11,
AEffectXMasterOpCode_12,
AEffectXMasterOpCode_13,
AEffectXMasterOpCode_14,
AEffectXMasterOpCode_15,
AEffectXMasterOpCode_16,
audioMasterGetCurrentProcessLevel, // Name guessed based on AudioEffectX::getCurrentProcessLevel
AEffectXMasterOpCode_18,
AEffectXMasterOpCode_19,
AEffectXMasterOpCode_1A,
AEffectXMasterOpCode_1B,
AEffectXMasterOpCode_1C,
AEffectXMasterOpCode_1D,
AEffectXMasterOpCode_1E,
AEffectXMasterOpCode_1F,
audioMasterGetVendorString, // Get Vendor Name
audioMasterGetProductString, // Get Product Name
audioMasterGetVendorVersion, // Get Vendor Version
audioMasterVendorSpecific, // Counterpart to AEffectXOpCode_32
audioMasterCanDo,
AEffectXMasterOpCode_25,
AEffectXMasterOpCode_26,
AEffectXMasterOpCode_27,
AEffectXMasterOpCode_28,
AEffectXMasterOpCode_29, // When called, returns a pointer to a string.
audioMasterUpdateDisplay, // Request an update for the editor display? Name guessed via AudioEffectX::updateDisplay
audioMasterBeginEdit, // Parameter Gained Focus. Likely used to help the host ignore unwanted inputs. Name guessed via AudioEffectX::beginEdit
audioMasterEndEdit, // Parameter Lost Focus. Likely used to help the host ignore unwanted inputs. Name guessed via AudioEffectX::endEdit
AEffectXMasterOpCode_2D,
AEffectXMasterOpCode_2E,
AEffectXMasterOpCode_2F,
AEffectXMasterOpCode_30,
AEffectXMasterOpCode_31,
AEffectXMasterOpCodeMax
};
enum VstPlugCategory { // Based on OpCode being here only.
// Taken from VstPlugCategory Vst2Wrapper::getPlugCategory (), then shuffled around until it made sense in most VST hosts.
kPlugCategUnknown = 0,
kPlugCategEffect,
kPlugCategSynth,
kPlugCategAnalysis,
kPlugCategMastering,
kPlugCategSpacializer,
kPlugCategRoomFx,
kPlugCateg__unk00, // Unknown use.
kPlugCategRestoration,
kPlugCateg__unk01, // Unknown use.
kPlugCategContainer, // AEffectX contains multiple plugins. Not clear how this works.
kPlugCategGenerator,
};
enum VstProcessLevels {
// No idea what the rest are.
kVstProcessLevelRealtime = 2,
kVstProcessLevelOffline = 4,
};
enum VstProcessPrecision {
kVstProcessPrecision32, // Single
kVstProcessPrecision64, // Double
};
-35
View File
@@ -1,35 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "aeffeditor.hpp"
AEffEditor::AEffEditor(AudioEffect* effect) : effect(effect), _handle() {}
AEffEditor::~AEffEditor() {}
bool AEffEditor::open(void* ptr)
{
if (!_handle) {
_handle = ptr;
return ptr;
}
return false;
}
void AEffEditor::close()
{
_handle = nullptr;
return;
}
-17
View File
@@ -1,17 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "aeffeditor.hpp"
-65
View File
@@ -1,65 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vstkey.h"
#include "vsttypes.h"
#pragma pack(push, 8)
class AudioEffect;
class AEffEditor {
public:
AEffEditor(AudioEffect* effect);
virtual ~AEffEditor();
virtual bool getRect(ERect** rect)
{
//*rect = nullptr;
return false;
}
virtual bool open(void* ptr);
virtual void close();
virtual void do_nothing()
{
return;
}
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2100)
virtual bool setKnobMode(VstInt32 val)
{
return false;
}
virtual bool onKeyDown(VstKeyCode& keyCode)
{
return false;
}
virtual bool onKeyUp(VstKeyCode& keyCode)
{
return false;
}
virtual bool onWheel(float distance)
{
return false;
}
#endif
protected:
AudioEffect* effect; // Restricted to this name by vst2wrapper.
void* _handle;
};
#pragma pack(pop)
-177
View File
@@ -1,177 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "audioeffect.hpp"
#include <cstring>
#include "aeffect.h"
#define FOURCC(a, b, c, d) ((a << 24) | (b << 16) | (c << 8) | d)
AudioEffect::AudioEffect(audioMasterCallback p_audioMaster, VstInt32 __unk00, VstInt32 __unk01)
{
memset(&cEffect, 0, sizeof(AEffect));
cEffect.magic = FOURCC('V', 's', 't', 'P');
cEffect.effect_data = this;
#if (!defined VST_VERSION_SUPPORT)
cEffect.version = kVstVersion_2400;
#else
cEffect.version = VST_VERSION_SUPPORT;
#endif
cEffect.control = [](AEffect* self, VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value) { return reinterpret_cast<AudioEffect*>(self->effect_data)->control(opcode, param1, param2, ptr, value); };
cEffect.process = [](AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames) { return reinterpret_cast<AudioEffect*>(self->effect_data)->process(inputs, outputs, sampleFrames); };
cEffect.setParameter = [](AEffect* self, VstInt32 index, float value) { reinterpret_cast<AudioEffect*>(self->effect_data)->setParameter(index, value); };
cEffect.getParameter = [](AEffect* self, VstInt32 index) { return reinterpret_cast<AudioEffect*>(self->effect_data)->getParameter(index); };
cEffect.processReplacing = [](AEffect* self, float** inputs, float** outputs, VstInt32 sampleFrames) { return reinterpret_cast<AudioEffect*>(self->effect_data)->processReplacing(inputs, outputs, sampleFrames); };
audioMaster = p_audioMaster;
numPrograms = cEffect.numPrograms;
curProgram = 0;
editor = nullptr;
}
AudioEffect::~AudioEffect() {}
VstIntPtr AudioEffect::control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value)
{
switch (opcode) {
case audioEffectOpen:
open();
break;
case audioEffectClose:
close();
break;
case audioEffectSetProgram:
setProgram(param1);
break;
case audioEffectGetProgram:
return getProgram();
case audioEffectSetProgramName:
setProgramName((char*)ptr);
break;
case audioEffectGetProgramName:
getProgramName((char*)ptr);
break;
case audioEffectGetParameterLabel:
getParameterLabel(param1, (char*)ptr);
break;
case audioEffectGetParameterDisplay:
getParameterDisplay(param1, (char*)ptr);
break;
case audioEffectGetParameterName:
getParameterName(param1, (char*)ptr);
break;
case audioEffectSetSampleRate:
setSampleRate(value);
break;
case audioEffectSetBlockSize:
setBlockSize(static_cast<VstInt32>(value));
break;
case audioEffectSuspendResume:
if (!param2) {
suspend();
} else {
resume();
}
break;
case audioEffectEditorGetSize:
if (editor) {
return editor->getRect((ERect**)ptr) ? 1 : 0;
}
break;
case audioEffectEditorOpen:
if (editor) {
return editor->open(ptr);
}
break;
case audioEffectEditorClose:
if (editor) {
editor->close();
}
break;
case audioEffectEditorDoNothing: // Occasionally appears. Does nothing? Only called when editor is open.
if (editor) {
editor->do_nothing();
}
break;
case audioEffectGetChunk:
return getChunk((void**)ptr, !!param1);
case audioEffectSetChunk:
return setChunk(ptr, static_cast<VstInt32>(value), !!param1);
default:
break;
}
return 0;
}
AEffect* AudioEffect::getAeffect()
{
return &cEffect;
}
void AudioEffect::setEditor(AEffEditor* p_editor)
{
editor = p_editor;
}
void AudioEffect::setUniqueID(VstInt32 uniqueID)
{
cEffect.uniqueID = uniqueID;
}
void AudioEffect::setNumInputs(VstInt32 numInputs)
{
cEffect.numInputs = numInputs;
}
void AudioEffect::setNumOutputs(VstInt32 numOutputs)
{
cEffect.numOutputs = numOutputs;
}
void AudioEffect::setInitialDelay(VstInt32 delay)
{
cEffect.delay = delay;
}
void AudioEffect::canProcessReplacing(bool value)
{
if (value)
cEffect.flags |= AEffectFlagCanReplacing;
else
cEffect.flags &= ~AEffectFlagCanReplacing;
}
void AudioEffect::isSynth(bool value)
{
if (value)
cEffect.flags |= AEffectFlagIsSynthesizer;
else
cEffect.flags &= ~AEffectFlagIsSynthesizer;
}
void AudioEffect::programsAreChunks(bool value)
{
if (value)
cEffect.flags |= AEffectFlagProgramsAreChunks;
else
cEffect.flags &= ~AEffectFlagProgramsAreChunks;
}
void AudioEffect::setParameterAutomated(VstInt32 index, float value)
{
setParameter(index, value);
if (audioMaster)
audioMaster(getAeffect(), audioMasterAutomate, index, 0, 0, value);
}
-100
View File
@@ -1,100 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "aeffect.h"
#include "aeffeditor.h"
#include "vstevent.h"
#include "vstkey.h"
#include "vstparameter.h"
#include "vstpin.h"
#include "vstspeaker.h"
#include "vsttypes.h"
// This may work. Or it may not. We don't guarantee compatibility with the original.
class AudioEffect {
public:
AudioEffect(audioMasterCallback audioMaster, VstInt32 __unk00, VstInt32 __unk01);
virtual ~AudioEffect();
protected:
// Internal
virtual VstIntPtr control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value);
public:
// AudioEffect
virtual AEffect* getAeffect();
virtual void setEditor(AEffEditor* editor);
virtual void process(float** inputs, float** outputs, VstInt32 sampleFrames){};
virtual float getParameter(VstInt32 index)
{
return 0;
}
virtual void setParameter(VstInt32 index, float value){};
virtual void processReplacing(float** inputs, float** outputs, VstInt32 sampleFrames){};
// AEffect
virtual void setUniqueID(VstInt32 uniqueID);
virtual void setNumInputs(VstInt32 numInputs);
virtual void setNumOutputs(VstInt32 numOutputs);
virtual void setInitialDelay(VstInt32 delay);
virtual void canProcessReplacing(bool value);
virtual void isSynth(bool value);
virtual void programsAreChunks(bool value);
// Audio Master (sorted by AEffectMasterOpCodes)
virtual void setParameterAutomated(VstInt32 index, float value);
// Audio Plugin (sorted by AEffectOpCodes)
virtual void open(){};
virtual void close(){};
virtual void setProgram(VstInt32 program){};
virtual VstInt32 getProgram()
{
return 0;
}
virtual void setProgramName(char* name){};
virtual void getProgramName(char* name)
{
*name = 0;
}
virtual void getParameterLabel(VstInt32 index, char* label){};
virtual void getParameterDisplay(VstInt32 index, char* text){};
virtual void getParameterName(VstInt32 index, char* text){};
virtual void setSampleRate(float newSamplerate){};
virtual void setBlockSize(VstInt32 newBlockSize){};
virtual void suspend(){};
virtual void resume(){};
virtual VstInt32 getChunk(void** data, bool isPreset = false)
{
return 0;
}
virtual VstInt32 setChunk(void* data, VstInt32 byteSize, bool isPreset = false)
{
return 0;
}
// Defined by Implementation
protected: // Needs to be accessible by AudioEffectX
AEffect cEffect; // vst2wrapper requires this.
audioMasterCallback audioMaster; // vst2wrapper requires this.
VstInt32 numPrograms;
VstInt32 curProgram;
AEffEditor* editor;
};
-220
View File
@@ -1,220 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "audioeffectx.hpp"
#include "vstkey.h"
AudioEffectX::AudioEffectX(audioMasterCallback audioMaster, VstInt32 __unk00, VstInt32 __unk01) : AudioEffect(audioMaster, __unk00, __unk01)
{
cEffect.processDoubleReplacing = [](AEffect* self, double** inputs, double** outputs, VstInt32 sampleFrames) { return reinterpret_cast<AudioEffectX*>(self->effect_data)->processDoubleReplacing(inputs, outputs, sampleFrames); };
}
AudioEffectX::~AudioEffectX() {}
VstIntPtr AudioEffectX::control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value)
{
switch (opcode) {
case audioEffectProcessEvents:
return processEvents((VstEvents*)ptr);
case audioEffectIsParameterAutomatable:
return canParameterBeAutomated(param1) ? 1 : 0;
case audioEffectConvertStringToParameter:
return string2parameter(param1, (char*)ptr) ? 1 : 0;
case audioEffectGetProgramNameIndexed:
return getProgramNameIndexed(static_cast<VstInt32>(value), param1, (char*)ptr) ? 1 : 0;
case audioEffectGetInputProperties:
return getInputProperties(param1, (VstPinProperties*)ptr);
case audioEffectGetOutputProperties:
return getOutputProperties(param1, (VstPinProperties*)ptr);
case audioEffectGetPlugCategory:
return (VstIntPtr)getPlugCategory();
case audioEffectSetSpeakerArrangement:
return setSpeakerArrangement((VstSpeakerArrangement*)param2, (VstSpeakerArrangement*)ptr);
case audioEffectBypass:
return setBypass(!!param2) ? 1 : 0;
case audioEffectGetEffectName:
return getEffectName((char*)ptr) ? 1 : 0;
case audioEffectGetVendorString:
return getVendorString((char*)ptr) ? 1 : 0;
case audioEffectGetProductString:
return getProductString((char*)ptr) ? 1 : 0;
case audioEffectGetVendorVersion:
return getVendorVersion();
case audioEffectVendorSpecific:
return vendorSpecific(param1, param2, ptr, value);
case audioEffectCanDo:
return canDo((char*)ptr);
case audioEffectGetTailSize:
return getGetTailSize();
case audioEffectGetParameterProperties:
return getParameterProperties(param1, (VstParameterProperties*)ptr) ? 1 : 0;
case audioEffectGetVSTVersion:
return cEffect.version;
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2100)
case audioEffectEditorKeyDown:
if (editor) {
VstKeyCode keycode{.character = param1, .virt = static_cast<unsigned char>(param2), .modifier = static_cast<unsigned char>(value)};
editor->onKeyDown(keycode);
}
return 0;
case audioEffectEditorKeyUp:
if (editor) {
VstKeyCode keycode{.character = param1, .virt = static_cast<unsigned char>(param2), .modifier = static_cast<unsigned char>(value)};
editor->onKeyUp(keycode);
}
return 0;
case audioEffectEditorKnobMode:
if (editor) {
editor->setKnobMode(param2) ? 1 : 0;
}
return 0;
case audioEffectMidiGetProgramName:
return getMidiProgramName(param1, (MidiProgramName*)ptr);
case audioEffectMidiGetCurrentProgram:
return getCurrentMidiProgram(param1, (MidiProgramName*)ptr);
case audioEffectMidiGetProgramCategory:
return getMidiProgramCategory(param1, (MidiProgramCategory*)ptr);
case audioEffectMidiHasProgramsChanged:
return hasMidiProgramsChanged(param1) ? 1 : 0;
case audioEffectMidiGetKeyName:
return getMidiKeyName(param1, (MidiKeyName*)ptr) ? 1 : 0;
#endif
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2300)
case audioEffectGetSpeakerArrangement:
return getSpeakerArrangement((VstSpeakerArrangement**)param2, (VstSpeakerArrangement**)ptr);
case audioEffectStartProcessing:
return startProcess();
case audioEffectStopProcessing:
return stopProcess();
#endif
#if (!defined VST_VERSION_SUPPORT) || (VST_VERSION_SUPPORT >= kVstVersion_2400)
case audioEffectSetProcessingPrecision:
return setProcessPrecision(param1) ? 1 : 0;
case audioEffectMidiGetNumInputChannels:
return getNumMidiInputChannels();
case audioEffectMidiGetNumOutputChannels:
return getNumMidiOutputChannels();
#endif
default:
return AudioEffect::control(opcode, param1, param2, ptr, value);
}
}
VstInt32 AudioEffectX::canHostDo(char* text)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterCanDo, 0, 0, text, 0);
return false;
}
bool AudioEffectX::beginEdit(VstInt32 paramIndex)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterBeginEdit, paramIndex, 0, 0, 0);
return false;
}
bool AudioEffectX::endEdit(VstInt32 paramIndex)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterEndEdit, paramIndex, 0, 0, 0);
return false;
}
bool AudioEffectX::ioChanged()
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterIOChanged, 0, 0, 0, 0);
return false;
}
bool AudioEffectX::updateDisplay()
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterUpdateDisplay, 0, 0, 0, 0);
return false;
}
bool AudioEffectX::sizeWindow(VstInt32 width, VstInt32 height)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterSizeWindow, width, height, 0, 0);
return false;
}
VstInt32 AudioEffectX::getCurrentProcessLevel()
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterGetCurrentProcessLevel, 0, 0, 0, 0);
return 0;
}
bool AudioEffectX::getHostVendorString(char* text)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterGetVendorString, 0, 0, text, 0);
return false;
}
bool AudioEffectX::getHostProductString(char* text)
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterGetProductString, 0, 0, text, 0);
return false;
}
VstInt32 AudioEffectX::getHostVendorVersion()
{
if (audioMaster)
return !!audioMaster(getAeffect(), audioMasterGetVendorVersion, 0, 0, 0, 0);
return 0;
}
void AudioEffectX::canDoubleReplacing(bool value)
{
if (value)
cEffect.flags |= AEffectFlagCanDoubleReplacing;
else
cEffect.flags &= ~AEffectFlagCanDoubleReplacing;
}
void AudioEffectX::noTail(bool value)
{
if (value)
cEffect.flags |= AEffectFlagIsSilentOnSilence;
else
cEffect.flags &= ~AEffectFlagIsSilentOnSilence;
}
VstTimeInfo* AudioEffectX::getTimeInfo(VstInt32 filter)
{
if (audioMaster) {
auto ptr = audioMaster(getAeffect(), audioMasterGetTimeInfo, 0, filter, 0, 0);
// Returned value should be a pointer to a VstTimeInfo.
return reinterpret_cast<VstTimeInfo*>(ptr);
}
return 0;
}
bool AudioEffectX::sendVstEventsToHost(VstEvents* events)
{
if (audioMaster) {
audioMaster(getAeffect(), audioMasterProcessEvents, 0, 0, events, 0);
}
return 0;
}
-23
View File
@@ -1,23 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This is based on the publicly available VST 3.x SDK "vst2wrapper" files. All content is as such licensed under the BSD 3-Clause license provided in those files, and also shown above.
*
* Assume that everything here is guesswork. It seems to work, but is largely unconfirmed.
*/
#pragma once
#include "audioeffectx.hpp"
-167
View File
@@ -1,167 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "aeffectx.h"
#include "audioeffect.hpp"
#include "vstmidi.h"
#include "vstpin.h"
#include "vstspeaker.h"
#include "vsttypes.h"
class AudioEffectX : public AudioEffect {
public:
AudioEffectX(audioMasterCallback audioMaster, VstInt32 __unk00, VstInt32 __unk01);
virtual ~AudioEffectX();
protected:
// Internal
virtual VstIntPtr control(VstInt32 opcode, VstInt32 param1, VstIntPtr param2, void* ptr, float value) override;
public:
// AEffect/AEffectX
virtual void canDoubleReplacing(bool value);
virtual void noTail(bool value);
virtual void processDoubleReplacing(double** inputs, double** outputs, VstInt32 sampleFrames){};
// Audio Master (sorted by AEffectMasterOpCodes)
virtual VstTimeInfo* getTimeInfo(VstInt32 filter);
virtual bool sendVstEventsToHost(VstEvents* events);
virtual bool ioChanged();
virtual bool sizeWindow(VstInt32 width, VstInt32 height);
virtual VstInt32 getCurrentProcessLevel();
virtual bool getHostVendorString(char* text);
virtual bool getHostProductString(char* text);
virtual VstInt32 getHostVendorVersion();
virtual VstInt32 canHostDo(char* text);
virtual bool beginEdit(VstInt32 paramIndex);
virtual bool endEdit(VstInt32 paramIndex);
virtual bool updateDisplay();
// Audio Plugin (sorted by AEffectOpCodes)
virtual VstInt32 processEvents(VstEvents* events)
{
return 0;
}
virtual bool canParameterBeAutomated(VstInt32 index)
{
return false;
}
virtual bool string2parameter(VstInt32 index, char* text)
{
return false;
}
virtual bool getProgramNameIndexed(VstInt32 category, VstInt32 index, char* text)
{
return false;
}
virtual bool getInputProperties(VstInt32 index, VstPinProperties* properties)
{
return false;
}
virtual bool getOutputProperties(VstInt32 index, VstPinProperties* properties)
{
return false;
}
virtual VstPlugCategory getPlugCategory()
{
return kPlugCategUnknown;
}
virtual bool setSpeakerArrangement(VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput)
{
return false;
}
virtual bool setBypass(bool onOff)
{
return false;
}
virtual bool getEffectName(char* name)
{
return false;
}
virtual bool getVendorString(char* text)
{
return false;
}
virtual bool getProductString(char* text)
{
return false;
}
virtual VstInt32 getVendorVersion()
{
return 0;
}
virtual VstIntPtr vendorSpecific(VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg)
{
return 0;
}
virtual VstInt32 canDo(char* text)
{
return 0;
}
virtual VstInt32 getGetTailSize()
{
return 0;
}
virtual bool getParameterProperties(VstInt32 index, VstParameterProperties* p)
{
return false;
}
virtual VstInt32 getMidiProgramName(VstInt32 channel, MidiProgramName* midiProgramName)
{
return 0;
}
virtual VstInt32 getCurrentMidiProgram(VstInt32 channel, MidiProgramName* currentProgram)
{
return 0;
}
virtual VstInt32 getMidiProgramCategory(VstInt32 channel, MidiProgramCategory* category)
{
return 0;
}
virtual bool hasMidiProgramsChanged(VstInt32 channel)
{
return false;
}
virtual bool getMidiKeyName(VstInt32 channel, MidiKeyName* keyName)
{
return false;
}
virtual bool getSpeakerArrangement(VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput)
{
return false;
}
virtual VstInt32 startProcess()
{
return 0;
}
virtual VstInt32 stopProcess()
{
return 0;
}
virtual bool setProcessPrecision(VstInt32 precision)
{
return false;
}
virtual VstInt32 getNumMidiInputChannels()
{
return 0;
}
virtual VstInt32 getNumMidiOutputChannels()
{
return 0;
}
};
-40
View File
@@ -1,40 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstEventTypes {
kVstMidiType = 1,
kVstSysExType = 6,
};
struct VstEvent {
VstInt32 type;
VstInt32 byteSize;
VstInt32 deltaFrames;
VstInt32 flags;
// ? bytes
};
struct VstEvents {
VstInt32 numEvents;
VstInt32 reserved;
VstEvent* events[2];
};
#pragma pack(pop)
-100
View File
@@ -1,100 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vsttypes.h"
// vstgui4 has a perfect implementation of this just lying around.
#pragma pack(push, 8)
enum VstModifierKey {
MODIFIER_SHIFT = 1 << 0, // Shift
MODIFIER_ALTERNATE = 1 << 1, // Alt
MODIFIER_COMMAND = 1 << 2, // Control on Mac
MODIFIER_CONTROL = 1 << 3 // Ctrl on PC, Apple on Mac
};
enum VstVirtualKey {
VKEY_BACK = 1,
VKEY_TAB,
VKEY_CLEAR,
VKEY_RETURN,
VKEY_PAUSE,
VKEY_ESCAPE,
VKEY_SPACE,
VKEY_NEXT,
VKEY_END,
VKEY_HOME,
VKEY_LEFT,
VKEY_UP,
VKEY_RIGHT,
VKEY_DOWN,
VKEY_PAGEUP,
VKEY_PAGEDOWN,
VKEY_SELECT,
VKEY_PRINT,
VKEY_ENTER,
VKEY_SNAPSHOT,
VKEY_INSERT,
VKEY_DELETE,
VKEY_HELP,
VKEY_NUMPAD0,
VKEY_NUMPAD1,
VKEY_NUMPAD2,
VKEY_NUMPAD3,
VKEY_NUMPAD4,
VKEY_NUMPAD5,
VKEY_NUMPAD6,
VKEY_NUMPAD7,
VKEY_NUMPAD8,
VKEY_NUMPAD9,
VKEY_MULTIPLY,
VKEY_ADD,
VKEY_SEPARATOR,
VKEY_SUBTRACT,
VKEY_DECIMAL,
VKEY_DIVIDE,
VKEY_F1,
VKEY_F2,
VKEY_F3,
VKEY_F4,
VKEY_F5,
VKEY_F6,
VKEY_F7,
VKEY_F8,
VKEY_F9,
VKEY_F10,
VKEY_F11,
VKEY_F12,
VKEY_NUMLOCK,
VKEY_SCROLL,
VKEY_SHIFT,
VKEY_CONTROL,
VKEY_ALT,
VKEY_EQUALS
};
struct VstKeyCode {
VstInt32 character;
unsigned char virt; // see enum VstVirtualKey
unsigned char modifier; // see enum VstModifierKey
};
#pragma pack(pop)
-69
View File
@@ -1,69 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vsttypes.h"
#include "vstversion.h"
#pragma pack(push, 8)
enum VstMidiEventFlags {
kVstMidiEventIsRealtime,
};
struct VstMidiEvent : VstEvent {
VstInt32 noteLength;
VstInt32 noteOffset;
char midiData[4];
char detune;
char noteOffVelocity;
char __unk00;
char __unk01;
};
struct VstMidiSysexEvent : VstEvent {
VstInt32 dumpBytes;
VstIntPtr __unk00;
char* sysexDump;
VstIntPtr __unk01;
};
struct MidiKeyName {
VstInt32 thisProgramIndex;
VstInt32 thisKeyNumber;
char keyName[kVstMaxNameLen];
VstInt32 __unk00;
VstInt32 __unk01;
};
struct MidiProgramName {
VstInt32 thisProgramIndex;
char name[kVstMaxNameLen];
VstInt32 midiProgram; // Could be swapped with thisProgramIndex?
VstInt32 midiBankMsb;
VstInt32 midiBankLsb;
VstInt32 __unk01;
VstInt32 parentCategoryIndex; // -1 appears to mean no category.
VstInt32 flags;
};
struct MidiProgramCategory {
VstInt32 thisCategoryIndex;
char name[kVstMaxNameLen]; // Name guessed, but might be wrong. Doesn't seem to be used.
VstInt32 parentCategoryIndex;
VstInt32 flags;
};
#pragma pack(pop)
-48
View File
@@ -1,48 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstParameterFlags {
kVstParameterIsSwitch = 1,
kVstParameterUsesIntegerMinMax = 2,
kVstParameterCanRamp = 7,
};
struct VstParameterProperties {
float __unk00;
float __unk01;
float __unk02;
char label[64];
VstInt32 flags;
VstInt32 minInteger;
VstInt32 maxInteger;
VstInt32 __unk03;
VstInt32 __unk04;
char shortLabel[8];
// There's more after this, but it's not used?
// We know what they're for (see vst.h), but they don't appear anywhere.
VstInt16 __unk05; // Order/Index for display. Starts at 0.
VstInt16 __unk06; // Category Index, 0 for none, 1+ for category.
VstInt16 __unk07; // Number of parameters in this category
VstInt16 __unk08; // Know absolutely nothing about this one.
char __unk09[24]; // Category Label. We know the size here, and what it is.
char __unk10[16]; // Always exists, not sure why. May be padding.
};
#pragma pack(pop)
-36
View File
@@ -1,36 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstPinFlags {
kVstPinIsActive,
kVstPinUseSpeaker,
kVstPinIsStereo,
};
struct VstPinProperties {
char label[kVstMaxLabelLen];
VstInt32 flags;
VstInt32 arrangementType;
char shortLabel;
// ? bytes
};
#pragma pack(pop)
-97
View File
@@ -1,97 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstSpeakerArrangmentType { // Name adapted from vst.h
kSpeakerArrUserDefined = -2,
kSpeakerArr__unk01 = -1,
// Taken from: VstInt32 Vst2Wrapper::vst3ToVst2SpeakerArr
kSpeakerArrMono = 0,
kSpeakerArrStereo,
kSpeakerArrStereoSurround,
kSpeakerArrStereoCenter,
kSpeakerArrStereoSide,
kSpeakerArrStereoCLfe,
kSpeakerArr30Cine,
kSpeakerArr30Music,
kSpeakerArr31Cine,
kSpeakerArr31Music,
kSpeakerArr40Cine,
kSpeakerArr40Music,
kSpeakerArr41Cine,
kSpeakerArr41Music,
kSpeakerArr50,
kSpeakerArr51,
kSpeakerArr60Cine,
kSpeakerArr60Music,
kSpeakerArr61Cine,
kSpeakerArr61Music,
kSpeakerArr70Cine,
kSpeakerArr70Music,
kSpeakerArr71Cine,
kSpeakerArr71Music,
kSpeakerArr80Cine,
kSpeakerArr80Music,
kSpeakerArr81Cine,
kSpeakerArr81Music,
kSpeakerArr102,
};
enum VstSpeakerType { // Name adapted from vst.h
// Taken from VstInt32 Vst2Wrapper::vst3ToVst2Speaker (Vst::Speaker vst3Speaker)
kSpeakerUndefined = INT32_MAX, // Weirdest one to figure out. Why not -1?
kSpeakerM = 0,
kSpeakerL,
kSpeakerR,
kSpeakerC,
kSpeakerLfe,
kSpeakerLs,
kSpeakerRs,
kSpeakerLc,
kSpeakerRc,
kSpeakerS,
kSpeakerSl,
kSpeakerSr,
kSpeakerTm,
kSpeakerTfl,
kSpeakerTfc,
kSpeakerTfr,
kSpeakerTrl,
kSpeakerTrc,
kSpeakerTrr,
kSpeakerLfe2,
};
struct VstSpeakerProperties {
float __unk00;
float __unk01;
float __unk02;
float __unk03;
char name[64];
VstInt32 type; // VstSpeakerType, see vst.h
char __unk04[28];
};
struct VstSpeakerArrangement {
VstInt32 type; // VstSpeakerArrangmentType, see vst.h
VstInt32 numChannels;
VstSpeakerProperties speakers[32]; // See vst.h. I don't know if this size is correct.
};
#pragma pack(pop)
-54
View File
@@ -1,54 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vsttypes.h"
#pragma pack(push, 8)
enum VstSMPTEFrameRate {
// Taken from: void Vst2Wrapper::setupProcessTimeInfo ()
kVstSmpte24fps = 0,
kVstSmpte25fps = 1,
kVstSmpte2997fps = 2,
kVstSmpte30fps = 3,
kVstSmpte2997dfps = 4,
kVstSmpte30dfps = 5,
kVstSmpteFilm16mm = 6,
kVstSmpteFilm35mm = 7,
kVstSmpte239fps = 9,
kVstSmpte249fps = 10,
kVstSmpte599fps = 11,
kVstSmpte60fps = 12,
};
struct VstTimeInfo {
double samplePos;
double sampleRate;
double nanoSeconds;
double ppqPos;
double tempo;
double barStartPos;
double cycleStartPos;
double cycleEndPos;
VstInt32 timeSigNumerator;
VstInt32 timeSigDenominator;
VstInt32 smpteOffset;
VstInt32 smpteFrameRate;
VstInt32 samplesToNextClock;
VstInt32 flags;
};
#pragma pack(pop)
-53
View File
@@ -1,53 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#ifdef __cplusplus
#include <cinttypes>
#else
#include <inttypes.h>
#endif
#define VstFunctionAPI __cdecl
enum VstMaxLengths { // Anything with k is an enum?
kVstMaxNameLen = 64,
kVstMaxLabelLen = 64,
kVstMaxShortLabelLen = 8,
kVstExtMaxParamStrLen = 32, // Apparently incorrect, but actually in use by many hosts.
kVstMaxParamStrLen = 8,
kVstMaxProgNameLen = 24,
kVstMaxVendorStrLen = 64,
kVstMaxEffectNameLen = 32,
};
// 16-bit wide Integer
typedef int16_t VstInt16;
// 32-bit wide Integer
typedef int32_t VstInt32;
// Variable size Integer Pointer
typedef intptr_t VstIntPtr;
// Float and double are used as-is. No custom type name here.
// Bus Direction. Appears to be int32_t
typedef int32_t BusDirection;
// Rectangle
struct ERect {
VstInt16 left, top, right, bottom;
};
-28
View File
@@ -1,28 +0,0 @@
/*
* Copyright 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
* Copyright 2024 Steinberg Media Technologies GmbH
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
enum VstVersion {
kVstVersion_0 = 0, // Anything before 2.0, rarely used.
kVstVersion_1000 = 1000, // 1.0
kVstVersion_1100 = 1100, // 1.1
kVstVersion_2 = 2, // 2.0, rarely used.
kVstVersion_2000 = 2000, // 2.0
kVstVersion_2100 = 2100, // 2.1
kVstVersion_2200 = 2200, // 2.2
kVstVersion_2300 = 2300, // 2.3
kVstVersion_2400 = 2400, // 2.4
};