简体   繁体   English

Korg Nanokey MIDI Controller 用于 Arduino?

[英]Korg Nanokey MIDI Controller for Arduino?

I have a Korg NanoKey which I'd like to use to control a simple synthesizer I've designed on the Arduino platform.我有一个Korg NanoKey ,我想用它来控制我在 Arduino 平台上设计的简单合成器。 (I have an Arduino Uno .) Basically, I don't care about MIDI, I just want to read what note the keyboard has pressed down, but if MIDI is the only way I can do that, then it's okay with me. (我有一个Arduino Uno 。)基本上,我不关心 MIDI,我只想阅读键盘按下的音符,但如果 MIDI 是我能做到这一点的唯一方法,那么我没关系。 So my big question is, how do I do this?所以我最大的问题是,我该怎么做? I haven't been able to find anyone else on the Internet who has already done this.我无法在互联网上找到其他已经这样做的人。

But more specifically, I see two challenges: First, I'd like to plug my NanoKey directly into the Arduino's USB port, but then I'm wondering if the Arduino would provide the necessary power to the NanoKey.但更具体地说,我看到了两个挑战:首先,我想将我的 NanoKey 直接插入 Arduino 的 USB 端口,但我想知道 Arduino 是否会为 NanoKey 提供必要的电源。 Second, I'm not sure what protocol I would be reading.其次,我不确定我会阅读什么协议。 Can I just read MIDI signals as described in this tutorial ?我可以按照本教程中的说明读取 MIDI 信号吗?

I don't want to curb your enthusiasm but what you're attempting might be a bit hard basket.我不想抑制你的热情,但你正在尝试的可能有点困难。 A USB system consists of a host controller and one or more peripheral devices. USB 系统由主机 controller 和一个或多个外围设备组成。 It's the host that controls traffic flow to the devices which means that devices can't transmit data on the bus without an explicit request from the host controller.它是控制设备流量的主机,这意味着如果没有来自主机 controller 的明确请求,设备就无法在总线上传输数据。

I'm not familiar with either the nanoKey or the Arduino platform but I'd be fairly confident that the nanoKey is a USB "device", normally connected to a computer which would act as the host.我不熟悉 nanoKey 或 Arduino 平台,但我相当确信 nanoKey 是 USB “设备”,通常连接到充当主机的计算机。 So what you would need for this system to work is for the Arduino to act as the host when communicating with the nanoKey.因此,要使该系统正常工作,您需要让 Arduino 在与 nanoKey 通信时充当主机。 The Arduino schematic shows that the Arduino Uno uses an ATmega8U2 for USB coms. Arduino 原理图显示 Arduino Uno 为 USB 通信使用ATmega8U2 Unfortunately the ATmega8U2 is a USB device, so you've got two peripheral devices but no host controller to facilitate the transfer of data between them.不幸的是,ATmega8U2 是一个 USB 设备,所以你有两个外围设备,但没有主机 controller 来促进它们之间的数据传输。 You'd be better off using a development board for a micro that provides either USB Host or USB On-the-Go.您最好使用提供 USB 主机或 USB On-the-Go 的微型开发板。

I opened up a Korg Nano controller yesterday and was surprised to discover that there's an AVR mega32 inside.我昨天打开了一个 Korg Nano controller,惊讶地发现里面有一个 AVR mega32。 It would be a significant undertaking, but with a bit of work you could probably work out the schematic and reprogram it yourself using their programming header breakout.这将是一项艰巨的任务,但通过一些工作,您可能会制定出原理图并使用他们的编程 header 突破自行重新编程。 You might not end up with much more functionality than you've got this other way, but it would be very educational.您最终可能不会获得比其他方式更多的功能,但它会很有教育意义。

As mentioned in the other posts, you would need to use a separate chip to provide the USB Host interface.如其他帖子中所述,您需要使用单独的芯片来提供 USB 主机接口。 Here's a great guide to using the USB Host shield by Circuits@Home to interface with an Akai LPK25 (USB Midi Keyboard).这是使用Circuits@Home 的 USB 主机屏蔽与 Akai LPK25(USB MIDI 键盘)接口的绝佳指南。

http://blog.makezine.com/2010/11/30/usbhacking/ http://blog.makezine.com/2010/11/30/usbhacking/

The Arduino sketch is provided, so you should be able to try it out, however debugging the USB Host connection could get tricky real fast if it doesn't work out of the box.提供了 Arduino 草图,因此您应该可以尝试一下,但是如果不能开箱即用,调试 USB 主机连接可能会很快变得棘手。

I agree with the Jono - you are biting off a lot - it might even end up easiest to hook the keys up to the Arduino directly - tearing out the electronics and figuring out a way to multiplex the keys into a single channel without losing polyphony (resistor 'ladder' maybe).我同意 Jono 的观点——你咬了很多东西——它甚至可能最终最容易将键直接连接到 Arduino——拆掉电子设备并找出一种方法将键多路复用到单个通道而不会丢失复音(电阻“梯子”可能)。 I any case, good luck.我无论如何,祝你好运。 Amusingly, you'd making an analog keyboard to plug into a digital synthesizer.有趣的是,你会制作一个模拟键盘来插入数字合成器。

Quick and Dirty Arduino MIDI Over USB demonstrates how to send/receive MIDI out over USB, but unfortunately, this probably isn't any help for what you are trying to do, since he's found a way to send and receive MIDI signals from a USB host, not act as a USB host himself - the opposite of your problem. Quick and Dirty Arduino MIDI Over USB demonstrates how to send/receive MIDI out over USB, but unfortunately, this probably isn't any help for what you are trying to do, since he's found a way to send and receive MIDI signals from a USB主机,而不是自己充当 USB 主机 - 与您的问题相反。 However, I thought perhaps it would be of use, if you ever wanted to control your device from a computer.但是,如果您想从计算机控制您的设备,我认为它可能会有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM