|
|
|
07-26-2021, 04:31 AM
|
#1
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
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.
|
|
|
07-26-2021, 08:04 AM
|
#2
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
Hi Dax, I got your PM,
You should be able do that by selection your source envelope then a custom action using:
- Script: X-Raym_Select envelope points in visible armed envelope of selected tracks.lua
- SWS/BR: Copy selected points in selected envelope to all visible envelopes in selected tracks
- Envelope: Toggle record arm for selected envelope -- to exclude source envelope from
- SWS/BR: Unselect envelope -- to prevent envelope selection to overide the following script
- 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
|
|
|
07-27-2021, 07:31 AM
|
#3
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
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.
|
|
|
07-27-2021, 03:40 PM
|
#4
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
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.
|
|
|
07-28-2021, 01:41 AM
|
#5
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
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.
|
|
|
07-29-2021, 04:35 AM
|
#6
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
@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.
|
|
|
07-31-2021, 07:32 AM
|
#7
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
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.
|
|
|
07-31-2021, 08:24 AM
|
#8
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
Quote:
Originally Posted by daxliniere
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.
|
|
|
07-31-2021, 08:27 AM
|
#9
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
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.
|
|
|
07-31-2021, 10:26 AM
|
#10
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Quote:
Originally Posted by mpl
...only with linear envelopes slopes.
|
I feel like that's a reasonable limitation.
|
|
|
07-31-2021, 10:27 AM
|
#11
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Quote:
Originally Posted by X-Raym
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)
|
|
|
08-03-2021, 01:09 AM
|
#12
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
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()
|
|
|
08-03-2021, 04:48 AM
|
#13
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Hey Mikhail,
Thank you for this. The way it works is almost, but not quite right:
|
|
|
08-03-2021, 05:36 AM
|
#14
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
Quote:
Originally Posted by daxliniere
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.
|
|
|
08-03-2021, 06:00 AM
|
#15
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Quote:
Originally Posted by mpl
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
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?
|
|
|
08-03-2021, 07:19 AM
|
#16
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
Your envelopes are "square" like. They aren't linear.
|
|
|
08-04-2021, 04:15 PM
|
#17
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Hey Mikhail,
Perhaps I've misunderstood what you meant? All except the second last envelope contain only linear transitions.
|
|
|
08-04-2021, 09:17 PM
|
#18
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
Quote:
Originally Posted by daxliniere
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.
|
|
|
08-05-2021, 04:34 AM
|
#19
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
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
Last edited by daxliniere; 08-05-2021 at 05:27 AM.
|
|
|
08-05-2021, 11:03 AM
|
#20
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
Quote:
Originally Posted by daxliniere
|
It is better to attach simple RPP to analyze.
|
|
|
08-06-2021, 01:09 AM
|
#21
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
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.
|
|
|
08-06-2021, 03:38 PM
|
#22
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
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?
|
|
|
08-06-2021, 10:12 PM
|
#23
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
Quote:
Originally Posted by daxliniere
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
|
|
|
08-07-2021, 04:12 AM
|
#24
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
Quote:
Originally Posted by mpl
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.
|
|
|
08-09-2021, 06:16 AM
|
#25
|
Human being with feelings
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
|
mpl has nailed it with version 1.01! Available for his donors through ReaPack.
|
|
|
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 03:19 AM.
|