Initial release

This commit is contained in:
civ
2026-08-16 18:24:52 +07:00
commit 876886a39a
13244 changed files with 2353959 additions and 0 deletions
@@ -0,0 +1 @@
build/
@@ -0,0 +1,114 @@
cmake_minimum_required(VERSION 3.14.0)
option(SMTG_ENABLE_VST3_PLUGIN_EXAMPLES "Enable VST 3 Plug-in Examples" OFF)
option(SMTG_ENABLE_VST3_HOSTING_EXAMPLES "Enable VST 3 Hosting Examples" OFF)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13 CACHE STRING "")
set(vst3sdk_SOURCE_DIR "../../")
if(NOT vst3sdk_SOURCE_DIR)
message(FATAL_ERROR "Path to VST3 SDK is empty!")
endif()
project(VST3_AU_PlugIn
# This is your plug-in version number. Change it here only.
# Version number symbols usable in C++ can be found in
# source/version.h and ${PROJECT_BINARY_DIR}/projectversion.h.
VERSION 1.2.1.8
DESCRIPTION "VST3_AU_PlugIn VST 3 Plug-in"
)
# -- AudioUnitSDK --
include(FetchContent)
FetchContent_Declare(
AudioUnitSDK
GIT_REPOSITORY https://github.com/apple/AudioUnitSDK.git
GIT_TAG HEAD
)
FetchContent_MakeAvailable(AudioUnitSDK)
FetchContent_GetProperties(
AudioUnitSDK
SOURCE_DIR SMTG_AUDIOUNIT_SDK_PATH
)
# -------------------
set(SMTG_VSTGUI_ROOT "${vst3sdk_SOURCE_DIR}")
add_subdirectory(${vst3sdk_SOURCE_DIR} ${PROJECT_BINARY_DIR}/vst3sdk)
smtg_enable_vst3_sdk()
smtg_add_vst3plugin(VST3_AU_PlugIn
source/version.h
source/cids.h
source/processor.h
source/processor.cpp
source/controller.h
source/controller.cpp
source/entry.cpp
)
#- VSTGUI Wanted ----
if(SMTG_ENABLE_VSTGUI_SUPPORT)
target_sources(VST3_AU_PlugIn
PRIVATE
resource/editor.uidesc
)
target_link_libraries(VST3_AU_PlugIn
PRIVATE
vstgui_support
)
smtg_target_add_plugin_resources(VST3_AU_PlugIn
RESOURCES
"resource/editor.uidesc"
)
endif(SMTG_ENABLE_VSTGUI_SUPPORT)
# -------------------
smtg_target_add_plugin_snapshots (VST3_AU_PlugIn
RESOURCES
resource/301DF339AFA3533FB5053B1B41367137_snapshot.png
resource/301DF339AFA3533FB5053B1B41367137_snapshot_2.0x.png
)
target_link_libraries(VST3_AU_PlugIn
PRIVATE
sdk
)
smtg_target_configure_version_file(VST3_AU_PlugIn)
if(SMTG_MAC)
smtg_target_set_bundle(VST3_AU_PlugIn
BUNDLE_IDENTIFIER com.steinberg.vst3sdk.audiounit-tutorial
COMPANY_NAME "Steinberg Media Technologies"
)
smtg_target_set_debug_executable(VST3_AU_PlugIn
"/Applications/VST3PluginTestHost.app"
"--pluginfolder;$(BUILT_PRODUCTS_DIR)"
)
elseif(SMTG_WIN)
target_sources(VST3_AU_PlugIn PRIVATE
resource/win32resource.rc
)
if(MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT VST3_AU_PlugIn)
smtg_target_set_debug_executable(VST3_AU_PlugIn
"$(ProgramW6432)/Steinberg/VST3PluginTestHost/VST3PluginTestHost.exe"
"--pluginfolder \"$(OutDir)/\""
)
endif()
endif(SMTG_MAC)
# -- Add the AUv2 target
if (SMTG_MAC AND XCODE AND SMTG_ENABLE_AUV2_BUILDS)
list(APPEND CMAKE_MODULE_PATH "${vst3sdk_SOURCE_DIR}/cmake/modules")
include(SMTG_AddVST3AuV2)
smtg_target_add_auv2(VST3_AU_PlugIn_AU
BUNDLE_NAME audiounit_tutorial
BUNDLE_IDENTIFIER com.steinberg.vst3sdk.audiounit_tutorial.audiounit
INFO_PLIST_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/resource/au-info.plist
VST3_PLUGIN_TARGET VST3_AU_PlugIn)
smtg_target_set_debug_executable(VST3_AU_PlugIn_AU "/Applications/Reaper.app")
endif(SMTG_MAC AND XCODE AND SMTG_ENABLE_AUV2_BUILDS)
@@ -0,0 +1,141 @@
# AudioUnit Version 2 Tutorial
In this tutorial you will learn how to add AudioUnit Version 2 support to your **VST 3** plug-in.
First of all, you need a **VST 3** plug-in project. For this tutorial we have generated one via the [VST 3 Project Generator](https://steinbergmedia.github.io/vst3_dev_portal/pages/What+is+the+VST+3+SDK/Project+Generator.html) from the SDK.
# Adding the AudioUnit Version 2 Target
## Obtaining the required AudioUnit SDK
The *AudioUnit Version 2* target needs the official *AudioUnit SDK* from Apple.
As of this writing you can find it on GitHub: [https://github.com/apple/AudioUnitSDK](https://github.com/apple/AudioUnitSDK)
How you obtain and store the SDK is up to you, for the reproducibility of this tutorial, we will download it via *CMake* when generating the project.
So we add the following text to the *CMakeLists.txt* directly before we include the **VST 3 SDK**.
```
include(FetchContent)
FetchContent_Declare(
AudioUnitSDK
GIT_REPOSITORY https://github.com/apple/AudioUnitSDK.git
GIT_TAG HEAD
)
FetchContent_MakeAvailable(AudioUnitSDK)
FetchContent_GetProperties(
AudioUnitSDK
SOURCE_DIR SMTG_AUDIOUNIT_SDK_PATH
)
```
It is important to set the `SMTG_AUDIOUNIT_SDK_PATH` variable to tell the **VST 3 SDK** where to find the AudioUnit SDK.
## Creating the property list
For *AudioUnit Version 2* you need a manufacturer OSType registered with Apple.
How to do this is out of the scope for this tutorial, please search the web on how this is done.
Besides the manufacturer OSType you also need a subtype OSType which you can choose by yourself.
Both the manufacturer and subtype account for the uniqueness of your *AudioUnit Version 2*.
Now you can generate the required property list file:
```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CSResourcesFileMapped</key>
<string>yes</string>
<key>AudioComponents</key>
<array>
<dict>
<key>factoryFunction</key>
<string>AUWrapperFactory</string>
<key>description</key>
<string>AudioUnit Tutorial</string>
<key>manufacturer</key>
<string>Stgb</string>
<key>name</key>
<string>Steinberg: AudioUnit Tutorial</string>
<key>subtype</key>
<string>0002</string>
<key>type</key>
<string>aufx</string>
<key>version</key>
<integer>1</integer>
</dict>
</array>
</dict>
</plist>
```
Make sure to change the strings for `description`, `manufacturer`, `name`, `subtype` and `type`.
The type must be one of:
- aufx (Audio Effect)
- aumu (Instrument)
- aumf (Audio Effect with MIDI Input/Output)
If you build an audio effect you also need to add the supported channel layouts to the list:
```
<key>AudioUnit SupportedNumChannels</key>
<array>
<dict>
<key>Outputs</key>
<string>2</string>
<key>Inputs</key>
<string>2</string>
</dict>
<dict>
<key>Outputs</key>
<string>2</string>
<key>Inputs</key>
<string>1</string>
</dict>
<dict>
<key>Outputs</key>
<string>1</string>
<key>Inputs</key>
<string>1</string>
</dict>
</array>
```
Save it to a file called `au-info.plist` inside the resource directory.
## Adding the AudioUnit Version 2 Target
Now you can add the AudioUnit target to the end of your *CMakeLists.txt* file:
```
if (SMTG_MAC AND XCODE AND SMTG_COREAUDIO_SDK_PATH)
list(APPEND CMAKE_MODULE_PATH "${vst3sdk_SOURCE_DIR}/cmake/modules")
include(SMTG_AddVST3AuV2)
smtg_target_add_auv2(VST3_AU_PlugIn_AU
BUNDLE_NAME audiounit_tutorial
BUNDLE_IDENTIFIER com.steinberg.vst3sdk.audiounit_tutorial.audiounit
INFO_PLIST_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/resource/au-info.plist
VST3_PLUGIN_TARGET VST3_AU_PlugIn)
smtg_target_set_debug_executable(VST3_AU_PlugIn_AU "/Applications/Reaper.app")
endif(SMTG_MAC AND XCODE AND SMTG_COREAUDIO_SDK_PATH)
```
Now after generating and building the project the "audiounit_tutorial" plug-in should be available in
any AudioUnit host.
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CSResourcesFileMapped</key>
<string>yes</string>
<key>AudioComponents</key>
<array>
<dict>
<key>factoryFunction</key>
<string>AUWrapperFactory</string>
<key>description</key>
<string>AudioUnit Tutorial</string>
<key>manufacturer</key>
<string>Stgb</string>
<key>name</key>
<string>Steinberg: AudioUnit Tutorial</string>
<key>subtype</key>
<string>0002</string>
<key>type</key>
<string>aufx</string>
<key>version</key>
<integer>1</integer>
</dict>
</array>
<key>AudioUnit SupportedNumChannels</key>
<array>
<dict>
<key>Outputs</key>
<string>2</string>
<key>Inputs</key>
<string>2</string>
</dict>
<dict>
<key>Outputs</key>
<string>2</string>
<key>Inputs</key>
<string>1</string>
</dict>
<dict>
<key>Outputs</key>
<string>1</string>
<key>Inputs</key>
<string>1</string>
</dict>
</array>
</dict>
</plist>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<vstgui-ui-description version="1">
<fonts>
</fonts>
<colors>
</colors>
<template background-color="~ BlackCColor" background-color-draw-style="filled and stroked" class="CViewContainer" mouse-enabled="true" name="view" opacity="1" origin="0, 0" size="300, 300" transparent="false" wants-focus="false"/>
<bitmaps/>
</vstgui-ui-description>
@@ -0,0 +1,44 @@
#include <windows.h>
#include "../source/version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Version
/////////////////////////////////////////////////////////////////////////////
VS_VERSION_INFO VERSIONINFO
FILEVERSION MAJOR_VERSION_INT,SUB_VERSION_INT,RELEASE_NUMBER_INT,BUILD_NUMBER_INT
PRODUCTVERSION MAJOR_VERSION_INT,SUB_VERSION_INT,RELEASE_NUMBER_INT,BUILD_NUMBER_INT
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040004e4"
BEGIN
VALUE "FileVersion", FULL_VERSION_STR"\0"
VALUE "ProductVersion", FULL_VERSION_STR"\0"
VALUE "OriginalFilename", stringOriginalFilename"\0"
VALUE "FileDescription", stringFileDescription"\0"
VALUE "InternalName", stringFileDescription"\0"
VALUE "ProductName", stringFileDescription"\0"
VALUE "CompanyName", stringCompanyName"\0"
VALUE "LegalCopyright", stringLegalCopyright"\0"
VALUE "LegalTrademarks", stringLegalTrademarks"\0"
//VALUE "PrivateBuild", " \0"
//VALUE "SpecialBuild", " \0"
//VALUE "Comments", " \0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x400, 1252
END
END
@@ -0,0 +1,18 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#pragma once
#include "pluginterfaces/base/funknown.h"
#include "pluginterfaces/vst/vsttypes.h"
namespace Steinberg::Vst {
//------------------------------------------------------------------------
static const Steinberg::FUID kVST3AUPlugInProcessorUID (0x301DF339, 0xAFA3533F, 0xB5053B1B, 0x41367137);
static const Steinberg::FUID kVST3AUPlugInControllerUID (0x473E512F, 0x68875B49, 0xB2EEFB2D, 0x886C33C6);
#define VST3AUPlugInVST3Category "Fx"
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,82 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#include "controller.h"
#include "cids.h"
#include "vstgui/plugin-bindings/vst3editor.h"
using namespace Steinberg;
namespace Steinberg::Vst {
//------------------------------------------------------------------------
// VST3AUPlugInController Implementation
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::initialize (FUnknown* context)
{
// Here the Plug-in will be instantiated
//---do not forget to call parent ------
tresult result = EditControllerEx1::initialize (context);
if (result != kResultOk)
{
return result;
}
// Here you could register some parameters
return result;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::terminate ()
{
// Here the Plug-in will be de-instantiated, last possibility to remove some memory!
//---do not forget to call parent ------
return EditControllerEx1::terminate ();
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::setComponentState (IBStream* state)
{
// Here you get the state of the component (Processor part)
if (!state)
return kResultFalse;
return kResultOk;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::setState (IBStream* state)
{
// Here you get the state of the controller
return kResultTrue;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInController::getState (IBStream* state)
{
// Here you are asked to deliver the state of the controller (if needed)
// Note: the real state of your plug-in is saved in the processor
return kResultTrue;
}
//------------------------------------------------------------------------
IPlugView* PLUGIN_API VST3AUPlugInController::createView (FIDString name)
{
// Here the Host wants to open your editor (if you have one)
if (FIDStringsEqual (name, Vst::ViewType::kEditor))
{
// create your editor here and return a IPlugView ptr of it
auto* view = new VSTGUI::VST3Editor (this, "view", "editor.uidesc");
return view;
}
return nullptr;
}
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,49 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#pragma once
#include "public.sdk/source/vst/vsteditcontroller.h"
namespace Steinberg::Vst {
//------------------------------------------------------------------------
// VST3AUPlugInController
//------------------------------------------------------------------------
class VST3AUPlugInController : public Steinberg::Vst::EditControllerEx1
{
public:
//------------------------------------------------------------------------
VST3AUPlugInController () = default;
~VST3AUPlugInController () SMTG_OVERRIDE = default;
// Create function
static Steinberg::FUnknown* createInstance (void* /*context*/)
{
return (Steinberg::Vst::IEditController*)new VST3AUPlugInController;
}
//--- from IPluginBase -----------------------------------------------
Steinberg::tresult PLUGIN_API initialize (Steinberg::FUnknown* context) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API terminate () SMTG_OVERRIDE;
//--- from EditController --------------------------------------------
Steinberg::tresult PLUGIN_API setComponentState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::IPlugView* PLUGIN_API createView (Steinberg::FIDString name) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API setState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API getState (Steinberg::IBStream* state) SMTG_OVERRIDE;
//---Interface---------
DEFINE_INTERFACES
// Here you can add more supported VST3 interfaces
// DEF_INTERFACE (Vst::IXXX)
END_DEFINE_INTERFACES (EditController)
DELEGATE_REFCOUNT (EditController)
//------------------------------------------------------------------------
protected:
};
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,50 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#include "processor.h"
#include "controller.h"
#include "cids.h"
#include "version.h"
#include "public.sdk/source/main/pluginfactory.h"
#define stringPluginName "VST3 AU PlugIn"
using namespace Steinberg::Vst;
using namespace Steinberg::Vst;
//------------------------------------------------------------------------
// VST Plug-in Entry
//------------------------------------------------------------------------
BEGIN_FACTORY_DEF ("Steinberg Media Technologies",
"https://steinberg.net",
"mailto:info@steinberg.de")
//---First Plug-in included in this factory-------
// its kVstAudioEffectClass component
DEF_CLASS2 (INLINE_UID_FROM_FUID(kVST3AUPlugInProcessorUID),
PClassInfo::kManyInstances, // cardinality
kVstAudioEffectClass, // the component category (do not changed this)
stringPluginName, // here the Plug-in name (to be changed)
Vst::kDistributable, // means that component and controller could be distributed on different computers
VST3AUPlugInVST3Category, // Subcategory for this Plug-in (to be changed)
FULL_VERSION_STR, // Plug-in version (to be changed)
kVstVersionString, // the VST 3 SDK version (do not changed this, use always this define)
VST3AUPlugInProcessor::createInstance) // function pointer called when this component should be instantiated
// its kVstComponentControllerClass component
DEF_CLASS2 (INLINE_UID_FROM_FUID (kVST3AUPlugInControllerUID),
PClassInfo::kManyInstances, // cardinality
kVstComponentControllerClass,// the Controller category (do not changed this)
stringPluginName "Controller", // controller name (could be the same than component name)
0, // not used here
"", // not used here
FULL_VERSION_STR, // Plug-in version (to be changed)
kVstVersionString, // the VST 3 SDK version (do not changed this, use always this define)
VST3AUPlugInController::createInstance)// function pointer called when this component should be instantiated
//----for others Plug-ins contained in this factory, put like for the first Plug-in different DEF_CLASS2---
END_FACTORY
@@ -0,0 +1,180 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#include "processor.h"
#include "cids.h"
#include "base/source/fstreamer.h"
#include "pluginterfaces/vst/ivstparameterchanges.h"
using namespace Steinberg;
namespace Steinberg::Vst {
//------------------------------------------------------------------------
// VST3AUPlugInProcessor
//------------------------------------------------------------------------
VST3AUPlugInProcessor::VST3AUPlugInProcessor ()
{
//--- set the wanted controller for our processor
setControllerClass (kVST3AUPlugInControllerUID);
}
//------------------------------------------------------------------------
VST3AUPlugInProcessor::~VST3AUPlugInProcessor ()
{}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::initialize (FUnknown* context)
{
// Here the Plug-in will be instantiated
//---always initialize the parent-------
tresult result = AudioEffect::initialize (context);
// if everything Ok, continue
if (result != kResultOk)
{
return result;
}
//--- create Audio IO ------
addAudioInput (STR16 ("Stereo In"), Steinberg::Vst::SpeakerArr::kStereo);
addAudioOutput (STR16 ("Stereo Out"), Steinberg::Vst::SpeakerArr::kStereo);
/* If you don't need an event bus, you can remove the next line */
addEventInput (STR16 ("Event In"), 1);
return kResultOk;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::terminate ()
{
// Here the Plug-in will be de-instantiated, last possibility to remove some memory!
//---do not forget to call parent ------
return AudioEffect::terminate ();
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::setActive (TBool state)
{
//--- called when the Plug-in is enable/disable (On/Off) -----
return AudioEffect::setActive (state);
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::process (Vst::ProcessData& data)
{
//--- First : Read inputs parameter changes-----------
/*if (data.inputParameterChanges)
{
int32 numParamsChanged = data.inputParameterChanges->getParameterCount ();
for (int32 index = 0; index < numParamsChanged; index++)
{
if (auto* paramQueue = data.inputParameterChanges->getParameterData (index))
{
Vst::ParamValue value;
int32 sampleOffset;
int32 numPoints = paramQueue->getPointCount ();
switch (paramQueue->getParameterId ())
{
}
}
}
}*/
//--- Here you have to implement your processing
if (data.numSamples > 0)
{
//--- ------------------------------------------
// here as example a default implementation where we try to copy the inputs to the outputs:
// if less input than outputs then clear outputs
//--- ------------------------------------------
int32 minBus = std::min (data.numInputs, data.numOutputs);
for (int32 i = 0; i < minBus; i++)
{
int32 minChan = std::min (data.inputs[i].numChannels, data.outputs[i].numChannels);
for (int32 c = 0; c < minChan; c++)
{
// do not need to be copied if the buffers are the same
if (data.outputs[i].channelBuffers32[c] != data.inputs[i].channelBuffers32[c])
{
memcpy (data.outputs[i].channelBuffers32[c], data.inputs[i].channelBuffers32[c],
data.numSamples * sizeof (Vst::Sample32));
}
}
data.outputs[i].silenceFlags = data.inputs[i].silenceFlags;
// clear the remaining output buffers
for (int32 c = minChan; c < data.outputs[i].numChannels; c++)
{
// clear output buffers
memset (data.outputs[i].channelBuffers32[c], 0,
data.numSamples * sizeof (Vst::Sample32));
// inform the host that this channel is silent
data.outputs[i].silenceFlags |= ((uint64)1 << c);
}
}
// clear the remaining output buffers
for (int32 i = minBus; i < data.numOutputs; i++)
{
// clear output buffers
for (int32 c = 0; c < data.outputs[i].numChannels; c++)
{
memset (data.outputs[i].channelBuffers32[c], 0,
data.numSamples * sizeof (Vst::Sample32));
}
// inform the host that this bus is silent
data.outputs[i].silenceFlags = ((uint64)1 << data.outputs[i].numChannels) - 1;
}
}
return kResultOk;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::setupProcessing (Vst::ProcessSetup& newSetup)
{
//--- called before any processing ----
return AudioEffect::setupProcessing (newSetup);
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::canProcessSampleSize (int32 symbolicSampleSize)
{
// by default kSample32 is supported
if (symbolicSampleSize == Vst::kSample32)
return kResultTrue;
// disable the following comment if your processing support kSample64
/* if (symbolicSampleSize == Vst::kSample64)
return kResultTrue; */
return kResultFalse;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::setState (IBStream* state)
{
// called when we load a preset, the model has to be reloaded
IBStreamer streamer (state, kLittleEndian);
return kResultOk;
}
//------------------------------------------------------------------------
tresult PLUGIN_API VST3AUPlugInProcessor::getState (IBStream* state)
{
// here we need to save the model
IBStreamer streamer (state, kLittleEndian);
return kResultOk;
}
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,57 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#pragma once
#include "public.sdk/source/vst/vstaudioeffect.h"
namespace Steinberg::Vst {
//------------------------------------------------------------------------
// VST3AUPlugInProcessor
//------------------------------------------------------------------------
class VST3AUPlugInProcessor : public Steinberg::Vst::AudioEffect
{
public:
VST3AUPlugInProcessor ();
~VST3AUPlugInProcessor () SMTG_OVERRIDE;
// Create function
static Steinberg::FUnknown* createInstance (void* /*context*/)
{
return (Steinberg::Vst::IAudioProcessor*)new VST3AUPlugInProcessor;
}
//--- ---------------------------------------------------------------------
// AudioEffect overrides:
//--- ---------------------------------------------------------------------
/** Called at first after constructor */
Steinberg::tresult PLUGIN_API initialize (Steinberg::FUnknown* context) SMTG_OVERRIDE;
/** Called at the end before destructor */
Steinberg::tresult PLUGIN_API terminate () SMTG_OVERRIDE;
/** Switch the Plug-in on/off */
Steinberg::tresult PLUGIN_API setActive (Steinberg::TBool state) SMTG_OVERRIDE;
/** Will be called before any process call */
Steinberg::tresult PLUGIN_API setupProcessing (Steinberg::Vst::ProcessSetup& newSetup) SMTG_OVERRIDE;
/** Asks if a given sample size is supported see SymbolicSampleSizes. */
Steinberg::tresult PLUGIN_API canProcessSampleSize (Steinberg::int32 symbolicSampleSize) SMTG_OVERRIDE;
/** Here we go...the process call */
Steinberg::tresult PLUGIN_API process (Steinberg::Vst::ProcessData& data) SMTG_OVERRIDE;
/** For persistence */
Steinberg::tresult PLUGIN_API setState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API getState (Steinberg::IBStream* state) SMTG_OVERRIDE;
//------------------------------------------------------------------------
protected:
};
//------------------------------------------------------------------------
} // namespace Steinberg::Vst
@@ -0,0 +1,20 @@
//------------------------------------------------------------------------
// Copyright(c) 2024 Steinberg Media Technologies.
//------------------------------------------------------------------------
#pragma once
#include "pluginterfaces/base/fplatform.h"
// Plain project version file generated by cmake
#include "projectversion.h"
#define stringOriginalFilename "VST3 AU PlugIn.vst3"
#if SMTG_PLATFORM_64
#define stringFileDescription "VST3 AU PlugIn VST3 (64Bit)"
#else
#define stringFileDescription "VST3 AU PlugIn VST3"
#endif
#define stringCompanyName "Steinberg Media Technologies\0"
#define stringLegalCopyright "Copyright(c) 2024 Steinberg Media Technologies."
#define stringLegalTrademarks "VST is a trademark of Steinberg Media Technologies GmbH"