Giter VIP home page Giter VIP logo

vst3_public_sdk's Introduction

Welcome to VST 3 SDK public_sdk

Here are located:

  • helper classes implementing VST 3 Interfaces
  • samples of VST 3 Hosting and VST 3 plug-ins
  • AAX Wrapper
  • AU Wrapper
  • AUv3 Wrapper
  • InterAppAudio

License & Usage guidelines

More details are found at VST 3 SDK public_sdk License


Return to VST 3 SDK

vst3_public_sdk's People

Contributors

kxxt avatar rehans avatar scheffle avatar whydoubt avatar ygrabit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vst3_public_sdk's Issues

Can't make mda vsts reload their state under linux

Hello,

My loading code does the following:

  if (fx.component)
  {
    // First reload the processor state into the processor.
    {
      QDataStream str{m_savedProcessorState};
      Vst3DataStream stream{str};
      fx.component->setState(&stream);

      // Then into the controller
      if (fx.controller)
      {
        QDataStream str{m_savedProcessorState};
        Vst3DataStream stream{str};
        fx.controller->setComponentState(&stream);
      }
      m_savedProcessorState = {};
    }

    // Then reload the controller-specific data
    if (fx.controller)
    {
      if(!m_savedControllerState.isEmpty())
      {
        QDataStream str{m_savedControllerState};

        Vst3DataStream stream{str};

        fx.controller->setState(&stream);

        m_savedControllerState = {};
      }
    }
  }

and seems to work for most plug-ins, but not for the mda plug-ins that come with the SDK.
I put a breakpoint in fx.controller->setComponentState(&stream); and observe the following trace which leads to stuff not being reloaded:

1   VST3::(anonymous namespace)::loadProgram(const VST3::(anonymous namespace)::IO::BigEndianStream &, const VST3::Optional<int> &)       vst2persistence.cpp 
2   VST3::(anonymous namespace)::loadPrograms(Steinberg::IBStream &, VST3::Vst2xState::Programs &, const VST3::Optional<int> &)       vst2persistence.cpp
3   VST3::tryVst2StateLoad(Steinberg::IBStream&, VST3::Optional<int>)       vst2persistence.cpp 
4   Steinberg::Vst::mda::BaseController::setComponentState(Steinberg::IBStream *)       mdaBaseController.cpp 

e.g. in loadProgram it returns there:

Optional<VST3::Vst2xProgram> loadProgram (const IO::BigEndianStream& state,
                                          const Optional<int32_t>& vst2xUniqueID)
{
	Vst2xProgram program;
	int32_t id;
	if (!(state >> id))
		return {};
	if (id != cMagic)   // < here this condition fails, id == 0;
		return {};
    ...

I have no idea where to look ; I tried to disable the suspicious-looking SMTG_MDA_VST2_COMPATIBILITY macro but in that case the plug-ins stop loading altogether.

v3.7.5_build_44: ‘translateKeyMessage’ was not declared in this scope

When building sfizz with vst3sdk v3.7.5_build_44 I get:

[ 64%] Building CXX object src/CMakeFiles/sfizz_internal.dir/sfizz/modulations/sources/ADSREnvelope.cpp.o
cd /build/sfizz/src/build/src && /usr/bin/c++ -DGHC_FILESYSTEM_FWD -I/build/sfizz/src/sfizz-1.2.0/src/. -I/build/sfizz/src/sfizz-1.2.0/src/sfizz -I/build/sfizz/src/sfizz-1.2.0/external/filesystem/include -I/build/sfizz/src/sfizz-1.2.0/external/atomic_queue/include -I/build/sfizz/src/sfizz-1.2.0/src/sfizz/utility/spin_
mutex -I/build/sfizz/src/sfizz-1.2.0/src/sfizz/utility/bit_array -I/build/sfizz/src/sfizz-1.2.0/src/external/hiir -I/build/sfizz/src/sfizz-1.2.0/external/jsl/include -I/build/sfizz/src/sfizz-1.2.0/external/st_audiofile/src -I/build/sfizz/src/sfizz-1.2.0/src/external/spline -I/build/sfizz/src/sfizz-1.2.0/src/external/t
unings/include -I/build/sfizz/src/sfizz-1.2.0/src/external/kiss_fft -I/build/sfizz/src/sfizz-1.2.0/src/external/cpuid/src -I/build/sfizz/src/sfizz-1.2.0/external/threadpool -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clas
h-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wno-multichar -Werror=return-type -msse2 -ffast-math -fopenmp -std=gnu++17 -MD -MT src/CMakeFiles/sfizz_internal.dir/sfizz/modulations/sources/ADSREnvelope.cpp.o -MF CMakeFiles/sfizz_i
nternal.dir/sfizz/modulations/sources/ADSREnvelope.cpp.o.d -o CMakeFiles/sfizz_internal.dir/sfizz/modulations/sources/ADSREnvelope.cpp.o -c /build/sfizz/src/sfizz-1.2.0/src/sfizz/modulations/sources/ADSREnvelope.cpp
/build/sfizz/src/sfizz-1.2.0/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk/source/vst/vstguieditor.cpp:260:8: error: ‘KeyboardEvent’ does not name a type
  260 | static KeyboardEvent translateKeyMessage (char16 key, int16 keyMsg, int16 modifiers)
      |        ^~~~~~~~~~~~~
/build/sfizz/src/sfizz-1.2.0/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk/source/vst/vstguieditor.cpp: In member function ‘virtual Steinberg::tresult Steinberg::Vst::VSTGUIEditor::onKeyDown(Steinberg::char16, Steinberg::int16, Steinberg::int16)’:
/build/sfizz/src/sfizz-1.2.0/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk/source/vst/vstguieditor.cpp:295:21: error: ‘translateKeyMessage’ was not declared in this scope
  295 |                 if (translateKeyMessage (keyCode, key, keyMsg, modifiers))
      |                     ^~~~~~~~~~~~~~~~~~~
/build/sfizz/src/sfizz-1.2.0/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk/source/vst/vstguieditor.cpp: In member function ‘virtual Steinberg::tresult Steinberg::Vst::VSTGUIEditor::onKeyUp(Steinberg::char16, Steinberg::int16, Steinberg::int16)’:
/build/sfizz/src/sfizz-1.2.0/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk/source/vst/vstguieditor.cpp:319:21: error: ‘translateKeyMessage’ was not declared in this scope
  319 |                 if (translateKeyMessage (keyCode, key, keyMsg, modifiers))
      |                     ^~~~~~~~~~~~~~~~~~~

VST_SDK is not set by any cmake files, and causes issues

if(NOT VST_SDK)
target_sources(sdk_common
PRIVATE
source/common/pvaluecontainer.cpp
source/common/pvaluecontainer.h
)
endif(NOT VST_SDK)

Hi there,

I've been trying to get the vstsdk3 to build a custom plugin, and the complete lack of decent documentation makes this a challenge.

I get the following error:
[build] Cannot find source file: [build] [build] source/common/pvaluecontainer.cpp

Which is due to the above lines, because this file simply is not present in the repository, so this line looks to be an error with the library configuration. Where is this file? Why is it referenced when it doesn't exist?

If I add:
set(VST_SDK on)

to my build, it gets further, failing on:
[build] LINK : fatal error LNK1181: cannot open input file 'pluginterfaces.lib'

Is anyone else having these issues? Is there any decent documentation for the api for someone getting started with it that FULLY explains how to use it?

regards,
etheory

3.7.1_build_50 fails to build due to vstvalidator

Hi! I'm packaging vst3sdk for Arch Linux and for integration purposes I also build the example plugins.

Whereas this worked fine with the previous version (aside from #20 ) with 3.7.1_build_50 it is now broken:

  export CFLAGS+=" -DNDEBUG"
  export CXXFLAGS+=" -DNDEBUG"
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE='None' \
        -Wno-dev \
        -B build \
        -S .
  make VERBOSE=1 -C build

It seems that the validator is not called correctly.

The full build log is attached:
vst3sdk-3.7.1_build_50.log

Set the knob mode in AU wrapper

Hi, I'm observing that auv3wrapper sets the knob mode to linear, but auwrapper does not set it.
I receive a user complaint that knobs are rotary in Logic AUv2, but linear was expected.
Maybe it's appropriate for AUv2 to also force the knob mode to linear?

[Linux] cstdio is missing in threadchecker_linux.cpp on Fedora 32

When building VST 3 SDK on fresh installed Fedora 32, cmake outputs the error that cstdio is missing in source/common/threadchecker_linux.cpp. This issue has the error output from cmake.

I fixed this by including cstdio in threadchecker_linux.cpp as following.

#if SMTG_OS_LINUX // Line 39

#include <cstdio> // Add this line.
#include <pthread.h>

Does not build after the GCC 11 update

The error is raised from public.sdk/source/main/moduleinit.h.
no member named 'numeric_limits' in namespace 'std'
Including <limits> fixes this problem.

[Windows] Link Error on VST3Inspector

[Windows] Link Error on VST3Inspector

Following error occured on GitHub Actions' windows-latest environment. VST 3 SDK version is 3.7.7.

2022-12-16T16:07:44.5922127Z vstgui_uidescription.lib(uiviewcreator.obj) : error LNK2019: unresolved external symbol "public: __cdecl VSTGUI::UIViewCreator::AutoAnimationCreator::AutoAnimationCreator(void)" (??0AutoAnimationCreator@UIViewCreator@VSTGUI@@QEAA@XZ) referenced in function "void __cdecl VSTGUI::UIViewCreator::`dynamic initializer for '__gAutoAnimationCreator''(void)" (??__E__gAutoAnimationCreator@UIViewCreator@VSTGUI@@YAXXZ) [D:\a\VSTPlugins\VSTPlugins\build\public.sdk\samples\vst-hosting\inspectorapp\VST3Inspector.vcxproj]
2022-12-16T16:07:44.5924152Z D:\a\VSTPlugins\VSTPlugins\build\bin\Release\VST3Inspector\VST3Inspector.exe : fatal error LNK1120: 1 unresolved externals [D:\a\VSTPlugins\VSTPlugins\build\public.sdk\samples\vst-hosting\inspectorapp\VST3Inspector.vcxproj]

Following CMake command is used. (Link to full build script):

cmake `
  -S vst3sdk `
  -B build `
  -G "Visual Studio 17 2022" `
  -A x64 `
  -DCMAKE_BUILD_TYPE=Release `
  -DSMTG_MYPLUGINS_SRC_PATH="$SRC_ROOT\VSTPlugins" `
  -DSMTG_PLUGIN_TARGET_USER_PATH="$SRC_ROOT\target" `
  -DSMTG_ADD_VST3_HOSTING_SAMPLES=FALSE `
  -DSMTG_ADD_VST3_PLUGINS_SAMPLES=FALSE `
  -DSMTG_CREATE_PLUGIN_LINK=FALSE

cmake --build build -j --config Release

Full log from GitHub Actions is on following link:

https://gist.github.com/ryukau/70f07cc29c0d189df2e8e674dd76b515

Workaround

VST3Inspector is placed in public.sdk\sample. So I expected that setting SMTG_ADD_VST3_HOSTING_SAMPLES to FALSE disables the build, but it didn't. As a workaround, I changed first condition of public.sdk\samples\vst-hosting\inspectorapp\CMakeLists.txt as following.

if(TARGET vstgui AND TARGET vstgui_standalone AND SMTG_ADD_VST3_HOSTING_SAMPLES)

AGain should provide the root unit.

// create root only if you want to use the programListId
/* unitInfo.id = kRootUnitId; // always for Root Unit
unitInfo.parentUnitId = kNoParentUnitId; // always for Root Unit
Steinberg::UString (unitInfo.name, USTRINGSIZE (unitInfo.name)).assign (USTRING ("Root"));
unitInfo.programListId = kNoProgramListId;
unit = new Unit (unitInfo);
addUnitInfo (unit);*/

Hi,

The VST3 SDK document says,

The root unit is the component itself, so getUnitCount must return 1 at least.
The root unit id has to be 0 (kRootUnitId).

(in the IUnitInfo Class Reference page)

The root unit of this hierarchy is always present (explicit or implicit) and has ID '0'. A Plug-in that
does not define any further units simply consist of unit '0'.

(in the Units page)

But AGain sample does not provide the root unit if a developer does not want to use the programListId.

I suppose that these lines should not be commented out to meet IUnitInfo specification.
(and I suppose validator should test that a plugin provides the root unit.)

Thank you.

Missing includes in threadchecker_linux.cpp

When trying to compile vst3sdk with gcc 10.2.0 I get:

[ 19%] Building CXX object VSTGUI.build/lib/CMakeFiles/vstgui.dir/vstguidebug.cpp.o
cd /build/vst3sdk/src/vst3sdk/build/VSTGUI.build/lib && /usr/bin/c++ -DVSTGUI_ENABLE_DEPRECATED_METHODS=1 -I/usr/include/freetype2 -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -DNDEBUG -Wno-multichar -Wno-multichar -g -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -DSMTG_RENAME_ASSERT=1 -
Wsuggest-override -std=gnu++11 -o CMakeFiles/vstgui.dir/vstguidebug.cpp.o -c /build/vst3sdk/src/vst3sdk/vstgui4/vstgui/lib/vstguidebug.cpp
/build/vst3sdk/src/vst3sdk/public.sdk/source/common/threadchecker_linux.cpp: In member function ‘virtual bool Steinberg::Vst::LinuxThreadChecker::test(const char*, bool)’:
/build/vst3sdk/src/vst3sdk/public.sdk/source/common/threadchecker_linux.cpp:56:13: error: ‘stderr’ was not declared in this scope
   56 |    fprintf (stderr, "%s", failmessage);
      |             ^~~~~~
/build/vst3sdk/src/vst3sdk/public.sdk/source/common/threadchecker_linux.cpp:38:1: note: ‘stderr’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
   37 | #include "threadchecker.h"
  +++ |+#include <cstdio>
   38 |
/build/vst3sdk/src/vst3sdk/public.sdk/source/common/threadchecker_linux.cpp:56:4: error: ‘fprintf’ was not declared in this scope; did you mean ‘wprintf’?
   56 |    fprintf (stderr, "%s", failmessage);
      |    ^~~~~~~
      |    wprintf
make[2]: *** [public.sdk/CMakeFiles/sdk.dir/build.make:121: public.sdk/CMakeFiles/sdk.dir/source/common/threadchecker_linux.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

AUv3Wrapper resets all parameter values when `restartComponent(kParamTitlesChanged)` is called

The AUv3Wrapper's implementation of ComponentHelper::restartComponent (int32 flags) calls [auv3Wrapper initializeParameters] when the kParamTitlesChanged flag is set.

This unexpectedly causes all parameter values to be set to their default values because of the following code in createParameters:

sPar.value = pi.defaultNormalizedValue;
[self setParameter:pi.id value:pi.defaultNormalizedValue];
[self setControllerParameter:pi.id value:pi.defaultNormalizedValue];

This is a major problem for plugins that call restartComponent with kParamTitlesChanged during preset loading.

I'm not sure what the correct solution is. Perhaps createParameters should not be calling setParameter or setControllerParameter and doing sPar.value = _editcontroller->getParamNormalized(pi.id); instead - or maybe the behaviour needs to switch depending on whether the is parameter is being initialised for the first time or not.

Incorrect string copy in HostAttributeList::getString

In HostAttributeList::getString stringSize should be multiplied by sizeof TChar because it is copying bytes not characters.
This causes many plugins to display garbage in channel names when they query for attributes in response to Vst::ChannelContext::IInfoListener
Also plugins that use strings with HostAttributeList fail.

This is the fix.
#23

Assert failure with vst2 wrapper using SDK 3.7.2

I reported this issue in details in the forum and somebody suggested this might be a better place for it.

Here are the steps to reproduce:

  1. Compile vst2 plugin using VST3 SDK 3.7.2 and the included wrapper (and use the VST2 SDK that was last released)
  2. Load 1 instance of the plugin in Reason 11 (or Maschine 2)… works
  3. Load another instance of the plugin in Reason 11 (or Maschine 2) => hard failure

It fails due to an assert in the following code:

// from platformfactory.cpp line 30
void initPlatform (PlatformInstanceHandle instance)
{
	vstgui_assert (!gPlatformFactory); // <======== this is where it fails
	setPlatformFactory (std::unique_ptr<IPlatformFactory> (new VSTGUIPlatformFactory (instance)));
}

I was able to trace down the issue to the call to InitModule() which, in the case of the vst2wrapper happens on each instantiation of the plugin (call to VSTPluginMain) instead of when the module/library is loaded only. So the second time it is called, it fails due to the assert.

Linux: editorhost / runloop.cpp

I am sorry for the tone, but which n00b has written it?
There are all typical errors a person does when creating his first Linux event loop in life...

In RunLoop::select :

  • select(). nfds should be max(fd)+1, not just max(fd)
  • selecting for writeFDs make no sense here and produce busy looping

In RunLoop::start :

  • it make sense first evaluate timeout and then use it then other way around (hoping it will select something the first time, so will be evaluated after)

In TimerProcessor::handleTimersAndReturnNextFireTimeInMs :

  • if (timersToFire.empty ()) should be if(timers.empty()). If we had no ready timers, that does not mean we do not need timers at all.

I know that "lucky bugs combination" make VSTGUI somehow run inside current version. But has no-one notice it consumes 70% (in case of VSTGUI) up to 100% (with other GUI) one core with absolutely idle plug-in?

[Linux] audiohost segfault on sample plugin

Ubuntu 22.04 "jammy"

audiohost loads and runs the noteexpressionsynth sample but segfaults on exit:

/vst3test/build/bin/Debug$ ./audiohost /home/john/Desktop/vst3test/build/VST3/Debug/noteexpressionsynth.vst3
Press <enter> to continue . . .
Segmentation fault (core dumped)

GDB stacktrace:

Reading symbols from ./audiohost...
(gdb) run /vst3test/build/VST3/Debug/noteexpressionsynth.vst3
Starting program: /vst3test/build/bin/Debug/audiohost /vst3test/build/VST3/Debug/noteexpressionsynth.vst3

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5e5c640 (LWP 276805)]
[New Thread 0x7ffff5c67640 (LWP 276806)]
[New Thread 0x7ffff5be4640 (LWP 276807)]
Press <enter> to continue . . .
[Thread 0x7ffff5be4640 (LWP 276807) exited]
[Thread 0x7ffff5c67640 (LWP 276806) exited]
[Thread 0x7ffff5e5c640 (LWP 276805) exited]

Thread 1 "audiohost" received signal SIGSEGV, Segmentation fault.
0x0000555555603320 in ?? ()
(gdb) bt
#0  0x0000555555603320 in  ()
#1  0x00007ffff728840a in VSTGUI::SharedPointer<VSTGUI::CFontDesc>::operator=(VSTGUI::CFontDesc*) (this=0x7ffff7842660 <VSTGUI::globalFonts>, _ptr=0x0)
    at /vst3test/vst3sdk/vstgui4/vstgui/lib/vstguibase.h:441
#2  0x00007ffff74d5c04 in VSTGUI::CFontDesc::cleanup() () at /vst3test/vst3sdk/vstgui4/vstgui/lib/cfont.cpp:96
#3  0x00007ffff7588528 in VSTGUI::exit() () at /vst3test/vst3sdk/vstgui4/vstgui/lib/vstguiinit.cpp:20
#4  0x00007ffff72af445 in operator()() const (__closure=0x555555612628) at /vst3test/vst3sdk/public.sdk/source/vst/vstguieditor.cpp:67
#5  0x00007ffff72b0796 in std::__invoke_impl<void, <lambda()>&>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/11/bits/invoke.h:61
#6  0x00007ffff72b05d6 in std::__invoke_r<void, <lambda()>&>(struct {...} &) (__fn=...) at /usr/include/c++/11/bits/invoke.h:111
#7  0x00007ffff72b038c in std::_Function_handler<void(), <lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/11/bits/std_function.h:290
#8  0x00007ffff72a5658 in std::function<void ()>::operator()() const (this=0x555555612628) at /usr/include/c++/11/bits/std_function.h:590
#9  0x00007ffff72b2285 in Steinberg::(anonymous namespace)::sortAndRunFunctions(Steinberg::(anonymous namespace)::FunctionVector&) (array=std::vector of length 1, capacity 1 = {...})
    at /vst3test/vst3sdk/public.sdk/source/main/moduleinit.cpp:84
#10 0x00007ffff72b2375 in DeinitModule() () at /vst3test/vst3sdk/public.sdk/source/main/moduleinit.cpp:121
#11 0x00007ffff728c757 in ModuleExit() () at /vst3test/vst3sdk/public.sdk/source/main/linuxmain.cpp:77
#12 0x000055555558c9f9 in VST3::Hosting::(anonymous namespace)::LinuxModule::~LinuxModule() (this=0x5555555e4fa0, __in_chrg=<optimized out>)
    at /vst3test/vst3sdk/public.sdk/source/vst/hosting/module_linux.cpp:140
#13 0x000055555558f17b in __gnu_cxx::new_allocator<VST3::Hosting::(anonymous namespace)::LinuxModule>::destroy<VST3::Hosting::(anonymous namespace)::LinuxModule>(VST3::Hosting::(anonymous namespace)::LinuxModule*) (this=0x5555555e4fa0, __p=0x5555555e4fa0) at /usr/include/c++/11/ext/new_allocator.h:168
#14 0x000055555558f147 in std::allocator_traits<std::allocator<VST3::Hosting::(anonymous namespace)::LinuxModule> >::destroy<VST3::Hosting::(anonymous namespace)::LinuxModule>(std::allocator_traits<std::allocator<VST3::Hosting::(anonymous namespace)::LinuxModule> >::allocator_type&, VST3::Hosting::(anonymous namespace)::LinuxModule*) (__a=..., __p=0x5555555e4fa0)
    at /usr/include/c++/11/bits/alloc_traits.h:535
#15 0x000055555558f00b in std::_Sp_counted_ptr_inplace<VST3::Hosting::(anonymous namespace)::LinuxModule, std::allocator<VST3::Hosting::(anonymous namespace)::LinuxModule>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (this=0x5555555e4f90) at /usr/include/c++/11/bits/shared_ptr_base.h:528
#16 0x000055555557f285 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (this=0x5555555e4f90) at /usr/include/c++/11/bits/shared_ptr_base.h:168
#17 0x000055555557de5f in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (this=0x5555555e47f0, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:705
#18 0x000055555557d23c in std::__shared_ptr<VST3::Hosting::Module, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (this=0x5555555e47e8, __in_chrg=<optimized out>)
    at /usr/include/c++/11/bits/shared_ptr_base.h:1154
#19 0x000055555557d25c in std::shared_ptr<VST3::Hosting::Module>::~shared_ptr() (this=0x5555555e47e8, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/shared_ptr.h:122
#20 0x000055555557c0da in Steinberg::Vst::AudioHost::App::~App() (this=0x5555555e47e0, __in_chrg=<optimized out>)
    at /vst3test/vst3sdk/public.sdk/samples/vst-hosting/audiohost/source/audiohost.cpp:68
#21 0x000055555557c106 in Steinberg::Vst::AudioHost::App::~App() (this=0x5555555e47e0, __in_chrg=<optimized out>)
    at /vst3test/vst3sdk/public.sdk/samples/vst-hosting/audiohost/source/audiohost.cpp:68
#22 0x000055555557e4be in std::default_delete<Steinberg::Vst::EditorHost::IApplication>::operator()(Steinberg::Vst::EditorHost::IApplication*) const
    (this=0x5555555d1890 <Steinberg::Vst::AudioHost::gInit>, __ptr=0x5555555e47e0) at /usr/include/c++/11/bits/unique_ptr.h:85
#23 0x000055555557d47e in std::unique_ptr<Steinberg::Vst::EditorHost::IApplication, std::default_delete<Steinberg::Vst::EditorHost::IApplication> >::~unique_ptr()
    (this=0x5555555d1890 <Steinberg::Vst::AudioHost::gInit>, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:361
#24 0x000055555558296a in Steinberg::Vst::AudioHost::AppInit::~AppInit() (this=0x5555555d1890 <Steinberg::Vst::AudioHost::gInit>, __in_chrg=<optimized out>)
    at /vst3test/vst3sdk/public.sdk/samples/vst-hosting/audiohost/source/platform/appinit.h:48
#25 0x00007ffff7b24495 in __run_exit_handlers (status=0, listp=0x7ffff7cf8838 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at ./stdlib/exit.c:113
#26 0x00007ffff7b24610 in __GI_exit (status=<optimized out>) at ./stdlib/exit.c:143
#27 0x00007ffff7b08d97 in __libc_start_call_main (main=main@entry=0x55555557c99d <main(int, char**)>, argc=argc@entry=2, argv=argv@entry=0x7fffffffe088) at ../sysdeps/nptl/libc_start_call_main.h:74
#28 0x00007ffff7b08e40 in __libc_start_main_impl
     (main=0x55555557c99d <main(int, char**)>, argc=2, argv=0x7fffffffe088, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe078) at ../csu/libc-start.c:392
#29 0x0000555555566635 in _start ()
(gdb) quit
A debugging session is active.

	Inferior 1 [process 276802] will be killed.

Quit anyway? (y or n) y

Feature Request: Support automation highlighting in AAXWrapper

I didn't hear back from you, so here's my proposal regarding the above FR. The idea is to add an AAX specific function to the IVst3ToAAXWrapper interface so the plugin implementation can poll the control highlighting state whenever the developer wishes to. Another option would be to have a corresponding interface extension that may extend the IEditController implementation that an apropriate AAXWrapper_GUI::SetControlHighlightInfo() delegates to through your editor BaseWrapper. Please let me know whether this or a similar patch can be added in a future SDK update.

  1. Extend the IVst3ToAAXWrapper interface declaration in the following way:
class IVst3ToAAXWrapper : public FUnknown
{
public:
	virtual tresult PLUGIN_API getAutomationHighlight (int tag, int *color) = 0;

	//------------------------------------------------------------------------
	static const FUID iid;
};
DECLARE_CLASS_IID (IVst3ToAAXWrapper, 0x6D319DC6, 0x60C56242, 0xB32C951B, 0x93BEF4C6)

//------------------------------------------------------------------------

/**   Pro Tools automation highlighting colors
*/
enum AAXHighlightColor
{
	kHighlightColorNone = -1,
	kHighlightColorRed, // Corresponds to AAX_eHighlightColor_Red
	kHighlightColorBlue, // Corresponds to AAX_eHighlightColor_Blue
	kHighlightColorGreen, // Corresponds to AAX_eHighlightColor_Green
	kHighlightColorYellow // Corresponds to AAX_eHighlightColor_Yellow
};

This enables the plugin to retrieve the current highlighting color for all the controls corresponding to the parameter "tag".

  1. Add a map that keeps track of the highlights to the AAX Wrapper (aaxwrapper.h):
// static creation method
	static AAXWrapper* create (Steinberg::IPluginFactory* factory,
	                           const Steinberg::TUID vst3ComponentID, AAX_Plugin_Desc* desc,
	                           AAXWrapper_Parameters* p);

...
	// IVst3ToAAXWrapper
	Steinberg::tresult PLUGIN_API getAutomationHighlight (int tag, int *color) SMTG_OVERRIDE;
...

private:
...
	std::map<int, int> automationHighlights;
  1. Implement "getAutomationHighlight()" e.g. (aaxwrapper.cpp):
...
tresult PLUGIN_API AAXWrapper::getAutomationHighlight(int tag, int *color)
{
	if (color != nullptr)
	{
		auto it = automationHighlights.find(tag);
		if (it != automationHighlights.end())
		{
			*color = it->second;
			return kResultTrue;
		}
	}
	return kResultFalse;
}
...
  1. Override and implement "SetControlHighlightInfo()" in aaxwrapper_gui.h / aaxwrapper_gui.cpp so it fills the map with the currently active highlights:
...
AAX_Result AAXWrapper_GUI::SetControlHighlightInfo(AAX_CParamID aaxid, AAX_CBoolean iIsHighlighted, AAX_EHighlightColor iColor)
{
	AAXWrapper* wrapper =
		static_cast<AAXWrapper_Parameters*> (GetEffectParameters())->getWrapper();

	// NOTE: One could make getVstParamID() a static helper function in AAXWrapper instead
	if (aaxid[0] != 'p')
		return AAX_ERROR_INVALID_PARAMETER_ID;
	Vst::ParamID id;
	if (sscanf(aaxid + 1, "%x", &id) != 1)
		return AAX_ERROR_INVALID_PARAMETER_ID;

	int color = kHighlightColorNone;

	if (iIsHighlighted)
	{
		switch(iColor)
		{
		case AAX_eHighlightColor_Red: color = kHighlightColorRed; break;
		case AAX_eHighlightColor_Blue: color = kHighlightColorBlue; break;
		case AAX_eHighlightColor_Green: color = kHighlightColorGreen; break;
		case AAX_eHighlightColor_Yellow: color = kHighlightColorYellow; break;
		}
	}

	wrapper->automationHighlights[id] = color;

	return AAX_SUCCESS;
}
...

Allow moduleinfo.json and IPluginCompatibility to coexist

In JUCE, we implement the IPluginCompatibility interface, and then query this implementation during the plugin build to generate the moduleinfo.json.

However, plugins implemented in this way fail in the VST3 validator:

bool checkPluginCompatibility (VST3::Hosting::Module::Ptr& module,
IPtr<IPluginCompatibility> compat, std::ostream* errorStream)
{
bool failure = false;
if (auto moduleInfoPath = VST3::Hosting::Module::getModuleInfoPath (module->getPath ()))
{
failure = true;
if (errorStream)
{
*errorStream
<< "Error: The module contains a moduleinfo.json file and the module factory exports a IPluginCompatibility class. Only one is allowed, while the moduleinfo.json one is prefered.\n";
}
}

The requirement that IPluginCompatibility and moduleinfo.json may not coexist is not mentioned in the documentation for the moduleinfo feature. As such, the inclusion of this check in the validator is unexpected.

Allowing the IPluginCompatibility interface to coexist with moduleinfo.json has a number of benefits:

  • It allows plugin vendors to specify compatibility information in a single location, directly in their source code. This is much more intuitive and easier to implement than requiring that users supply this information to whatever build system they are using.
  • It means that users need to supply less information overall. The plugin already knows its own class UIDs, so it can automatically insert these into the generated JSON. There's no need for users to find out this information themselves and supply it to the build system.
  • It's consistent with the rest of the information in moduleinfo.json - all the rest of the information in this file can be derived from information that is already present in the VST3 dylib (the main role of the moduleinfotool is to format information present in a plugin binary into a moduleinfo.json for that binary!).

At the same time, I can't really think of any disadvantages of this approach. One possible argument is that duplicating information in two locations may lead to hosts inconsistently preferring one of those information sources. However, this is a problem even without considering IPluginCompatibility: all the rest of the information in moduleinfo.json is derived from the plugin binary, so it must already be specified that hosts should prefer to use the moduleinfo.json (if it exists) as the source of truth for any duplicated information. Therefore, allowing the moduleinfo.json to coexist with IPluginCompatibility does not place any additional implementation burden on hosts.

I hope that this requirement can be relaxed and the validator updated in the next version of the SDK.

A related change has previously been discussed here.

Issue reports from our users are here and here.

undefined behavior - load of misaligned address

When running the VST3 validator with UBSan enabled, a load of a misaligned address address is flagged:

vst3sdk/public.sdk/source/vst/hosting/../utility/uid.h:177:10: runtime error: load of misaligned address 0x00016f3ced7e for type 'const uint64_t' (aka 'const unsigned long long'), which requires 8 byte alignment
0x00016f3ced7e: note: pointer points here
 30 03 00 60 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  68 65 6c 70 00 00 00 00  24 fe
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior vst3sdk/public.sdk/source/vst/hosting/../utility/uid.h:177:10 in
vst3sdk/public.sdk/source/vst/hosting/../utility/uid.h:178:10: runtime error: load of misaligned address 0x00016f3ced86 for type 'const uint64_t' (aka 'const unsigned long long'), which requires 8 byte alignment

This is the case for lines 177 and 178 in uid.h:

Support for android

I'm working on VST Host compilation for different platforms like Linux, Windows, MacOS, Android etc. Currently I have a small problem with using plugins on Android due to the folder's hierarchy that "module_linux.cpp" assumes.

The problematic function is "getOSPath". When I comment out following code (look at screen below) I'm able to use VST plugin.

Is there a possibility to add file similar to "module_linux.cpp" but for android?

image

Changing the preset should not affect the host bypass state in AAX

Please check this short screencast:

https://i.imgur.com/XmYdIhU.gif

This is a demonstration of how the bypass is supposed to react when the user changes the presets in Pro Tools - check the Avid EQ-3 plugin as a reference.

The Fuse Audio Labs VQA-154 plugin uses Steinberg's AAX Wrapper and you can see that changing the presets overwrites the master bypass because it's stored in the plugin's state chunk.

I suggest using something along the lines of the following code in order to restore the bypass to its last setting once the preset is changed to overcome this:

  1. Add a double member, e.g. "savedBypass" to the AAXWrapper class.

  2. In AAXWrapper_Parameters::NotificationReceived() add

{
	char bypassId[10];
	sprintf(bypassId, "p%8X", mWrapper->mBypassParameterID);

	double value;

	if(GetParameterNormalizedValue(bypassId, &value) == AAX_SUCCESS)
		mWrapper->savedBypass = value;
	...
	break;
}

to the case AAX_eNotificationEvent_PresetOpened.

  1. In AAXWrapper::onTimer() add
	char bypassId[10];
	sprintf(bypassId, "p%8X", mBypassParameterID);

	if(presetChanged)
	{
		int i = 0;
		double value;
		AAX_CString id;

		while(aaxParams->GetParameterIDFromIndex(i++, &id) == AAX_SUCCESS)
		{
			if(id == bypassId)
			{
				aaxParams->SetParameterNormalizedValue(id.CString(), savedBypass);
			}
			else if(aaxParams->GetParameterNormalizedValue(id.CString(), &value) == AAX_SUCCESS)
			{
				aaxParams->SetParameterNormalizedValue(id.CString(), value);
			}
		}

		presetChanged = false;
	}

to the recently added fix for "Automation issues after switching presets in aaxwrapper".

Automation issues after switching presets in aaxwrapper

here apparently is an automation issue which happens after selecting presets using the aaxwrapper in SDK v3.6.9. It can easily be reproduced using again_aax:

  1. In Pro Tools instanciate again_aax.
  2. Create and save 2 or more presets with different gain settings using Pro Tools' preset browser.
  3. Add gain parameter to automation list.
  4. Switch to e.g. write automation mode.
  5. Start playback and switch between the presets created in 2.
  6. Stop playback and reset to initial timeline cursor.
  7. Switch to read mode.
  8. Restart playback.

Expected result: Automation follows the gain parameter settings according to presets selected while writing the automation.
Actual result: Gain parameter doesn't change. It seems as if the automation values aren't reported to the host properly.

Switching presets per se works fine, it's just that the according parameter changes aren't transferred back to the host. It may have to do something with the fact that Vst2Wrapper::setChunk() is scheduled for a later call in onTimer(), which happens if AAXWrapper_Parameters::SetChunk() isn't called from the main thread.'
My assumption is that either the automation value reported back to ProTools reflects the parameter's old state or there isn't any reporting going on at all. I'd need to investigate further in order to confirm that. I also assume there weren't any changes regarding that in 3.6.10 given that the wrapper has been refactored? At least it doesn't have to do with the fixes suggested in my recent PRs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.