JSyn Tutorial

Modifying an Envelope

We have seen how to create an envelope using this code:

myEnvData = new SynthEnvelope( data );

When the envelope is created, the values in the data array are copied to
internal storage inside JSyn. The data array can then be deleted or modified
without affecting the envelope. So how can we modify an envelope once it
has been created? The answer is to use the envelopes write() method.

Suppose we wanted to change the attack time of an envelope. We can either
create a new data array, or we can modify our original array. For clarity,
let's make a new array.