Controlling a web based app using USB midi controller
I'd like to connect a USB midi controller (88 key keyboard) and use the keys to control a web based application.
I've seen people using web-based apps to control arduino based robots so think this may be possible?
Q1 is this possible? Or has it already been done? Q2 if it IS possible can you please outline the process? Q3 can you post links to 开发者_StackOverflow中文版any open source examples/libraries?
Can you explain a little more about what you want to do? There would be a couple of different ways to do this.
Use an existing MIDI library to respond to MIDI events and then send a series of keyboard-keystrokes to do things.
Create a custom server that runs on your computer and talks to your device. You can then connect to your "MIDI" server and transmit and receive data using sockets (ie, you could create a controller surface in Flex or Silverlight if you wanted to). I used an approach like this to build a MIDI controller app on an Android handset.
Create a web site that talks to your device. This would use pretty much the same techniques as #2. I've actually gotten this working with an ASP .NET webite, it was a very simple proof of concept - you load a page and it plays a note on your MIDI device. With the library I mention below, you pretty much just "open" your device then listen for data and transmit data.
I created my own MIDI over TCP/IP library based on this sample code over at CodeProject: http://www.codeproject.com/KB/audio-video/midiwrapper.aspx.
I was planning on Open Sourcing the code put haven't had time to get it ready. If there is enough interested I could be convinced to post it up somewhere.
精彩评论