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

Reply
 
Thread Tools Display Modes
Old 07-02-2020, 03:32 AM   #1
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default [API] SetEnvelopeStateChunk: a FR and a BUG report

Currently the only way to remove an envelope is either to use Main_OnCommand(40065, 0) "Clear envelope" action - which is impractical for a script - or to remove it from the track state chunk (there is currently a bug in this way).

FR:
It would be great if we could completely remove/clear an envelope by passing an empty string ("") to SetEnvelopeStateChunk.


Edit:
BUG: See posts #4 and #5
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)

Last edited by amagalma; 07-03-2020 at 05:12 AM.
amagalma is offline   Reply With Quote
Old 07-02-2020, 03:55 AM   #2
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

I've just found out that this completely removes the envelope:
Code:
ok = reaper.SetEnvelopeStateChunk( env, "-", false )

Which is not documented. So, forget the FR above and please, just add to the documentation that passing "-" as a string, clears the envelope.
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)

Last edited by amagalma; 07-02-2020 at 04:03 AM.
amagalma is offline   Reply With Quote
Old 07-02-2020, 05:01 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

I'll add it to my docs as well.
__________________
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 07-02-2020, 08:07 AM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Quote:
Originally Posted by amagalma View Post
So, forget the FR above and please, just add to the documentation that passing "-" as a string, clears the envelope.
Actually I think more technically correct would be "passing anything that's not a valid <VOLENV2> subchunk clears the envelope".

I noticed this recently too when I unintentionally passed a string with SetEnvelopeStateChunk() that contained some crap and wondered why the envelope disappeared. :P
nofish is offline   Reply With Quote
Old 07-02-2020, 01:49 PM   #5
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by nofish View Post
Actually I think more technically correct would be "passing anything that's not a valid <VOLENV2> subchunk clears the envelope".

I noticed this recently too when I unintentionally passed a string with SetEnvelopeStateChunk() that contained some crap and wondered why the envelope disappeared. :P

Oh, just tested it.. So, it is actually a bug and not a feature! Passing any junk as a string clears the envelope but the retval is "false" as if the envelope was not set.


So, my FR is valid and the bug should be fixed. Invalid strings should not clear the envelope and the retval should be "false". An empty string should clear the envelope and the retval should be "true".
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma 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 01:28 PM.


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