Page 1 of 1

Handling NRPNs in M4L

Posted: Mon Mar 29, 2010 12:01 am
by Pym
In writing M4L devices to control the Tetra and Mopho I created a couple javascripts to handling converting CCs to NRPNs and back again. This should allow you to assembly incoming CCs into 14 bit NRPN Index + Value lists and send 14 bit Index + Values as 4 separate CCs to trigger an NRPN change. I haven't troubleshot everything quite yet but it's working great for the Mopho Keyboard here. Hopefully I'll get a device set up pretty soon, still need to figure out how to tunnel sysex over... bleh.

NRPNs Part 1: The Basics - The first blog post goes over what NRPNs are and how MIDI handles them since I've gotten a lot of questions around that topic.
NRPNs Part 2: Filtering NRPNs in Ableton with M4L - Describes how to use Javascript to filter NRPN values from an incoming MIDI stream and assemble them into NRPN# and value for using in M4L
NRPNs Part 3: Sending with Ableton and M4l - Covers some bitwise operations used to convert values into MSB and LSB and the actual repackaging into 4 CC packets

Let me know if anything looks wrong or if there are any bugs, hope it helps!

Re: Handling NRPNs in M4L

Posted: Mon Mar 29, 2010 4:05 am
by Hanz_Petrov
Excellent tutorials! Thanks for sharing.

Hanz

Re: Handling NRPNs in M4L

Posted: Mon Apr 05, 2010 4:35 pm
by citric_acid
that sounds nice...if you have any patch to share or to test, please let us know. i own a mopho and a tetra, i love it an if i can handle it with max for live it will be verry cool.

thx,
cit

Pym wrote:In writing M4L devices to control the Tetra and Mopho I created a couple javascripts to handling converting CCs to NRPNs and back again. This should allow you to assembly incoming CCs into 14 bit NRPN Index + Value lists and send 14 bit Index + Values as 4 separate CCs to trigger an NRPN change. I haven't troubleshot everything quite yet but it's working great for the Mopho Keyboard here. Hopefully I'll get a device set up pretty soon, still need to figure out how to tunnel sysex over... bleh.

NRPNs Part 1: The Basics - The first blog post goes over what NRPNs are and how MIDI handles them since I've gotten a lot of questions around that topic.
NRPNs Part 2: Filtering NRPNs in Ableton with M4L - Describes how to use Javascript to filter NRPN values from an incoming MIDI stream and assemble them into NRPN# and value for using in M4L
NRPNs Part 3: Sending with Ableton and M4l - Covers some bitwise operations used to convert values into MSB and LSB and the actual repackaging into 4 CC packets

Let me know if anything looks wrong or if there are any bugs, hope it helps!

Re: Handling NRPNs in M4L

Posted: Fri Apr 09, 2010 6:51 pm
by solconnection
Wow, wonderful stuff, thanks!

I am trying to do a rough and ready interface for my moog voyager RME (i dont really have the time at all to be working on this project but anyway..).

In its midi implementation it has a list of standard CC's it responds to, but some params respond to NRPN , ie.

Image

is it possible to hook a live.dial up to your nrpn_to_cc.js to get it to generate a value suitable for sticking in the CC inlet of midiformat? any ideas on how i would specify the MSB and LSB as shown in the image above?. For example, say i wanted to control LFO rate: 3 MSB 35 LSB or OSC 1 Wave: 9 MSB 41 LSB?

Id really appreciate your advice here :)

thanks in advance, have a nice day
-Dan

Re: Handling NRPNs in M4L

Posted: Sat Apr 10, 2010 10:42 pm
by phunk80
Dan, how is your progress?Have you started yet? I a planned to do exactly the same...build an editor for my RME..

sorry for hijacking this thread. Thank you for the tuts on nrpn, highly appreciated. ;)

Re: Handling NRPNs in M4L

Posted: Sat Apr 10, 2010 11:03 pm
by hautlle
I would definitely be interested in seeing your work as well. As a proud new owner of both a Tetr4 and M4L this is the exact type of thing I was looking at getting into! I'll be reading those blogs while I'm here at work and hopefully I'll start on something once I get home.

Re: Handling NRPNs in M4L

Posted: Sat Apr 10, 2010 11:57 pm
by solconnection
phunk80 wrote:Dan, how is your progress?Have you started yet? I a planned to do exactly the same...build an editor for my RME..

sorry for hijacking this thread. Thank you for the tuts on nrpn, highly appreciated. ;)
hey mate, glad to hear you have plans for something too.

Ive knocked up an interface (for now just modelled on the actual knobs available on the RME, no special extras yet) and mapped some of the simple CC's...it just sends to the voyager for now but doesn't receive anything back (ie. if you twist a knob on the voyager the max patch doesn't update)

to be honest i haven't done that much at all, i wanted to get this NRPN issue sorted before i did anything else. Ill send you a pm and let you know if i come up with anything interesting though

-Dan

Re: Handling NRPNs in M4L

Posted: Wed Aug 04, 2010 11:58 am
by thenicowski
:oops: Hey guys,

im sorry to take that old thread to alive, but i have a couple of questions in case of the tetra.
I´m really basic in Max and just start with this gui for the tetra.

it´s not final and some paramters are not correctly working but it works for the first. I read this thread and i was wondering if its possible to get the parameters from the tetra to the gui (m4l). what i want is to change the program on tetra and the parameter will sync to ableton. Possible ?
Second is maybe very basic but i see some of the cables in the gui and didnt find a solution the keep them away.

here is the patch maybe someone can help me
http://www.sendspace.com/file/cs5bq5

Re: Handling NRPNs in M4L

Posted: Sun May 06, 2012 1:22 am
by Syncretia
Hey. Time for a thread resurrection.

I just bought a Tetra the other day and was horrified when I realised that there was no way to do sound design and parameter automation through Ableton.

My first reaction was to jump in to M4L for this, but I quickly learned that M4L doesn't support Tetra's protocol SysEx out of the box, so then I stumbled upon this thread.

So now, I need to know: has anyone got a working patch yet? I know there's an M4L patch that works with midi CCs but that's not a full implementation. I'm very keen to get this going and am happy to spend as much time as necessary to get a working controller going.

Also, has anyone played with the Reaktor version? It seems like they've done a NRPN implementation in Reaktor but I can't get the Reaktor patch to work. Has anyone gotten it to work? Anyway, I've got a full day off today and really wanted to get stuck in to sound design with the Tetra but instead I'm chasing up programming leads like I do at work every day :(

PS: The link in the post above is down. Does this patch still exist?

Re: Handling NRPNs in M4L

Posted: Sun May 06, 2012 2:08 am
by Syncretia
Also, from reading all this and the Tetra manual, I'm starting to get the impression that it's going to be impossible to create a proper editor inside M4L because M4L blocks SysEx messages. Now, this is the picture that's starting to emerge in my mind:

-It seems that you can send a sysex message to the tetra to request a data dump
-The data data returns with all the parameters what they are set to on the current patch

This is how the Tetra editor works. I've noticed through a midi monitoring tool, the Tetra does a data dump every time I click on the editor's screen. I'm guessing that the editor, when focus is gained, sends a request to the tetra for data, receives the data, and then updates all the parameters on the screen with values from the data dump. This is what I need to do.

Is this going to be impossible in M4L? Am I going to have to create a VST to do this instead?

Re: Handling NRPNs in M4L

Posted: Tue May 08, 2012 8:34 pm
by twisted-space
Syncretia wrote:Am I going to have to create a VST to do this instead?

It's actually Live that blocks sysex, not M4L.
A vst editor must have direct access to a real or virtual midi port to be able to send and recieve sysex from inside live.