-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single merged plugin build #9
Conversation
@@ -1322,9 +1322,9 @@ OSStatus ComponentBase_AP_Close(AUv2Plugin* auv2) | |||
return noErr; | |||
} | |||
|
|||
__attribute__((visibility("default"))) void* GetPluginFactory(const AudioComponentDescription* inDesc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VST3 also uses the name GetPluginFactory
, so I renamed this to avoid clashing. I've changed the factoryFunction
in Info.plist.in
to match.
# The properties: | ||
set(MACOSX_BUNDLE_TAGS "<string>Synthesizer</string>") # Predefined tags are: Bass, Delay, Distortion, Drums, Dynamics, Dynamics Processor, Effects, Equalizer, Filter, Format Converter, Guitar, Imaging, MIDI, Mixer, Offline Effect, Output, Panner, Pitch, Reverb, Sampler, Synthesizer, Time Effect, Vocal. But you can use others. | ||
set(MACOSX_BUNDLE_TYPE "aumu") # "aufx" for Effect, "augn" for Generator, "aumu" for Instrument, "aufm" for Music Effect. | ||
set(MACOSX_BUNDLE_SUBTYPE "Xmpl") # For AU and GarageBand 10.3 compatibility, the first letter must be upper-case, the others lower-case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find! Thanks I didn't know about this
|
||
endif() # APPLE | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_BINARY_DIR}/${PRODUCT_NAME}.clap" "${CMAKE_BINARY_DIR}/${PRODUCT_NAME}.vst3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we simply copy the .clap
over to .vst3
and .component
.
<key>CFBundleIconFile</key> | ||
<string>@MACOSX_BUNDLE_ICON_FILE@</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>@bundle_identifier@</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lower-case because it's a parameter to the configure_info_plist
function. This way, the standalone app can have a different bundle ID from the plugin.
<key>CFBundleShortVersionString</key> | ||
<string>@PROJECT_VERSION@</string> | ||
<key>CFBundlePackageType</key> | ||
<string>@bundle_type@</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This becomes APPL
for the standalone app, and BNDL
for the plugin.
Hey @martinfinke thanks a lot for this. I absolutely love seeing git diffs with more red than green. Simplifying the build process and combining all formats into one sounds pretty good to me. It would be great if CPLUG could build both single targets and all targets, whichever the user prefers. I took a quick look through your commits, and I think both are possible with your changes. Good work! |
Nice, thanks for merging! |
Thanks for your contributions! It definitely cleaned up a lot of the build script. I'd like to think of ways to simplify things more. I'd love to take a peek at your AUv3 code. What would you say is the benefit of v3 over v2? Does Logic do a better job at fully supporting v3 than v2? (I hope so). As for VST2, well CPLUGs VST3 wrapper already works fine (for synths*) in plenty of popular hosts, so I don't think there's a big gain there. There's also the VST2 licensing problem, which I'd like to avoid. |
Here's what I have so far: cplug_auv3.m.zip. It's not very well tested. The AUv3 API is pretty confusing, so hopefully it can be a starting point, or reference on how e.g. buffer handling is done. Or you could just use AUAudioUnitV2Bridge instead, to make an AUv3 from CPLUG's existing AUv2. Steinberg also has something. I didn't try them, I prefer to see what's going on..
I agree: Not much gain for the average case, especially for new projects. So best to not include it in an open-source project like this, especially with the licensing (you can't just put |
Great thanks for sharing that AUv3 code! This is a helpful starting point |
Hello! First off, thank you so much for this project. I tried to do the same thing over the last couple of days, and then found this. Great work 👍
How about building a single binary target that contains all the plug-in formats in one file? You get a file/bundle that's a valid VST3, CLAP and AUv2 plugin, all in one. Just rename it to
.component
,.vst3
or.clap
and put it in the correct folder.It needs less config and saves build time (one build instead of three). Because the files are 100% identical, you only have to codesign once, and upload once to Apple for notarization.
If you ship a .pkg installer, you can put only the .vst3 bundle in the installer, and then copy it over to AUv2 and CLAP using a post-install script on the user's machine.
SonicCharge MicroTonic does this. The pkg Installer has a script that just copies one plugin over to the other formats. It really uses 100% the same plist with the same bundle ID across all plugin formats. The VST3's plist even contains all the AUv2
AudioComponents
stuff. It seems fine.I also added a
configure_info_plist
CMake function that's used by both the Standalone App and Plugin target. With the@MY_VARIABLE@
syntax in the plist you can use any CMake variable directly, without passing it toset_target_properties
.I hope this is helpful 🙂
I haven't been able to get the build working on Windows yet, but have tested AUv2, VST3 and CLAP on macOS.
I briefly looked at #4. Giving the structs of different backends all the same name
CplugHostContext
is probably not compatible with this PR (ODR violation).By the way, ChatGPT really tried to generate the ASCII art
PLUGIN
heading. 😆