我有RSI问题,尝试了30种不同的电脑键盘,都让我很痛苦。弹钢琴不会给我带来痛苦。我已经弹钢琴20年了,没有任何疼痛问题。我想知道是否有一种方法可以从MIDI键盘捕获MIDI并输出键盘敲击。我对MIDI一无所知,但我想要一些关于如何将这个信号转换成按键的指导。


当前回答

学习速记吧!

从你们的讨论来看,这很明显。从技术角度来看,你不想重新发明任何轮子。但是,一旦你建立了联系(这个问题要问的是什么)并开始工作,你仍然有大部分工作要做:你必须训练你的大脑。你还必须发明最聪明、最有效的方法来做到这一点——这是一个完全脱离计算机技术的设计问题。你或者我们任何人都不够格。

幸运的是,经过几个世纪的成熟,这个问题已经得到了解决和磨练……

学速记!

是的,这会花掉你一大笔钱。但是,你自己几百个小时的时间又有什么价值呢?结果却不是那么好。此外,维基百科上的速记文章说,“它看起来更像钢琴键盘”。

当然,除非你想要一个杂耍效果。我不得不承认,我从来没有想过这种可能性,看到有人从钢琴键盘上打出一段文字真的很有趣!

你可以从一个带有触控板的USB键盘开始(或者一个指向杆会更符合人体工程学?),使用Plover来翻译它(我相信它可以配置为让非字母键保留其功能,因为它们对编程至关重要),或者,遵循线程Re: Plover键盘来滚动你自己的USB速记键盘,或者,购买一个速记键盘。

好运!

其他回答

考虑在硬件上模拟usb(或ps/2?)键盘。您将不再依赖于特定的操作系统或特定的操作系统API。硬件解决方案将经受住时间的考验。当其他人都在使用Windows 11时,不要在Windows 7中使用旧的API !Arduino很容易学。

Arduino MIDI硬件是现成的 Arduinos已被用于模拟键盘设备

有很多关于Arduino的信息和帮助。这是一个为新手打造的硬件黑客平台。现在谷歌正在推广Arduino,它只会变得更大。

编辑:虚拟USB键盘软件和硬件

要解决这个问题,你需要做一些事情:

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.

还有另一种可能: 单手和弦键盘已经存在。我看过关于它们的视频,但你必须确定它们是否会伤害你的手。

这不会太难。

我假设你用的是Windows,不过我不确定。我已经用普通的c++编写了一个MIDI排序器http://pianocheetah.com,它允许您使用钢琴键盘来运行命令。没有任何理由你不能做同样的事情来按键 进入键盘输入流。

但是现在来吧。你记得你花了多长时间来学习 首先是键盘,对吧? 你愿意再经历一次吗? 你愿意让你的键盘被污染吗 上面全是一堆愚蠢的关键符号?

你至少要用26个字母,10个数字,11个标点符号, 以及至少12个功能键及其移位状态。 所以有60个键加上移位的状态。 那会消耗掉整整5个八度的音阶。 你会一直做钢琴“跳”。 向触摸打字说再见。

你可能避免了肢体劳损,但你已经制造了另一种劳损 对你自己来说是不同类型的噩梦。

祝你的老板能在上班时给你买一个迷笛键盘。

如果你真的学会了弹钢琴,你就学会了 如何释放压力。用QWERTY键盘。 没有紧张。开始缓慢。

如果你懂Java编程,你可以这样使用:

首先,实现一个javax.sound.midi.Receiver,使用send(..)方法将“Note on”事件映射到你想要的击键。

您需要使用它的getMessage方法获取MidiMessage的内容,并按照您的方式解释它。消息字节的含义可以在MIDI消息中找到。

在接收到某个键盘键的'note on'或'note off'后,您可以通过为它分配KeyEvent类的常量将其映射到您喜欢的键,例如c# 4 -> KeyEvent。VK_A等等。然后,java.awt可以使用这个键代码。Robot的keyPress和keyRelease方法实际发送击键到操作系统,从而发送到其他应用程序。

我在大学里学的是钢琴演奏,然后接触了交互设计、编程和使用Vim,所以我实际上花了很多时间来创建这样的原型。

在Linux中,通过使用为多媒体艺术家设计的图形化编程语言“Pure Data”以及Alex Andre设计的x11key外部代码,可以很快地实现这一点。

在Mac上,你可以使用MidiStroke。我相信Windows上的一个方法是使用MidiOx和AutoHotKey工具。还有一次,我有一个使用Java插件的Max/MSP版本。我相信Patrice Colet为Pure Data做了一个外部窗口,效果也很好,但我似乎再也找不到它了。此外,MaxMSP还有一个外部组件,可以在Windows上执行此操作。最后,这个非免费但很棒的Osculator可以做你想做的事情-请参阅功能页面。

当我让它工作时,我从来没有坚持过,因为我无法停止使用这种布局。不过,把显示器放在电子键盘上就很酷!祝你好运。