MIDI / OSC web interface

595 views
Skip to first unread message

Martin Klang

unread,
Mar 5, 2013, 8:30:01 AM3/5/13
to hackspace_group Hack Space
question to all you knowledgeable people:

I'd like to create a simple web interface to control a music device on a server using OSC or MIDI.
The idea is that people can go to my web page, drag some sliders up and down, and it generates OSC (or MIDI) messages on the server.

Searching for this I've come across the Web MIDI API [1], which looks cool and appears to be set for inclusion in HTML5.
However it solves a different problem, since I don't want to control MIDI devices on the client, but on the server/host.

I could code a web-to-midi back-end myself, but if anyone knows of prior work it could save me a lot of trouble.

Martin

[1] http://www.w3.org/TR/2012/WD-webmidi-20121025/

Panagiotis Tigas

unread,
Mar 5, 2013, 8:46:10 AM3/5/13
to Martin Klang, hackspace_group Hack Space
Hi Martin,

I wouldn't suggest you to go that way and try something so experimental. Alternatively you can use websockets and send requests from html5 to a service running node.js which will proxy websockets to OSC or MIDI. It should look like this.

browser <------> node.js service <------------> [list of devices]

Quick google search returned me the following:

cheers


--
You received this message because you are subscribed to the Google Groups "London Music Hack Space" group.
To unsubscribe from this group and stop receiving emails from it, send an email to london-music-hack...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Panagiotis Tigas

http://ptigas.com/

Martin Klang

unread,
Mar 6, 2013, 4:21:58 AM3/6/13
to Panagiotis Tigas, hackspace_group Hack Space

thanks Panos, good links -
I might still have to roll my own to get web->midi as well as midi->web, but it's a starting point.

cheers,

Martin

henrique matias

unread,
Mar 11, 2013, 3:16:58 PM3/11/13
to codeoclock, london-musi...@googlegroups.com, Panagiotis Tigas
I have no doubts that this part of the process will be solved in node.js, if you need more stuff in the server than maybe you might need something else, if its simply a remote controller with html GUI, node.js is the way to go.

I have played with Web MIDI myself, and its cool, but as you said doesn't solve the problem you have now.

Regarding the communication, you'll use http://socket.io to keep an "alive" connection from the user to your server, it has fallback to flash and all the crap so you don't have to worry about learning the internal things.

You'll probably want to run your own server, so using the most recent version of node is advised since the combination of node.js + socket.io might result in memory leak as stated here: http://jpallen.net/2013/03/08/tracking-down-a-memory-leak-in-node-js-and-socket-io/

Anything let me know,

speak soon

On 11 March 2013 14:28, codeoclock <hugh...@gmail.com> wrote:
I've done something similar enough to that recently, called Sonify Everything. It sends midi notes to a browser to be played by midi.js, and uses node.js as a server, which can accept notes from a midi keyboard, or some other algorithm that sonifies data. It uses the Pusher API to transfer data, although I'm sure there are ways to do it with much less latency - it currently seems to be averaging about 300ms, which from a musical standpoint is obviously not ok. Unfortunately I can't open source it yet, because it is not finished, and I plan to submit it to my university for assessment and their policy is that a project has to be private until after assessment, but if you want to have a look at the code please get in touch. @hughrawlinson on Twitter, or hu...@codeoclock.net.

Martin Dittus

unread,
Mar 13, 2013, 10:05:31 AM3/13/13
to Martin Klang, hackspace_group Hack Space
I'd keep it simple.

Every scripting language you may use to build a website can send packets over TCP or UDP, which is all you need. Either write your own OSC implementation (it's not hard, particularly if you only want to send specific messages) or search for OSC libraries in your language of choice. (Since OSC is a stateless protocol you don't even need to retain session state between requests.)

Happy to give you some further pointers if you let me know speci

m.

Martin Dittus

unread,
Mar 13, 2013, 10:16:17 AM3/13/13
to Martin Klang, hackspace_group Hack Space
Whoops.

That should have been: Happy to give you some further pointers if you let me know what messages you're trying to generate (just sliders?), what scripting language you'd like to use, what instruments you want to control, etc.

m.
Reply all
Reply to author
Forward
0 new messages