HID to MIDI with MAX

Learn about building and using Max for Live devices.
Post Reply
sham-79
Posts: 33
Joined: Fri Jan 07, 2011 10:26 am

HID to MIDI with MAX

Post by sham-79 » Wed Apr 13, 2011 5:03 pm

I'm a total Max Newbie so please forgive my lack of knowledge,

Are there any ready made patchers for converting HID to MIDI cc and/or notes. I am aware of 'hi' object but am getting stuck trying to implement it...I've only been using Max for a couple of days but am finding it a truly alien experience to anything I’ve used before.

Cheers
S

pucklermuskau
Posts: 118
Joined: Thu Nov 18, 2004 7:26 pm
Contact:

Re: HID to MIDI with MAX

Post by pucklermuskau » Wed Apr 13, 2011 6:16 pm

have you looked at the hi object help? If you copy that whole help patch into your patch, its got a drop down menu which lets you set the device you're polling (also lets you choose different polling frequencies). Then look at the max window to see what kind of data you're getting out of your device, and then routing that into a midiformat object, and out the midiout...
i drop on the lokeymassive

sham-79
Posts: 33
Joined: Fri Jan 07, 2011 10:26 am

Re: HID to MIDI with MAX

Post by sham-79 » Thu Apr 14, 2011 3:22 pm

Thanks for that, I finally managed to get some MIDI out of my old PS2 controller and in to Ableton, even if in a completely uncontrolled way, but at least I sort of understand the process now.

My PC can now recognise the game pad as a 'USB joystick' and all the buttons trigger a different value response but I’ll need to do some work the relative MIDIout values with if I'm going to make it useful. In your opinion should I use a conversion matrix or something to change the MIDI cc/notes generated for ones I want or is it better to use the MIDI learn function in Ableton? I'm guessing one method is easier for note related play and the other for control commands, both of which I'd like to achieve... I've tried neither yet.

Thanks again

toscanini
Posts: 410
Joined: Thu May 05, 2005 5:42 pm

Re: HID to MIDI with MAX

Post by toscanini » Thu Apr 14, 2011 5:20 pm

Hey,

You'll need to go through some trial and error play. The attached image shows what the hi object outputs for my computer keyboard for four key presses and releases. I assume for other hi sources you'll also get messages in the form of lists of two integers. And probably more than one message per action.
Image
In my case I wanted to keep the message where the first element is always different and the second element switches between 1 and 0 (for key press/release). I use a route object to filter that message out, and feed the element that could correspond to "pitch" into a coll object. Nice about the coll is that once you made your list of equivalencies between values and MIDI notes you can edit your "conversion matrix" by hand in coll's window.
I don't know anything about the PSP controller, it might have sophisticated velocity or double press possibilities, anyway here's a simple example of my configuration for you to check out:

<pre><code>
----------begin_max5_patcher----------
1154.3ocyY0zjiZCD8r8uBU9XJmInugbaysT4ZtM0VSgMZ8vtXfBj2LS1Z+u
Gg.6wimlw8XvDevfQROoVO5WKTqeLe1hUEOYpWP9cx8jYy9w7Yy7E0Tvrtmm
sXa7Sqyhq8MaQt4eJV80EKaqxZdx5KNqHNYqotlP2WUZhuBWi+UJaegeoH2l
Gu03q5SUowYj+nHKYe0461llmYr9gh1UXYrc8io4adnxr11ZpTQzcAKIbpn4
lR1bkFdW.4yuzQE6rm1SMidc5+5GcZfCTawssz9boos2Wrf74lZ9474MWVhj
YrEa1jY.l9pO5ziQ8yHdDu4FKX+0CSuxJSsI2FaSKxOtufm1uY9kl6FHn95X
JV4MA1oVvEPL83xrI1BwV7KwWg8NjIyOGDsSEI+N4MfuROThkrhrBfSzis9w
OiHxvlqQzyPIrOHkrJNeyhkc2GS5YaZR5Wx1U+HjaiXj4HlT6U.ReLF4XGio
UCNdbSY75uQRIoPTCcrkTsTCS6olnfahvuumOSQ01XK.yvtHgk97NMT+5Szf
fabulF1wMHPqYSGa8TWbXkmgZW.+ULCtE0BdeFqmUyDcZ4SG5wiIWWjkAQi5
qSXIFk5CKEclX2hOp1a4Q+NzmMStGRhswc7RGwzTwtbugITK6JZeyt22vCM0
Uy2LO+pl5J56wY65FZgp80wr8uL.Ay6ArFCXV.L3PLfERXvQn.qGBXFHXY.J
BKDFLE0HygAyPANb.fYBXvbTf6wrEn.2CaKQMmiF.XNrShDkvfA6dJQILDTX
vnDFxfA.l2CggRXvfCFnPILXvyYEJggbHfEv91JbBCXmDEJgAGVXnPILjrA.
V.6jnPILXvNIJbqXziYiRXH4C.LCN.nBmvnGBCkvPCCViRXHEC.LuGvnDFbX
UkFkvP2CXTBCob.f48.FkvPAqm0nDFZXeaMJgghNDvvBCMJggBVXnQILT8Lm
QILTvtmgn7sUvumCO12t6utdo8Kmqi+tI4A2NAbe.+CwVaU5pc11Ltd72Qa1
tx32z.sC93swjegPeYatGuyD0HmU.NymNIFym0Rt3Fequ6xaRYBDwbkxjDMT
gJcIrKfXVN97SkafLtAlPoNOHBkSnBBURnJBEzehO1Ioj2xTx18qKTmg2hFx
Vcg9cQrYygfDuw7F57SkkYFxelaMU4NB4uLOupHtJ4296JmWXYbBgCvoQirD
kF50lgcToOEBMI5++0D20GiUVjkAxJhwlUZyFdKqv02Djx6bLasoW+s4x75b
FA7qS5uG8yF3QnLeSuRgj36Obrw8fSxRqsuMxiuyc0ke5A05MvlxeMaUWrqZ
89tb+J8jWrwDSsMM+PZVu+kCIfPOznGSSRL4Gmv0soIkEtEY5Lhdd2g1lDuZ
3fsoSL7qsMoQPShI2hNGIEMoVDCAGomTKhJPXRzI1lbKaQBOmMMs9RTLzDeR
MoHLlzGyhnQsAkcQkatwiN7z.sUwUvVoQWGaki4cMahkDZrKBMgAyPYSSqLk
iwQiOoqUyw35Osu4THIoIz+FyJiC46YbO7y4+GvU27XL
-----------end_max5_patcher-----------
</code></pre>

cheers,
toscanini

sham-79
Posts: 33
Joined: Fri Jan 07, 2011 10:26 am

Re: HID to MIDI with MAX

Post by sham-79 » Fri Apr 15, 2011 8:01 am

Thankyou
This sounds very cool, I'll definateley have a look at the patcher over the weekend.

Cheers

S

Post Reply