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

Reply
 
Thread Tools Display Modes
Old 07-26-2021, 04:31 AM   #1
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default REQ: Copy all env points from selected env to all other visible envs

Hey gang,
I'm looking for a script to copy all envelope points from a selected envelope to all other visible envelopes on the same track, but not copy their values.

In other words, it would change this to this:



Happy to throw a little money at it for your time.


All the best,
Dax.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 07-26-2021, 08:04 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Hi Dax, I got your PM,


You should be able do that by selection your source envelope then a custom action using:
  1. Script: X-Raym_Select envelope points in visible armed envelope of selected tracks.lua
  2. SWS/BR: Copy selected points in selected envelope to all visible envelopes in selected tracks
  3. Envelope: Toggle record arm for selected envelope -- to exclude source envelope from
  4. SWS/BR: Unselect envelope -- to prevent envelope selection to overide the following script
  5. Script: X-Raym_Reset selected envelope points to center default value.lua (just released)
Best


EDIT: need points selected at first stage

Last edited by X-Raym; 07-26-2021 at 08:07 AM. Reason: Need point selected
X-Raym is offline   Reply With Quote
Old 07-27-2021, 07:31 AM   #3
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Hey Raymond,
Very cool, thanks for that.

What if I added 2 more constraints?
-Preserve existing points instead of resetting to default value.
-Only for time selection (if no time selection exists, use entire project as bounds)

I feel like a modification of SWS/BR: Copy selected points in selected envelope to all visible envelopes in selected tracks would be ideal. I've spoken to Breeder about it a couple times, but nothing has eventuated.

(Out of interest, do you know if we can access the code for that action? I looked for BR_COPY_ENV_PT_SEL_TR_ENVS_VIS in SWS_MASTER code, but couldn't find anything useful.)


All the best,
Dax.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 07-27-2021, 03:40 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Quote:
-Only for time selection (if no time selection exists, use entire project as bounds)
The SWS function has a variation with time selection only.


Quote:
-Preserve existing points instead of resetting to default value.
This is definitely begining very specific ! 😆but maybe with the time selection version you will not need to preserve points on the whole envelope.



Quote:
do you know if we can access the code for that action?
All SWS is open source. But it is hardcore C++. Lua scripting is the way to go if you want to code some things.
X-Raym is offline   Reply With Quote
Old 07-28-2021, 01:41 AM   #5
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

This is complex. I mean, it is easy to just put points of selected envelope to other track envelopes, preserving current envelope values.

But only if envelope are linear. Otherwise you have to extrapolate envelopes up to next point, or go deeper into the math and try to match needed slope for curves you split. Not abig deal, but requires nice knowledge of reaper envelope curves formula.
mpl is offline   Reply With Quote
Old 07-29-2021, 04:35 AM   #6
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

@MPL - I can tell you that Breeder achieved this with SWS/BR: Insert new envelope point at mouse cursor using value at current position (obey snapping)
Which is why he was the first person I reached out to about this script.

EDIT: Nope, I spoke too soon. This is how that action works, and I'm 100% okay with that. It doesn't need to be a rocket science experiment.

Attached Images
File Type: gif BR_insertEnvPt.gif (5.5 KB, 321 views)
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 07-31-2021, 07:32 AM   #7
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Hey Raymond,
Thank you for releasing X-Raym_Reset selected envelope points to center default value. With that and your guidance in post #2, I have at least been able to get a very good start on the function I'd hoped for.

I wanted to let you know that Width and Width (Pre-FX) are reset to 0% instead of 100%.

Thank you again!

Dax.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 07-31-2021, 08:24 AM   #8
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Quote:
Originally Posted by daxliniere View Post
Hey Raymond,
Thank you for releasing X-Raym_Reset selected envelope points to center default value. With that and your guidance in post #2, I have at least been able to get a very good start on the function I'd hoped for.

I wanted to let you know that Width and Width (Pre-FX) are reset to 0% instead of 100%.

Thank you again!

Dax.
You have to deal with Envelope_Evaluate. It gives you current envelope value. Insert point with that value and it gives you result (but again, only with linear envelopes slopes.
mpl is offline   Reply With Quote
Old 07-31-2021, 08:27 AM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

You are right about width, center is equal to default expept for with.
I have tons of centered script..not sure what would be best... center ir set tp 100% for widths..
Ill keep that in mind.
X-Raym is offline   Reply With Quote
Old 07-31-2021, 10:26 AM   #10
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Quote:
Originally Posted by mpl View Post
...only with linear envelopes slopes.
I feel like that's a reasonable limitation.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 07-31-2021, 10:27 AM   #11
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Quote:
Originally Posted by X-Raym View Post
You are right about width, center is equal to default expept for with.
I have tons of centered script..not sure what would be best... center ir set tp 100% for widths..
Ill keep that in mind.
Yeah, you've got it. (Y)
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 08-03-2021, 01:09 AM   #12
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Quick and dirty example:

Code:
tr_env = reaper.GetSelectedEnvelope( 0 )
track, index, index2 = reaper.Envelope_GetParentTrack( tr_env )

point_t = {}
for ptidx=1,  reaper.CountEnvelopePoints( tr_env ) do
  local retval, time, value, shape, tension, selected = reaper.GetEnvelopePoint( tr_env, ptidx-1 )
  point_t[#point_t+1] = time
end

for envidx = 1,  reaper.CountTrackEnvelopes( track ) do
  tr_env_child = reaper.GetTrackEnvelope( track, envidx-1 )
  for i = 1, #point_t do
    retval, value = reaper.Envelope_Evaluate( tr_env_child, point_t[i], 44100, 1 )
    reaper.InsertEnvelopePoint( tr_env_child, point_t[i], value, -1, -1, false, true )
  end 
  reaper.Envelope_SortPoints( tr_env_child )
end

reaper.UpdateArrange()
mpl is offline   Reply With Quote
Old 08-03-2021, 04:48 AM   #13
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Hey Mikhail,
Thank you for this. The way it works is almost, but not quite right:

__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 08-03-2021, 05:36 AM   #14
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Quote:
Originally Posted by daxliniere View Post
Hey Mikhail,
Thank you for this. The way it works is almost, but not quite right:
This happened with non-linear envelopes, right? I mentioned above twice it will works only for linear envelopes, not curved or square. You have to deal with other types of envelopes using various bits of math. Also closer points should be taken into account.

There is a lot of ReaScript work for today, so I can take a look at it a bit later (but this will be under paid section of my scripts).

Last edited by mpl; 08-03-2021 at 05:42 AM.
mpl is offline   Reply With Quote
Old 08-03-2021, 06:00 AM   #15
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Quote:
Originally Posted by mpl View Post
This happened with non-linear envelopes, right?
One of them was, so fair enough for that one, but the others were linear:



What seems to be happening is that the script is taking the first value of the envelope after it was changed and applying that to the entire envelope.

Quote:
Originally Posted by mpl View Post
There is a lot of ReaScript work for today, so I can take a look at it a bit later (but this will be under paid section of my scripts).
Yes, of course, no rush. And please let me know about how to donate for this script.

Will you also be able to make the script adapt to project samplerate (I see 44100 is hard-coded in this example) and to obey time selection if a time selection exists?
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 08-03-2021, 07:19 AM   #16
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Your envelopes are "square" like. They aren't linear.
mpl is offline   Reply With Quote
Old 08-04-2021, 04:15 PM   #17
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Hey Mikhail,
Perhaps I've misunderstood what you meant? All except the second last envelope contain only linear transitions.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 08-04-2021, 09:17 PM   #18
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Quote:
Originally Posted by daxliniere View Post
Hey Mikhail,
Perhaps I've misunderstood what you meant? All except the second last envelope contain only linear transitions.

This is "square" envelope. I supposed others at 2nd and 3rd envelopes (last point up to the right out of your gif) are also square. Thats why they change its value to initial when you try to "split" envelope at current value point.

Last edited by mpl; 08-05-2021 at 06:45 AM.
mpl is offline   Reply With Quote
Old 08-05-2021, 04:34 AM   #19
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Yes, as I mentioned in post #17, one of the envelopes has a square transition (it is a Bypass envelope). All of the other have linear (or bezier) transitions, I promise!

You can see for yourself:
https://drive.google.com/file/d/1U73...ew?usp=sharing
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]

Last edited by daxliniere; 08-05-2021 at 05:27 AM.
daxliniere is offline   Reply With Quote
Old 08-05-2021, 11:03 AM   #20
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Quote:
Originally Posted by daxliniere View Post
Yes, as I mentioned in post #17, one of the envelopes has a square transition (it is a Bypass envelope). All of the other have linear (or bezier) transitions, I promise!

You can see for yourself:
https://drive.google.com/file/d/1U73...ew?usp=sharing
It is better to attach simple RPP to analyze.
mpl is offline   Reply With Quote
Old 08-06-2021, 01:09 AM   #21
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

I`ve added mpl_Split all track envelopes at selected envelope points positions.

It takes selected points of selected envelope and split other track envelopes at these points positions. Here are conditions for shapes:

Linear shape - simply split.
Square shape - set shape following new point to square also.
Other shapes - simply split, followed shape are linear.

It will be pretty hard to reimplement other shapes as sloped linear shapes. It anyway require split envelopes in multiple points and trying to match slope, so I leave it as it.

The code requires VFv2 package, but the function is not included in crypted binary so you can overview it here.

mpl is offline   Reply With Quote
Old 08-06-2021, 03:38 PM   #22
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Hey Mikhail,
From the video, it looks exactly as I had hoped. Thank you!
I'll test it tomorrow and send a donation.

What is the VFv2 thing you mentioned?
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 08-06-2021, 10:12 PM   #23
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Quote:
Originally Posted by daxliniere View Post
Hey Mikhail,
From the video, it looks exactly as I had hoped. Thank you!
I'll test it tomorrow and send a donation.

What is the VFv2 thing you mentioned?
Various Functions package. It is paid now. All new or updated scrripts from my repository require Various Functions package update. But if you donated me in the past, it will be free for you, this is how it looks like: https://forum.cockos.com/showpost.ph...&postcount=548
mpl is offline   Reply With Quote
Old 08-07-2021, 04:12 AM   #24
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

Quote:
Originally Posted by mpl View Post
Various Functions package. It is paid now. All new or updated scrripts from my repository require Various Functions package update. But if you donated me in the past, it will be free for you, this is how it looks like: https://forum.cockos.com/showpost.ph...&postcount=548
Ahh, gotcha. No worries, I have donated in the past, but I did make this request so I'm happy to send a donation for it. £20 coming your way.

Thanks again for the script, looking forward to testing it out.

All the best,
Dax.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 08-09-2021, 06:16 AM   #25
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,581
Default

mpl has nailed it with version 1.01! Available for his donors through ReaPack.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere 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 07:59 AM.


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