Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 02-02-2020, 04:38 PM   #1
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default Request for API functions to release an envelopes latch

The problem:

Due to the lack of proper touch state (when automation mode is Touch) for FX and track parameters that aren't volume/pan (eg send volume/pan) - I'm trying to develop my own touch mode in a script.

I have tried many solutions - and pretty much got the FX parameters one working great by simply unarming the envelope when I detect that the controllers touch sensitive fader is not touched, and rearming it when the controller fader is touched again. This works pretty well.

But... this does not work for most track parameters - as volume/pan/send volume etc all revert to the trim value when you bypass the envelope while in latch/touch/write automation modes. There appears to be no way to change this.

The problem with this is that the controller's faders will jump to the trim value when I need it to continue to feedback the envelope value. I'm using the UI API's such as GetTrackUIVolPan - to get the envelope current values during playback - but these APIs return the trim value when an envelope is bypassed.

There is also the Clear Track Envelope Latches action - but this clears all of them so is not suitable when I may be automating two track envelopes from the same track at any time. If I trigger the action when I 'untouch' one fader - it releases the latch for the other fader I'm still touching - causing a blip in the envelope until that fader moves again. If I don't call the action until I untouch all faders - the ones untouched first continue to write the last captured value until the action is called - so not performing as touch mode should.

I've tried plenty of other workarounds with the available functions (some pretty exotic) - but nothing works well enough.


The solution:

There are several things that could solve this - that I don't think are currently available. One is to allow the GetTrackUIVolPan style API's to continue to output the envelope value even when the envelope is unarmed. But this is changing existing functionality - so probably not the best solution.

The ideal solution would be to provide an API where I can simply pass in the envelope pointer - and it will release the latch for that envelope (if one is set). This won't alter any existing functionality - and I presume would be pretty trivial as there are already actions to do this - albeit for all track parameters at once.

Being able to do this means I can leave the envelope armed throughout the automation capture - which means I can ensure the controller's faders will follow the actual envelope when the controller's fader is 'untouched'.

So my request would be for new API functions - something like:

ReleaseTrackEnvelopeLatch(TrackEnvelope env)

(and even - for completeness)

ReleaseFXEnvelopeLatch(TrackEnvelope env)

(EDIT: mespotine has a better suggestion here: https://forum.cockos.com/showpost.ph...8&postcount=18 )

Using these - I can recreate touch mode for all types of parameters - not just the subset available currently (which appears to be just track volume and pan). Touch mode doesn't work for FX parameters or other track parameters such as sends as far as I can tell.

Of course - if there is already a way to release the latch for a specific envelope - I'd be ecstatic to learn how

Many thanks,
Leon.
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website

Last edited by lb0; 02-28-2020 at 05:26 PM.
lb0 is offline   Reply With Quote
Old 02-03-2020, 07:14 PM   #2
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Yes, please, this would enable us to make every external controller touch-aware and make it work with any paramter.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-05-2020, 05:03 PM   #3
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

@devs: or is the info stored somewhere in the state chunk?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-06-2020, 03:23 PM   #4
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default

Quote:
Originally Posted by _Stevie_ View Post
@devs: or is the info stored somewhere in the state chunk?
A good question - but not according to:

https://github.com/ReaTeam/Doc/blob/...%20Definitions

I'm not sure altering the chunk would be suitable in an automation capturing context (too slow).

And I don't think that data would likely be stored in there anyway - the chunks are for more persistent data that you want saved in the rpp file - for recall when you reload the project. I don't think saving touch state in the rpp file would be of any use.
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 02-06-2020, 03:34 PM   #5
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
Default

I also took a quick look out of curiousity (using the ChunkEditor script which I find quite handy for such things) but yeah, latch state doesn't seem to be stored there (and actually I also wouldn't have expected it would, for the reasons lbo states).
nofish is offline   Reply With Quote
Old 02-06-2020, 04:18 PM   #6
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Yeah, good point! So an API function would be the best solution.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-07-2020, 02:11 AM   #7
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Could someone make a LiceCap of how to release a latch with Reaper?
Maybe I can find something, but I never used latch in envelopes before.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-07-2020, 03:35 AM   #8
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default

Quote:
Originally Posted by mespotine View Post
Could someone make a LiceCap of how to release a latch with Reaper?
Maybe I can find something, but I never used latch in envelopes before.
Thanks,

Here's an example of releasing the latch while capturing automation. This uses the action to release all latches for a single track's envelopes. I need to be able to release a single envelope's latch - while leaving any others intact.

__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 02-08-2020, 09:39 AM   #9
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

I'll have a look.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-08-2020, 09:41 AM   #10
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Awesome, very much appreciated!
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-20-2020, 12:18 PM   #11
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

@lbo

With latch, do you refer to the automation mode "Latch"?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-20-2020, 03:00 PM   #12
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

Answering for Leon on this, since I'm not sure if he has subscribed to the thread: yes, it's about latch automation.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-20-2020, 03:11 PM   #13
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Ok, then I probably have bad news for you:

There seems to be only one automationmode for all envelopes in each track, signaled by AUTOMODE-entry in a TrackStateChunk.

That means, when changing latch to something else, it is always for all envelopes in a track, as far as I could find out.

Correct me, if I'm wrong, so I can dig deeper....
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-21-2020, 10:20 AM   #14
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default

Quote:
Originally Posted by mespotine View Post
Ok, then I probably have bad news for you:

There seems to be only one automationmode for all envelopes in each track, signaled by AUTOMODE-entry in a TrackStateChunk.

That means, when changing latch to something else, it is always for all envelopes in a track, as far as I could find out.

Correct me, if I'm wrong, so I can dig deeper....
Hi Mespotine,

No - that's not what I mean for this.

Each parameter has a latch state (has it been touched or not) - this is what I mean when I want to be able to release a parameters latch - to stop it being touched.

The automation mode will be latch for all parameters - this is what I want. But in latch automation mode - every parameter has a latch on/off state - which is currently handled entirely by Reaper - but I would like to be able to manipulate it via an API.

Currently - it's only possible to release all latches at once via an action - but it must be possible to enable/release a latch per parameter - as this is something Reaper itself does in latch mode.
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 02-22-2020, 10:54 AM   #15
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Ok, I think I got it.

Yes you're right, that this is handled internally. It isn't even represented in projectfiles when I store one with latch and one with release latch.

Still, I hope this can be managed somehow, so I digged deeper into it.

The first thing I managed is to find a way to get, whether latch isn't released currently on a certain Envelope, so this could be helpful to get at least, whether latch is currently activated.

I hope, I can find a way of activating(this can be done by using actions who move the slider) and releasing(dunno how to do it properly yet) it as well.



PS: I think, this could be handled very nice in the API. Would be nice to have the full control over it, without having to release all latches and without having to add dummy-envelopepoints to activate latch.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-22-2020, 11:39 AM   #16
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
Default

May I add that we are SUPER grateful that you are taking the time to dive into this. THANK YOU!!!

And yes, an API feature would be a great way to deal with this.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 02-23-2020, 12:44 PM   #17
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default

Quote:
Originally Posted by mespotine View Post
Ok, I think I got it.

...

PS: I think, this could be handled very nice in the API. Would be nice to have the full control over it, without having to release all latches and without having to add dummy-envelopepoints to activate latch.
Thank you for taking time and looking into this - much further than I've gone.

Yes - I'm hopeful that an API might be considered - the dummy envelope idea is interesting - but probably too messy for my preference. Doing it this way might leave a tiny door open between releasing all latches and re-latching those that should still be latched - for an existing bit of automation being left in the envelope when it should have been overwritten. Not really something I would like to risk.

So it's fingers crossed for now. It would be really nice to be able to implement Touch style automation capturing for those parameters where it is not currently implemented (using Latch mode).
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 02-28-2020, 07:28 AM   #18
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

I have thought about that for a few days and I think, I have a better idea for an API-function that solves your problem AND gives you even more.

You probably need only one function:

Code:
boolean retval = reaper.GetSetEnvelopeActivatedLatch(TrackEnvelope env, boolean is_set, boolean is_activated)

Retval:
   boolean retval - true, if latch is currently activated for TrackEnvelope; false, if not

Parameters:
   TrackEnvelope env - the Track/FXEnvelope whose Latch you want to get/set
   boolean is_set - true, set it; false, get the current state
   boolean is_activated - if is_set=true: true, activate latch; false, deactivate latch on envelope

This gives you a way to activate/deactivate the current state of activation of latch on an envelope.
It also gives you the opportunity to get, whether latch is currently activated or not, which could be helpful with some automation-usecases you want to create.

With activated, I mean in reference of your gif, when the latch-state is red. With deactivated, when the latch-state is yellow.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-28-2020, 05:22 PM   #19
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default

Quote:
Originally Posted by mespotine View Post
I have thought about that for a few days and I think, I have a better idea for an API-function that solves your problem AND gives you even more.

You probably need only one function:

Code:
boolean retval = reaper.GetSetEnvelopeActivatedLatch(TrackEnvelope env, boolean is_set, boolean is_activated)

Retval:
   boolean retval - true, if latch is currently activated for TrackEnvelope; false, if not

Parameters:
   TrackEnvelope env - the Track/FXEnvelope whose Latch you want to get/set
   boolean is_set - true, set it; false, get the current state
   boolean is_activated - if is_set=true: true, activate latch; false, deactivate latch on envelope

This gives you a way to activate/deactivate the current state of activation of latch on an envelope.
It also gives you the opportunity to get, whether latch is currently activated or not, which could be helpful with some automation-usecases you want to create.

With activated, I mean in reference of your gif, when the latch-state is red. With deactivated, when the latch-state is yellow.
Yep - I agree wholeheartedly with this This would work for my purpose and be more versatile to boot!

Thanks for taking the time to think about it.

Now fingers crossed the devs might be interested sometime...
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 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 09:16 AM.


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