Hello Jack,

Ah, I see, I tried setting env.value but not reading from it, I was still reading env.last().

I would implement chugins or STK but alas, I do not C++ very much.  ;)

   michael


On Jan 30, 2020, at 10:32 AM, Jack Atherton <lja@ccrma.stanford.edu> wrote:

FYI, you should be able to avoid using the Step if you use env.value() instead of env.last(). Last is the output sample, and value is the amplitude of the envelope being applied to the input signal. It would probably be useful to implement those other envelope types as chugins -- go for it!

On Thu, Jan 30, 2020 at 8:22 AM Michael Heuer <heuermh@gmail.com> wrote:
Hello ChucKers,

For the longest time I couldn't figure out how to get envelopes to work correctly as modulators

ADSR env => blackhole;

spork ~ updateAtSampleRate();

fun void updateAtSampleRate()
{
  while (true)
  {
    1::samp => now;
    env.last() => // do something
  }
}

It turns out they need a kick in the pants to work correctly, in other words

Step step => ADSR env => blackhole;
1.0 => step.next;


Is this intentional?

Then is there any interest in implementing all the other envelope types (AD, AR, AHDSR, DADSR, DAHDSR)?  I could probably do it in ChucK, but it might be better to implement them as chugins or upstream in STK.

In any case, now that I know how to make ADSR envelopes work, I have some pretty awful synthesized drums, just in time for the RPM challenge.


Cheers,

   michael
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users