Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 03-17-2020, 08:36 PM   #81
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

How many samples would be required? Let us assume n, a command line tool creating from 1 sample n differently amplified versions, putting all into RS5k and theoretically it should work somehow.

Take any single sample, make a fine amplification version of it. Some randomization effects could improve a bit more, pitch shift tiny amounts up or down, pan tiny amounts left or right, vibrato longer notes for example. Even the timing could be changed by tiny amounts. What is the correct "tiny amount" needs to found out first.

Example:
Take some bongo or percussion kind of sample, apply above trick. Then start tapping on the table, audio to midi. If this would work nicely, you could apply this technique to any percussion sample and getting more realistic results without requiring any complicated devices, a single microphone would do the job. A compressor up or down, could help finetuning as well.
TonE is offline   Reply With Quote
Old 03-17-2020, 08:45 PM   #82
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Quote:
Originally Posted by Vagelis View Post
Nice work man thnx!!

About the bezier curve that you mention on start , it's pretty easy to implement a 3 point Bezier with adjustable curve, i made it lately in Reaktor for a project that i 'm working on with the following equation:



e.g x0-y0=start point, x1-y1= middle point to adjust the curve, x2-y2=end point.

Here's how it looks
https://imgur.com/a/cTR5OpO?fbclid=I...guw5s6IK8ri_EE
Would bezier be the best trick for appling some inertia to any slider, as jsfx?
TonE is offline   Reply With Quote
Old 03-18-2020, 03:00 AM   #83
Vagelis
Human being with feelings
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 546
Default

Quote:
Originally Posted by TonE View Post
Would bezier be the best trick for appling some inertia to any slider, as jsfx?
No idea how it works in Jsfx. In reaktor in order to apply inertia to a slider, first you pass the value throught a lowpass filter, the in goes to the slider and the filter freq controls the amount of inertia.
Vagelis is online now   Reply With Quote
Old 03-18-2020, 06:51 AM   #84
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 40
Default

Quote:
Originally Posted by TonE View Post
Would bezier be the best trick for appling some inertia to any slider, as jsfx?
On a first approach, I'd definitely go for a low pass filter too, this is how you usually implement inertia the easy way in 3D games for example. You need to perform these operations with time tracking in mind, using the time_precise function. Something like :

Code:
t          = time_precise()
dt         = last_t - t
last_t     = t
alpha      = dt / (dt+inertia)
new_val    = (1 - alpha) * old_val + alpha * target
old_val    = new_val
This would give you some exponential inertia ; it would generate quite a bunch of midi events, and you should take care of handling correctly the convergence to avoid spawning and infinite number of events (test that you're very close to the target, and snap at the end).

Do you think that adding inertia to the plugin is a worthy addition?
Talagan is online now   Reply With Quote
Old 03-18-2020, 08:28 AM   #85
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Oh, I asked here, because I saw the formula above, I was asking generally, applying to any variable, represented as slider, could be anything here or elsewhere.

But my idea is coming originally from here: https://forum.cockos.com/showthread.php?t=232933

How would I connect new_value (I guess) above to a slider, e.g. slider1?
Something like:

slider1:new_value=1<{0,1,1}>Sent Status

I liked with bezier example, the user could adjust the curve to taste, meaning the inertia amount.

I would protect the output just by doing modulo something, if there is nothing against that method.
TonE is offline   Reply With Quote
Old 03-18-2020, 08:43 AM   #86
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Regarding this thread, Midi CC Mapper X, I would like to see some example templates, you could remove all items/media, and vsti, adding instead some reasynth or Synth1,Dexed,SQ8L or so, just having some examples what are typical use case scenarios.

I like e.g. how Song Switcher has beautiful examples, not as templates, initially, only images, later even an .rpp was added to its thread, something like this would be cool here as well. see https://forum.cockos.com/showthread.php?t=181159 link to image, see https://imgur.com/ZnFMX4B link to example project, see https://forum.cockos.com/attachment....5&d=1566514382
TonE is offline   Reply With Quote
Old 03-18-2020, 08:55 AM   #87
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Your tool can be used for any midi event, not only CC or velocity, using a tiny trick after that, something like pizmidi midiConverter3, and converting the cc or velocity e.g. to pitchbend. Then you would apply all those curves to pitchbend, or anything else supported by midiConverter3. Writing here just to share this idea, as another (tricky) use case.
TonE is offline   Reply With Quote
Old 03-19-2020, 12:32 AM   #88
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Quote:
Originally Posted by Talagan View Post
On a first approach, I'd definitely go for a low pass filter too, this is how you usually implement inertia the easy way in 3D games for example. You need to perform these operations with time tracking in mind, using the time_precise function. Something like :

Code:
t          = time_precise()
dt         = last_t - t
last_t     = t
alpha      = dt / (dt+inertia)
new_val    = (1 - alpha) * old_val + alpha * target
old_val    = new_val
Should I put above code under @block or @init or both?
TonE is offline   Reply With Quote
Old 03-19-2020, 12:57 AM   #89
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Ok it seems I do not need this technique, just found out the 'time gap' between note events seems to have and influence how long the triggered fx will be active, so this is my inertia, if I want longer fx, I should increase this gap, else shortening the gap.

Using this technique probabilistic notes, e.g. generated via ReaRack3 Random Note Gate, by master Time Waster, can be used for triggering fx parameters, thus making those parameters also probabilistic, e.g. increasing Reverb Wet amount. Great.

However it would be still useful to know how to add inertia to any slider, making it slower while changing its values.
TonE is offline   Reply With Quote
Old 03-19-2020, 02:33 AM   #90
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 40
Default

Hi TonE, thanks again for you "brainstorm" feedback, ideas and all

In the example above, the slider would give you the "target" value. This is were you want to slowly go from current_val, due to inertia. Every call to the time loop, you want to update the current value of your parameter to converge more to your target. So the above code has to be called "every time frame" to update the current value, that means as often as possible, so theoretically in the @block or in the @sample. But I've never tested this approach, I don't know if it's reasonable to spawn so many midi events (at each @block call). The other potential problem I see is that it should probably be better to evaluate dt (the delta time since last call) by counting the elapsed samples, and not relying on the time functions of the API which are not "deterministic" on replay.
Talagan is online now   Reply With Quote
Old 03-19-2020, 02:44 AM   #91
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 40
Default

@TonE, regarding this inertia problem, it's a bit off-topic now so I propose to continue the discussion in your other thread https://forum.cockos.com/showthread.php?t=232933 I'm going to write you a working example there.

Last edited by Talagan; 03-19-2020 at 02:52 AM.
Talagan is online now   Reply With Quote
Old 03-23-2020, 03:44 AM   #92
DANIELE
Human being with feelings
 
DANIELE's Avatar
 
Join Date: Aug 2015
Location: Florence, Italy
Posts: 373
Default

Quote:
Originally Posted by Talagan View Post

What I'd propose instead (and hope it would cover the vast majority of use cases), is some kind of "clamping" feature. You'd only set a minimum and maximum boundaries for your curve by providing a floating number for the min and the max, between 0 and 1 ; the pen draw would be restricted to that zone, and if you click on one of the curve from the library, it would be deformed to fit in between min and max. Additionaly (maybe, to be discussed), a hint would be given in the UI to indicate the MSB (and LSB, if pertinent) corresponding to these min/max boundaries, if you really need that precise info. Of course, it's a proposition and open to discussion too

Ben

Ehi thank you Talagan, it seems a really good workaround.


In a few words you use percentage to bypass the multiple precision. Maybe you could let insert percentage values with a good precision instead of floating numbers. It could be more intuitive.


I also think that showing the conversion in midi values would be a very useful feature. After all you are already performing the conversion under the hood so you only have to show it.
__________________
Audio: AKG-K240 MKII, Adam A7X, Audient iD22 - Steinberg UR22; Piano: Yamaha P-250 - NI S88 MK1;
!!DANIELE EPIC ORCHESTRAL MUSIC!! |*| STAR WARS SERIES
DANIELE is offline   Reply With Quote
Old 03-29-2020, 09:16 PM   #93
Dex
Human being with feelings
 
Join Date: Sep 2017
Posts: 270
Default

Quote:
Originally Posted by Talagan View Post
Regarding the first feature, channel routing, I think it's doable, the trickiest part being having a clear, self-explanatory UI. As I see it (which is pretty much what Dex has described), I'd go for an additional parameter for the MIDI src, with its mate parameter for the MIDI dst, the second one being "scoped" by the first one :
  • Possible values for the "channel" src param : "ANY" (or "ALL"), 1, 2, 3 .... 16
  • Possible values for the "channel" dst param :
    • If src = ANY, then no choice is offered, the behavior is "same as src"
    • If src = 1,2, ..., 16, then anything from 1,2 .... 16 is offered

I make these remarks because if the [ANY -> 1-16] or [1-16 -> ANY] configurations were offered, it would mean channel merging or inversely message duplication, and I'm not totally sure it is in the spirit of the plugin (or useful in some circumstances). For example, the plugin does not offer CC message duplication (one CC to multiple CCs) ; that's why I'd stick to a "one src to one dst" scheme. But this is open to discussion and I'd like your opinion :-)
Yes, that's exactly right.

If CC merging or splitting needs to be done, it can be done with a different plugin before this one in the chain.

Thanks!
Dex is online now   Reply With Quote
Old 03-31-2020, 10:47 AM   #94
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 40
Default

Dear all,

Here's a new version (3.3) enhanced with the excellent recent suggestions from Dex, DANIELE and TonE ; it adds some channel routing options, as well as MIDI values restriction for the curves, plus a small number of fixes and enhancements. While not everything is possible regarding channel routing, it offers imho a decent number of options without breaking the initial logic. Channel routing may be defined individually for each CC, but also for the green and red parts of the keyboard. This allows keyboard splitting between channels, whereas originally, the plugin would only allow to drop the red part (which is still the current default behaviour).

In addition, you can now set some min/max limits for the MIDI output range. This will clamp the current curve, but also restrict the pen drawing to the allowed space, and all pre-defined curves will now be applied to the restricted space, so that it offers a lot more of possibilies with simple interaction.

@DANIELE, I've changed my mind regarding the input mode of the min/max values ; it was easier and cleaner to enter midi values directly. The min/max widgets will offer MSB or MSB+LSB tweaking depending of the resolution of the output (low/high).

Hope you'll enjoy! Many many thanks for the latest suggestions.

Ben

----

Complete changelog for 3.3

Fix : HighRes midi velocity was not properly handled for MSB 1, LSB 0.
Fix : Highres midi velocity LSB was not sent on the proper CC (#88).
Added a "pen" button to trigger pen mode, to avoid accidental clicks on the curve
Added channel routing options for notes and ccs.
Added firewall option for unrouted notes.
Since red keys may now be kept due to channel re-routing, added an option to select what keys are transposed (All/Green/Red)
Since red keys may now be kept due to channel re-routing, added an option to select what keys are affected by the velocity control (All/Green/Red)
Added curve mih/max behaviours : the user can now set some min/max limits on the curve, so that the curve is clamped between those bounds. Predefined curves will be adapted to that range and pen drawing will be restricted to that range too.
And a bit of source code cleaning.

Talagan is online now   Reply With Quote
Old Yesterday, 02:13 AM   #95
DANIELE
Human being with feelings
 
DANIELE's Avatar
 
Join Date: Aug 2015
Location: Florence, Italy
Posts: 373
Default

Ehi looks amazing!! Thank you Talagan, I'll try it as soon as I can.


Only one question: I originally installed it directly without using Reapack, now I'd like to install using that but by doing this I'll loose all the settings and probably all my actual track sets in my template.


Is there a way to do the change seamlessly?


Thank you again for your amazing work. Actually it is a core plugin in my templates.
__________________
Audio: AKG-K240 MKII, Adam A7X, Audient iD22 - Steinberg UR22; Piano: Yamaha P-250 - NI S88 MK1;
!!DANIELE EPIC ORCHESTRAL MUSIC!! |*| STAR WARS SERIES
DANIELE is offline   Reply With Quote
Old Yesterday, 04:13 AM   #96
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Worth linking here*
https://forum.cockos.com/showthread.php?t=123475

Kawai K4 manual has some nice velocity curve examples with explanations where they can be useful. Can we save user curves here as well? There seem to be 10 more square spaces free? You could take any curve image as background, then designing/replicating that curve here, then saving as permanent preset for the future. But those available should be enough. I guess the presets should save already all made changes. Thanks a lot for all the improvements.

* Liked this comment under last youtube there:
wow, I'm impressed. that's the mother of midi setups...he must have about 30 sound modules linked to volume pedals via programmable/present tone banks routed via reverb and delays then into a mix desk....or a digitized version fun by a mac/ midi controller. he has every sound playing at once but fades them in or out via pedals...now that's clever....and remembering each pedal for each sound module...that's also clever....bit like watching an organist in church...what a great use of technology and really understanding your 'kit'. and then having the talent and taste to create something wonderful with it all.....what a guy.

Last edited by TonE; Yesterday at 04:26 AM.
TonE is offline   Reply With Quote
Old Yesterday, 04:34 AM   #97
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Quote:
Originally Posted by DANIELE View Post
Only one question: I originally installed it directly without using Reapack, now I'd like to install using that but by doing this I'll loose all the settings and probably all my actual track sets in my template.


Is there a way to do the change seamlessly?
Rename your jsfx to originalname_something.jsfx, then they will not overlap in future. Just one idea.
TonE is offline   Reply With Quote
Old Yesterday, 09:16 AM   #98
DANIELE
Human being with feelings
 
DANIELE's Avatar
 
Join Date: Aug 2015
Location: Florence, Italy
Posts: 373
Default

Quote:
Originally Posted by TonE View Post
Rename your jsfx to originalname_something.jsfx, then they will not overlap in future. Just one idea.

Thank you but I really need them to overlap, I try to explain better.


I have a template with many tracks with this plugin on configured on my needs, if install the reapack version it doesn't replace the old one. I find the old one missing if I load my template and I really need for it to replace the old one to inherit the settings, without the needs to set everything from scratch.
__________________
Audio: AKG-K240 MKII, Adam A7X, Audient iD22 - Steinberg UR22; Piano: Yamaha P-250 - NI S88 MK1;
!!DANIELE EPIC ORCHESTRAL MUSIC!! |*| STAR WARS SERIES
DANIELE is offline   Reply With Quote
Old Yesterday, 11:24 AM   #99
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 40
Default

@DANIELE, I've took quite some time to make the updates work seamlessly between versions, so I hope it won't break anything. But be sure I had that problem in mind.

What you can do for testing is to update through reapack to 3.3, load your project and see if all is well. If there are some problems, DON'T SAVE, revert through reapack to 3.2 (it's possible to switch between versions, this is why reapack is so cool ; in Browse Packages > Right Click > Versions > 3.2 + Reaper restart).

Make a backup of your project before doing anything to be sure.

Tell me if all goes well!

EDIT: Oops, I've read your message too quickly. Let me investigate further to find a solution for your case.

EDIT2 : Ok, so this is what I've found, maybe there's a better solution, IDK (if someone reads this and has a good experience on that matter?). The solution I have found is the following :

1 - Make a backup of your project.
2 - Install the 3.3 script through Reapack.
3 - Open your project RPP file with a text editor (textmate under MacOS, notepad++ under windows, etc).
4 - Find how the effect was referenced in your project ; it should be something like :
<JS "the_file_name_of_the_old_midi_mapper_x_jsfx_in_yo ur_reapers_library_directory.jsfx" ""
5 - Replace all occurences of :
"the_file_name_of_the_old_midi_mapper_x_jsfx_in_yo ur_reapers_library_directory.jsfx"
by
"ReaTeam JSFX/MIDI/talagan_MIDI CC Mapper X.jsfx"
6 - Save the RPP
7 - Reopen with reaper, and check if it works.
8 - Then, you can probably remove the old JSFX file from your library.

Last edited by Talagan; Today at 12:52 AM.
Talagan is online now   Reply With Quote
Old Yesterday, 12:06 PM   #100
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 40
Default

Quote:
Originally Posted by TonE View Post
Worth linking here*
https://forum.cockos.com/showthread.php?t=123475

Kawai K4 manual has some nice velocity curve examples with explanations where they can be useful. Can we save user curves here as well? There seem to be 10 more square spaces free? You could take any curve image as background, then designing/replicating that curve here, then saving as permanent preset for the future. But those available should be enough. I guess the presets should save already all made changes. Thanks a lot for all the improvements.
@TonE, you're challenging! Thanks a lot for all those remarks/comments/reactions, this is really helpful! I really need to take some time to think about those ideas and if it's achievable (like extending the default lib with custom user templates). I'll look into it during the next upcoming days!
Talagan is online now   Reply With Quote
Old Yesterday, 04:10 PM   #101
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

"You could...", I meant here of course "We could...", applied to anyone. So we can do this already, just make your window half transparent so you can see the background Kawai K4 manual for example, move and resize so both curves are in same place, then continue designing in your tool, making them match as good as possible, then saving as preset should do the trick, I guess.

I should do a youtube of this example, maybe.
TonE is offline   Reply With Quote
Old Today, 12:14 AM   #102
DANIELE
Human being with feelings
 
DANIELE's Avatar
 
Join Date: Aug 2015
Location: Florence, Italy
Posts: 373
Default

Quote:
Originally Posted by Talagan View Post
@DANIELE, I've took quite some time to make the updates work seamlessly between versions, so I hope it won't break anything. But be sure I had that problem in mind.

What you can do for testing is to update through reapack to 3.3, load your project and see if all is well. If there are some problems, DON'T SAVE, revert through reapack to 3.2 (it's possible to switch between versions, this is why reapack is so cool ; in Browse Packages > Right Click > Versions > 3.2 + Reaper restart).

Make a backup of your project before doing anything to be sure.

Tell me if all goes well!

EDIT: Oops, I've read your message too quickly. Let me investigate further to find a solution for your case.

EDIT2 : Ok, so this is what I've found, maybe there's a better solution, IDK (if someone reads this and has a good experience on that matter?). The solution I have found is the following :
  • 1 - Make a backup of your project.
    2 - Install the 3.3 script through Reapack.
3 - Open your project RPP file with a text editor (textmate under MacOS, notepad++ under windows, etc).
4 - Find how the effect was referenced in your project ; it should be something like :
<JS "the_file_name_of_the_old_midi_mapper_x_jsfx_in_yo ur_reapers_library_directory.jsfx" ""
5 - Replace all occurences of :
"the_file_name_of_the_old_midi_mapper_x_jsfx_in_yo ur_reapers_library_directory.jsfx"
by
"ReaTeam JSFX/MIDI/talagan_MIDI CC Mapper X.jsfx"
6 - Save the RPP
7 - Reopen with reaper, and check if it works.
8 - Then, you can probably remove the old JSFX file from your library.

Thank you for your kind answer.


I already did this, I downloaded the plugin from Reapack and I noticed that the file name was different, this is why it didn't replaced the "normally installed" one. I already managed to install 3.3 normally (and it works great by the way, the midi value limit is truly a game changer!!).


I also tried to open my RPP project with Notepad++ and I remember I tried to replace the string I thinked was the one to be replaced. What I did wrong probably is not replacing it well or non replacing the right one.


I'll try this evening, after work, your suggestion and I'll let you know.


Many thanks again for your help.
__________________
Audio: AKG-K240 MKII, Adam A7X, Audient iD22 - Steinberg UR22; Piano: Yamaha P-250 - NI S88 MK1;
!!DANIELE EPIC ORCHESTRAL MUSIC!! |*| STAR WARS SERIES
DANIELE is offline   Reply With Quote
Old Today, 12:58 AM   #103
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 40
Default

Quote:
Originally Posted by DANIELE View Post
I also tried to open my RPP project with Notepad++ and I remember I tried to replace the string I thinked was the one to be replaced. What I did wrong probably is not replacing it well or non replacing the right one.

I'll try this evening, after work, your suggestion and I'll let you know.
Ok! Maybe it's worth noting that Reaper does not always put double quotes around parameters in its ini/RPP files, for example, when the parameter has no spaces, the double quotes are often omitted. So don't forget to have them around the Reapack jsfx name.

Also, to retrieve the "good" name for the Reapack version of the jsfx, you can get a clue in two ways : create an empty project with an empty track, add the Reapack version of the jsfx, save, open the RPP with notepad++ and look for the good string. Or, you can open the reaper-jsfx.ini file located at the root of your REAPER user folder, it's the database that REAPER uses to track all installed JSFX, so the "good" name should be there (the old one too).
Talagan is online now   Reply With Quote
Old Today, 01:37 AM   #104
DANIELE
Human being with feelings
 
DANIELE's Avatar
 
Join Date: Aug 2015
Location: Florence, Italy
Posts: 373
Default

Quote:
Originally Posted by Talagan View Post
Ok! Maybe it's worth noting that Reaper does not always put double quotes around parameters in its ini/RPP files, for example, when the parameter has no spaces, the double quotes are often omitted. So don't forget to have them around the Reapack jsfx name.

Also, to retrieve the "good" name for the Reapack version of the jsfx, you can get a clue in two ways : create an empty project with an empty track, add the Reapack version of the jsfx, save, open the RPP with notepad++ and look for the good string. Or, you can open the reaper-jsfx.ini file located at the root of your REAPER user folder, it's the database that REAPER uses to track all installed JSFX, so the "good" name should be there (the old one too).

I'll do it and I'll let you know.


Thanks again Talagan.
__________________
Audio: AKG-K240 MKII, Adam A7X, Audient iD22 - Steinberg UR22; Piano: Yamaha P-250 - NI S88 MK1;
!!DANIELE EPIC ORCHESTRAL MUSIC!! |*| STAR WARS SERIES
DANIELE is offline   Reply With Quote
Old Today, 12:46 PM   #105
Dex
Human being with feelings
 
Join Date: Sep 2017
Posts: 270
Default

Quote:
Originally Posted by Talagan View Post
Here's a new version (3.3) enhanced with the excellent recent suggestions from Dex, DANIELE and TonE
<3 Thanks!
Dex is online now   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 01:27 PM.


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