SDK v2.1 is now merged into the main branch of GitHub - 4ms/metamodule-plugin-sdk: SDK for building MetaModule Plugins · GitHub
New API features
This adds a lot of new API functions and some helper classes based on feedback from this forum (click to read the docs for each):
System API
Filesystem Helper API
Stream and Block Resampler
WavFileStream class – helps with streaming wav files from SD or USB, including throttling disk access and managing the large thread-safe buffer.
WaveformDisplay class
translate_path_to_local()
I want to call out specifically the Filesystem::translate_path_to_local() function (here). This should be used in your modules anytime you use a path to a file in the VCV Rack version (for example, if your module saves the path to a .wav file). It will translate the VCV/computer path to one relative to the current patch file. All the user has to do is put any associated files (e.g. sample .wav files) into the same directory as their MetaModule .yml patch file, and the files will automatically be found when they load the patch.
Use it like this:
std::string mm_path = translate_path_to_local(vcv_computer_path, Patch::get_path());
mm_path will be a valid MetaModule path to a file in the same dir as the currently playing patch file
Changes to submodules
There’s one change made to the structure of the repo, which you might run into if you use git to keep the SDK up to date: The SDK is no longer using submodules for the metamodule-core-interface, metamodule-rack-interface, and metamodule-plugin-libc. Instead, these are just regular folders inside the repo. The folder names have been changed to core-interface, rack-interface, and plugin-libc. You don’t need to do anything special or different, but if you’re using git pull or git checkout to update the SDK periodically, you should know that git won’t automatically delete the old submodule directories. You may see a warning from git about them, so just manually delete them if it’s causing a problem.