Old 07-06-2019, 10:36 AM   #1
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default Sending an NRPN message from a midi item

Hi,

I need to send an NRPN message to an external synth to automate a parameter periodically. It doesn't need to be continuous, just needs to fire every now and again.

Is there a way I can do this?
Travesty is offline   Reply With Quote
Old 07-06-2019, 12:58 PM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

I suppose it should be rather easy to write a JSFX plugin that sends out NRPN messages when requested to do so by a Midi message, a move of a slider or some timing definition.

-Michael
mschnell is offline   Reply With Quote
Old 07-06-2019, 01:48 PM   #3
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,359
Default

You can send NRPN from the MIDI editor, but it's quite convoluted, because they are spread out across 3 CC lanes.

You need to create
- CC99 (NRPN MSB)
- CC98 (NRPN LSB)
and either
- CC6 (Data entry LSB)
or, if you need 14 bit data entry
- CC6/38 (Data entry 14bit)

and create an event on each lane with the appropriate value and make sure they get sent in the above order.

Probably, as it's such a pita to create them in Reaper, you should consider to create a MIDI item for each of the NRPNs you regularly need and save them as a project bay (or as MIDI files), so you can grab them from there.
gofer is offline   Reply With Quote
Old 07-09-2019, 03:51 PM   #4
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

Thanks guys, I saw those ccs in the midi editor, but wasn't sure how to use them, I'll try that.
Saying that though, it would also be useful to have an nrpn translator jsfx. How difficult would that be? Do you have any pointers?
Travesty is offline   Reply With Quote
Old 07-09-2019, 09:36 PM   #5
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Quote:
Originally Posted by Travesty View Post
it would also be useful to have an nrpn translator jsfx. How difficult would that be? Do you have any pointers?
I can do one for you. What event should trigger the output of what NRPN message ?

-Michael
mschnell is offline   Reply With Quote
Old 07-10-2019, 05:06 AM   #6
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

I was thinking more of a general purpose translator, if that were possible
Travesty is offline   Reply With Quote
Old 07-10-2019, 05:57 AM   #7
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Quote:
Originally Posted by Travesty View Post
I was thinking more of a general purpose translator, if that were possible
What exactly is "general Purpose" and what do you want to "translate" ?

If you simply want to translate a normal CC message to a dedicated NRPM message, that would be an easy starting point (but not very "general purpose".

-Michael
mschnell is offline   Reply With Quote
Old 07-10-2019, 08:12 AM   #8
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

For my purposes, which is controlling external synths from reaper, a plugin which had sliders assignable to nrpns which you could then automate or map to a control would be very useful
Travesty is offline   Reply With Quote
Old 07-10-2019, 02:31 PM   #9
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

I'll do a draft for you tomorrow...
-Michael
mschnell is offline   Reply With Quote
Old 07-11-2019, 05:59 AM   #10
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Here you are:

Code:
desc:Slider to Midi NRPM
author: Michael Schnell (mschnell@bschnell.de)
version: 1.0
changelog: initial release
donation: United Nations Foundation http://www.unfoundation.org/
about:
  ## Description
  Sends an RPM message according to the channel and Parameter No setting whenever the Value value slider is modified manually or by automation
  Compress: don't send messages for partial values that did not change
  Reset Parameter No: After sending a message seqence set parameter No to 0 to free CC # 6 and #38 for normal use
  
// reference: http://www.philrees.co.uk/nrpnq.htm

slider1:0<0,16,1{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}>Channel
slider2:0<0,16383,1>Parameter No
slider3:0<0,16383,1>Parameter Value
slider4:1<0,127,1{No,only CC 6 & 38,All}>Compress
slider5:1<0,127,1{No,Yes}>Reset parameter No

@init
  cc    = 0xB0;
  mes12 =  99;  // NRPM MSB 
  mes22 =  98;  // NRPM LSB 
  mes12x= 101;  //  RPM MSB 
  mes22x= 100;  //  RPM LSB 
  mes3xx= 127;  // Parameter NULL
  mes32 =   6;  // Data Entry MSB
  mes42 =  38;  // Data Entry LSB 
  old   =  -1;
  mes13old = -1;
  mes23old = -1;
  mes33old = -1;
  mes43old = -1;
  ch = -1;
  
@slider
  ch != slider1 ? (
    ch = slider1;
    old = -1;
    mes13old = -1;
    mes23old = -1;
    mes33old = -1;
    mes43old = -1;
  );
  mesx1 = cc + slider1;
  mes13 = (slider2 >> 7) & 0x7F;
  mes23 = slider2 & 0x7F;
  mes33 = (slider3 >> 7) & 0x7F;
  mes43 = slider3 & 0x7F;
  new   = slider3;

@block
  old != new ? ( 
    slider4 ? (
      mes13old != mes13 ? midisend(0,mesx1,mes12,mes13);
      mes23old != mes23 ? midisend(0,mesx1,mes22,mes23);
      mes33old != mes33 ? midisend(0,mesx1,mes32,mes33);
      mes43old != mes43 ? midisend(0,mesx1,mes42,mes43);
      slider4 > 1 ? (
        mes13old = mes13;
        mes23old = mes23;
      );  
      mes33old = mes33;
      mes43old = mes43;
     ) : ( 
      midisend(0,mesx1,mes12,mes13);
      midisend(0,mesx1,mes22,mes23);
      midisend(0,mesx1,mes32,mes33);
      midisend(0,mesx1,mes42,mes43);
    );
    slider5 ? (
      midisend(0,mesx1,mes12x,mes3xx);
      midisend(0,mesx1,mes22x,mes3xx);    
    );
    old = new;
  );
-Michael
mschnell is offline   Reply With Quote
Old 07-11-2019, 02:29 PM   #11
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 797
Default

Have you checked Ctrlr? Making panels from scratch there requires some time, but may be someone has done that for your synth already.
azslow3 is offline   Reply With Quote
Old 07-11-2019, 09:34 PM   #12
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Quote:
Originally Posted by azslow3 View Post
Have you checked Ctrlr? Making panels from scratch there requires some time, but may be someone has done that for your synth already.
In what way is this related to the NRPM issue ?

-Michael

Last edited by mschnell; 07-11-2019 at 11:34 PM.
mschnell is offline   Reply With Quote
Old 07-11-2019, 10:59 PM   #13
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 797
Default

Quote:
Originally Posted by mschnell View Post
In what way is thi related to the NRPM issue ?

-Michael
Just another view angle on the problem. If hardware synth is represented by Ctrlr panel (which internally can send/receive corresponding messages), automating something can be done the same way as with a soft synth parameters.
azslow3 is offline   Reply With Quote
Old 07-12-2019, 07:54 AM   #14
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

I was using the official plugin controller for the synth and automating via that, but not all functions are present, plus it's overkill for what I'm actually trying to do, which is to set the synth to the scale of whatever tune is currently playing in a live situation. Plus it gets a bit funny when you have multiple instances open. This is the Dave Smith / Pioneer Toraiz AS1 btw.


I'll give the JS a try, thanks!
Travesty is offline   Reply With Quote
Old 07-12-2019, 11:53 PM   #15
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Let me know if you need further assistance...
If you confirm it works, I'll upload the code to ReaPack.

-Michael
mschnell is offline   Reply With Quote
Old 07-15-2019, 06:30 AM   #16
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

Will try it out tonight, cheers
Travesty is offline   Reply With Quote
Old 07-15-2019, 01:42 PM   #17
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 798
Default

Works great, thanks.

I edited the value slider range to 21 because that's the range of the control I'm interested in.
It might be worth having a way to set the range of the slider without going into the code, if that is possible. The max any of the controls on this synth is 256, so if anyone wanted to automate something like that and didn't know you could easily change the code, might be a bit fiddly.

Good stuff though, it has solved the problem
Travesty is offline   Reply With Quote
Old 07-15-2019, 02:02 PM   #18
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
Default

Uploaded it to ReaPack...
-Michael
mschnell is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.