Max Midi Input

Error message

  • Notice: Use of undefined constant filter - assumed 'filter' in preg_replace() (line 1 of /home/davemr/mo-seph.com/sites/all/modules/drutex/drutex.module(363) : regexp code).
  • Notice: Use of undefined constant filter - assumed 'filter' in preg_replace() (line 1 of /home/davemr/mo-seph.com/sites/all/modules/drutex/drutex.module(363) : regexp code).
  • Notice: Use of undefined constant filter - assumed 'filter' in preg_replace() (line 1 of /home/davemr/mo-seph.com/sites/all/modules/drutex/drutex.module(363) : regexp code).
  • Notice: Use of undefined constant filter - assumed 'filter' in preg_replace() (line 1 of /home/davemr/mo-seph.com/sites/all/modules/drutex/drutex.module(363) : regexp code).
  • Notice: Use of undefined constant filter - assumed 'filter' in preg_replace() (line 1 of /home/davemr/mo-seph.com/sites/all/modules/drutex/drutex.module(363) : regexp code).
  • Notice: Use of undefined constant filter - assumed 'filter' in preg_replace() (line 1 of /home/davemr/mo-seph.com/sites/all/modules/drutex/drutex.module(363) : regexp code).
  • Notice: Use of undefined constant filter - assumed 'filter' in preg_replace() (line 1 of /home/davemr/mo-seph.com/sites/all/modules/drutex/drutex.module(363) : regexp code).
  • Notice: Undefined index: en in drutex_node_view() (line 81 of /home/davemr/mo-seph.com/sites/all/modules/drutex/drutex.module).

I've been having a fight with Max4Live recently about using midi devices. I'd like to make a gigantic patch which integrates all my control surfaces, and replaces lots of the automap functionality with something that fits my playing style better. The problem is:

  • m4l replaces max's midi functionality with its own driver, which takes midi from the Live channel the device is on.
  • so you can't use multiple devices in a patch. At least, you can't differentiate them.
  • a workaround would be to put each device on a different midi channel, and then separate the midi data inside the patch. But, Live "helpfully" forces everything to appear on channel 1. So, no luck there.
  • another workaround would be to have a max patch running, using max's midi drivers, and send/receive the data into max4live. This looks like it works while you're editing the patch, but as soon as you close it, it goes back into Live, and then send/receive doesn't work any more.

So, I think I'm left with two options:

  • use something like OSC to send midi data from standard max to m4l
  • use different midi drivers

option 2 seemed easier, so being a java kid, I wrote a real quick MXJ object to wrap java's midi functionality, and spit it out to Max. The result is in the attached zip.

Usage is like this: MXJ MidiIn use

It's been only very very lightly tested (I plugged a controller in and numbers came out what looked sorta right), and doesn't do anything fancy. In particular, I've got no idea about latency/jitter issues.

Source is included in the jar, feel free to do anything with it. No responsibility is implied whatsoever. Comments and suggestions welcomed!

Installation[edit | edit source]

Put this jar: http://www.mo-seph.com/files/midiIn.jar into a directory that MXJ is scanning for jars (look at the max.java.config.txt file in your max installation)

BTW, anyone using a Mac: the java/midi situation on OSX is a mess. Apple didn't include a java SPI in their java distribution, so you need to install one. Humantic used to make a free one (http://www.humatic.de/htools/mmj.htm) but I couldn't get it to work, and they've discontinued development. I've been using Mandolane's one (http://www.mandolane.co.uk/swMandoMidi.html) which is not free, but works. Apparently, recent versions of Snow Leopard have it built in, but I can't confirm that.

Enjoy!

AttachmentSize
midiIn.jar9.63 KB