Old 01-06-2016, 04:10 PM   #1
t0b4cc0
Human being with feelings
 
Join Date: Dec 2015
Posts: 13
Default bypass envelope per api

Hi!

I browsed the reascript api documentation now for such a long time but cant find it.

How do I "bypass envelope" like this: (per api)

Attached Images
File Type: jpg bypassenv.jpg (44.1 KB, 591 views)
t0b4cc0 is offline   Reply With Quote
Old 01-06-2016, 04:15 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,964
Default

I don't think there is a dedicated API function for this, but you can probably achieve what you want by manually editing the state chunk of the envelope using GetEnvelopeStateChunk and SetEnvelopeStateChunk.

See http://wiki.cockos.com/wiki/index.ph...tions#Envelope ACT: Active, int (bool).

Last edited by cfillion; 01-06-2016 at 04:32 PM.
cfillion is offline   Reply With Quote
Old 01-06-2016, 04:40 PM   #3
t0b4cc0
Human being with feelings
 
Join Date: Dec 2015
Posts: 13
Default

Thats the one I found too but I didnt understand it at all.

In th api it looks like this:

http://www.reaper.fm/sdk/reascript/r...lopeStateChunk

http://www.reaper.fm/sdk/reascript/r...lopeStateChunk

So I first get the statechunk into a variable.

I printed it, it looks like this:

Code:
(1, '(TrackEnvelope*)0x0000000003F53410', '<PARMENV 0 0.000000 1.000000 0.500000\nACT 1\nVIS 1 1 1\nLANEHEIGHT 0 0\nARM 1\nDEFSHAPE 0 -1 -1\nPT 0 0.5 0\nPT 0.6 0.9 0 0 0 0 0.5\nPT 0.6 0.9 0 0 0 0 0.5\nPT 0.6 0.9 0 0 0 0 0.5\nPT 0.6 0.9 0 0 0 0 0.5\nPT 0.6 0.9 0 0 0 0 0.5\n>\n', 1000, 0)
Now I need to change the part "nACT 1" to "nACT 0" in the string and then set the string with the set function again?

Thats pretty inefficient with hundreds of envelopes.
Is there any way around this?

I just want the envelopes to do nothing for a short time so I can test different values with the knoobs in the vsti during play.
t0b4cc0 is offline   Reply With Quote
Old 01-06-2016, 04:58 PM   #4
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,964
Default

Yes, that's it.

Code:
local env, ret, rppxml

env = reaper.GetSelectedEnvelope(0)
ret, rppxml = reaper.GetEnvelopeStateChunk(env, "", true)

rppxml = string.gsub(state, "\nACT 1", "\nACT 0")

reaper.SetEnvelopeStateChunk(env, rppxml, true)
Quote:
Originally Posted by t0b4cc0 View Post
Thats pretty inefficient with hundreds of envelopes.
I agree...
cfillion is offline   Reply With Quote
Old 01-06-2016, 05:57 PM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

With reaper.BR_EnvGetProperties from SWS, you can return ACTIVE state


Code:
boolean activeOut retval, boolean visibleOut, boolean armedOut, boolean inLaneOut, number laneHeightOut, number defaultShapeOut, number minValueOut, number maxValueOut, number centerValueOut, number typeOut, boolean faderScalingOut reaper.BR_EnvGetProperties(BR_Envelope envelope)
It use that it almost all my envelope scripts.
X-Raym is offline   Reply With Quote
Old 01-06-2016, 07:21 PM   #6
t0b4cc0
Human being with feelings
 
Join Date: Dec 2015
Posts: 13
Default

Oh that looks good too, atm Ive built this ugly thing:

Edit: that didnt work in practice as i used a string for testing but the chunk is a tuple containing a string.

What do you guys do if you have envelopes but want to test changes in your vsti?

Ill try your way x-raym.

Edit: i dont have this function. i use python btw if that matters. i think im missing something since it also dos not show up in the official api

Last edited by t0b4cc0; 01-07-2016 at 09:37 AM.
t0b4cc0 is offline   Reply With Quote
Old 01-06-2016, 07:39 PM   #7
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Do you have SWS 2.8.2 installed ?
also, I posted the Lua syntax, but of course, the python one is a bit different (it is in the api reference).
I remeber I was also using track chunk before Breeder from sws shows me his function.
The peformance gain was very high (2 or 3 time faster), AND it is easier to use. It worth it :P
X-Raym is offline   Reply With Quote
Old 01-06-2016, 09:13 PM   #8
t0b4cc0
Human being with feelings
 
Join Date: Dec 2015
Posts: 13
Default

ty for the extension, ill take a look at it.

idk why reaper cant allow me to play around with my synth when i have an automation.

i didnt make it now. in python this envstate is pretty crazy. would be so easy with a single string.

Last edited by t0b4cc0; 01-06-2016 at 09:18 PM.
t0b4cc0 is offline   Reply With Quote
Old 01-07-2016, 12:39 AM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

What do you want to do with the automation ? There is dedicatd functions to manipulate the envelopes more easily.
X-Raym is offline   Reply With Quote
Old 01-07-2016, 09:32 AM   #10
t0b4cc0
Human being with feelings
 
Join Date: Dec 2015
Posts: 13
Default

I wrote a script that randomizes all parameters of a vsti.

In the script I can store, load and evolve(changes all parameters a little bit) different presets, this is done using RPR_TrackFX_SetParam, a preset is stored in the script as array of floats.

I want to make an envelope for each parameter and set a point for its current value. (that works for one point in time already)

The problem is in the moment I set the envlopes for the first parameter configuration its impossible to change parameters.

Everytime I change a parameter it will get changed back to where the envelope is, so I cant check out different presets.
Is there another way around this? (except for the sws extension)


Edit: is it possible to select multiple envelopes and bypass them? or can i just "cut" an envelope (so that i have points in time that it doesnt try to enforce its value onto the parameter)? it seems like the moment I introduce a envelope it always enforces its current value on any point in time.

ofc there is the possibility to go on WRITE mode, but that makes reaper crash when i change the preset (300 envelopes in write mode too much ~.~)

Last edited by t0b4cc0; 01-07-2016 at 09:51 AM.
t0b4cc0 is offline   Reply With Quote
Old 01-07-2016, 09:43 AM   #11
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

You have to update all points value at the same time (or point ad edit cursor if it is what you are doing),
or create new envelope points if there is none.
Once there is envelope, it's mostly envelope that will determine the value of the FX. (apart with trip/read mode).
X-Raym is offline   Reply With Quote
Old 12-27-2018, 10:18 AM   #12
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

What is fastest way to tell if take envelope is active?

X = reaper.EnvelopeEvaluate(env,0,0,0) returns 1 here if active,0 if not. Is that a reliable way?

Trying to help a fellow here:
https://forum.cockos.com/showthread.php?t=215194
FnA 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 02:55 AM.


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