Page 1 of 1

Posted: 17 May 2012, 00:20
by bsork
I've uploaded an envelope patch anyone intereset can try if they want:
http://www.sensomusic.com/forums/upload ... DAHDSR.pat

I will eventually put it into the add-ons, but I wouldn't mind any comments or bug reports before I do.

A short description: I've added a delay time and a hold time part to the normal ADSR envelope. It's also possible to have exponential or logarithmic curves on the attack, decay and release segments.

I've also added a couple of extra outputs that might come in handy once in a while. The segment output shows the current part of the envelope (0=stopped, 1 = delay, 2=attack, 3=hold, 4=decay, 5=sustaining, 6=release), while the pos output shows the progress from the gate is on and the delay segment starts at 0, up to the release segment ends at 1.

I've done quite a bit of testing, and as long as you don't mess to much with the time parameters while the envelope plays, it seem to work fine. Modulating the sustain level when playing should work fine.

Posted: 17 May 2012, 04:23
by r.erorr
thanks bsork.

Posted: 17 May 2012, 08:33
by nay-seven
great, I 'll test that! ( think to an example patch for newbie when you add it as add-on )

Posted: 17 May 2012, 21:11
by multiphone
Thanks Bsork !

Very Nice.

Best

Posted: 17 May 2012, 23:20
by bsork
nay-seven wrote:great, I 'll test that! ( think to an example patch for newbie when you add it as add-on )
Good idea - maybe a simple synth or something like that.

Posted: 18 May 2012, 21:36
by headphoner
Hi,

Very useful

It's allready in my patches.

Posted: 19 May 2012, 14:50
by senso
well done+++

Posted: 20 May 2012, 21:56
by bsork
Thanks for the feedback, guys. No bugs or weird behaviour found so far?

I'm have some more ideas I'd like to implement (modulation of parameters, etc) before I make a proper add-on, but I've struggling a bit with some of the maths...

Posted: 20 May 2012, 23:19
by headphoner
Hi bsork,

No bugs for the moment, it works very well.

Posted: 22 May 2012, 00:16
by bsork
I've uploaded a slightly improved version: http://www.sensomusic.com/forums/upload ... AHDSR2.pat

There are two changes:

- The segment now outputs the position within each part of the envelope, so for instance the attack part goes from 2.0 to 2.9999...To get the same values as before, use a Trunc module.Obviously stopped=0 and sustaining=5 are as before. You could for example use for send only the attack or the release part of a sound to a delay, or start some other modulations when reaching the sustain point, without the need for a lot of extra logic or a whole extra EG.

- A new parameter: legato with three choices: off/retrig, keep time, and catch level.
- - off/retrig is the old behaviour, where the attack always starts from 0.
- - keep time will - if the release hasn't finished - start from the current value and use the full attack time to reach 1.
- - catch level (any suggestions for a better name?) will - if the release hasn't finished - find out where in the attack part the level is the same as the current value and continue the attack from there.

keep time and catch level don't work when delay > 0, as I couldn't find a way to incorporate that which made sense... If someone has some suggestions, bring them on. :)

---

Making this has made me wonder why the ADSR envelopes are still the norm on most software synths, as the inclusion of a Delay and a Hold doesn't really take much programming. In fact, those two are the simplest parts to code (for me, anyway). Granted, a delay at the start of the envelope is mostly not what you would use when controlling the volume envelope, but when using an EG to control eg the intensity or rate of tremolo or vibrato it can come in handy. A Hold part can be nice when you want to give a little extra punch to the attack of some sounds, as well as retaining the transient portion of samples. I'm sure, though, that a lot of the ADSRs out there have something of this built in; especially when it comes to emulations of hardware synths where there really should be some shaping of the curves as well as little bit of Hold before the decay sets in. But why not give the user control over the parameters? At least when not creating an emulation.

Posted: 22 May 2012, 08:26
by nay-seven
Thanks a lot Bsork !

Posted: 24 May 2012, 02:51
by Floego
Great patch bsork!
I would like to ask the possibility to use a button rather than a switch gate for the triggering of the envelope, as the adsr, asr patches (the ones bundled with usine) do. :)

Posted: 24 May 2012, 06:34
by bsork
Floego wrote:Great patch bsork!
I would like to ask the possibility to use a button rather than a switch gate for the triggering of the envelope, as the adsr, asr patches (the ones bundled with usine) do. :)
"One-shot" EGs like that is so easy to create using a PointsCurve module (like in the ADSR patch) that I I decided not to bother. But I'm still not finished with my EG "obsession", so I will have that in the back of my mind when creating new, expanded versions.

Posted: 24 May 2012, 09:06
by bsork
@floego
I was thinking a little more around your question, and I think it wouldn't be to difficult to add a one-shot option without messing with the script. However, the sustain length might pose some problems. I'll see what I can come up with, and incorporate it in v3, which will have something similar to the legato, but for the release. Maybe tonight, or sometime next week.

Posted: 24 May 2012, 20:22
by Floego
bsork wrote:@floego
I was thinking a little more around your question, and I think it wouldn't be to difficult to add a one-shot option without messing with the script. However, the sustain length might pose some problems. I'll see what I can come up with, and incorporate it in v3, which will have something similar to the legato, but for the release. Maybe tonight, or sometime next week.
Thank you bsork! :)

Posted: 25 May 2012, 00:15
by bsork
And here's version 3: http://www.sensomusic.com/forums/upload ... AHDSR3.pat

The legato parameter has been renamed to attack mode, and another has been added: release mode. I have also changed the naming of the values to retrigger, constant time, and constant rate. The attack mode has all three, while the release mode has the last two.

These changes goes for both the script and the patch, while in the patch I've added a choice between gate mode (as before), and a trig mode where the gate is controlled with a play and a stop button, while the length of the sustain time can be controlled with a fader unless the stop button has been triggered.

Posted: 25 May 2012, 03:59
by Floego
Thanks for the new version and the trigger mode ! :)
I find the HOLD part very useful for percussive sounds.
How does the knobs adjust the curves? from log to exponential or viceversa?

I'll have to explore your patch a bit more, it owns many alternative ways to control a sound.

Posted: 25 May 2012, 07:39
by bsork
I'm not quite sure what you should call the curves, actually. I'm using a power function: result = power(x, curve) where curve = 1 is linear.

The best way to check what's happening is connecting an Oscilloscope to the out parameter. That's what I've been using.

I agree on the Hold function. I have no evidence of this whatsoever, but I think it's more often used in samplers than synths to keep the original sound's transient more or less untouched by volume or filter modulations. I also have a vague memory of reading a test years ago of why classic synth X was "fat" while classic Y was "punchy", etc, and I remember that one of them had more punch just because the ADSR had a built-in Hold - but design or not. Not surprising - after all it's not far what happens with limiting or compressing.

Coming up next is modulation of the parameters. Am I being obsessed with EGs? :rolleyes: :)

Posted: 25 May 2012, 08:56
by multiphone
Hello Bsork,

Brillant and essential !!

Thanks for the "trig mode" !!!

Perhaps one last entry the script would be the total duration of the envelope? It could well define the envelope of a sound based on its total length ?



Best

Posted: 28 May 2012, 20:34
by bsork
I'm not sure if I follow you. Adding up the various time-based parameters outside of the script is easy enough if you want that - do you mean the real elapsed time?

Posted: 29 May 2012, 17:22
by multiphone
Hello Bsork,

Yes, sorry if i'ts not realy clear.

Yes i mean total elapsed time.

For example if the duration of the sound are not the same each time, il you need a 100ms, real elapsed time of the first envelope and 150 ms of the second one an 90ms for the third one.

Best

Of course the addition of all components gives the total duration of the envelope Delay + Attack + Hold + Dec + Rel = Tolal Duration for data out is easy but for data entry ?

Best

Posted: 29 May 2012, 21:45
by bsork
Do I understand you correctly that you want an output with the total time in ms, starting at 0 and added to as long the envelope is running? If so, that's easy, and I will include it in the next version.

Posted: 03 Jun 2012, 21:09
by bsork
Been busy, and it will take some time before I have complete version with modulation ready, so in the meantime, here's v4 with an "elapsed time" ouput: http://www.sensomusic.com/forums/upload ... AHDSR4.pat

Posted: 04 Jun 2012, 09:16
by multiphone
Hello Bsork,

Thanks for this new version !

I will test it in a situation quickly.

Best

Posted: 11 Dec 2012, 02:51
by rj0
It's taken a while, but it seems that MSegs (Multi-Segment envelopes) are slowly becoming the norm.