On Wed, Aug 14, 2002 at 10:13:54 -0400, Nathan Stewart wrote:
> How can I truncate the length of the current output buffer without
> closing the whole data stream? Is this what I want to do?

You can't alter the length of the output buffer, you have to produce as
many samples as you consume.

For a simple gate, you should be copying samples from input to output when
its open and writing 0.0f's to the output when its closed.

I used a simple state machine with 4 states: closed, opening, open,
closing.  c.f. http://plugin.org.uk/src/gate_1410.xml

The envelope function is a linear segment:
                                      g^
           ___________                a|
          /           \               i|
         /             \              n|
        /               \
_______/                 \_________   time-->
closed open   open   clos  closed
       ing           ing

Which is obviously wrong, but I haven't to round to fixing it. Applying a
low order, low cutoff lp filter should be enough.

- Steve

Reply via email to