# Envelope problems. Driving me a bit nuts

Discussion in 'REAKTOR' started by berlov, Sep 9, 2017.

1. ### berlovNew Member

Messages:
11
(see attached image)

This is an issue I've encountered in a couple of projects now; the basic function I'm trying to create is a means of detecting when an envelope is not being used. so a Compare/Equal module will simply read out 1 whenever the Envelope is at 0. Simplest thing in the world except that, uh, it's..... not? Doing that? Honestly what am I missing here? Am I even missing something? Have I just broken physics? What do I have to do to repair the laws of mathematics?

2. ### salamanderanagramNI Product Owner

Messages:
3,203
primary envelopes never actually decay to 0, just very close to it.

instead, check if it's smaller than a really small number, like .0000001

• Informative x 1
3. ### berlovNew Member

Messages:
11
Hm. What a strange, bewildering quirk.
I got it to work when I changed the Compare/Equal to just a Compare (so I could set it to output when A is equal to or less than B) and set the B input to 0.000001. Bit anxious that this could be prone to stop working again depending on where the envelope decides to fall, but I'll leap that hurdle when I get to it I guess. Could always add an extra zero to the fraction

4. ### colBNI Product Owner

Messages:
1,835
Think of the maximum level (usually 1)
Now as a thought experiment take half away... then take the answer and take half of that away... now take half of that away...
The value drops quickly to start with, then tails away... it will get near to zero pretty quick, but never reach zero.

That's basically how decay works in most natural/authentic/analog sounding envelopes. The decay time is varied by changing what fraction you take away at each step.
It's pretty much what happens in a real analog electric circuit too.

• Informative x 2
• Like x 1
5. ### berlovNew Member

Messages:
11
Gotcha -- Yeah, that makes sense actually.

Laws of physics repaired

• Funny x 1