结合使用VST.net和Unity3d创建简单的VST主机 [英] Using VST.net with Unity3d to create a simple VST host

查看:135
本文介绍了结合使用VST.net和Unity3d创建简单的VST主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功简化了 Vst.net主机样本直接加载vst仪器.通常,我只是剥离了GUI并使其自动触发了一些测试说明.当我将其构建为控制台应用程序时,此代码有效.

I've successfully simplified the Vst.net host sample to directly load a vst instrument. Mostly I've just stripped out the GUI and made it automatically fire a few test notes. This code works when I build it as a console application.

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上,我无法使其运行或构建.我收到的错误消息是:

However, when I build this as a dll, import it into Unity and then attach it to a simple GameObject, I'm not able to get it to run or build. The error message I get is:

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 ++ interop dll,但我所做的任何事情都无法使其与Unity一起使用.

I've rebuilt the C++ interop dll from source but nothing I do makes it work with Unity.

我可以做些什么使Jacobi.Vst.Interop dll与Unity很好地工作吗?

Is there something I can do to make the Jacobi.Vst.Interop dll work nicely with Unity?

推荐答案

VST.Net对VC110.CRT程序包具有依赖性.该错误可能是未安装VC运行时的结果.

VST.Net has a dependency on the VC110.CRT package. That error could be a result of not have the VC runtime installed.

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

这篇关于结合使用VST.net和Unity3d创建简单的VST主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆