我有RSI问题,尝试了30种不同的电脑键盘,都让我很痛苦。弹钢琴不会给我带来痛苦。我已经弹钢琴20年了,没有任何疼痛问题。我想知道是否有一种方法可以从MIDI键盘捕获MIDI并输出键盘敲击。我对MIDI一无所知,但我想要一些关于如何将这个信号转换成按键的指导。
当前回答
在我看来,你不是在寻求如何自己建立它的建议,而是更多地询问已经有什么资源可以实现你想要的。根据你的操作系统,有很多方法可以实现这一点,而不必从头开始编写自己的程序:
MIDI中风
免费的。适用于Mac OS X 10.3及以上版本。这一款特别提供了“使用任何MIDI键盘作为完整的电脑键盘替代品的能力”。
Bome的迷笛翻译
免费/明信片(有点奇怪)。对于Windows 2000及以上版本,以及Mac OS x,它最初似乎更倾向于autohotkey类型的使用,但进一步研究,我认为它可以很好地做你想做的事情。
Max和aka,键盘
免费的。对于Mac OS x来说,这并不是一个“现成的”解决方案,但如果你对基本的设备配置感到满意,它应该不会太糟糕。
其他回答
实际上,我在这个工作了一段时间前,试图捕捉摇滚乐队鼓输入到我的计算机(做一个小Java自制鼓模拟器)无论如何,我问了一个问题在这里,时间延迟问题(有轮询代码在那里,以及我试图做的事情。)如果我能找到我的程序,我可以给你的代码,它使用第三方API (JInput)。
祝你好运。
我在大学里学的是钢琴演奏,然后接触了交互设计、编程和使用Vim,所以我实际上花了很多时间来创建这样的原型。
在Linux中,通过使用为多媒体艺术家设计的图形化编程语言“Pure Data”以及Alex Andre设计的x11key外部代码,可以很快地实现这一点。
在Mac上,你可以使用MidiStroke。我相信Windows上的一个方法是使用MidiOx和AutoHotKey工具。还有一次,我有一个使用Java插件的Max/MSP版本。我相信Patrice Colet为Pure Data做了一个外部窗口,效果也很好,但我似乎再也找不到它了。此外,MaxMSP还有一个外部组件,可以在Windows上执行此操作。最后,这个非免费但很棒的Osculator可以做你想做的事情-请参阅功能页面。
当我让它工作时,我从来没有坚持过,因为我无法停止使用这种布局。不过,把显示器放在电子键盘上就很酷!祝你好运。
在Java中,可以使用JMF (Java Media framework)来转换MIDI信号。 键盘设计的基本是易于使用,即用户界面;并把常用的字符/符号放在手边。
Java Sound Resources中的示例代码和API:示例:数字信号处理(DSP)有助于理解如何处理信号。
更多参考资料:
用控件处理音频 数字音频信号处理,第二版
有一个程序叫做GlovePIE。您可以用一种简单的脚本语言对它进行编程,而且我相信它支持MIDI。我不确定这是否符合“Java”的范畴,但它仍然是一个伟大的程序。我用它来控制使用PS3控制器的机器人。它非常强大。
要解决这个问题,你需要做一些事情:
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.
还有另一种可能: 单手和弦键盘已经存在。我看过关于它们的视频,但你必须确定它们是否会伤害你的手。
推荐文章
- 移动文本字段时,键盘出现迅速
- 电话:用于文本输入的数字键盘
- 出现键盘时,Flutter小部件将调整大小。如何预防这种情况?
- 当文本字段被选中时,滚动UITableView
- 你如何告诉如果大写锁定使用JavaScript?
- 我如何检测软件键盘在Android设备上是否可见?
- Android:当焦点在EditText上时自动显示软键盘
- 如何解散键盘的UITextView与返回键?
- 如何解除屏幕上的键盘?
- 在JS/jQuery中绑定方向键
- Android:我如何防止软键盘把我的视图往上推?
- 编辑文本聚焦时如何显示软键盘
- 运行javascript函数时,用户完成输入,而不是上键?
- 把钢琴键盘当作电脑键盘使用
- Xcode 6:键盘在模拟器中不显示