首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >结合使用VST.net和Unity3d创建一个简单的VST主机

结合使用VST.net和Unity3d创建一个简单的VST主机
EN

Stack Overflow用户
提问于 2018-05-21 00:54:37
回答 1查看 620关注 0票数 0

我已经成功地简化了Vst.net host sample,使其可以直接加载vst仪器。大多数情况下,我只是剥离了GUI,让它自动触发一些测试笔记。当我将其构建为控制台应用程序时,此代码可以正常工作。

代码语言:javascript
复制
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,我无法使其运行或构建。我得到的错误消息是:

代码语言:javascript
复制
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++一起工作。

有没有什么我可以做的,让Unity和Jacobi.Vst.Interop很好地协同工作?

EN

回答 1

Stack Overflow用户

发布于 2019-03-03 04:22:41

VST.Net依赖于VC110.CRT包。该错误可能是由于没有安装VC运行时造成的。

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50437265

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档