Author Topic: How to best develop plugins for use with OpenMPT  (Read 1295 times)

Offline dem1

  • Active artist
  • *
  • Posts: 15
  • Operating System: Windows 7
How to best develop plugins for use with OpenMPT
« on: May 19, 2021, 17:49:38 »
Suppose I want to write a few plugins for use with OpenMPT: custom distortion, a granulator, a full-screen visualizer with MIDI input.
It looks like OpenMPT supports VST2 and DirectX Media Objects. Are there any others? Where can I find documentation/SDKs? Which one would minimize development time for what I have in mind? Are there any features that I should avoid in order to ensure compatibility with OpenMPT?

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,358
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: How to best develop plugins for use with OpenMPT
« Reply #1 on: May 19, 2021, 18:03:40 »
Quote
Are there any others?
There's also built-in plugins but obviously those will really only work with OpenMPT, and there is absolutely zero guarantee for API stability for internal plugins (we refactor it as required).

DirectX plugins haven't really been relevant in the last ten years or so, I wouldn't even know where to find the SDK for developing them, and few hosts support them. VST2 is the only widely supported solution, and even though Steinberg is trying to make it more and more difficult to obtain access to the SDK (because they want to push VST3), there are third-party projects such as DPF that will allow you to still create VST2 plugins. In fact, that project in particular allows you to use the same code base to create plugins in several formats. I have never used it myself but looking at the examples, DPF should be able to get you started quickly. The biggest limitation with any plugin format is that OpenMPT currently only supports one stereo input and one stereo output for each plugin (no sidehcain buses etc.), but apart from that you should be able to use most features of VST2.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline dem1

  • Active artist
  • *
  • Posts: 15
  • Operating System: Windows 7
Re: How to best develop plugins for use with OpenMPT
« Reply #2 on: May 19, 2021, 18:51:52 »
Quote
Are there any others?
There's also built-in plugins but obviously those will really only work with OpenMPT, and there is absolutely zero guarantee for API stability for internal plugins (we refactor it as required).

DirectX plugins haven't really been relevant in the last ten years or so, I wouldn't even know where to find the SDK for developing them, and few hosts support them. VST2 is the only widely supported solution, and even though Steinberg is trying to make it more and more difficult to obtain access to the SDK (because they want to push VST3), there are third-party projects such as DPF that will allow you to still create VST2 plugins. In fact, that project in particular allows you to use the same code base to create plugins in several formats. I have never used it myself but looking at the examples, DPF should be able to get you started quickly. The biggest limitation with any plugin format is that OpenMPT currently only supports one stereo input and one stereo output for each plugin (no sidehcain buses etc.), but apart from that you should be able to use most features of VST2.

Built-in plugins are an interesting possibility. I suppose that would (currently) mean forking OpenMPT and compiling it with my plugin (with a few things added to PluginManager.cpp)?

DPF looks very neat, thanks for pointing that out!

I'm curious why VST3, sidechain buses, etc., aren't supported?

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,358
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: How to best develop plugins for use with OpenMPT
« Reply #3 on: May 19, 2021, 20:53:22 »
Built-in plugins are an interesting possibility. I suppose that would (currently) mean forking OpenMPT and compiling it with my plugin (with a few things added to PluginManager.cpp)?
Correct.

I'm curious why VST3, sidechain buses, etc., aren't supported?
The reason for both is "because the work hasn't been done", but for VST3 also once again Steinberg's questionable way of licensing their SDKs, and that it is greatly overengineered and nobody really likes working with VST3. A lot of OpenMPT's plugin communication is done via MIDI, and VST3 was originally designed to essentially completely replace MIDI. This means that for years many things that were trivially possible in VST2 were not possible in VST3, some of which might still not be possible today (I don't know). At this point I'd probably be more likely to add LV2 support than VST3 support.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline dem1

  • Active artist
  • *
  • Posts: 15
  • Operating System: Windows 7
Re: How to best develop plugins for use with OpenMPT
« Reply #4 on: May 20, 2021, 15:59:40 »
The reason for both is "because the work hasn't been done", but for VST3 also once again Steinberg's questionable way of licensing their SDKs, and that it is greatly overengineered and nobody really likes working with VST3. A lot of OpenMPT's plugin communication is done via MIDI, and VST3 was originally designed to essentially completely replace MIDI. This means that for years many things that were trivially possible in VST2 were not possible in VST3, some of which might still not be possible today (I don't know). At this point I'd probably be more likely to add LV2 support than VST3 support.

That makes sense, I'd had a hard time figuring out where to even start with VST3 - but it might just be more complicated than what I actually need it for :)
LV2 does seem a lot friendlier, and nobody can beat that license!