如何像笔记本电脑的触摸板一样使用MIDI控制器? [英] How to use MIDI controller like a laptop touchpad?

查看:174
本文介绍了如何像笔记本电脑的触摸板一样使用MIDI控制器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MIDI控制器,带有X-Y触摸板,输出的数值在0到127之间.我想用C#编写一个程序,使其像鼠标一样.分辨率太低而无法使用绝对屏幕坐标,那么我该如何使用笔记本电脑触摸板之类的相对坐标?

I have a MIDI controller with an X-Y touchpad that outputs values between 0 and 127. I want to write a program in C# that makes it act like a mouse. The resolution is too low to use absolute screen coordinates, so how would I go about using relative coordinates like a laptop touchpad?

推荐答案


一个.将其控制的区域限制为可以产生的值的范围
b.缩放值,即Mouse.X = (Screen.Width/128) * controller.X;

许多MIDI控制器可以输出两个很多的7位值,以提供14位CC分辨率-如果未使用运行状态,则还会得到状态字节的重复,以及配对的控制器字节.看起来像

You can do either or both of these
a. limit the area it controls to the range of values it can produce
b. scale the values i.e Mouse.X = (Screen.Width/128) * controller.X;

Many MIDI controllers can output two lots of 7 bit values to give 14 bit CC resolution - you also get a repeat of the status byte if running status isn''t used, plus the paired controller byte. This would look something like

1sssssss (status)
0ccccccc (controller LSB)
0vvvvvvv (LSB value)
1sssssss (status if no running status)
0ccccccc (controller MSB)
0vvvvvvv (MSB value)



您的控制器可能具有启用此设置的设置,该设置将为您提供0-16383,这会足够!



Your controller may possibly have a setting to enable this which would give you 0 - 16383 which would be plenty!


它可以发送使用2个字节的弯音,以便对一个轴进行排序.还有其他使用2个字节的CC可以使用吗?
It can send pitchbend which uses 2 bytes so that''s one axis sorted. Are there any more CCs that use 2 bytes that I can use?


它们都在 http://www.midi.org/techspecs/midimessages.php [ ^ ].

控制器0至31与控制器32至63配对以提供14位.有很多是未定义"的,因此最好使用其中一个或多个.
They are all listed http://www.midi.org/techspecs/midimessages.php[^] in table 3.

Controllers 0 thru 31 are paired with controllers 32 thru 63 to give 14 bits. There are many that are ''Undefined'' so it would be a good idea to use one or more of those.


这篇关于如何像笔记本电脑的触摸板一样使用MIDI控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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