Handling NRPNs in M4L

Questions and discussion about building and using Max for Live devices
Post Reply
Pym
Posts: 3
Joined: Sun Mar 28, 2010 11:48 pm
Location: San Francisco
Contact:

Handling NRPNs in M4L

Post by Pym » Mon Mar 29, 2010 12:01 am

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!
Chris aka. Pym
Dave Smith Instruments

Hanz_Petrov
Posts: 119
Joined: Sat Feb 06, 2010 2:39 pm
Contact:

Re: Handling NRPNs in M4L

Post by Hanz_Petrov » Mon Mar 29, 2010 4:05 am

Excellent tutorials! Thanks for sharing.

Hanz
http://remotescripts.blogspot.com/ - an introduction to the Framework classes

citric_acid
Posts: 62
Joined: Wed Nov 21, 2007 9:30 am
Location: Bocholt - NRW - Germany
Contact:

Re: Handling NRPNs in M4L

Post by citric_acid » Mon Apr 05, 2010 4:35 pm

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!
iMac 2,5 ghz, 4 GB ram... actual OS X, MOTU Traveller MK2
MacBook 2GHz,1GB, Audio Kontroll 1, Live 8, Max4Live
to mutch Hardware....

solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Re: Handling NRPNs in M4L

Post by solconnection » Fri Apr 09, 2010 6:51 pm

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

phunk80
Posts: 6
Joined: Mon Nov 09, 2009 5:20 pm

Re: Handling NRPNs in M4L

Post by phunk80 » Sat Apr 10, 2010 10:42 pm

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. ;)

hautlle
Posts: 55
Joined: Wed Nov 25, 2009 6:55 am

Re: Handling NRPNs in M4L

Post by hautlle » Sat Apr 10, 2010 11:03 pm

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.

solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Re: Handling NRPNs in M4L

Post by solconnection » Sat Apr 10, 2010 11:57 pm

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

thenicowski
Posts: 1
Joined: Sun Nov 08, 2009 9:08 pm

Re: Handling NRPNs in M4L

Post by thenicowski » Wed Aug 04, 2010 11:58 am

: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

Syncretia
Posts: 328
Joined: Tue Jun 14, 2011 9:34 pm
Location: Melbourne
Contact:

Re: Handling NRPNs in M4L

Post by Syncretia » Sun May 06, 2012 1:22 am

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?
Download and listen @ http://www.syncretia.com

Syncretia
Posts: 328
Joined: Tue Jun 14, 2011 9:34 pm
Location: Melbourne
Contact:

Re: Handling NRPNs in M4L

Post by Syncretia » Sun May 06, 2012 2:08 am

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?
Download and listen @ http://www.syncretia.com

twisted-space
Posts: 1250
Joined: Fri Aug 31, 2007 5:50 pm
Location: UK Midlands

Re: Handling NRPNs in M4L

Post by twisted-space » Tue May 08, 2012 8:34 pm

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.

Post Reply