How to view the Linen.kr envelope shape

If you plot a UGen or an array of UGens, then you must enclose it with a pair of curly brackets. Thus your code

Linen.kr(gate, attackTime:0.0, susLevel:1.5, releaseTime:1, doneAction: Done.freeSelf).plot;

should be rewrittne as follows:

{ Linen.kr(gate, attackTime:0.0, susLevel:1.5, releaseTime:1, doneAction: Done.freeSelf) }.plot // it does not still work.

However, the word gate is not accepted: sclang thinks this is a variable, but it is not declared. Moreover, you should change the value is changed from 1 to 0 to release the envelope according to the help document of Linen. You can do this by using an Impulse for example:

{ Impulse.kr(0) }.plot // By default, the value changes in 64 samples of the sample-rate of the server.

or

{ Impulse.ar(0) }.plot // the value changes in a sample of the sample-rate of the server.

.kr(0)

and

.ar(0)

means Impulse is generated only one time. If you change the value, then it produces impulses according to the value per second.

Thus, the following might be what you would like to have:

{ Linen.kr(Impulse.kr(0), attackTime:0.01, susLevel:0.5, releaseTime:1, doneAction: Done.freeSelf) }.plot(3);

plot(3) means plot for 3 seconds, and you need to wait 3 seconds to see the result.

1 Like