我有RSI问题,尝试了30种不同的电脑键盘,都让我很痛苦。弹钢琴不会给我带来痛苦。我已经弹钢琴20年了,没有任何疼痛问题。我想知道是否有一种方法可以从MIDI键盘捕获MIDI并输出键盘敲击。我对MIDI一无所知,但我想要一些关于如何将这个信号转换成按键的指导。
当前回答
试试Bome的MIDI翻译器。
它可以跨平台工作,可以轻松地将任何MIDI输入转换为键盘,快速设置和配置,另外它是免费的个人使用。
有一个教程,快速提示:MIDI翻译- MIDI键击,如何轻松设置:
基本上,你可以做的事情有无限的可能性,包括和弦和修饰键。我用它作为我的现场音频设备来控制我的DAW使用我的钢琴,从来没有遇到过问题。
其他回答
一个很好的。net库,完全支持midi (BASS),请访问http://www.un4seen.com。
而对于另一部分,将键盘midi音符转换为按键等,我会使用AutoItX, ActiveX/COM和DLL接口来实现autoIt。信息和下载,请登录http://www.autoitscript.com/site/autoit/
不需要编写键盘驱动程序。
使用. net DirectSound接口这样的东西来连接到MIDI设备应该是相当容易的。您需要识别目标MIDI设备,然后获取用于侦听传入消息的代码(有关于通过谷歌进行此操作的文章)。
由于您正在使用MIDI in作为键盘,因此基本上只需要检测两个MIDI消息,即打开和关闭。MIDI消息是三个数据字节,指定命令、音符和速度。note off只是音符号(有时“坏”MIDI堆栈以零速度发送音符,这也是你必须预料到的)。
一旦你有了转换它们的消息,从。net输出的键盘应该相当简单。
其他答案中有很多关于技术细节的建议;我只是想让你对实际的MIDI消息有一个概念。好运!
要解决这个问题,你需要做一些事情:
A way to capture MIDI data from your keyboard. Depending upon the interface: MIDI interface (classic) or USB MIDI interface (modern) the most likely interface is to a computer as it provides the most options. USB host microcontrollers are not as simple as just using a computer. A scheme to convert MIDI data into keystrokes. Like one user pointed out, chords are the way to go as the number of keys will not be dependent upon the number of piano keys. A way to inject a key into the operating system. This will require a low-level driver to be accurate. I have played around with applications that inject keyboard and mouse data into applications in Windows 7, and it can be flaky and depend upon whether an application is currently in focus. This is hardest part of the interface. What may work is to create a HID USB keyboard microcontroller that also has a serial interface.
串行接口将创建一个虚拟串行端口。读取MIDI数据并产生击键的软件可以向虚拟串行端口发送一个串行消息。微控制器将发送一个击键,使它看起来像一个标准的键盘输入。这将允许同时连接MIDI端口和USB MIDI键盘。
Hmmm, with this type of interface you could also simulate a mouse and use some piano keys setup for the mouse axis and buttons. The pressure could be used to determine mouse pointer velocity. So you could eliminate the mouse as well. Another benefit of this approach is any type of input device you connect could talk to the virtual serial port to produce keyboard and mouse events. So if you wanted to add other hardware such as drum pedals or a joystick it would be a matter of adjusting the program that talks to the serial interface.
Another take on the above is like some posted above to use an Arduino, but also include USB Host Shield from Sparkfun to handle USB based music keyboards. This allows the Arduino to be programmed as a keyboard or keyboard mouse combo in the boot loader chip and allows the device to act a USB host for the USB based music keyboard. Then you are covered for both types. Although, I still think the virtual serial port method is more flexible and would be easier to program in the long run. The Arduino device will be harder to change than a desktop program or service.
还有另一种可能: 单手和弦键盘已经存在。我看过关于它们的视频,但你必须确定它们是否会伤害你的手。
考虑在硬件上模拟usb(或ps/2?)键盘。您将不再依赖于特定的操作系统或特定的操作系统API。硬件解决方案将经受住时间的考验。当其他人都在使用Windows 11时,不要在Windows 7中使用旧的API !Arduino很容易学。
Arduino MIDI硬件是现成的 Arduinos已被用于模拟键盘设备
有很多关于Arduino的信息和帮助。这是一个为新手打造的硬件黑客平台。现在谷歌正在推广Arduino,它只会变得更大。
编辑:虚拟USB键盘软件和硬件
以MAME街机游戏为例。他们已经建立了硬件设备,允许输入任意数量的不同项目。例如,iPac将输入设备的信号转换为USB,然后计算机可以使用USB来模拟按键。您可以使用任意组合的输入设备,只要不需要疯狂的编程逻辑就可以,因为解释输入的软件已经完成并经过了良好的测试。
我见过飞行模拟器座舱输入,自定义亭,和投票系统建立在这种方法.....而且价格也很合理!
推荐文章
- 移动文本字段时,键盘出现迅速
- 电话:用于文本输入的数字键盘
- 出现键盘时,Flutter小部件将调整大小。如何预防这种情况?
- 当文本字段被选中时,滚动UITableView
- 你如何告诉如果大写锁定使用JavaScript?
- 我如何检测软件键盘在Android设备上是否可见?
- Android:当焦点在EditText上时自动显示软键盘
- 如何解散键盘的UITextView与返回键?
- 如何解除屏幕上的键盘?
- 在JS/jQuery中绑定方向键
- Android:我如何防止软键盘把我的视图往上推?
- 编辑文本聚焦时如何显示软键盘
- 运行javascript函数时,用户完成输入,而不是上键?
- 把钢琴键盘当作电脑键盘使用
- Xcode 6:键盘在模拟器中不显示