Old 09-02-2020, 05:39 AM   #81
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Quote:
Originally Posted by nofish View Post
Would these help (just in cased you missed it..):
ScaleFromEnvelopeMode, ScaleToEnvelopeMode.
No its not that:

1. I convert value from FaderMode to EnvMode(raw)
2. ???
3. ??? ???

Then what?

I add delta value to it then do schwa function Slider2Val ?

Convert back again?

What ever I did resulted nothing with envelope manipulation in FaderScaling mode
Sexan is online now   Reply With Quote
Old 09-02-2020, 05:56 AM   #82
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,815
Default

The implementation I posted above is what ScaleFromEnvelopeMode/ScaleToEnvelopeMode does internally.

I'm not clear on exactly what you're trying to do, but perhaps the missing piece is normalization. The fader scaling conversion should be normalized to 1000, where 0 is the bottom of the envelope and 1000 is the top.

Given a volume envelope value of 1.0, which means +0dBFS, and a fader-scaled volume envelope with a displayed maximum volume of +12dB, ScaleFromEnvelopeMode returns 716, which means that envelope point will be displayed at a height of 716/1000 from the bottom of the envelope.

If you want to move that point upwards by say 10% of the envelope height, you'd set the scaled value to 816, then convert back to a volume envelope value of 1.67, which is about +4.45dB.
schwa is offline   Reply With Quote
Old 09-02-2020, 06:14 AM   #83
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Want to do this:


But with fader mode (which is not working)

You cleared up some things to me, was not sure what values is giving to me (567, 777 etc)

BTW I've seen some scripts (there are 2-3 that use this), also was not clear what and how are they doing it but, most of them had hardcoded zones:

Code:
   if     dB_val < -90 then dB_step = 5     -- < -90 dB
    elseif dB_val < -60 then dB_step = 3     -- from -90 to -60 dB
    elseif dB_val < -45 then dB_step = 2     -- from -60 to -45 dB
    elseif dB_val < -30 then dB_step = 1.5   -- from -45 to -30 dB
    elseif dB_val < -18 then dB_step = 1     -- from -30 to -18 dB
    elseif dB_val < 24  then dB_step = 0.2   -- from -18 to 24 dB
and also some justins functions:

Code:
function VAL2DB(x)
  if x < 0.0000000298023223876953125 then 
    x = -150
  else
    x = max(-150, log(x)* 8.6858896380650365530225783783321)
  end
  return x
end

function DB2VAL(x)
  return exp(x*0.11512925464970228420089957273422)
end
Do I need any of this?

Last edited by Sexan; 09-02-2020 at 06:21 AM.
Sexan is online now   Reply With Quote
Old 09-02-2020, 06:36 AM   #84
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

This is the far as I got:



But trying to figure out how to fix that big jumps at the bottom

Code:
 local mouse_val = 0.006 * dy -- random step

 for j = 1, #edits[i].env_points do 
    local env = edits[i].env_points[j]
                
    A1 =  reaper.ScaleFromEnvelopeMode(1, env.value )                
    A1 = mouse_val + A1

    A2 =  reaper.ScaleToEnvelopeMode(1, A1)                
              
    env.value = A2
    reaper.SetEnvelopePoint(edits[i].env, env.id, env.time, env.value , env.shape, env.tension, env.selected, true)
  end
Sexan is online now   Reply With Quote
Old 09-02-2020, 06:36 AM   #85
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,827
Default

Quote:
Originally Posted by Sexan View Post
One of the best features in my Area51 script coming up soon for RE:

Standard copy (ctrl+c)
Paste = Hold for preview, Release to paste
Brilliant!
Vagelis is online now   Reply With Quote
Old 09-02-2020, 06:45 AM   #86
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,815
Default

Quote:
Originally Posted by Sexan View Post
This is the far as I got:
If you set Preferences > Editing Behavior > Envelope Display > Volume envelope range to +12dB, does it work the way you expect?
schwa is offline   Reply With Quote
Old 09-02-2020, 06:47 AM   #87
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Quote:
Originally Posted by schwa View Post
If you set Preferences > Editing Behavior > Envelope Display > Volume envelope range to +12dB, does it work the way you expect?
Same as above....

What I expect is:
Sexan is online now   Reply With Quote
Old 09-02-2020, 07:03 AM   #88
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,815
Default

Ah, actually, GetEnvelopePointEx (and GetEnvelopePoint) returns the already-scaled value. So all you should need to do is directly adjust the envelope value.

Last edited by schwa; 09-02-2020 at 07:58 AM.
schwa is offline   Reply With Quote
Old 09-02-2020, 07:18 AM   #89
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

It gives me exact same values as non Ex one. Is there some hidden argument?


Last edited by Sexan; 09-03-2020 at 02:35 AM.
Sexan is online now   Reply With Quote
Old 09-02-2020, 07:24 AM   #90
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,815
Default

I'm not sure if you are overcomplicating things or I am undercomplicating things, but here is code that increases all fader-scaled envelope points by a constant amount.

Code:
tr=reaper.GetTrack(0,0)
env=reaper.GetTrackEnvelope(tr,0);
n=reaper.CountEnvelopePoints(env)
for i=0,n do
  ret,pos,val=reaper.GetEnvelopePoint(env,i,0,0,0,0,0)
  val=val+100
  reaper.SetEnvelopePoint(env,i,pos,val,0,0,0)
end
schwa is offline   Reply With Quote
Old 09-02-2020, 07:41 AM   #91
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Ok we did it.

Fader scaling step = 1
Amplitude scaling step = 0.005

And everything works (and I do not want to do this again, any time soon)

Fixing, cleaning the script and releasing soon
Sexan is online now   Reply With Quote
Old 09-02-2020, 07:57 AM   #92
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 471
Default

This exchange is such a clear example of the values of Reaper/Cockos.

Amazing!
tdc is offline   Reply With Quote
Old 09-02-2020, 08:07 AM   #93
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,009
Default

Hey Embass very nice script you done! testing it here and works very fine !! Thx for sharing

Option for groups as mentioned would be great!

EDIT: One problem if I dont use RE in my right drag after terminating the script it will be in my right drag Mmod.I think you need to restore the Mmod at the end of it.

Last edited by daniellumertz; 09-02-2020 at 08:25 AM.
daniellumertz is online now   Reply With Quote
Old 09-02-2020, 02:20 PM   #94
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Schwa helped, I lost my mind (team work!) and here it is with fader scaling:

Position your mouse before running the script to activate Wrap or Trim action (this will be improved still, testing some concepts but I have more ideas)

Left side of RE - Warp Left
In RE - Trim volume
Right side of RE - Wrap Right



Press and hold shortcut to manipulate, release when finished

Last edited by Sexan; 02-13-2023 at 08:15 AM.
Sexan is online now   Reply With Quote
Old 09-02-2020, 02:30 PM   #95
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
Default

Why that couldn't be in there natively is beyond me, though.

I wouldn't mind if we could assing scripts to any mouse modifier (not just click contexts, but drag as well)...
EvilDragon is online now   Reply With Quote
Old 09-02-2020, 02:36 PM   #96
Funkybot
Human being with feelings
 
Funkybot's Avatar
 
Join Date: Jul 2007
Location: New Joisey
Posts: 6,023
Default

Hopefully Schwa takes a gander at some of the code posted here and lifts the best parts!

Awesome work scripters!
Funkybot is online now   Reply With Quote
Old 09-02-2020, 03:05 PM   #97
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Quote:
Originally Posted by EvilDragon View Post

I wouldn't mind if we could assing scripts to any mouse modifier (not just click contexts, but drag as well)...
That would change things I think for scripts in so many good ways... Schwa!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 09-02-2020, 03:08 PM   #98
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
Default

Quote:
Originally Posted by schwa View Post
Ah, actually, GetEnvelopePointEx (and GetEnvelopePoint) returns the already-scaled value.
Then isn't this part in the API doc misleading?
Quote:
Returns the envelope scaling mode: 0=no scaling, 1=fader scaling. All API functions deal with raw envelope point values, to convert raw from/to scaled values see ScaleFromEnvelopeMode, ScaleToEnvelopeMode.
nofish is offline   Reply With Quote
Old 09-02-2020, 03:12 PM   #99
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Quote:
Originally Posted by nofish View Post
Then isn't this part in the API doc misleading?
Thats why I was extremely confused, even brain went 404:

https://forum.cockos.com/showpost.ph...3&postcount=81
Sexan is online now   Reply With Quote
Old 09-02-2020, 04:03 PM   #100
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,826
Default

So is non of this stuff AI yet, just track envelopes?
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 09-03-2020, 05:08 AM   #101
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 471
Default

@sexan. Would it be possible to have a mode of your script that adds a fade at the start and end of the selected area by adding two points either side of the region? The fade would be a small 50ms or something.

This would be amazing for cleaning and editing vocal takes for breaths or inconsistent levels etc.
tdc is offline   Reply With Quote
Old 09-03-2020, 05:22 AM   #102
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Not sure if I understand can you make me some mockup ?
Sexan is online now   Reply With Quote
Old 09-03-2020, 07:26 AM   #103
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 471
Default

Thanks Sexan, here you go.



The selected area is attenuated, but either side an additional envelope point is added resulting in a fade and not an abrupt level change.

This would ideally all be happening on Take Envelopes.
tdc is offline   Reply With Quote
Old 09-03-2020, 07:59 AM   #104
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
Default

Quote:
Originally Posted by tdc View Post
Thanks Sexan, here you go.



The selected area is attenuated, but either side an additional envelope point is added resulting in a fade and not an abrupt level change.

This would ideally all be happening on Take Envelopes.
I think you could do it quite similarily without razor edit already:


(That's mouse modifier 'Move envelope segment' in combination with 'Transition time for automatically created envelope edge points'.)
nofish is offline   Reply With Quote
Old 09-03-2020, 08:31 AM   #105
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,820
Default

Quote:
Originally Posted by EvilDragon View Post
Why that couldn't be in there natively is beyond me, though.

I wouldn't mind if we could assing scripts to any mouse modifier (not just click contexts, but drag as well)...
i guess they have the stability of the feature as priority ! hopefully this and multiple horizontal is in the aim for next cycles! envelopes is where multiple horizontal areas has more evident huge benefit and use cases
__________________
🙏🏻

Last edited by deeb; 09-03-2020 at 08:43 AM.
deeb is offline   Reply With Quote
Old 09-03-2020, 09:30 AM   #106
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Well that actually is already in the script, but with much lower number.

I can make it so you can adjust it on fly

WIP:



(it wont be like this so you have to be careful when moving, it will be on some modifier (click drag or something). I have stuff to do here to make whole script little bit friendly and precise

Last edited by Sexan; 09-03-2020 at 09:52 AM.
Sexan is online now   Reply With Quote
Old 09-03-2020, 11:46 AM   #107
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 650
Default

These looks amazing. Happy envelopes bending all


I also think that letting scripters acces to mouse modifiers like dragging and letting users changing mouse modifiers by actions on toolbar would be cool.
__________________
Love is patient and kind; love does not envy or boast; it is not arrogant or rude.
It does not insist on its own way; it is not irritable or resentful;
it does not rejoice at wrongdoing, but rejoices with the truth. Corinthians 13:4-6
strachupl is online now   Reply With Quote
Old 09-03-2020, 12:10 PM   #108
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
Default

Quote:
Originally Posted by strachupl View Post
I also think that letting scripters acces to mouse modifiers like dragging and letting users changing mouse modifiers by actions on toolbar would be cool.
Another +1 for this. Being able to trigger scripts including left-click, left-drag, right-click, right-drag and double click for all the modifier sections, would be the feather in the cap on this.

And yes, I think it's also time to implement mouse modifier "presets" that the user can store and recall so they can customize for different workflows and easily switch between them. It still keeps Reaper "tool-less" but gives the user the ability to better tailor specific workflows.
Klangfarben is offline   Reply With Quote
Old 09-04-2020, 01:47 AM   #109
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 471
Default

Quote:
Originally Posted by Sexan View Post
Well that actually is already in the script, but with much lower number.

I can make it so you can adjust it on fly

WIP:



(it wont be like this so you have to be careful when moving, it will be on some modifier (click drag or something). I have stuff to do here to make whole script little bit friendly and precise
Adjustment on the fly would be brilliant Sexan!!! pre-mix vocal work will be a joy with this feature, and you will save me 1000’s of mould clicks per day.
tdc is offline   Reply With Quote
Old 09-04-2020, 12:22 PM   #110
AJYoung
Human being with feelings
 
Join Date: Aug 2018
Posts: 93
Default

Quote:
Originally Posted by Sexan View Post
I can make it so you can adjust it on fly

WIP:
Wait. Pause that. Enhance.



uhhhhh
AJYoung is offline   Reply With Quote
Old 09-04-2020, 12:46 PM   #111
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,686
Default

Its WIP, that was just a showcase, no error checking, no limit checking... was just a demo of 4 lines of code
Sexan is online now   Reply With Quote
Old 09-04-2020, 01:20 PM   #112
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 471
Default

Quote:
Originally Posted by AJYoung View Post
Wait. Pause that. Enhance.



uhhhhh
Though it does prove Sexan is a Timelord.
tdc is offline   Reply With Quote
Old 09-04-2020, 05:07 PM   #113
Arthur McArthur
Human being with feelings
 
Arthur McArthur's Avatar
 
Join Date: Sep 2016
Location: Toronto
Posts: 749
Default

Looking very promising guys!

One script that would be really nice to have is "duplicate contents of razor edits to fill regions in loop points"

From: https://i.imgur.com/IBDmepu.png

to: https://i.imgur.com/n0cP2AQ.png

Or, alternatively "duplicate contents of razor edits to fill time selection" for those who don't use regions.
Arthur McArthur is offline   Reply With Quote
Old 09-05-2020, 04:21 AM   #114
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default Still holding your beer Sexan (or anyone else)! ;)

But for a different reason!

I wonder how hard it would be to do something like the below but image if those "squares" were audio items and you could "skew" the contents inside of the razor edit via timestretch like the below image to squish it up at one end and expand at the other end the item starts and ends and timestretch at the same time.

Very good for sound and music effects where you say have a beat you draw in on say 16ths and then use a razor edit script that skews it so it can say start fast and gets slower in a non linear way (or the opposite way around) depending on moving the mouse left or right of the razor edit area.

Hope that makes sense. It's something that I've always wanted to do and normally I've had to try and play it in via a midi kick drum live and then manually sync all the items to it which takes ages

__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 09-05-2020, 08:52 AM   #115
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,826
Default

Quote:
Originally Posted by musicbynumbers View Post
But for a different reason!

I wonder how hard it would be to do something like the below but image if those "squares" were audio items and you could "skew" the contents inside of the razor edit via timestretch like the below image to squish it up at one end and expand at the other end the item starts and ends and timestretch at the same time.

Very good for sound and music effects where you say have a beat you draw in on say 16ths and then use a razor edit script that skews it so it can say start fast and gets slower in a non linear way (or the opposite way around) depending on moving the mouse left or right of the razor edit area.

Hope that makes sense. It's something that I've always wanted to do and normally I've had to try and play it in via a midi kick drum live and then manually sync all the items to it which takes ages

imgsnip
Yeah, I have been looking for something like this to do the Noisia style skewed stretches quickly.
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 09-05-2020, 09:32 AM   #116
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,827
Default

Quote:
Originally Posted by musicbynumbers View Post

I wonder how hard it would be to do something like the below but image if those "squares" were audio items and you could "skew" the contents inside of the razor edit via timestretch like the below image to squish it up at one end and expand at the other end the item starts and ends and timestretch at the same time.

Very good for sound and music effects where you say have a beat you draw in on say 16ths and then use a razor edit script that skews it so it can say start fast and gets slower in a non linear way (or the opposite way around) depending on moving the mouse left or right of the razor edit area.
Would be great +1.

Quote:
Originally Posted by musicbynumbers View Post
Hope that makes sense. It's something that I've always wanted to do and normally I've had to try and play it in via a midi kick drum live and then manually sync all the items to it which takes ages
The way i'm doing it now is by importing audio into reasamplomatic and modulate the loop end with an lfo or envelope. The only thing that needs to take care before that, is to bounce the audio to the length you want for loop's end max value.
So if you want to start or end at 1/1 length, you have to bounce the audio before to 1/1 and so on.
The other way is by triggering midi notes from reasamplomatic, paint a strum and then bend them to change speed, or another alternative way to bend them is with julian sanders midi script.
Vagelis is online now   Reply With Quote
Old 09-05-2020, 10:09 AM   #117
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
Default

Cool good ideas thanks.

Another way I've done it in the past is with an old xenakios plugin that allowed you to draw in a line to represent the distribution but it's hard to get it musically/mathematically correct
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 09-05-2020, 12:02 PM   #118
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,827
Default

Indeed, Xenakios script is nice, but not very useful to make precise adjustments, since it's not changing the length in real-time.

Also now we can stretch the positions of the looped sections with the loop start/end modifier, but not by slow/fast rate.



I really wish if we had another modifier addition to adjust loop section start/end in media item edge context, that would stretch the looped sections from slow to fast as well.

Dear Schwa, if you 're listening,please.
Vagelis is online now   Reply With Quote
Old 09-05-2020, 03:03 PM   #119
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 428
Default

Something in progress...
While Sexan is working on a version with the hotkey approach I wanted to try one that uses handles and runs in the background:


It seems that unless we can get a faster defer cycle the hotkey approach is much better. (Clicking stuff is a bit iffy at 33fps)
__________________
ReaScript Discord Server | Scripts | JSFX

Last edited by BirdBird; 12-27-2020 at 11:06 AM.
BirdBird is offline   Reply With Quote
Old 09-05-2020, 03:27 PM   #120
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,009
Default

looking great birdbird :O :O :O
daniellumertz 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 02:55 PM.


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