如何按下midi键盘上的按键并知道按下了哪个键并通过c#播放音符?非常感谢你 ... [英] how can I press on a key in a midi keyboard and know which key was pressed and play the note by c#? Thank you very much ...

查看:129
本文介绍了如何按下midi键盘上的按键并知道按下了哪个键并通过c#播放音符?非常感谢你 ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何按下midi键盘上的按键并知道按下了哪个按键并通过c#播放音符?非常感谢

how can I press on a key in a midi keyboard and know which key was pressed and play the note by c#? Thank you very much

推荐答案

我猜你可以使用这个:用于Windows MIDI API的包装库 [ ^ ]



但是,根据经验,我发现的问题是实际上与输出的延迟有关。 midi很好,但没有使用ASIO,只要你对音频进行任何*重要处理就会明显延迟音频,这使得无法在C中创建任何合理的音频应用程序。



但是,还有其他选择,都有缺点和优点。 Synthmaker - 现在Flowstone非常适合简单编码令人惊讶的错综复杂的VST和FLStudio插件,但它的MIDI支持并不是很好。



我从经验中找到的最佳选择是(我不确定地认为)是使用C ++。您可以依赖STL甚至提升库来帮助您 - 我推荐它,特别是如果您正在使用MIDI,因为如果您在C ++中进行任何midi排序,容器和迭代器就是当天的顺序。
I'm guessing you can use this: Wrapper Library for Windows MIDI API[^]

However, speaking from experience, the issue I found with that actually has to do with the latency of the output. The midi is fine, but without using ASIO the audio is noticeably delayed as soon as you do *any* significant processing on the audio and that makes it impossible to create any kind of reasonable audio app in C#

However, there are other options, all with drawbacks and advantages. Synthmaker - now Flowstone is excellent for simple coding of surprisingly intricate VSTs and FLStudio plugins but it's MIDI support is not great.

The best option I've found from experience is (and I don't like it admittedly) is to use C++. You can rely on the STL and even boost libraries to help you along - and I recommend it, particularly if you're doing MIDI because containers and iterators are the order of the day if you're doing any midi sequencing in C++.


你可以使用一些包含MIDI功能的3r-party .NET库,它具有处理MIDI输入事件的能力。

参见,例如,

https://code.google.com/p/midi-dot-net/wiki / SimpleExamples [ ^ ]。



另请参阅此CodeProject文章: C#MIDI工具包 [ ^ ]。



我个人还没有使用MIDI输入,只使用了MIDI o utput,但我有MIDI硬件并计划有一天到达这个活动领域,所以我不知道延迟问题有多糟糕,但我不能同意它可能与软件处理有关 - 它也可以做到很快就会引起注意,但我不知道硬件延迟有多糟糕。在一些基于USB的硬件中(我不是指MIDI),我观察到几毫秒的延迟。我想这取决于你使用的硬件接口。



-SA
You can use some 3r-party .NET library which wraps MIDI functionality with the capability to handle MIDI input events.
See, for example,
https://code.google.com/p/midi-dot-net/wiki/SimpleExamples[^].

See also this CodeProject article: C# MIDI Toolkit[^].

I personally did not work with MIDI input yet, only used MIDI output, but I have MIDI hardware and planned to get to this field of activity one day, so I don't know how bad is the latency problem, but I cannot agree that it can be related to software processing — it can be done too fast to be noticeable, but I don't know how bad hardware latency can be. In some USB-based hardware (I don't mean MIDI), I observed latency of few milliseconds. I guess it depends on the hardware interface you use.

—SA


这篇关于如何按下midi键盘上的按键并知道按下了哪个键并通过c#播放音符?非常感谢你 ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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