【问题标题】:Using VST.net with Unity3d to create a simple VST host使用 VST.net 和 Unity3d 创建一个简单的 VST 主机
【发布时间】:2018-10-30 10:14:19
【问题描述】:

我已成功简化 Vst.net host sample 以直接加载 vst 仪器。大多数情况下,我只是剥离了 GUI 并让它自动触发一些测试说明。当我将它构建为控制台应用程序时,此代码有效。

using System;
using Jacobi.Vst.Core;
using Jacobi.Vst.Interop.Host; 
using NAudio.Wave;
using CommonUtils.VSTPlugin;

namespace Jacobi.Vst.Samples.Host
{
///<Summary>
/// Gets the answer
///</Summary>
public class pianoVST
{
    ///<Summary>
    /// Gets the answer
    ///</Summary>
    public static VST vst = null;

    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {

    }

    /// <summary>
    /// Play some test notes.
    /// </summary>
    public void playTest()
    {
        var asioDriverNames = AsioOut.GetDriverNames();
        if (asioDriverNames.Length > 0)
        {
            MidiVstTest.UtilityAudio.OpenAudio(MidiVstTest.AudioLibrary.NAudio, asioDriverNames[0]);
            MidiVstTest.UtilityAudio.StartAudio();
            vst = MidiVstTest.UtilityAudio.LoadVST("[path-to-vst-dll]");
            for (int i = 0; i < 3; i++)
            {
                vst.MIDI_NoteOn(60, 100);
                System.Threading.Thread.Sleep(1000);
                vst.MIDI_NoteOn(60, 0);
                System.Threading.Thread.Sleep(1000);
            }
        }
    }
}
}

但是,当我将其构建为 dll 时,将其导入 Unity,然后将其附加到一个简单的 GameObject,我无法让它运行或构建。我得到的错误信息是:

ArgumentException: The Assembly Jacobi.Vst.Interop is referenced by Jacobi.Vst.Samples.Host ('Assets/Jacobi.Vst.Samples.Host.dll'). But the dll is not allowed to be included or could not be found.

我已经从源代码重建了 C++ 互操作 dll,但我没有做任何事情使它与 Unity 一起工作。

我可以做些什么来让 Jacobi.Vst.Interop dll 与 Unity 很好地配合使用吗?

【问题讨论】:

  • 我对Unity一无所知,但也许Interop dll是混合代码(.NET + C++)的事实被检测到并且在unity中不允许......? (假设你已经部署)

标签: c# unity3d dll vst


【解决方案1】:

VST.Net 依赖于 VC110.CRT 包。该错误可能是由于未安装 VC 运行时所致。

https://github.com/obiwanjacobi/vst.net/blob/master/docs/Using_VST.NET.md

【讨论】:

    猜你喜欢
    • 2017-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-12
    • 2011-06-16
    • 1970-01-01
    • 2023-03-20
    相关资源
    最近更新 更多