|
|
|
09-19-2009, 04:19 PM
|
#1
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Script to convert Envelope Automation to MIDI Expression!
Hello again everyone!
I discovered today that Reaper applies automation envelope to effect variables directly. What I wanted was to automate the modwheel (CC#1) from an automation envelope.
I looked all over for the solution and couldn't find one, so I rolled my own.
>> Download JS: Automation to MIDI HERE!! <<
To install
Simply copy the script Automation_to_MIDI into one of your JS effects folder. I'm using C:\Program Files\REAPER\Effects\MIDI but any of the Effects subdirectories will work.
Example Usage
Load up Reaper, add a your favorite VSTi (Mine is Zebra2) and then add the Automation_to_MIDI script in the chain before your VSTi.
Next, select the CC message you want to automate, I left it as the default for Modwheel data:
Now, back on the track, choose the [ENV] button and this window will pop up:
In this example seleting "CC Value" will automate the Modwheel, "AT Value" will automate the channel pressure/aftertouch, and "PB value" will automate pitch bend.
I should mention it's probably best to make sure your midi track doesn't have the midi type you're going to automate in it or weird jumps/changes in sound can occur.
Finally, draw the envelope of you dreams wil all its biezer and non-linear goodness to give those filtersweeps exactly the touch your track deserves!
Now your friends still using FL Studio won't look down on you when you want to add that MIDI automation envelope. Enjoy!
Last edited by zenmonkey; 09-19-2009 at 05:44 PM.
Reason: updated stash link for version 1.1
|
|
|
09-19-2009, 04:37 PM
|
#2
|
Human being with feelings
Join Date: Oct 2006
Posts: 91
|
AWESOME
Just logged-in to the forum to start a thread about how to automate hardware synth via on-track envelope and found this one =))
|
|
|
09-19-2009, 04:41 PM
|
#3
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by medea
AWESOME
Just logged-in to the forum to start a thread about how to automate hardware synth via on-track envelope and found this one =))
|
Glad you like it!
For your need you should just be able to do the same steps above but remove the VSTi from the FX chain. Then just route the generated midi out to the synth...
|
|
|
09-19-2009, 04:54 PM
|
#4
|
Human being with feelings
Join Date: Jul 2009
Posts: 1,071
|
Really nice, thanks !
|
|
|
09-19-2009, 04:55 PM
|
#5
|
Human being with feelings
Join Date: Oct 2006
Posts: 91
|
If I need to automate several CC parameters, I need to add several instances of your plugin, right?
|
|
|
09-19-2009, 05:06 PM
|
#6
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by medea
If I need to automate several CC parameters, I need to add several instances of your plugin, right?
|
Yep, that's how I'd do it too. I thought about adding more CC entries but didn't want to add the complexity to the script.
|
|
|
09-19-2009, 05:11 PM
|
#7
|
Human being with feelings
Join Date: Oct 2006
Posts: 91
|
Anyways, great tool and exactly at the right moment, thanks again =)
|
|
|
09-19-2009, 05:48 PM
|
#8
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Updated script to version 1.1. There were just enough sliders for me to add one extra CC event to automate. The New interface looks like:
The instructions above still apply except the envelope option changed from "CC Value" to "CC A Value".
|
|
|
09-19-2009, 05:49 PM
|
#9
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by medea
Anyways, great tool and exactly at the right moment, thanks again =)
|
You're quite welcome! Version 1.1 adds another CC message. I'm afraid I'm out of sliders to add any more. Still, it'll half the number of plugs you'll need if you're doing a lot of CC messages.
Cheers!
|
|
|
09-20-2009, 12:34 AM
|
#10
|
Human being with feelings
Join Date: Jul 2007
Location: Jazz City
Posts: 5,074
|
clever AND smart! thanks, zenmonkey!
|
|
|
09-20-2009, 02:18 AM
|
#11
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
You can have up to 64 sliders on a JS interface...
|
|
|
09-20-2009, 02:38 AM
|
#12
|
-blänk-
Join Date: Jun 2008
Posts: 11,359
|
Thanks a lot
It's nice to see your plug adresses some shortcomings of ReaControlMIDI concerning the choice of CC numbers. Very much appreciated. I like the channel aftertouch slider.
ReaControlMIDI is able to show the assigned CC number in the automation window and as labels of track controls, which is nice. I guess that's just out of reach with JS plugins?
They both complement well. One thing I don't like, (I don't think you can do anything about it) is that the acchieveable values are not restricted to integers in the envelope lanes and, much more annoying, on track control knobs.
|
|
|
09-20-2009, 08:28 AM
|
#13
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by EvilDragon
You can have up to 64 sliders on a JS interface...
|
Ah, I didn't know that. I had been going by the documentation in the JS Coding HTML dump. Thanks for the tip!
That being said, I don't think I'll be adding any more sliders to this GUI. Every new value has to be polled when any of the sliders move (the @slider code block doesn't tell you which slider has moved upon entry, just that something has changed). This means if I add more sliders, the app has to do more computation on potentially unchanged sliders.
If someone really really needs >2 CC sliders at a time I would be willing to make a variant with only CC sliders (say 8 or 12).
|
|
|
09-20-2009, 08:43 AM
|
#14
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by gofer
Thanks a lot
It's nice to see your plug addresses some shortcomings of ReaControlMIDI concerning the choice of CC numbers. Very much appreciated. I like the channel aftertouch slider.
|
You're quite welcome. I don't understand why a lot of midi apps ignore aftertouch. It's dead simple as far as the midi bytestream generation is concerned. As for the CC numbers, I first though about restricting them but then thought it'd be better to let others do what they will. Far be it for me to know why someone would want to automate CC 123 (all notes off).
Quote:
Originally Posted by gofer
ReaControlMIDI is able to show the assigned CC number in the automation window and as labels of track controls, which is nice. I guess that's just out of reach with JS plugins?
|
If there is a way I couldn't figure it out. That's why I settled on "CC A Value" and "CC B Value". Internally the name I display for the CC # is really just stored as a number in one of the sliders. JS doesn't really do strings too well.
Quote:
Originally Posted by gofer
They both complement well. One thing I don't like, (I don't think you can do anything about it) is that the achievable values are not restricted to integers in the envelope lanes and, much more annoying, on track control knobs.
|
Yep, this is another limitation of JS. All sliders are floats. The good news is internally the script converts everything to integers when sending the midi stream. I use the ceil() function (there is no round(), only floor() and ceil()). So don't worry too much about numbers like 124.563, internally I just treat that as 125.
The main reasons I rolled this instead of using ReaControlMidi was the lack of aftertouch and the modwheel sent both coarse and fine values with the default position in the center...It felt very weird to me.
|
|
|
09-20-2009, 08:54 AM
|
#15
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
Maybe you should suggest this to JCS as an improvement to ReaControlMIDI?
|
|
|
09-20-2009, 11:24 AM
|
#16
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
hey zenmonkey! I had to reply in the issue tracker (votes: I don't want people to think a JS can workaround that FR) so I come to give a hand, here, if I can.. to compensate
Quote:
Originally Posted by zenmonkey
If there is a way I couldn't figure it out. That's why I settled on "CC A Value" and "CC B Value". Internally the name I display for the CC # is really just stored as a number in one of the sliders. JS doesn't really do strings too well.
|
Yes, too complex for js (or to many things to put in a single dropdown box!). To see the CC# (i.e. another JS param/slider), you have to add this one as another automated parameter...
and JS dropdown contents (text) are correctly reported to fx knobs and in automation lanes, here
Quote:
Originally Posted by zenmonkey
Yep, this is another limitation of JS. All sliders are floats. The good news is internally the script converts everything to integers when sending the midi stream. I use the ceil() function (there is no round(), only floor() and ceil()). So don't worry too much about numbers like 124.563, internally I just treat that as 125.
|
You just need to re-assign the rounded value to the slider after processing. This corrected value will be reported to knobs and automations (i.e. impact on the curve!).
Quote:
Originally Posted by EvilDragon
You can have up to 64 sliders on a JS interface...
|
well, "theorically".
Please support this FR to turn the "theorically" into "really": http://forum.cockos.com/project.php?issueid=420
Last edited by Jeffos; 09-20-2009 at 11:30 AM.
Reason: the rounded slider value -> the rounded value to the slider
|
|
|
09-20-2009, 12:52 PM
|
#17
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by Jeffos
Yes, too complex for js (or to many things to put in a single dropdown box!). To see the CC# (i.e. another JS param/slider), you have to add this one as another automated parameter...
and JS dropdown contents (text) are correctly reported to fx knobs and in automation lanes, here
|
I think I'll just avoid this issue altogether. I think it's pretty easy for someone to remember CC A and CC B's corresponding numerical value.
Quote:
Originally Posted by Jeffos
You just need to re-assign the rounded value to the slider after processing. This corrected value will be reported to knobs and automations (i.e. impact on the curve!).
|
Neat! I just updated the script to version 1.2 with this suggestion. Now the TCP knobs don't do floats. It seems the automation envelopes still try to feed a float value though...stubborn envelopes.
|
|
|
09-20-2009, 01:30 PM
|
#18
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
If you want to impact the curve, just replace the faders with dropdowns.
|
|
|
09-20-2009, 01:44 PM
|
#19
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by Jeffos
If you want to impact the curve, just replace the faders with dropdowns.
|
I'm afraid I don't understand. Can you give me a quick code example (or point me towards a script that uses dropdowns)?
|
|
|
09-20-2009, 02:18 PM
|
#20
|
-blänk-
Join Date: Jun 2008
Posts: 11,359
|
Thanks so much for the new value handling. I see me using it quite a lot. It's nice to have the good ole 0-127 back. And to send single CC instead of the MSB/LSB couple.
I for one could need the "alzheimer- version" with the current controller name instead of CC A and CC B Value. But certainly not at the expense of a ridiculous amount of complexity in the code. I can easily alias the parameter name, so I'm good
Last edited by gofer; 09-20-2009 at 02:21 PM.
|
|
|
09-20-2009, 02:54 PM
|
#21
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by gofer
I can easily alias the parameter name, so I'm good
|
Oh slick! I didn't know you could do that. I just updated my latest template with that feature. Now all my TCPs say "Modwheel". Hoorray!
|
|
|
09-20-2009, 11:41 PM
|
#22
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
Quote:
Originally Posted by zenmonkey
I'm afraid I don't understand. Can you give me a quick code example (or point me towards a script that uses dropdowns)?
|
sure: your JS uses dropdowns The 2 top params in your GUI are dropdown boxes, the 3 bottom ones are faders.
Just replace thoses 3 silders with somthing like:
Code:
slider1:1<0,127,1{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127}}>bla bla
=> the automation curves will be impacted
=> the correct CC values will be displayed in automation lanes (rather than float values)
(not sure but I think it's better to re-create the FX/enveloppes after such an update...)
|
|
|
09-21-2009, 08:55 AM
|
#23
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by Jeffos
=> the automation curves will be impacted
=> the correct CC values will be displayed in automation lanes (rather than float values)
(not sure but I think it's better to re-create the FX/enveloppes after such an update...)
|
Ah, I get you now. I uploaded a new zip with two files:
Automation_to_MIDI: the original
Automation_to_MIDI_DD: The discrete dropdown version.
I can verify it does change the sound if using the same envelope from the original on the discrete version. I personally prefer the slider version but offered both in case someone else prefers the dropdown.
Oh and I couldn't convert pitch bend to a dropdown. 16,384 dropdown elements apparently aren't supported by JS even though I tried...
|
|
|
09-21-2009, 08:59 AM
|
#24
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
JS sliders support up to 1024 characters in their value definition, as I found out some time before.
|
|
|
09-21-2009, 09:05 AM
|
#25
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by EvilDragon
JS sliders support up to 1024 characters in their value definition, as I found out some time before.
|
Thanks for the tip. Yeah, enumerating all 16,384 elements added about 84K to the size of the script. I think it's safe to say I went further than 1024 chars.
|
|
|
09-21-2009, 09:07 AM
|
#26
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
|
Too bad you can't select the type of every slider (float, int...) with JS. Dropdowns are the ugliest possible solution of all times.
|
|
|
09-21-2009, 09:14 AM
|
#27
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by EvilDragon
Too bad you can't select the type of every slider (float, int...) with JS. Dropdowns are the ugliest possible solution of all times.
|
Agreed. I understand wanting to make JS simple so they picked the more complex type to be the only one. This lets one coerce from float to int but is impossible in the reverse. Still, something like:
Code:
slider1:8192<0,16383,1{:int:}>PB Value
Would be nice.
|
|
|
09-21-2009, 11:11 AM
|
#28
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
Quote:
Originally Posted by EvilDragon
Too bad you can't select the type of every slider (float, int...) with JS. Dropdowns are the ugliest possible solution of all times.
|
I'd like some improvments for JS too, but, here, no: it can (indirectly, through rounding, like some VST do). In fact, I suggest dropdowns to zenmonkey to workaround a super-minor issue I've already faced and that I've not yet reported in the tracker... it smells like another "Live with it" or "unconfirmed" ;-).
For pitch, 16383 items in a dropdown (hopefully, it would have been mainly used for monitoring, here but crazy stuff!! wider than the screen?) + impossible = a good argument though... humm... I'm gonna be punished by schwa once again, look at that!
|
|
|
10-10-2009, 02:21 PM
|
#29
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Update: 1.3
I've added two more scripts to the zipfile:
Automation_to_NRPN
Automation_to_RPN
They do exactly what they say; let you automate one NRPN or RPN per instance. This is useful for outbound hardware that doesn't necessarily use standard CCs to access parameters.
I wanted to print out the hex MSB and LSB values on the plugins since some manuals don't list the combined decimal number. If anyone knows how to do that w/o using a slider I'd like to know!
Finally, I didn't make DD variations of these because they use 16,000+ entries and I know JS won't support it.
Enjoy!
|
|
|
10-10-2009, 11:29 PM
|
#30
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Update 1.4
I thought a bit more about how I implemented the RPN/NRPN solution and decided to do a few refinements. There are now 2 new scripts, but they're different than the 1.3 release.
Automation_to_PN
Automation to PN supports all 16383 parameters for both RPN and NRPN types.
Type sets the message type to RPN or NRPN.
Parameter is the integer for the RPN/NRPN to use.
Value is the value of the chosen RPN/NRPN.
Automation_to_PN_HEX
Automation to PN HEX supports all 16383 parameters for both RPN and NRPN types.
Type sets the message type to RPN or NRPN.
MSB address is the most significant byte of the RPN/NRPN in hexadecimal.
LSB address is the least significant byte of the RPN/NRPN in hexadecimal.
Value is the value of the chosen RPN/NRPN.
The first mode is useful if the manual states the RPN/NRPN in integer format from 0..16383. The second is useful if the manual states the RPN/NRPN as a pair of hex numbers. Since different manufacturers do different tables I figured this would be best to cover both situations.
|
|
|
08-09-2010, 03:41 PM
|
#31
|
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 323
|
That's great, exactly what I was looking for. Jamstix uses CCs to control internal parameters that are not registered parameters (JS3 has only 3, power, reduction and timing), so this is perfect. I was going to make a FR (and I think I will still make), but this is the solution I needed now. Thanks!
__________________
Ceanganb
|
|
|
08-09-2010, 03:49 PM
|
#32
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by ceanganb
That's great, exactly what I was looking for. Jamstix uses CCs to control internal parameters that are not registered parameters (JS3 has only 3, power, reduction and timing), so this is perfect. I was going to make a FR (and I think I will still make), but this is the solution I needed now. Thanks!
|
You're welcome! I actually use them with Vember Audio's SURGE because it give a nice smooth 14-bit automation curve which for some automation sounds much better than 7-bit CC.
Just out of curiosity are you using the integer or hex one? I've actually though about merging the plugin and having the values convert from each other.
For example, you change the LSB and the value changes or you move the slider and the MSB/LSB changes. It's a cleaner workflow. Maybe I'll do that after I work out all the kinks with my latest Reason MIDI toy.
Edit: Nevermind, I realized now you're using the CC lane one. Nevertheless, enjoy!
Last edited by zenmonkey; 08-09-2010 at 03:50 PM.
Reason: correction
|
|
|
08-14-2010, 10:04 AM
|
#33
|
Moderator
Join Date: Aug 2007
Location: Italy
Posts: 4,327
|
Sorry but I don't get how this is different from what can be done with ReacontrolMIDI... is there any difference?
Thanks,
Mario
|
|
|
08-14-2010, 10:21 AM
|
#34
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Quote:
Originally Posted by mabian
Sorry but I don't get how this is different from what can be done with ReacontrolMIDI... is there any difference?
|
I wrote these scripts before ReaControlMIDI was part of Reaper. As far as CC lanes and PitchBend go now it's a toss-up.
If, however, you want to send RPN/NRPN or Aftertouch MIDI events you still cannot do so with ReaControlMIDI. I've kept them up in case anyone has used them in a track previously.
Last edited by zenmonkey; 08-14-2010 at 10:53 AM.
Reason: spelling
|
|
|
08-14-2010, 10:35 AM
|
#35
|
Moderator
Join Date: Aug 2007
Location: Italy
Posts: 4,327
|
Quote:
Originally Posted by zenmonkey
I wrote these sctips before ReaControlMIDI was part of Reaper. As far as CC lanes and PitchBend go now it's a toss-up.
If, however, you want to send RPN/NRPN or Aftertouch MIDI events you still cannot do so with ReaControlMIDI. I've kept them up in case anyone has used them in a track previously.
|
I supposed it was something like this, you're the ReacontrolMIDI precursor
Thanks a lot for the explanation,
Mario
|
|
|
03-05-2012, 12:45 PM
|
#36
|
Human being with feelings
Join Date: Apr 2011
Location: Canada
Posts: 454
|
Quote:
Originally Posted by zenmonkey
I wrote these scripts before ReaControlMIDI was part of Reaper. As far as CC lanes and PitchBend go now it's a toss-up.
If, however, you want to send RPN/NRPN or Aftertouch MIDI events you still cannot do so with ReaControlMIDI. I've kept them up in case anyone has used them in a track previously.
|
@zenmonkey
Thank you so much for these scripts! I was having problems with Roland's TTS-1 GM VSTi remembering its FX parameters and as they use NRPNs to adjust them, I could not automate them in Reaper but with your scripts it was very easy to do. FWIW, ReaControlMIDI has now a few RPN/NRPN options but nothing as easy to setup as your scripts.
Again, many thanks
|
|
|
03-05-2012, 07:53 PM
|
#37
|
Human being with feelings
Join Date: Jun 2007
Location: Texas
Posts: 109
|
Glad you found them useful -- I'm still hoping more VSTis will support NRPNs for 14-bit controller resolution.
|
|
|
03-08-2012, 02:55 AM
|
#38
|
Human being with feelings
Join Date: Jun 2011
Posts: 1
|
Thank you very much
This is just what I've been looking for. You have my gratitude *bow*
EDIT:
Has anyone successfully used this with Reaper 4? I unfortunately wasn't able to use the plugin yet. I copied it to the Reaper/Install Data/Effects/MIDI folder (or something like that, anyway the one, the other JS plugins are located in) but it does not show up.
Any suggestions?
Best,
Paul
EDIT2:
I finally got it. It's not the Effects folder in the Reaper install directory, but rather the one in /AppData/Roaming/Reaper/. Why the heck is there an Effects folder with - as far as I can judge - exactly the same contents in the installation directory? This is confusing me!
Last edited by less0; 03-09-2012 at 02:01 AM.
|
|
|
05-15-2018, 08:43 PM
|
#39
|
Human being with feelings
Join Date: Jun 2017
Posts: 56
|
thank alot for your script
i don't know why but reacontrolmidi overload my hardware (same in raw mode) but your script don't
|
|
|
05-15-2018, 09:25 PM
|
#40
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,791
|
What do you mean by "overload" ?
In fact, with the appropriate settings, the ReaControlMidi VST should use (slightly) less CPU power than a workalike (14 Bit) JSFX.
-Michael
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 08:04 AM.
|