1

Is it possible to build a VST with Unity3d?

It does seem possible to build Audio applications in unity.

But Im wondering whether a DLL can be built as a unityapp? Is it possible to integrate the VST sdk somehow with the final build?

Ke.
  • 2,484
  • 8
  • 40
  • 78

2 Answers2

1

Unity can use native plugins on most architectures. It seems VST is a native windows dll, you can run these with DllImport.

In Unity all audio is stored in AudioClips, you can modify their data using Create, Set and Get. You can also hook your script to audio importing in the editor, so you change it on load with AssetPostprocessor.OnPostprocessAudio.

So you would have to do some kind of a AudioClip to AudioClip filter using VST filters.

One advice with Unity - precise timing is hard as everything is tied to the main gameloop and it runs (ideally) with the frequency of your monitor refresh. If you want some more real time, you need to put your own threads in the background - it does work contrary to common advice on the web, just remember that almost nothing is thread safe in Unity, so to update the game state or AudioClips, you need to do that back in the game loop.

Krzysztof Bociurko
  • 4,575
  • 2
  • 26
  • 44
  • It's a good answer so have written it as correct. Would be very grateful if you know whether it's possible to export the dll file (or .vst for mac). I can only see a few options in the exporter. Or would I have to build the dll somehow with VisualStudio etc? – Ke. Dec 06 '15 at 09:47
  • 1
    I don't think this answers the question, which was about whether you can make a VST using Unity, not whether you can use VST plugins inside Unity – j b Apr 10 '19 at 09:10
0

As far as I know, at least out of the box, you can not wrap the exported Unity code in the framework needed for VST. That's the step getting in the way of being able to use a Unity interface inside a plugin host (eg: DAW).

Another approach would be to create a VST/AU plugin that talked to a Unity app that ran outside the plugin host.

grigb
  • 1,151
  • 8
  • 14